:root {
    color-scheme: dark;
    --brand-jott: #8e44ad;
    --brand-jott-soft: #b57edc;
    --brand-in: #2ecc71;
    --bg: #12141a;
    --surface-1: #181b22;
    --surface-2: #1f2330;
    --text: #f2f4f8;
    --text-2: #b8bfcc;
    --border: rgba(255, 255, 255, .1);
    --border-strong: rgba(255, 255, 255, .18);
    --danger: #ff8a80;
    --radius: 14px;
    --focus: 0 0 0 3px rgba(46, 204, 113, .55);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Manrope, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    line-height: 1.5;
}

a { color: var(--brand-in); }

h1, h2 { line-height: 1.2; margin: 0 0 16px; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.2rem; }

:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }

.site-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-1);
}

.site-header nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.site-header nav a { padding: 8px 4px; color: var(--text-2); text-decoration: none; }
.site-header nav a:hover { color: var(--text); }

.wordmark { font-size: 1.6rem; letter-spacing: -.02em; line-height: 1; text-decoration: none; }
.wordmark .jott { color: var(--brand-jott-soft); font-weight: 600; }
.wordmark .in { color: var(--brand-in); font-weight: 700; }

.page { max-width: 880px; margin: 0 auto; padding: 16px; display: grid; gap: 16px; }

.landing { max-width: 640px; margin: 0 auto; padding: 64px 16px; text-align: center; }
.hero-title { font-size: clamp(1.8rem, 6vw, 2.8rem); }
.hero-copy { color: var(--text-2); font-size: 1.1rem; }

.card { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; min-width: 0; }
.narrow { width: 100%; max-width: 440px; margin-inline: auto; }

.field { margin-bottom: 16px; }

label { display: block; margin-bottom: 4px; font-weight: 600; }

input {
    width: 100%;
    min-height: 44px;
    padding: 8px 12px;
    color: var(--text);
    font: inherit;
    background: var(--bg);
    border: 1px solid var(--border-strong);
    border-radius: 10px;
}

input[aria-invalid="true"] { border-color: var(--danger); }

.hint, .muted { color: var(--text-2); font-size: .92rem; }
.hint { margin: 4px 0 0; }
.field-error { margin: 4px 0 0; color: var(--danger); font-size: .92rem; }
.field-error::before { content: "Error: "; font-weight: 600; }

button, .button {
    display: inline-block;
    min-height: 44px;
    padding: 9px 18px;
    color: var(--text);
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    border-radius: 10px;
}

button.primary, .button.primary { background: var(--brand-jott); border-color: #a55bc4; color: #fff; }
button.danger { background: transparent; border-color: var(--danger); color: var(--danger); }
button.link { background: none; border: 0; padding: 8px 4px; color: var(--text-2); font-weight: 400; }
button.link:hover { color: var(--text); }

.inline { display: inline; margin: 0; }

.alert { margin: 0; padding: 12px 16px; border: 1px solid; border-radius: 10px; overflow-wrap: anywhere; }
.alert p { margin: 0 0 8px; }
.alert p:last-child { margin-bottom: 0; }
.alert-ok { border-color: var(--brand-in); background: rgba(46, 204, 113, .1); }
.alert-error { border-color: var(--danger); background: rgba(255, 138, 128, .1); }

.rows { list-style: none; margin: 0; padding: 0; }
.rows li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    padding: 12px 0;
    border-top: 1px solid var(--border);
    overflow-wrap: anywhere;
}
.rows li:first-child { border-top: 0; }
.rows .muted { display: block; }
.row-actions { display: flex; align-items: center; gap: 12px; }

.badge { padding: 2px 10px; font-size: .85rem; border: 1px solid var(--border-strong); border-radius: 999px; }

code { padding: 2px 6px; background: var(--bg); border-radius: 6px; overflow-wrap: anywhere; }

textarea {
    width: 100%;
    padding: 10px 12px;
    color: var(--text);
    font: inherit;
    resize: vertical;
    background: var(--bg);
    border: 1px solid var(--border-strong);
    border-radius: 10px;
}

textarea[aria-invalid="true"] { border-color: var(--danger); }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.feed { display: grid; gap: 12px; }
.jott-text { margin: 0 0 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.jott-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0 0 12px; padding: 0; }
.chip {
    padding: 2px 10px;
    color: var(--text);
    font-size: .9rem;
    background: rgba(142, 68, 173, .28);
    border: 1px solid rgba(181, 126, 220, .55);
    border-radius: 999px;
    overflow-wrap: anywhere;
}

