/* Web Remote's own page: no shared stylesheet, no fonts or images from anywhere else. */
:root {
  color-scheme: light dark;
  --paper: #f2f2f0;
  --surface: #ffffff;
  --sunken: #e9e9e6;
  --ink: #111214;
  --ink-2: #3b3e43;
  --muted: #666a71;
  --rule: rgba(17, 18, 20, 0.1);
  --rule-strong: rgba(17, 18, 20, 0.2);
  --on-ink: #ffffff;
  --header: rgba(242, 242, 240, 0.82);
  --q-green: #36db68;
  --q-yellow: #e9cd43;
  --q-red: #f34f39;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI Variable Display", "Segoe UI", "PingFang SC", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --gutter: max(20px, env(safe-area-inset-left, 0px));
  --gutter-r: max(20px, env(safe-area-inset-right, 0px));
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0a0a0b;
    --surface: #141517;
    --sunken: #1b1c1f;
    --ink: #edeef0;
    --ink-2: #c4c7cc;
    --muted: #8c9198;
    --rule: rgba(255, 255, 255, 0.09);
    --rule-strong: rgba(255, 255, 255, 0.18);
    --on-ink: #0a0a0b;
    --header: rgba(10, 10, 11, 0.78);
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.5 var(--font); -webkit-text-size-adjust: 100%; }
.remote .brand { color: var(--muted); font-size: 14px; text-decoration: none; }
.remote .code { font: 600 40px/1 var(--mono); letter-spacing: 0.12em; font-variant-numeric: tabular-nums; text-align: center; margin: 22px 0 14px; }
.remote .intro p { margin: 0; color: var(--ink-2); }
.remote .intro .wait { color: var(--muted); font-size: 14px; text-align: center; }
.remote { max-width: 760px; margin: 0 auto; padding: 24px var(--gutter-r) 120px var(--gutter); }
.remote .r-title { font: 600 28px/1.2 var(--font-display); margin: 2px 0 20px; }
.remote h2 { font: 600 17px/1.3 var(--font); margin: 0 0 12px; }
.remote .card { background: var(--surface); border: 1px solid var(--rule); border-radius: 14px; padding: 18px; margin-bottom: 16px; }
.remote .intro ol { margin: 14px 0 0; padding-left: 20px; color: var(--ink-2); }
.remote .intro li { margin: 6px 0; }
.remote .bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.remote .pill { display: inline-block; font-size: 12px; line-height: 1; padding: 5px 9px; border-radius: 999px; background: var(--sunken); color: var(--ink-2); white-space: nowrap; }
.remote .pill[data-link="connected"], .remote .pill[data-state="running"] { background: color-mix(in srgb, var(--q-green) 22%, transparent); color: var(--ink); }
.remote .pill[data-state="waitingForApproval"] { background: color-mix(in srgb, var(--q-yellow) 32%, transparent); color: var(--ink); }
.remote .pill[data-link="offline"] { background: color-mix(in srgb, var(--q-red) 22%, transparent); color: var(--ink); }
.remote .banner { background: var(--sunken); border-radius: 10px; padding: 10px 14px; font-size: 14px; color: var(--ink-2); margin: 0 0 14px; }
.remote .banner.warn { background: color-mix(in srgb, var(--q-yellow) 22%, transparent); color: var(--ink); }
.remote .empty, .remote .a-note { color: var(--muted); font-size: 14px; margin: 6px 0 0; }
.remote ul { list-style: none; margin: 0; padding: 0; }
.remote .quota { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(60px, 1fr) auto; gap: 4px 12px; align-items: center; padding: 8px 0; font-size: 14px; }
.remote .quota + .quota { border-top: 1px solid var(--rule); }
.remote .q-name small { color: var(--muted); }
.remote .q-bar { height: 6px; border-radius: 3px; background: var(--sunken); overflow: hidden; }
.remote .q-bar.none { background: none; }
.remote .q-bar i { display: block; height: 100%; background: var(--q-green); }
.remote .quota[data-level="warning"] .q-bar i { background: var(--q-yellow); }
.remote .quota[data-level="critical"] .q-bar i, .remote .quota[data-level="exhausted"] .q-bar i { background: var(--q-red); }
.remote .q-left { font-variant-numeric: tabular-nums; text-align: right; }
.remote .q-reset { grid-column: 1 / -1; color: var(--muted); font-size: 12px; }
.remote .q-reset:empty { display: none; }
.remote .sessions li + li { border-top: 1px solid var(--rule); }
.remote .session { display: grid; gap: 4px; width: 100%; text-align: left; background: none; border: 0; padding: 12px 0; color: inherit; font: inherit; cursor: pointer; }
.remote .s-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.remote .s-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.remote .s-meta { color: var(--muted); font-size: 13px; margin: 0; }
.remote .s-last { color: var(--ink-2); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.remote .d-head { margin-bottom: 14px; }
.remote .d-head h2 { font-size: 20px; margin: 8px 0 4px; }
.remote .back, .remote .link { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; font-size: 14px; cursor: pointer; }
.remote .thread { display: flex; flex-direction: column; gap: 10px; }
.remote .bubble { max-width: 88%; padding: 10px 13px; border-radius: 14px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; line-height: 1.45; }
.remote .bubble.agent { align-self: flex-start; background: var(--surface); border: 1px solid var(--rule); }
.remote .bubble.me { align-self: flex-end; background: var(--ink); color: var(--on-ink); }
.remote .bubble.pending { opacity: 0.6; }
.remote .bubble.failed { background: color-mix(in srgb, var(--q-red) 80%, var(--ink)); }
.remote .bubble small { display: block; font-size: 11px; opacity: 0.8; margin-top: 4px; }
.remote .bubble.working { color: var(--muted); }
.remote .requests { display: grid; gap: 12px; margin-top: 16px; }
.remote .approval { background: var(--surface); border: 1px solid var(--rule-strong); border-radius: 14px; padding: 14px; }
.remote .a-head { display: flex; gap: 8px; align-items: center; }
.remote .badge { font: 600 11px/1 var(--mono); padding: 4px 6px; border-radius: 5px; background: var(--sunken); }
.remote .a-path { font: 13px var(--mono); color: var(--muted); margin-top: 6px; overflow-wrap: anywhere; }
.remote pre { font: 13px/1.45 var(--mono); background: var(--sunken); border-radius: 8px; padding: 9px 11px; margin: 8px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 240px; overflow: auto; }
.remote pre.minus { background: color-mix(in srgb, var(--q-red) 14%, transparent); }
.remote pre.plus { background: color-mix(in srgb, var(--q-green) 14%, transparent); }
.remote .a-actions { display: flex; gap: 10px; margin-top: 12px; }
.remote .btn { flex: 1; font: 600 15px var(--font); padding: 11px 14px; border-radius: 10px; border: 1px solid var(--rule-strong); background: var(--surface); color: var(--ink); cursor: pointer; }
.remote .btn.allow { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.remote .btn:disabled { opacity: 0.5; cursor: default; }
.remote .foot { margin-top: 28px; text-align: center; }
.remote .composer { position: fixed; left: 0; right: 0; bottom: 0; display: flex; gap: 10px; align-items: flex-end; padding: 10px var(--gutter-r) calc(10px + env(safe-area-inset-bottom, 0px)) var(--gutter); background: var(--header); backdrop-filter: blur(14px); border-top: 1px solid var(--rule); }
.remote .composer[hidden] { display: none; }
.remote .composer textarea { flex: 1; max-width: 640px; margin-left: auto; resize: none; font: 15px/1.4 var(--font); padding: 10px 12px; border-radius: 12px; border: 1px solid var(--rule-strong); background: var(--surface); color: var(--ink); }
.remote .composer .btn { flex: 0 0 auto; margin-right: auto; }
