/* The InoU brand set: marigold band, cocoa ink, paper. Light and dark. Plain CSS, no build step. */

/* The phone's Quicksand (the same variable file, OFL; fonts/OFL.txt): the wordmark and the titles, as on the phone. Text is the system's face. */
@font-face {
    font-family: "Quicksand";
    src: url("fonts/Quicksand.ttf") format("truetype");
    font-weight: 300 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --paper: #f3efe6;
    --paper-alt: #eae4d8;
    --ink: #241708;
    --ink-soft: #6b5b4a;
    --rule: #dcd4c4;
    --accent: #8a5714;
    --band: #e9a32b;
    --band-ink: #2b1b0f;
    --mine: #e3ddee;
    --mine-ink: #241708;
    --note: #f4ddb0;
    --bad: #a3321c;
    --shadow: 0 6px 24px rgb(36 23 8 / 0.18);
    --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-brand: "Quicksand", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --paper: #141210;
        --paper-alt: #1b1815;
        --ink: #f0e9dd;
        --ink-soft: #a29686;
        --rule: #2c2721;
        --accent: #e9a32b;
        --mine: #262232;
        --mine-ink: #f0e9dd;
        --note: #3a2a12;
        --bad: #ff8b73;
        --shadow: 0 6px 24px rgb(0 0 0 / 0.5);
        color-scheme: dark;
    }
}

:root[data-theme="dark"] {
    --paper: #141210;
    --paper-alt: #1b1815;
    --ink: #f0e9dd;
    --ink-soft: #a29686;
    --rule: #2c2721;
    --accent: #e9a32b;
    --mine: #262232;
    --mine-ink: #f0e9dd;
    --note: #3a2a12;
    --bad: #ff8b73;
    --shadow: 0 6px 24px rgb(0 0 0 / 0.5);
    color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.4 var(--font); -webkit-font-smoothing: antialiased; }
