/* ResolveRT — Menumaker-family three-panel layout (1 : 2 : 1, chat centred).
   Data n Algos family palette: high-contrast black/white with the decisive
   red accent, in both day and night modes (Ankit's ruling 2026-09-03).
   Theme: [data-theme="dark"|"light"] on <html>, else follows the OS. */
:root {
  --bg: #ffffff;
  --panel: #f4f4f4;
  --card: #ffffff;
  --ink: #111111;
  --muted: #6a6a6a;
  --line: #e2e2e2;
  --accent: #e50914;
  --accent-ink: #ffffff;
  --sys-bg: #f1f1f1; --sys-ink: #444444; --sys-line: #dddddd;
  --shadow: 0 1px 2px rgba(0,0,0,.07), 0 6px 16px rgba(0,0,0,.10), 0 16px 40px rgba(0,0,0,.08);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.08), 0 3px 8px rgba(0,0,0,.07);
  --panel-edge: transparent;
  --pill-open: #e8eefc;      --pill-open-ink: #2b4faf;
  --pill-progress: #fff3d9;  --pill-progress-ink: #8a5b00;
  --pill-waiting: #f3e8fc;   --pill-waiting-ink: #6b2baf;
  --pill-resolved: #e2f5ec;  --pill-resolved-ink: #1d7a52;
  --pill-closed: #ececec;    --pill-closed-ink: #666666;
  --pill-triage: #fdeceb;    --pill-triage-ink: #b3423a;
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --bg: #0c0c0c;
    --panel: #171717;
    --card: #212121;
    --ink: #f2f2f2;
    --muted: #9a9a9a;
    --line: #2e2e2e;
    --sys-bg: #1c1c1c; --sys-ink: #bdbdbd; --sys-line: #333333;
    --shadow: 0 1px 2px rgba(0,0,0,.7), 0 8px 20px rgba(0,0,0,.55), 0 22px 50px rgba(0,0,0,.5);
    --shadow-sm: 0 1px 2px rgba(0,0,0,.6), 0 4px 10px rgba(0,0,0,.45);
    --panel-edge: #2a2a2a;
    --pill-open: #1d2a4d;      --pill-open-ink: #9db8f5;
    --pill-progress: #3a2d10;  --pill-progress-ink: #e8bb62;
    --pill-waiting: #32204d;   --pill-waiting-ink: #cba6f0;
    --pill-resolved: #14352a;  --pill-resolved-ink: #6fd3a6;
    --pill-closed: #2a2a2a;    --pill-closed-ink: #9a9a9a;
    --pill-triage: #3d1a18;    --pill-triage-ink: #f08a82;
  }
}
html[data-theme="dark"] {
  --bg: #0c0c0c;
  --panel: #171717;
  --card: #212121;
  --ink: #f2f2f2;
  --muted: #9a9a9a;
  --line: #2e2e2e;
  --sys-bg: #1c1c1c; --sys-ink: #bdbdbd; --sys-line: #333333;
  --shadow: 0 1px 2px rgba(0,0,0,.7), 0 8px 20px rgba(0,0,0,.55), 0 22px 50px rgba(0,0,0,.5);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.6), 0 4px 10px rgba(0,0,0,.45);
  --panel-edge: #2a2a2a;
  --pill-open: #1d2a4d;      --pill-open-ink: #9db8f5;
  --pill-progress: #3a2d10;  --pill-progress-ink: #e8bb62;
  --pill-waiting: #32204d;   --pill-waiting-ink: #cba6f0;
  --pill-resolved: #14352a;  --pill-resolved-ink: #6fd3a6;
  --pill-closed: #2a2a2a;    --pill-closed-ink: #9a9a9a;
  --pill-triage: #3d1a18;    --pill-triage-ink: #f08a82;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font: 13.5px/1.5 "Inter", -apple-system, "Segoe UI", system-ui, sans-serif;
       color: var(--ink); background: var(--bg); display: flex; flex-direction: column; }
button { font: inherit; cursor: pointer; border: 0; border-radius: 8px; padding: 7px 14px; font-weight: 600; }
button.primary { background: var(--accent); color: var(--accent-ink);
                 box-shadow: 0 2px 6px rgba(229,9,20,.35), 0 6px 16px rgba(229,9,20,.18); }
button.ghost { background: transparent; color: inherit; border: 1px solid var(--line); }
input, select, textarea { font: inherit; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); }
.mono { font-family: ui-monospace, "Cascadia Mono", monospace; }
.muted { color: var(--muted); }
.empty { color: var(--muted); padding: 8px 2px; }

/* top bar — wordmark header */
#topbar { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px 6px; }
.brand { font-size: 1.05rem; font-weight: 800; letter-spacing: .12em; }
.brand span { color: var(--accent); }

/* user drop-down panel */
#user-menu { position: relative; }
#user-btn { font-size: .82rem; padding: 6px 12px; }
#user-panel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: 230px;
              background: var(--card); border: 1px solid var(--line); border-radius: 12px;
              box-shadow: 0 10px 34px rgba(0,0,0,.28); padding: 8px; }
.up-identity { font-size: .8rem; color: var(--muted); padding: 6px 10px 8px; word-break: break-all; }
.up-divider { height: 1px; background: var(--line); margin: 6px 4px; }
.up-item { display: flex; justify-content: space-between; align-items: center; width: 100%;
           text-align: left; background: transparent; border: 0; border-radius: 8px;
           padding: 8px 10px; font-weight: 600; font-size: .84rem; color: var(--ink); }
.up-item:hover:not(:disabled) { background: var(--panel); }
.up-item:disabled { color: var(--muted); cursor: default; font-weight: 400; }
.up-item.active-view { color: var(--accent); }
.soon { font-size: .62rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
        background: var(--panel); border-radius: 999px; padding: 2px 7px; color: var(--muted); }

