/* cc-relay app: dark, close to the VS Code panel's own permission dialog. */
:root {
  color-scheme: dark;
  --bg: #1e1e1e;
  --panel: #252526;
  --panel2: #2d2d30;
  --border: #3c3c3c;
  --text: #cccccc;
  --strong: #e7e7e7;
  --muted: #9d9d9d;
  --blue: #0078d4;
  --sky: #4fc1ff;
  --red: #f14c4c;
  --amber: #cca700;
  --green: #89d185;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-tap-highlight-color: transparent; }
button { font: inherit; cursor: pointer; }
button:disabled { cursor: default; }
.page { max-width: 760px; margin: 0 auto; padding: 0 12px calc(28px + env(safe-area-inset-bottom)); }

/* top bar */
.bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; margin: 0 -12px 12px; padding: calc(10px + env(safe-area-inset-top)) 12px 10px; background: var(--bg); border-bottom: 1px solid var(--border); }
.back { color: var(--text); text-decoration: none; font-size: 30px; line-height: 1; padding: 0 8px 4px 0; }
.bar-title { flex: 1; min-width: 0; }
.title { font-weight: 600; color: var(--strong); font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub.mono { font-family: var(--mono); }
.chip { display: inline-flex; align-items: center; gap: 6px; flex: none; font-size: 12px; padding: 3px 9px; border-radius: 999px; background: var(--panel2); white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--muted); flex: none; }
.chip.green .dot, .st.green .dot { background: var(--green); }
.chip.blue .dot, .st.blue .dot { background: var(--sky); }
.chip.amber .dot, .st.amber .dot { background: var(--amber); }
.chip.red .dot, .st.red .dot { background: var(--red); }
.banner { background: var(--panel); border: 1px solid var(--border); border-left: 3px solid var(--amber); padding: 8px 10px; border-radius: 6px; font-size: 13.5px; margin-bottom: 12px; }
.banner.red { border-left-color: var(--red); }
.banner.blue { border-left-color: var(--sky); }