.facts { display: flex; flex-wrap: wrap; gap: 12px 32px; margin: 20px 0 0; }
.facts dt { color: var(--text-2); font-size: .85rem; }
.facts dd { margin: 0; }

.danger-zone { margin: 0; text-align: right; }
.danger-link { color: var(--danger); }

select {
    width: 100%;
    min-height: 44px;
    padding: 8px 12px;
    color: var(--text);
    font: inherit;
    background: var(--bg);
    border: 1px solid var(--border-strong);
    border-radius: 10px;
}

.chip a { color: inherit; text-decoration: none; }
.chip a:hover { text-decoration: underline; }

.app-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    max-width: 1080px;
    margin: 0 auto;
    padding: 16px;
}

.app-main { display: grid; gap: 16px; min-width: 0; align-content: start; }

.collections-nav { min-width: 0; }
.nav-title { font-size: .85rem; color: var(--text-2); margin: 0 0 8px; }
.collections-nav ul {
    /* Positioned so absolutely positioned screen-reader text scrolls inside it, not the page. */
    position: relative;
    display: flex;
    gap: 6px;
    margin: 0;
    padding: 0 0 6px;
    overflow-x: auto;
    list-style: none;
}
.collections-nav a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 44px;
    padding: 8px 12px;
    color: var(--text);
    text-decoration: none;
    white-space: nowrap;
    border: 1px solid var(--border);
    border-radius: 10px;
}
.collections-nav a:hover { background: var(--surface-2); }
.collections-nav a[aria-current="page"] { font-weight: 700; background: var(--surface-2); border-color: var(--brand-in); }
.nav-count { color: var(--text-2); font-size: .85rem; }
.nav-manage { color: var(--text-2) !important; }

.feed-header { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; overflow-wrap: anywhere; }
.feed-header h2 { margin: 0; }

.add-collection { display: grid; gap: 20px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }

@media (min-width: 760px) {
    .app-grid { grid-template-columns: 240px minmax(0, 1fr); align-items: start; }
    .collections-nav ul { flex-direction: column; overflow-x: visible; padding: 0; }
    .collections-nav a { white-space: normal; overflow-wrap: anywhere; }
    .add-collection { grid-template-columns: 1fr 1fr; }
}

.code-sample { margin: 0; padding: 12px; overflow-x: auto; font-size: .85rem; background: var(--bg); border-radius: 10px; }
.code-sample code { padding: 0; background: none; overflow-wrap: normal; }

.delivery-banner { padding: 12px 16px; background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius); }
.delivery-banner p { margin: 0 0 8px; overflow-wrap: anywhere; }
.delivery-banner p:last-child { margin-bottom: 0; }

.send-automation {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    background: #6d1bb0;
    border: 1px solid #8a3fd1;
    box-shadow: 0 4px 18px rgba(109, 27, 176, .45);
}
.send-dot { width: 14px; height: 14px; background: #b8e986; border-radius: 50%; box-shadow: 0 0 8px rgba(184, 233, 134, .8); }

.delivery-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 0 0 12px; }
.select-jott { display: inline-flex; align-items: center; gap: 8px; }
.select-jott input { width: 24px; min-height: 24px; height: 24px; accent-color: var(--brand-in); }
.select-jott label { margin: 0; font-weight: 400; }

.delivery-state { font-size: .92rem; font-weight: 600; }
.state-succeeded { color: var(--brand-in); }
.state-failed { color: var(--danger); }
.delivery-error { display: block; color: var(--danger); font-size: .92rem; font-weight: 400; }

.confirm-list { padding-left: 20px; overflow-wrap: anywhere; }

.modes { margin: 0 0 16px; padding: 0; border: 0; }
.modes legend { padding: 0; margin-bottom: 8px; font-weight: 600; }
.mode { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; }
.mode input { flex: none; width: 22px; min-height: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--brand-in); }
.mode label { margin: 0; }
.mode-help { display: block; color: var(--text-2); font-size: .92rem; font-weight: 400; }
.jottout { margin-left: 4px; font-size: .9rem; }
.jottout .jott { color: var(--brand-jott-soft); }
.jottout .in { color: var(--brand-in); }