/* the three panels: 1 : 2 : 1, chat in the middle */
#app { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 2fr 1fr; gap: 12px; padding: 10px 14px 14px; }
.panel { background: var(--panel); border-radius: 14px; box-shadow: var(--shadow);
         border: 1px solid var(--panel-edge);
         display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.panel-head { padding: 12px 14px 8px; }
.panel-head.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.panel-title { font-size: .78rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
               white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.panel-sub { font-size: .72rem; color: var(--muted); margin-top: 2px; }
.panel-body { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 14px 14px; }
.section-label { font-size: .68rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 12px 0 4px; }

/* left panel lists */
#left-panel ul { list-style: none; margin: 0; padding: 0; }
#left-panel li { padding: 7px 10px; border-radius: 8px; cursor: pointer; background: var(--card);
                 margin-bottom: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
                 border: 1px solid transparent; color: var(--ink); box-shadow: var(--shadow-sm); }
#left-panel li:hover { border-color: var(--line); }
#left-panel li.active { border-color: var(--accent); color: var(--accent); font-weight: 700; }
#left-panel li .badge { float: right; font-size: .72rem; color: var(--muted); }

/* a conversation in the rail: the id, its type, and its facts under a caret */
#left-panel li.thread { white-space: normal; padding: 6px 8px 6px 10px; }
.thread-row { display: flex; align-items: center; gap: 8px; }
.thread-name { flex: 1; font-size: .8rem; overflow: hidden; text-overflow: ellipsis; }
.thread-tag { font-size: .68rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
              color: var(--muted); background: var(--panel); border-radius: 999px; padding: 2px 8px; }
.thread-del { background: transparent; border: 0; color: var(--muted); padding: 0 3px;
              font-size: 1rem; line-height: 1; opacity: 0; transition: opacity .12s ease; }
#left-panel li.thread:hover .thread-del, .thread-del:focus { opacity: 1; }
.thread-del:hover { color: var(--accent); }
.thread-caret { background: transparent; border: 0; color: var(--muted); padding: 0 2px;
                font-size: .95rem; line-height: 1; transition: transform .12s ease; }
.thread-caret.open { transform: rotate(90deg); }
.thread-detail { margin: 7px 0 2px; padding-top: 7px; border-top: 1px solid var(--line);
                 display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; font-size: .74rem; }
.thread-detail > div { display: contents; }
.thread-detail dt { color: var(--muted); }
.thread-detail dd { margin: 0; text-align: right; overflow: hidden; text-overflow: ellipsis; }
#new-thread { margin-top: 10px; width: 100%; }

/* middle: chat */
#messages { display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 72ch; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; box-shadow: var(--shadow-sm); }
.msg { position: relative; }
.msg .who { font-weight: 700; font-size: .8rem; }
.edited { color: var(--muted); font-size: .66rem; margin-left: 8px; font-style: italic; }

/* your own words carry a menu; it stays out of the way until you look for it */
.msg-menu { position: absolute; top: 4px; right: 4px; background: transparent; border: 0;
            color: var(--muted); padding: 2px 7px; line-height: 1; font-size: .95rem;
            opacity: 0; transition: opacity .12s ease; }
.msg:hover .msg-menu, .msg-menu:focus { opacity: 1; }
.msg-menu:hover { color: var(--ink); }
.line-menu { position: absolute; top: 26px; right: 4px; z-index: 20; min-width: 118px;
             background: var(--card); border: 1px solid var(--line); border-radius: 9px;
             box-shadow: 0 10px 28px rgba(0,0,0,.32); padding: 5px; display: flex; flex-direction: column; }
.line-menu button { background: transparent; border: 0; text-align: left; color: var(--ink);
                    padding: 6px 9px; border-radius: 6px; font-size: .8rem; font-weight: 600; }
.line-menu button:hover:not(:disabled) { background: var(--panel); }
.line-menu button:disabled { color: var(--muted); cursor: default; font-weight: 400; }
.line-menu button.danger { color: var(--accent); }
.edit-box { width: 100%; font-size: .9rem; }
.msg .when { color: var(--muted); font-size: .7rem; margin-left: 8px; }
.msg.system { background: var(--sys-bg); border-color: var(--sys-line); color: var(--sys-ink); font-size: .86rem; }
/* The browser's [hidden] rule is `[hidden] { display: none }` — specificity
   (0,1,0). Any ID rule that sets `display` outranks it, so `el.hidden = true`
   silently does nothing. #composer had exactly that bug: the message box stayed
   visible with no conversation open, and Send posted to /api/tickets/null.
   Stated once, for every element that relies on the attribute. */
[hidden] { display: none !important; }

/* The convo panel's own actions. `+ New conversation` lives here rather than in
   the left rail: starting one is something you do TO a conversation you already
   have, not a thing you go elsewhere to request. Disabled until there is one. */
/* The intent buttons: what the person thinks this conversation is. Declared
   vocabulary, rendered from AttrTable, never hardcoded in the markup. The word
   is the whole button — the declared meaning is the title attribute, not a
   second line of print. */
/* Two columns, not three. With Task there are eleven types; three columns
   leaves an orphan on the last row, two columns divide cleanly and a one-word
   button has no need of the width. */
.intent-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; }
.intent-grid button {
  padding: 9px 8px; border-radius: 8px; font-size: .8rem; font-weight: 600;
  text-align: center; line-height: 1.2; white-space: nowrap;
}
.intent-grid button.wide { grid-column: 1 / -1; }
.intent-grid button.chosen { border-color: var(--accent); color: var(--accent); }

/* A panel body in halves: the top carries what is live, the bottom is held for
   what comes next. Each scrolls on its own so neither can push the other out. */
.panel-body.split { display: grid; grid-template-rows: 1fr 1fr; gap: 12px; overflow: hidden; padding-bottom: 12px; }
.panel-body.split > .half { min-height: 0; overflow-y: auto; }
#right-bottom { border-top: 1px solid var(--line); padding-top: 10px; }
#right-bottom.flash { animation: flash 0.9s ease; }
@keyframes flash { 0%, 100% { background: transparent; } 25% { background: var(--card); } }