/* session list */
.list { display: flex; flex-direction: column; gap: 8px; }
.card { display: flex; align-items: center; gap: 10px; padding: 12px; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; color: inherit; text-decoration: none; }
.card.needs { box-shadow: inset 3px 0 0 var(--red); }
.card-main { flex: 1; min-width: 0; }
.card-title { display: flex; gap: 8px; align-items: baseline; min-width: 0; }
.proj { font-weight: 600; color: var(--strong); white-space: nowrap; }
.branch { font-family: var(--mono); font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-label { font-size: 13px; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .85; }
.st { display: inline-flex; align-items: center; gap: 5px; }
.st .dot { width: 7px; height: 7px; }
.st.red { color: var(--red); }
.st.amber { color: var(--amber); }
.st.blue { color: var(--sky); }
.st.green { color: var(--green); }
.badge { flex: none; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; color: #fff; }
.badge.red { background: var(--red); }
.badge.blue { background: var(--blue); }
.badge.grey { background: #555; }

/* session page */
.sess-meta { margin: -4px 0 12px; }
.sess-meta .dir { font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; direction: rtl; text-align: left; }
.sess-label { font-size: 13.5px; margin-top: 4px; }
.idle { text-align: center; padding: 28px 8px; }
.idle p { margin: 4px 0; }

/* dialog, modelled on the VS Code panel */
.dlg { background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 12px; margin-bottom: 14px; }
.dlg.sending { opacity: .55; }
.dlg-head { display: flex; align-items: flex-start; gap: 8px; }
.dlg-title { flex: 1; margin: 0 0 8px; font-size: 16px; font-weight: 600; color: var(--strong); }
.chev { background: none; border: 0; color: var(--muted); font-size: 16px; padding: 0 2px; line-height: 1.4; }
.file { font-family: var(--mono); font-size: 12.5px; color: var(--muted); margin-bottom: 6px; word-break: break-all; }
pre.code { font-family: var(--mono); font-size: 13.5px; line-height: 1.5; color: var(--strong); white-space: pre-wrap; word-break: break-word; margin: 0 0 6px; max-height: 45vh; overflow: auto; }
pre.code .add { display: block; color: #a7e3a1; background: rgba(35, 134, 54, .18); }
pre.code .del { display: block; color: #f4a4a4; background: rgba(218, 54, 51, .18); }
.desc { color: var(--muted); font-size: 14px; margin: 4px 0 10px; }
.flag { color: var(--amber); font-size: 13px; margin: 0 0 10px; }
.lead { color: var(--muted); font-size: 13.5px; margin: 0 0 6px; }
.prompt { color: var(--strong); font-weight: 600; margin: 12px 0 0; }
.opts { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.opt { display: flex; gap: 10px; align-items: baseline; text-align: left; width: 100%; padding: 10px 12px; border-radius: 4px; border: 1px solid var(--border); background: transparent; color: var(--text); }
.opt .num { color: var(--muted); font-size: 13px; min-width: 1ch; }
.opt.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.opt.primary .num { color: #fff; }
.opt.primary .lbl { font-weight: 600; }
.opt.armed { background: #4d3a00; border-color: var(--amber); color: #ffd866; }
.opt.on { border-color: var(--blue); background: rgba(0, 120, 212, .2); }
.opt:active:not(:disabled) { filter: brightness(1.25); }
.opt:disabled { opacity: .5; }
.odesc { display: block; color: var(--muted); font-size: 13px; }
.opt.primary .odesc { color: #dbeaff; }
.say-row { display: flex; gap: 8px; align-items: flex-end; margin-top: 6px; }
.say { flex: 1; resize: none; background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 4px; padding: 10px 12px; font: inherit; min-height: 44px; max-height: 40vh; }
.say::placeholder { color: #8a8a8a; }
.say:focus { outline: 1px solid var(--blue); border-color: var(--blue); }
.send { flex: none; width: 44px; height: 44px; border-radius: 4px; border: 0; background: var(--blue); color: #fff; font-size: 18px; }
.send:disabled { background: var(--panel2); color: var(--muted); }
.dlg-foot { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; }
.link { background: none; border: 0; padding: 4px 0; color: var(--muted); font-size: 12.5px; }
.link.u { text-decoration: underline; text-underline-offset: 2px; }
.link.danger { color: var(--red); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.chip-btn { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--panel2); color: var(--text); font-size: 14px; }
.chip-btn:disabled { opacity: .5; }
.submit { width: 100%; padding: 11px; border: 0; border-radius: 4px; background: var(--blue); color: #fff; font-weight: 600; margin-top: 4px; }
.submit:disabled { background: var(--panel2); color: var(--muted); }
.q { margin-bottom: 14px; }
.qhead { display: inline-block; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--sky); background: rgba(79, 193, 255, .12); border-radius: 3px; padding: 1px 6px; margin-bottom: 4px; }
.qtext { margin: 2px 0 0; color: var(--strong); font-weight: 600; }
.custom { font-size: 13px; color: var(--sky); margin: 4px 0 0; }

/* markdown (plans, Claude's last message) */
.md { font-size: 14.5px; max-height: 55vh; overflow: auto; overflow-wrap: anywhere; }
.md p { margin: 0 0 8px; }
.md h3, .md h4, .md h5, .md h6 { font-size: 15px; margin: 12px 0 6px; color: var(--strong); }
.md ul, .md ol { margin: 0 0 8px; padding-left: 22px; }
.md li { margin: 2px 0; }
.md code { font-family: var(--mono); font-size: 13px; background: var(--panel2); padding: 0 4px; border-radius: 3px; }
.md pre { background: var(--bg); padding: 8px 10px; border-radius: 4px; overflow: auto; }
.md pre code { background: none; padding: 0; font-size: 12.5px; }

.err { color: var(--red); font-size: 13.5px; margin: 6px 0; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.empty { color: var(--muted); text-align: center; padding: 40px 0; }
.pairing { text-align: center; padding: 32px 8px; }
.pairing pre { display: inline-block; font-family: var(--mono); background: var(--panel); border: 1px solid var(--border); padding: 6px 14px; border-radius: 4px; }
footer.foot { display: flex; justify-content: center; gap: 28px; margin-top: 26px; }

#toast { position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); transform: translate(-50%, 16px); opacity: 0; background: #3a3a3a; color: #fff; padding: 10px 14px; border-radius: 6px; font-size: 14px; transition: opacity .2s, transform .2s; max-width: 92vw; pointer-events: none; z-index: 10; box-shadow: 0 4px 16px rgba(0, 0, 0, .4); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