#app { height: 100%; }
h1, h2, p { margin: 0; }
/* The wordmark and the screen titles (the phone: wordmark 18 / title 24, weight 700). */
h1, .logo, .brand, .pane-title { font-family: var(--font-brand); }
a { color: var(--accent); }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.loading { padding: 2rem; color: var(--ink-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---- buttons and fields ---- */
button.primary, button.quiet, button.danger, button.danger-quiet {
    border: 0; border-radius: 14px; padding: 0.6rem 1.1rem; font-weight: 600; min-height: 2.5rem;
}
button.primary { background: var(--band); color: var(--band-ink); }
button.primary:hover:not(:disabled) { filter: brightness(1.05); }
button.primary:disabled { opacity: 0.6; cursor: default; }
button.quiet { background: transparent; color: var(--ink); border: 1px solid var(--rule); }
button.quiet:hover { background: var(--paper-alt); }
button.danger { background: var(--bad); color: #fff; }
button.danger-quiet { background: transparent; color: var(--bad); border: 1px solid var(--rule); }
button.link { border: 0; background: none; color: var(--accent); padding: 0; text-decoration: underline; }
input[type="text"], textarea.field {
    width: 100%; border: 1px solid var(--rule); background: var(--paper); border-radius: 12px; padding: 0.6rem 0.8rem;
}
input[type="text"]:focus-visible, textarea.field:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }
.problem { color: var(--bad); font-size: 0.92rem; }
.hint { color: var(--ink-soft); font-size: 0.9rem; }
.empty { color: var(--ink-soft); padding: 1rem; }
.row-buttons { display: flex; gap: 0.6rem; justify-content: flex-end; flex-wrap: wrap; }

/* ---- centred cards: sign-in, accounts ---- */
.center { min-height: 100%; display: grid; place-items: center; padding: 1.5rem; }
.card { background: var(--paper-alt); border-radius: 18px; padding: 1.2rem; display: grid; gap: 0.7rem; }
.login-card { width: min(26rem, 100%); padding: 1.6rem; gap: 0.9rem; }
.logo { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 1.3rem; color: var(--accent); }
.digits { font-size: 1.6rem; letter-spacing: 0.4em; text-align: center; font-variant-numeric: tabular-nums; }
.account-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.account { width: 100%; display: flex; align-items: center; gap: 0.8rem; border: 1px solid var(--rule); background: var(--paper); border-radius: 14px; padding: 0.6rem 0.8rem; text-align: left; }
.account:hover { background: var(--paper-alt); }
.avatar { width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--band); color: var(--band-ink); display: grid; place-items: center; font-weight: 700; }

/* ---- the shell: list beside the chat ---- */
.shell { display: grid; grid-template-columns: minmax(18rem, 22rem) 1fr; height: 100%; }
.side { display: flex; flex-direction: column; border-right: 1px solid var(--rule); min-height: 0; background: var(--paper); }
.side-head { background: var(--band); color: var(--band-ink); display: flex; align-items: center; justify-content: space-between; padding: 0.55rem 0.9rem; min-height: 3.2rem; }
.brand { display: flex; align-items: center; gap: 0.45rem; color: var(--band-ink); text-decoration: none; font-weight: 700; font-size: 1.2rem; }
.side-tools { display: flex; gap: 0.4rem; }
.icon-button { width: 2.1rem; height: 2.1rem; border-radius: 50%; display: grid; place-items: center; color: var(--band-ink); background: rgb(43 27 15 / 0.12); text-decoration: none; font-weight: 700; font-size: 1.1rem; }
.icon-button:hover { background: rgb(43 27 15 / 0.22); }
.side > .problem { padding: 0.6rem 0.9rem; background: var(--note); color: var(--ink); }
.rows { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.row { display: flex; align-items: flex-start; gap: 0.55rem; padding: 0.7rem 0.9rem; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--rule); }
.row:hover { background: var(--paper-alt); }
.row.on { background: var(--paper-alt); box-shadow: inset 3px 0 0 var(--band); }
.row .dot { width: 0.55rem; height: 0.55rem; border-radius: 50%; margin-top: 0.5rem; flex: none; }
.row.unread .dot { background: var(--accent); }
.row.unread .name { font-weight: 700; }
.row .body { min-width: 0; flex: 1; display: grid; gap: 0.1rem; }
.row .line1 { display: flex; align-items: baseline; gap: 0.5rem; }
.row .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.row .tag { font-size: 0.75rem; color: var(--ink-soft); background: var(--paper-alt); border: 1px solid var(--rule); border-radius: 999px; padding: 0 0.45rem; white-space: nowrap; }
.row .when { margin-left: auto; font-size: 0.8rem; color: var(--ink-soft); white-space: nowrap; }
.row .preview { color: var(--ink-soft); font-size: 0.92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row.requests { background: var(--note); border-bottom: 1px solid var(--rule); padding: 0.8rem 0.9rem 0.8rem 1.5rem; align-items: center; justify-content: space-between; font-weight: 700; }
.row.requests.on { box-shadow: inset 3px 0 0 var(--accent); }
.row.requests .count { background: var(--accent); color: var(--paper); border-radius: 999px; min-width: 1.4rem; text-align: center; padding: 0 0.4rem; font-size: 0.85rem; }

.main { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.pane { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.welcome { align-items: center; justify-content: center; color: var(--ink-soft); }
.pane-head { display: flex; align-items: center; gap: 0.6rem; padding: 0.55rem 1rem; border-bottom: 1px solid var(--rule); min-height: 3.2rem; background: var(--paper); }
.head-text { min-width: 0; }
.pane-title { font-size: 1.1rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pane-sub { font-size: 0.82rem; color: var(--ink-soft); }
.back { display: none; text-decoration: none; font-size: 1.8rem; line-height: 1; padding: 0 0.4rem; color: var(--accent); }
.pane > .problem { padding: 0.5rem 1rem; background: var(--note); color: var(--ink); }

/* ---- the chat ---- */
.log { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 0.35rem; }
.log .empty { margin: auto; }
.msg { position: relative; display: grid; gap: 0.15rem; max-width: min(36rem, 82%); width: fit-content; padding-top: 0.2rem; }
.msg.mine { align-self: flex-end; justify-items: end; }
.msg.theirs { align-self: flex-start; justify-items: start; }
.who { font-size: 0.78rem; color: var(--ink-soft); padding: 0 0.3rem; }
.bubble { border-radius: 14px; padding: 0.5rem 0.8rem; background: var(--paper-alt); }
.msg.mine .bubble { background: var(--mine); color: var(--mine-ink); }
.text { white-space: pre-wrap; overflow-wrap: anywhere; user-select: text; }
.quote { margin: 0 0 0.35rem; padding: 0.15rem 0.6rem; border-left: 3px solid var(--band); font-size: 0.88rem; color: var(--ink-soft); }
.quote.gone { font-style: italic; }
.quote-who { font-weight: 700; }
.meta, .status { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; font-size: 0.78rem; color: var(--ink-soft); padding: 0 0.3rem; }
.msg.mine .meta, .msg.mine .status { justify-content: flex-end; }
.status .bad { color: var(--bad); }
.status .read { color: var(--accent); font-weight: 600; }
.badge { border: 1px solid var(--rule); background: var(--paper); border-radius: 999px; padding: 0 0.5rem; font-size: 0.85rem; }
.badge.mine { border-color: var(--accent); background: var(--note); }
.tools { position: absolute; top: -0.9rem; display: none; gap: 0.15rem; background: var(--paper); border: 1px solid var(--rule); border-radius: 10px; padding: 0.1rem; box-shadow: var(--shadow); z-index: 2; }
.msg.mine .tools { right: 0; }
.msg.theirs .tools { left: 0; }
.msg:hover .tools, .msg:focus-within .tools { display: flex; }
.tool { border: 0; background: none; border-radius: 8px; padding: 0.15rem 0.5rem; font-size: 0.85rem; color: var(--ink); }
.tool:hover { background: var(--paper-alt); }
.picker { position: absolute; top: 1.4rem; display: flex; gap: 0.1rem; background: var(--paper); border: 1px solid var(--rule); border-radius: 12px; padding: 0.25rem; box-shadow: var(--shadow); z-index: 3; }
.msg.mine .picker { right: 0; }
.pick { border: 0; background: none; font-size: 1.3rem; border-radius: 8px; padding: 0.1rem 0.3rem; }
.pick:hover, .pick[aria-pressed="true"] { background: var(--note); }
.call-note { align-self: center; font-size: 0.85rem; color: var(--ink-soft); background: var(--paper-alt); border-radius: 999px; padding: 0.2rem 0.8rem; }
@media (hover: none) { .tools { display: flex; position: static; box-shadow: none; border: 0; background: none; } }

.composer { position: relative; border-top: 1px solid var(--rule); padding: 0.6rem 1rem 0.8rem; display: grid; gap: 0.4rem; background: var(--paper); }
.banner { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; font-size: 0.88rem; color: var(--ink-soft); border-left: 3px solid var(--band); padding-left: 0.6rem; }
.banner-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compose-row { display: flex; gap: 0.6rem; align-items: flex-end; }
.field-box { flex: 1; display: flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; border: 1px solid var(--rule); border-radius: 14px; padding: 0.3rem 0.5rem; background: var(--paper); }
.field-box:focus-within { outline: 2px solid var(--accent); }
.field-box textarea { flex: 1; min-width: 8rem; border: 0; outline: 0; background: transparent; resize: none; padding: 0.3rem; max-height: 180px; }
.chip { display: inline-flex; align-items: center; gap: 0.2rem; background: var(--note); border-radius: 999px; padding: 0.05rem 0.2rem 0.05rem 0.6rem; font-size: 0.9rem; font-weight: 600; }
.chip button { border: 0; background: none; border-radius: 50%; width: 1.4rem; height: 1.4rem; }
.chip button:hover { background: rgb(0 0 0 / 0.12); }
.mentions { position: absolute; bottom: 100%; left: 1rem; list-style: none; margin: 0 0 -0.2rem; padding: 0.25rem; background: var(--paper); border: 1px solid var(--rule); border-radius: 12px; box-shadow: var(--shadow); min-width: 12rem; z-index: 4; }
.mentions li { padding: 0.35rem 0.7rem; border-radius: 8px; cursor: pointer; font-weight: 600; }
.mentions li.on, .mentions li:hover { background: var(--note); }
.mentions .sub { font-weight: 400; color: var(--ink-soft); }
.send { align-self: flex-end; }

/* ---- requests, new message, me ---- */
.requests-body, .me-body, .new-form { padding: 1rem; overflow-y: auto; display: grid; gap: 0.9rem; align-content: start; max-width: 40rem; }
.requests-body .rows { border: 1px solid var(--rule); border-radius: 14px; overflow: hidden; }
.knock { display: grid; gap: 0.6rem; }
.knock-name { font-size: 1.2rem; font-weight: 700; }
.knock-from, .knock-meta { color: var(--ink-soft); font-size: 0.88rem; }
.knock-preview { margin: 0; background: var(--paper-alt); border-radius: 14px; padding: 0.7rem 0.9rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.knock-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.4rem; }
.new-form label { font-weight: 600; font-size: 0.9rem; }
.card h2 { font-size: 1rem; }
.inline-form { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.inline-form label { font-weight: 700; }
.inline-form input { flex: 1; min-width: 10rem; }
.agent-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.agent-rows li { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }
.agent-text { display: grid; }
.agent-text .sub { color: var(--ink-soft); font-size: 0.85rem; }
.ask { background: var(--note); border-radius: 12px; padding: 0.6rem 0.8rem; }
.seg { display: inline-flex; border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; width: fit-content; }
.seg button { border: 0; background: var(--paper); padding: 0.45rem 0.9rem; }
.seg button.on { background: var(--band); color: var(--band-ink); font-weight: 700; }

/* ---- dialogs ---- */
dialog.ask { border: 0; border-radius: 18px; padding: 1.3rem; background: var(--paper); color: var(--ink); box-shadow: var(--shadow); width: min(24rem, calc(100vw - 2rem)); }
dialog.ask::backdrop { background: rgb(20 12 4 / 0.45); }
dialog.ask h2 { font-size: 1.1rem; margin-bottom: 0.4rem; }
dialog.ask p { color: var(--ink-soft); }
.ask-buttons { display: flex; justify-content: flex-end; gap: 0.6rem; margin-top: 1.1rem; }

/* ---- narrow screens: one pane at a time ---- */
@media (max-width: 820px) {
    .shell { grid-template-columns: 1fr; }
    body[data-pane="main"] .side { display: none; }
    body[data-pane="list"] .main { display: none; }
    .back { display: block; }
    .msg { max-width: 92%; }
}

/* One focus ring on the compose box (the box shows it, not the field inside), and the field is never collapsed. */
.field-box textarea:focus-visible { outline: 0; }
.field-box textarea { min-height: 1.9rem; }

/* The quiet day line between days. */
.day { align-self: center; margin: 0.8rem 0 0.3rem; font-size: 0.78rem; color: var(--ink-soft); background: var(--paper-alt); border-radius: 999px; padding: 0.1rem 0.8rem; }

/* The username examples: what people can type to reach the owner; the values are monospace. */
.examples dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.25rem 0.9rem; margin: 0.4rem 0 0; }
.examples dt { color: var(--ink-soft); }
.examples dd { margin: 0; }
.examples code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.92em; background: var(--paper); border: 1px solid var(--rule); border-radius: 6px; padding: 0.05rem 0.4rem; }
.problem.quiet-line { color: var(--ink-soft); }
.switch-row { display: flex; align-items: flex-start; gap: 0.7rem; cursor: pointer; }
.switch-row input { margin-top: 0.25rem; flex: none; }
.switch-text { display: grid; gap: 0.15rem; }
.switch-text .sub { color: var(--ink-soft); font-size: 0.85rem; }

/* ---- an invitation and the app (P-2254) ---- */
.login-form { display: grid; gap: 0.9rem; }
a.button { display: inline-block; border-radius: 14px; padding: 0.6rem 1.1rem; font-weight: 600; min-height: 2.5rem; box-sizing: border-box; text-decoration: none; text-align: center; }
a.button.primary { background: var(--band); color: var(--band-ink); }
a.button.quiet { background: transparent; color: var(--ink); border: 1px solid var(--rule); }
.get-qr { display: none; }
@media (min-width: 44rem) { .get-qr { display: grid; justify-items: center; gap: 0.4rem; } }
.get-qr img { background: #fff; padding: 0.5rem; border-radius: 12px; }