/* the directory: people, agents, and RRT */
.dir-search { width: 100%; margin-bottom: 8px; font-size: .8rem; }
#dir-list { list-style: none; margin: 0; padding: 0; }
.dir-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px;
           background: var(--card); margin-bottom: 5px; box-shadow: var(--shadow-sm); }
.dir-who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dir-name { font-size: .8rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dir-id { font-size: .66rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dir-kind { font-size: .62rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
            color: var(--muted); }
.dir-kind.system { color: var(--accent); }
.dir-kind.team { color: var(--accent); }
.dir-row.is-team .dir-name::before { content: "◇ "; color: var(--accent); }
.dir-acts { display: flex; gap: 5px; }
.dir-add, .dir-own { font-size: .7rem; padding: 3px 9px; }
.dir-add:disabled, .dir-own:disabled { opacity: .4; cursor: default; }
.dir-own { border-color: var(--accent); color: var(--accent); }
.dir-own.owning { border-color: var(--line); color: var(--muted); }
.dir-empty { color: var(--muted); font-size: .78rem; padding: 6px 2px; }

.head-actions { display: flex; gap: 8px; align-items: center; }

/* who is in the room, under the conversation id */
#room:empty { display: none; }
#room { margin-top: 7px; display: flex; flex-wrap: wrap; gap: 5px; }
.party { font-size: .68rem; font-weight: 600; border-radius: 999px; padding: 2px 9px;
         background: var(--card); border: 1px solid var(--line); color: var(--muted); }
.party.opener { color: var(--ink); }
.party.team { border-color: var(--accent); color: var(--accent); }

/* what has been asserted from this conversation, under its heading */
#assert-strip:empty { display: none; }
#assert-strip { margin-top: 8px; display: flex; flex-direction: column; gap: 5px; }
.assert-row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
              background: var(--card); border: 1px solid var(--line); border-radius: 8px;
              padding: 6px 11px; font-size: .78rem; }
.assert-id { font-size: .72rem; color: var(--muted); }
.assert-kind { font-size: .62rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
               color: var(--accent); }
.assert-title { flex: 1; min-width: 120px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.assert-owners { display: flex; gap: 5px; }
.owner { font-size: .68rem; font-weight: 600; background: var(--panel); border-radius: 999px; padding: 2px 9px; }
.owner.none { color: var(--muted); font-weight: 400; font-style: italic; }

.dlg-label { display: block; font-size: .74rem; font-weight: 700; letter-spacing: .05em;
             text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
#dlg-assert input { width: 100%; }
#dlg-assert menu { display: flex; justify-content: flex-end; gap: 8px; padding: 0; margin: 14px 0 0; }
.head-actions button[disabled] { opacity: .35; cursor: not-allowed; }

#composer { display: flex; gap: 8px; padding: 10px 14px 14px; align-items: center; }
#composer button.icon { padding: 6px 9px; font-size: .92rem; line-height: 1; }
#composer button.icon:disabled { opacity: .3; cursor: not-allowed; }

/* an attached file, rendered as the line it is */
.attachment { display: inline-flex; align-items: center; gap: 8px; margin-top: 2px;
              background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
              padding: 6px 11px; font-weight: 600; font-size: .8rem; color: inherit; max-width: 100%; }
.attachment:hover { border-color: var(--accent); color: var(--accent); }
.att-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-size { color: var(--muted); font-size: .72rem; font-weight: 400; }
#composer-author { width: 100px; }
#composer-body { flex: 1; }

/* right: ticket */
.ticket-head { display: flex; justify-content: space-between; align-items: center; }
#ticket h2 { margin: 8px 0 4px; font-size: .95rem; }
.pill { font-size: .72rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.pill.open { background: var(--pill-open); color: var(--pill-open-ink); }
.pill.in_progress { background: var(--pill-progress); color: var(--pill-progress-ink); }
.pill.waiting { background: var(--pill-waiting); color: var(--pill-waiting-ink); }
.pill.resolved { background: var(--pill-resolved); color: var(--pill-resolved-ink); }
.pill.closed { background: var(--pill-closed); color: var(--pill-closed-ink); }
.pill.triage { background: var(--pill-triage); color: var(--pill-triage-ink); }
.t-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin: 12px 0; }
.t-meta div { display: flex; flex-direction: column; min-width: 0; }
.t-meta dt { font-size: .64rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.t-meta dd { margin: 2px 0 0; }
.t-meta select { width: 100%; }
.t-actions { display: flex; gap: 8px; margin: 8px 0 2px; flex-wrap: wrap; }
#t-comments, #t-members { list-style: none; padding: 0; margin: 4px 0; display: flex; flex-direction: column; gap: 6px; }
#t-comments li, #t-members li { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-size: .85rem; box-shadow: var(--shadow-sm); }
#t-comments .who, #t-members .who { font-weight: 700; font-size: .78rem; }
#t-members li { display: flex; justify-content: space-between; gap: 8px; }
#btn-watch { font-size: .78rem; padding: 5px 10px; white-space: nowrap; }
#comment-form { display: flex; gap: 6px; margin-top: 8px; }
#comment-form input { flex: 1; min-width: 0; }

/* a protocol result, in the conversation where it belongs */
.msg.notice { max-width: none; }
.msg.notice.fail { border-color: var(--accent); }
.notice-title { font-weight: 700; font-size: .84rem; margin-bottom: 9px; }
.msg.notice.fail .notice-title { color: var(--accent); }
.notice-checks, .notice-warn { list-style: none; margin: 0; padding: 0; }
.notice-checks li { display: grid; grid-template-columns: 16px 54px 1fr; gap: 2px 8px;
                    align-items: baseline; padding: 5px 0; font-size: .8rem;
                    border-top: 1px solid var(--line); }
.notice-checks li:first-child { border-top: 0; }
.notice-checks .mark { font-weight: 700; }
.notice-checks li.ok .mark { color: #3fb950; }
.notice-checks li.bad .mark { color: var(--accent); }
.notice-checks .step { color: var(--muted); font-size: .68rem; font-weight: 700;
                       letter-spacing: .04em; text-transform: uppercase; }
.notice-checks .what { font-weight: 600; }
.notice-checks .why { grid-column: 3; color: var(--muted); font-size: .76rem; line-height: 1.45; }
.notice-sub { margin: 12px 0 5px; font-size: .68rem; font-weight: 700; letter-spacing: .08em;
              text-transform: uppercase; color: var(--muted); }
.notice-warn li { color: var(--muted); font-size: .76rem; padding: 2px 0 2px 14px; position: relative; }
.notice-warn li::before { content: "·"; position: absolute; left: 4px; }

/* toasts — a passing remark, over the middle of the app, in our own colours */
#toasts { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
          z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 8px;
          pointer-events: none; }
.toast { background: var(--card); border: 1px solid var(--line); border-radius: 10px;
         box-shadow: 0 10px 30px rgba(0,0,0,.34); padding: 9px 16px; font-size: .82rem;
         font-weight: 600; color: var(--ink); max-width: min(520px, 88vw);
         opacity: 1; transition: opacity .3s ease, transform .3s ease; }
.toast.going { opacity: 0; transform: translateY(6px); }
.toast.warn { border-color: var(--accent); }
.toast.warn::before { content: "⚠ "; color: var(--accent); }

/* dialog */
dialog { border: 0; border-radius: 14px; padding: 20px; width: min(440px, 90vw);
         box-shadow: 0 12px 40px rgba(0,0,0,.35); font: inherit; background: var(--card); color: var(--ink); }
dialog::backdrop { background: rgba(0,0,0,.5); }
dialog h2 { margin: 0 0 12px; font-size: 1rem; }
dialog menu { display: flex; justify-content: flex-end; gap: 8px; padding: 0; margin: 16px 0 0; }
/* the one dialog every ask goes through */
#dlg-ask h2 { font-size: 1rem; }
#dlg-ask .dlg-sub { margin: 0 0 4px; font-size: .84rem; line-height: 1.5; color: var(--muted); }
#dlg-ask #ask-input { width: 100%; margin-top: 12px; }
#dlg-ask button.danger { background: var(--accent); color: var(--accent-ink); }

/* statistics dialog */
#stats-body table { border-collapse: collapse; width: 100%; font-size: .86rem; }
#stats-body th, #stats-body td { text-align: left; padding: 5px 10px; border-bottom: 1px solid var(--line); }
#stats-body td:last-child { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
#stats-body h3 { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 12px 0 4px; }

@media (max-width: 980px) {
  #app { grid-template-columns: 1fr 2fr; }
  #side-panel { display: none; }
}
@media (max-width: 640px) {
  #app { grid-template-columns: 1fr; }
  #left-panel { display: none; }
}

/* identity: the simulated SSO picker */
#user-btn.identified { border-color: var(--accent); color: var(--accent); font-weight: 700; }
.dlg-sub { margin: -6px 0 14px; font-size: .8rem; }
#users-body { display: grid; gap: 8px; }
.user-card { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; width: 100%; text-align: left;
             background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
             padding: 10px 14px; color: var(--ink); box-shadow: var(--shadow-sm); }
.user-card:hover { border-color: var(--accent); }
.uc-name { font-weight: 700; font-size: .92rem; }
.uc-meta { grid-column: 1; font-size: .76rem; color: var(--muted); font-weight: 400; }
.uc-load { grid-row: 1 / span 2; align-self: center; font-size: .72rem; color: var(--muted);
           background: var(--card); border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
/* your own messages, so a multi-window conversation reads at a glance */
.msg.mine { border-color: var(--accent); }
.msg.mine .who { color: var(--accent); }
.note { font-size: .76rem; margin: 10px 0 0; }

/* ═══════════════════════════════════════════════════════════════════════════
   MODALS AND THE ACCOUNT MENU - the house manner.

   Ankit's ruling 2026-11-20: aesthetics, professionalism, elegance and
   intuitiveness are requirements, not polish, and the GlassLeaf screens are the
   reference to MATCH. So: deep radii, generous padding, one row per choice,
   red reserved for the primary action and for destructive words.

   Written against the tokens above, so all of it works in both themes. The
   GlassLeaf captures are dark because his machine is dark, not because the look
   is dark-only - and ResolveRT keeps its three-state theme switch.
   ═══════════════════════════════════════════════════════════════════════════ */

.sheet { border: 0; padding: 0; width: min(430px, 92vw); border-radius: 20px;
         background: var(--card); color: var(--ink);
         box-shadow: 0 24px 70px rgba(0,0,0,.45), 0 6px 18px rgba(0,0,0,.3); }
.sheet::backdrop { background: rgba(0,0,0,.6); backdrop-filter: blur(2px); }

.sheet-head { display: flex; align-items: center; justify-content: space-between;
              padding: 20px 22px 12px; }
.sheet-title { font-size: 1.02rem; font-weight: 800; letter-spacing: -.01em; }
.sheet-x { background: transparent; color: var(--muted); padding: 3px 8px;
           border-radius: 8px; font-size: 1.05rem; line-height: 1; }
.sheet-x:hover { background: var(--panel); color: var(--ink); }
.sheet-body { padding: 2px 22px 22px; display: flex; flex-direction: column; gap: 9px; }
.sheet-note { color: var(--muted); font-size: .78rem; line-height: 1.5; margin: 4px 2px 0; }

/* the welcome sheet - centred, because it is the first thing anyone sees */
.welcome { padding: 30px 26px 26px; text-align: center; }
.welcome .mark { margin: 0 auto 15px; }
.welcome h2 { margin: 0 0 7px; font-size: 1.3rem; font-weight: 800; letter-spacing: -.02em; }
.welcome p { margin: 0 0 22px; color: var(--muted); font-size: .86rem; }
.welcome .choices { display: flex; flex-direction: column; gap: 9px; text-align: left; }
/* Google renders its own button into here, in an iframe we cannot restyle -
   see the note in app.js. Centred and width-matched so it sits in the stack
   as though it were one of ours. */
#gsi { display: flex; justify-content: center; min-height: 44px; }

/* one row per choice - a provider, an identity, anything chosen from a list */
.row-btn { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
           background: var(--panel); border: 1px solid transparent; border-radius: 12px;
           padding: 12px 14px; color: var(--ink); font-weight: 600; font-size: .88rem; }
.row-btn:hover:not(:disabled) { border-color: var(--line); }
.row-btn:disabled { color: var(--muted); cursor: default; }
.row-btn .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-btn.connected { border-color: var(--accent); }

/* A monogram, not a logo. Drawing seven companies' marks from memory produces
   seven slightly wrong logos, which looks worse than not trying and misuses
   their trademarks besides. A lettered tile is deliberate. */
.glyph { width: 27px; height: 27px; border-radius: 8px; display: grid; place-items: center;
         font-size: .73rem; font-weight: 800; color: #ffffff; flex: 0 0 auto; letter-spacing: 0; }

/* ---- the account menu -------------------------------------------------
   Wider than it was. His email wrapped onto two lines in the old 230px, which
   is the kind of thing that reads as unfinished however well the thing works. */
#user-panel { width: 292px; padding: 6px; }
.up-id { display: flex; align-items: center; gap: 11px; padding: 11px 11px 12px; }
.up-id .grow { flex: 1; min-width: 0; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
          font-weight: 800; font-size: .95rem; background: var(--panel);
          border: 1.5px solid var(--accent); color: var(--ink); flex: 0 0 auto; }
.up-name { font-weight: 700; font-size: .88rem; line-height: 1.3;
           overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-mail { font-size: .75rem; color: var(--muted); line-height: 1.35;
           overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-item { justify-content: flex-start; gap: 11px; padding: 9px 11px; }
.up-item .ico { width: 16px; height: 16px; flex: 0 0 auto; color: var(--muted); }
.up-item .tail { margin-left: auto; }
.up-item.danger { color: var(--accent); }
.up-item.danger .ico { color: var(--accent); }

/* The account control: one circle, two states.
   Overrides the plain #user-btn sizing above by carrying both the id and the
   class, so the padding and font-size there do not fight it. */
#user-btn.avatar-btn {
  width: 38px; height: 38px; border-radius: 50%; padding: 0;
  display: grid; place-items: center;
  background: var(--card); border: 1.5px solid var(--accent);
  color: var(--ink); font-weight: 800; font-size: .95rem; line-height: 1;
  transition: background .12s ease;
}
#user-btn.avatar-btn:hover { background: var(--panel); }
#user-btn .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); display: block; }

/* A provider row that can be acted on, and the key field it opens. */
.row-wrap { display: flex; flex-direction: column; gap: 7px; }
.row-tail { font-family: ui-monospace, "Cascadia Mono", monospace;
            font-size: .78rem; color: var(--muted); letter-spacing: .04em; }
.row-act { background: transparent; border: 0; color: var(--accent);
           font-weight: 700; font-size: .76rem; padding: 4px 7px; border-radius: 7px; }
.row-act:hover { background: var(--panel); }
.row-act.quiet { color: var(--muted); }
.row-act.quiet:hover { color: var(--ink); }
.key-form { display: flex; gap: 7px; padding: 0 2px 2px; }
.key-form input { flex: 1; min-width: 0; font-size: .82rem; }
.key-form button { font-size: .8rem; padding: 7px 13px; }
.key-hint { font-size: .72rem; color: var(--muted); padding: 0 4px 2px; }

/* The connect view's two ways out of a dead end: make a key, or pay for one.
   Quiet by design - they are escape hatches beside the primary action, not
   competitors to it. */
.sheet-links { display: flex; gap: 18px; padding: 2px 4px 0; }
.sheet-links a { color: var(--muted); font-size: .78rem; font-weight: 600;
                 text-decoration: none; }
.sheet-links a:hover { color: var(--ink); text-decoration: underline; }
.sheet-head .back { margin-right: 2px; font-size: 1rem; }
.sheet-head .sheet-title { flex: 1; }

/* ═══════════════════════════════════════════════════════════════════════════
   FLOATING WINDOWS - Ankit's ruling 2026-11-20. The fixed 1:2:1 grid is gone;
   five windows you can drag anywhere and resize, each remembering where you
   left it. The grid rules above are kept because the dialogs still use the
   shared panel vocabulary, but #app no longer lays anything out.
   ═══════════════════════════════════════════════════════════════════════════ */

#app { display: block; position: relative; flex: 1; min-height: 0; padding: 0; }

.win {
  position: fixed;
  display: flex; flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
  /* The browser's own handle, bottom-right. One line, and it behaves exactly
     the way people already expect a window corner to behave. */
  resize: both;
  min-width: 230px; min-height: 140px;
  max-width: 100vw; max-height: 100vh;
}
.win.dragging {
  box-shadow: 0 10px 28px rgba(0,0,0,.34), 0 28px 70px rgba(0,0,0,.3);
  /* No transition while dragging - a window that eases toward the pointer
     feels like lag, not polish. */
  transition: none;
}

.win-head {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px 9px;
  cursor: grab;
  /* Without this, a drag selects the title text instead of moving the window. */
  user-select: none;
  flex: 0 0 auto;
}
.win.dragging .win-head { cursor: grabbing; }
.win-head .win-title {
  flex: 1; min-width: 0;
  font-size: .78rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.win-head .head-actions { flex: 0 0 auto; }

.win-body { flex: 1; min-height: 0; overflow-y: auto; padding: 2px 14px 14px; }
.win-foot { flex: 0 0 auto; }

/* A window held for something not built yet says so, rather than being an
   unexplained empty rectangle. */
.reserved { color: var(--muted); font-size: .82rem; line-height: 1.5; }

/* !! BELOW THIS WIDTH FLOATING STOPS HELPING. There is no room to arrange
   anything, so the windows become an ordinary scrolling column. The inline
   left/top/width/height the script writes are overridden here rather than
   removed, so widening the window restores the arrangement untouched. */
@media (max-width: 900px) {
  #app { overflow-y: auto; padding: 10px 14px 14px; }
  .win {
    position: static !important;
    width: auto !important; height: auto !important;
    min-height: 180px; max-height: none;
    resize: none;
    margin-bottom: 12px;
  }
  .win-head { cursor: default; }
}

/* ---- settings controls -------------------------------------------------
   A button per model, and a slider or a switch for everything that is a
   degree or a yes/no. Nothing here is a free-text box pretending to be a
   setting. */
.field { padding: 13px 2px 3px; border-top: 1px solid var(--line); }
.field:first-child { border-top: 0; padding-top: 4px; }
.field-head { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.field-label { flex: 1; font-size: .8rem; font-weight: 700; }
.field-value { font-size: .76rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.field-note { font-size: .72rem; color: var(--muted); margin-top: 8px; line-height: 1.45; }

/* A row of choices. Wraps rather than scrolls - a model list can be long and a
   hidden option is an option nobody picks. */
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { background: var(--card); border: 1px solid var(--line); color: var(--ink);
              border-radius: 9px; padding: 7px 11px; font-size: .79rem; font-weight: 600; }
.seg button:hover:not(.on) { border-color: var(--muted); }
.seg button.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

input[type="range"] { width: 100%; accent-color: var(--accent); }

/* The switch. A checkbox is still underneath it, so it is keyboard reachable
   and announces itself properly - only its appearance is ours. */
.switch { display: inline-block; position: relative; width: 40px; height: 23px;
          flex: 0 0 auto; vertical-align: middle; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0;
                opacity: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; background: var(--line); border-radius: 999px;
               transition: background .15s ease; pointer-events: none; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px;
                      width: 17px; height: 17px; border-radius: 50%; background: #ffffff;
                      box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .15s ease; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(17px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.field textarea { width: 100%; min-height: 76px; resize: vertical; font-size: .82rem; }

/* The gear on a connected provider row, where the key tail used to be. */
.row-cog { background: transparent; border: 0; color: var(--muted); padding: 4px 6px;
           border-radius: 7px; line-height: 0; }
.row-cog:hover { background: var(--card); color: var(--ink); }
.row-cog svg { width: 17px; height: 17px; }

/* ---- stacking ----------------------------------------------------------
   !! THE ACCOUNT MENU MUST OUTRANK EVERY WINDOW.
   Windows take a rising z-index each time one is raised, so after enough
   clicks they passed the menu's old z-index of 30 and began covering it. The
   fix is a reserved band rather than a bigger number: windows live below 1000,
   the top bar and its menu above it, and windows.js renumbers rather than
   climbing past the ceiling. */
#topbar { position: relative; z-index: 1000; }
#user-menu { position: relative; z-index: 1001; }
#user-panel { z-index: 1002; }

/* ---- resizable sheets --------------------------------------------------
   A dialog is a fixed box by default, which is wrong on a small laptop and
   wasteful on a large screen. The corner handle makes it the reader's call.
   `overflow: auto` is what makes resize work at all on a <dialog>. */
.sheet { resize: both; overflow: auto; min-width: 320px; min-height: 180px;
         max-width: 96vw; max-height: 92vh; }

/* ---- a setting that does not apply to the chosen model ------------------ */
.field.off { opacity: .5; }
.field.off input, .field.off textarea, .field.off .seg button { pointer-events: none; }
.help { background: transparent; border: 1px solid var(--line); color: var(--muted);
        width: 17px; height: 17px; border-radius: 50%; padding: 0; line-height: 1;
        font-size: .68rem; font-weight: 800; flex: 0 0 auto; }
.help:hover { border-color: var(--accent); color: var(--accent); }
.help-text { font-size: .72rem; color: var(--muted); margin-top: 8px; line-height: 1.45;
             border-left: 2px solid var(--line); padding-left: 9px; }

/* The welcome sheet is centred text with no header row, so its way out sits in
   the corner rather than in a bar that would unbalance it. */
.sheet-x.corner { position: absolute; top: 11px; right: 12px; z-index: 2; }

/* ---- context blocks ----------------------------------------------------- */
.ctx-actions { display: flex; gap: 8px; padding-top: 6px; }
.ctx-block { border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px;
             margin-bottom: 9px; background: var(--card); }
.ctx-block.off { opacity: .55; }
.ctx-top { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; }
.ctx-name { flex: 1; min-width: 0; font-weight: 700; font-size: .85rem; color: var(--ink);
            background: transparent; border: 0; border-bottom: 1px solid transparent;
            border-radius: 0; padding: 2px 0; }
.ctx-name:focus { outline: none; border-bottom-color: var(--accent); }
.ctx-meta { font-size: .68rem; color: var(--muted); white-space: nowrap; }
.ctx-scopes { display: flex; gap: 5px; margin-bottom: 9px; }
.ctx-scopes button { font-size: .71rem; padding: 4px 10px; border-radius: 7px;
                     background: var(--panel); border: 1px solid transparent;
                     color: var(--muted); font-weight: 700; }
.ctx-scopes button.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.ctx-block textarea { width: 100%; min-height: 62px; font-size: .8rem; resize: vertical; }
.ctx-file { font-size: .76rem; color: var(--muted);
            font-family: ui-monospace, "Cascadia Mono", monospace; }
.ctx-del { background: transparent; border: 0; color: var(--muted); font-size: .95rem;
           padding: 2px 7px; border-radius: 6px; line-height: 1; }
.ctx-del:hover { color: var(--accent); background: var(--panel); }

/* ---- what came back, and what went out ---------------------------------- */
.think, .sent { margin-top: 9px; border-top: 1px solid var(--line); padding-top: 7px; }
.think summary, .sent summary { cursor: pointer; font-size: .68rem; color: var(--muted);
                                font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.think .body { font-size: .8rem; color: var(--muted); white-space: pre-wrap;
               margin-top: 7px; line-height: 1.5; }
.sent table { width: 100%; font-size: .72rem; border-collapse: collapse; margin-top: 6px; }
.sent td { padding: 3px 6px; border-top: 1px solid var(--line); color: var(--muted); }
.sent td.scope { font-weight: 700; text-transform: uppercase; font-size: .62rem; letter-spacing: .06em; }
.sent td.n { text-align: right; font-variant-numeric: tabular-nums; }

/* ---- a conversation in the rail, and its way out ------------------------ */
#threads li { display: flex; align-items: center; gap: 7px; }
#threads .t-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Out of the way until you look for it, which is right for an action with no
   undo - but reachable by keyboard at all times, so it is not a mouse-only
   feature. */
#threads .t-del { background: transparent; border: 0; color: var(--muted); padding: 1px 5px;
                  border-radius: 6px; font-size: .9rem; line-height: 1;
                  opacity: 0; transition: opacity .12s ease; flex: 0 0 auto; }
#threads li:hover .t-del, #threads .t-del:focus-visible { opacity: 1; }
#threads .t-del:hover { color: var(--accent); background: var(--panel); }

/* ---- the Next prompt window --------------------------------------------
   Every piece that will go, in the order it will go, with the one control
   that matters: in or out. */
#next-list { display: flex; flex-direction: column; gap: 5px; }
/* The panel is two layers: the boxes you type into, built once and kept so the
   caret survives a redraw, and everything below them, rebuilt on every change.
   Both carry the same column rhythm so the seam is invisible. */
.np-fixed, .np-rest { display: flex; flex-direction: column; gap: 5px; }
.np-row { display: flex; align-items: flex-start; gap: 8px; padding: 6px 8px;
          border-radius: 8px; background: var(--card); border: 1px solid transparent; }
.np-row:hover { border-color: var(--line); }
.np-row.out { opacity: .45; }
.np-row input[type="checkbox"] { margin: 2px 0 0; accent-color: var(--accent);
                                 width: 14px; height: 14px; flex: 0 0 auto; }
.np-main { flex: 1; min-width: 0; }
.np-name { font-size: .78rem; font-weight: 600; overflow: hidden;
           text-overflow: ellipsis; white-space: nowrap; }
.np-row.out .np-name { text-decoration: line-through; }
.np-peek { font-size: .68rem; color: var(--muted); overflow: hidden;
           text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.np-tag { font-size: .58rem; font-weight: 800; letter-spacing: .07em;
          text-transform: uppercase; color: var(--muted); background: var(--panel);
          border-radius: 999px; padding: 2px 7px; flex: 0 0 auto; margin-top: 1px; }
.np-tag.user { color: var(--accent); }
.np-n { font-size: .67rem; color: var(--muted); font-variant-numeric: tabular-nums;
        flex: 0 0 auto; margin-top: 2px; }
.np-head { font-size: .62rem; font-weight: 800; letter-spacing: .09em;
           text-transform: uppercase; color: var(--muted); margin: 9px 0 3px; }
.np-head:first-child { margin-top: 0; }

/* ---- the Conversations sheet -------------------------------------------
   Each conversation is a card with a name and a way out, not a line of text
   in a list. A thing you can act on should look like a thing. */
#threads { list-style: none; margin: 0; padding: 0; display: flex;
           flex-direction: column; gap: 8px; }
#threads li { display: flex; align-items: center; gap: 10px;
              background: var(--panel); border: 1px solid transparent;
              border-radius: 12px; padding: 12px 14px; cursor: pointer; }
#threads li:hover { border-color: var(--line); }
#threads li.active { border-color: var(--accent); }
#threads .t-name { flex: 1; min-width: 0; font-size: .85rem; font-weight: 600;
                   overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#threads li.active .t-name { color: var(--accent); }
/* Out of the way until you look for it - right for an action with no undo -
   but always reachable by keyboard. */
#threads .t-del { background: transparent; border: 0; color: var(--muted);
                  padding: 3px 7px; border-radius: 7px; font-size: .95rem;
                  line-height: 1; opacity: 0; transition: opacity .12s ease;
                  flex: 0 0 auto; }
#threads li:hover .t-del, #threads .t-del:focus-visible { opacity: 1; }
#threads .t-del:hover { color: var(--accent); background: var(--card); }

/* ---- a reply, in segments ----------------------------------------------
   Each paragraph or section of an answer is its own addressable piece: you
   can lift it into a note, take it to its own conversation, or drop it from
   what gets sent. So it looks like a piece rather than a run of text. */
.seg { position: relative; border-radius: 9px; padding: 7px 30px 7px 10px;
       margin: 0 -10px; border: 1px solid transparent; }
.seg + .seg { margin-top: 2px; }
.seg:hover { background: var(--panel); border-color: var(--line); }
.seg-body { white-space: pre-wrap; }
.seg.dropped { opacity: .42; }
.seg.dropped .seg-body { text-decoration: line-through; text-decoration-thickness: 1px; }
.seg-more { position: absolute; top: 5px; right: 4px; background: transparent;
            border: 0; color: var(--muted); padding: 1px 6px; border-radius: 6px;
            font-size: .95rem; line-height: 1; opacity: 0; transition: opacity .12s ease; }
.seg:hover .seg-more, .seg-more:focus-visible { opacity: 1; }
.seg-more:hover { color: var(--ink); background: var(--card); }

/* The one menu both routes open. */
.seg-menu { position: fixed; z-index: 1200; min-width: 190px; padding: 5px;
            background: var(--card); border: 1px solid var(--line); border-radius: 11px;
            box-shadow: 0 14px 38px rgba(0,0,0,.38); display: flex; flex-direction: column; }
.seg-menu button { background: transparent; border: 0; text-align: left; color: var(--ink);
                   padding: 8px 10px; border-radius: 7px; font-size: .81rem; font-weight: 600; }
.seg-menu button:hover { background: var(--panel); }
.seg-menu button.danger { color: var(--accent); }
.seg-menu .sep { height: 1px; background: var(--line); margin: 4px 6px; }
.seg-menu .what { font-size: .68rem; color: var(--muted); padding: 5px 10px 7px;
                  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- a note, as a window -----------------------------------------------
   Made while you work: lift a piece out of a reply and it opens here, beside
   the conversation rather than inside it. Closing puts it away; it stays in
   Context and reopens where you left it. */
.win.note .win-head { gap: 8px; }
.win.note .win-title { text-transform: none; letter-spacing: 0; font-size: .82rem;
                       font-weight: 700; color: var(--ink); }
.win.note .note-chars { font-size: .66rem; color: var(--muted); flex: 0 0 auto;
                        font-variant-numeric: tabular-nums; }
.win.note .note-x { background: transparent; border: 0; color: var(--muted);
                    padding: 2px 6px; border-radius: 6px; font-size: .9rem;
                    line-height: 1; flex: 0 0 auto; }
.win.note .note-x:hover { background: var(--card); color: var(--ink); }
.win.note .win-body { padding: 0 12px 12px; }
.win.note textarea { width: 100%; height: 100%; min-height: 80px; resize: none;
                     font-size: .82rem; line-height: 1.5; border-color: transparent;
                     background: transparent; padding: 4px 2px; }
.win.note textarea:focus { outline: none; border-color: var(--line);
                           background: var(--card); padding: 6px 8px; }
.win.note.in-prompt { border-color: var(--accent); }
.note-state { display: flex; align-items: center; gap: 7px; padding: 4px 2px 8px;
              font-size: .7rem; color: var(--muted); }

/* ---- an attached note in the Next prompt panel --------------------------
   A card, not a tick: the choice is not "in or out" but WHERE it belongs,
   which is what decides where it lands in the request and what it costs. */
.np-item { background: var(--card); border: 1px solid var(--line);
           border-radius: 10px; padding: 8px 9px; }
.np-item.out { opacity: .5; }
.np-item-top { display: flex; align-items: baseline; gap: 8px; margin-bottom: 7px; }
.np-item.out .np-name { text-decoration: line-through; }
.np-scope { display: flex; gap: 4px; flex-wrap: wrap; }
.np-scope button { background: var(--panel); border: 1px solid transparent;
                   color: var(--muted); border-radius: 7px; padding: 3px 8px;
                   font-size: .67rem; font-weight: 700; }
.np-scope button:hover:not(.on) { border-color: var(--line); color: var(--ink); }
.np-scope button.on { background: var(--accent); color: var(--accent-ink);
                      border-color: var(--accent); }

/* ---- a tool ------------------------------------------------------------
   Same card as a note, because it is the same question - where does this
   belong. The difference is the unavailable state, which is SHOWN rather
   than hidden: "your provider does not offer this here" is information, and
   an absent row is not. */
.np-tool .np-what { margin-top: 5px; }
.np-tool.blocked { opacity: .62; border-style: dashed; }
.np-tool.blocked .np-name { text-decoration: none; }
.np-tool.blocked .np-peek { color: var(--muted); font-style: italic; }

/* ---- the prompt, written out ------------------------------------------- */
.sheet-wide { width: min(760px, 94vw); }
.lit { border: 1px solid var(--line); border-radius: 10px;
       padding: 9px 11px; margin-bottom: 9px; background: var(--card); }
.lit-label { display: flex; align-items: baseline; justify-content: space-between;
             gap: 8px; font-size: .64rem; font-weight: 800; letter-spacing: .09em;
             text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.lit-note { font-size: .7rem; color: var(--muted); margin-bottom: 6px; }
.lit-text { margin: 0; white-space: pre-wrap; word-break: break-word;
            font-family: ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace;
            font-size: .74rem; line-height: 1.55; color: var(--ink); }
/* The seams, in colour: what the model is told, what you said, what it said. */
.lit-tools { border-left: 3px solid var(--accent); }
.lit-system { border-left: 3px solid #7a7a7a; }
.lit-user { border-left: 3px solid #2f6fd0; }
.lit-assistant { border-left: 3px solid #39894f; }
.lit-open { margin-top: 8px; background: var(--panel); border: 1px solid var(--line);
            color: var(--ink); border-radius: 8px; padding: 4px 10px;
            font-size: .68rem; font-weight: 700; }
.lit-open:hover { border-color: var(--accent); color: var(--accent); }
.win-act { background: var(--panel); border: 1px solid var(--line); color: var(--muted);
           border-radius: 8px; padding: 3px 9px; font-size: .66rem; font-weight: 700;
           margin-right: 8px; }
.win-act:hover { border-color: var(--accent); color: var(--accent); }

/* ---- the two you write yourself ---------------------------------------- */
.np-edit { margin-bottom: 4px; }
.np-edit textarea { width: 100%; min-height: 46px; resize: vertical;
                    font-size: .76rem; line-height: 1.45; padding: 6px 8px; }

/* An answer that never arrived, explained where the answer would have been. */
.empty-reply { border: 1px dashed var(--line); border-radius: 10px;
               padding: 9px 11px; line-height: 1.5; }
