:root {
  --bg: #0f1115; --panel: #171a21; --panel2: #1e222b; --line: #2a2f3a; --text: #e9ecf1; --muted: #8b93a3;
  --accent: #5b8cff; --you: #ffb02e; --claude: #7c6cff; --ok: #3fbf74; --bad: #ff5a52;
  color-scheme: dark;
}
* { 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; }
button, select, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
code { font-family: ui-monospace, Consolas, monospace; font-size: .92em; }
[hidden] { display: none !important; }

.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: var(--bg); }
.top h1 { font-size: 19px; margin: 0; display: flex; align-items: center; gap: 9px; letter-spacing: .2px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); display: inline-block; }
.dot.live { background: var(--ok); box-shadow: 0 0 0 0 rgba(63,191,116,.6); animation: pulse 2.4s infinite; }
.dot.off { background: var(--bad); animation: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(63,191,116,.55); } 70% { box-shadow: 0 0 0 8px rgba(63,191,116,0); } 100% { box-shadow: 0 0 0 0 rgba(63,191,116,0); } }
.actions { display: flex; gap: 6px; }
.icon { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; min-width: 42px; height: 42px; font-size: 18px; }
.icon.danger { color: var(--bad); }

.tabs { display: flex; gap: 6px; padding: 0 16px; overflow-x: auto; scrollbar-width: none; }
.tabs button { flex: none; background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; color: var(--muted); }
.tabs button.on { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 600; }
.tabs .n { opacity: .7; margin-left: 4px; font-weight: 500; }
.filters { padding: 10px 16px 0; }
.filters select { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; width: 100%; max-width: 280px; }

main { padding: 6px 16px calc(40px + env(safe-area-inset-bottom)); max-width: 760px; margin: 0 auto; }
.group h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); margin: 20px 2px 8px; font-weight: 600; }
.card { display: block; width: 100%; text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 14px; margin-bottom: 8px; position: relative; }
.card:active { background: var(--panel2); }
.card .t { font-weight: 550; padding-right: 14px; }
.card .meta { display: flex; flex-wrap: wrap; gap: 6px 10px; margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.card.new::after { content: ""; position: absolute; top: 14px; right: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.chip { border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; }
.who-you { color: var(--you); } .who-claude { color: var(--claude); } .who-github { color: var(--ok); }
.empty { text-align: center; color: var(--muted); padding: 50px 24px; }
.empty .big { color: var(--text); font-size: 18px; font-weight: 600; }

.sheet { position: fixed; inset: 0; z-index: 10; background: var(--bg); overflow-y: auto; overscroll-behavior: contain; }
.sheet-top { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: var(--bg); border-bottom: 1px solid var(--line); }
.sheet-body { padding: 14px 16px calc(40px + env(safe-area-inset-bottom)); max-width: 760px; margin: 0 auto; }
.muted { color: var(--muted); }
.title-input { width: 100%; background: transparent; border: 0; font-size: 20px; font-weight: 650; resize: none; padding: 0; outline: none; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0 6px; }
.grid label { font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.grid select, .grid input { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; color: var(--text); width: 100%; min-width: 0; }
.block { margin-top: 18px; }
.label { font-size: 12px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; }
.link { background: none; border: 0; color: var(--accent); text-transform: none; letter-spacing: 0; font-size: 13px; padding: 0; }
.seg { display: flex; gap: 8px; }
.seg button { flex: 1; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 11px; }
.seg button.on[data-v="do"] { border-color: var(--ok); background: rgba(63,191,116,.14); }
.seg button.on[data-v="dont"] { border-color: var(--bad); background: rgba(255,90,82,.14); }
textarea { width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; resize: vertical; outline: none; }
textarea:focus, select:focus, input:focus { border-color: var(--accent); }
.with-mic { display: flex; gap: 8px; align-items: flex-end; }
.mic, .send { flex: none; width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel2); font-size: 18px; }
.mic.rec { background: var(--bad); border-color: var(--bad); animation: pulse 1.2s infinite; }
.send { background: var(--accent); border-color: var(--accent); color: #fff; }

.notes { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; overflow-wrap: anywhere; }
.notes p { margin: 0 0 8px; } .notes p:last-child { margin: 0; }
.notes ol, .notes ul { margin: 0 0 8px; padding-left: 22px; } .notes li { margin: 4px 0; }
.notes a, .thread a { color: var(--accent); }
.copy { background: var(--panel2); border: 1px dashed var(--muted); border-radius: 7px; padding: 1px 7px; font-family: ui-monospace, Consolas, monospace; font-size: .92em; }
.copy::after { content: " ⧉"; opacity: .6; }
.thread { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.msg { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.you { background: rgba(255,176,46,.08); border-color: rgba(255,176,46,.3); margin-left: 28px; }
.msg .who { font-size: 12px; margin-bottom: 3px; }
.msg .who .muted { margin-left: 6px; }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 20;
  background: var(--text); color: var(--bg); padding: 9px 16px; border-radius: 999px; font-weight: 600; font-size: 14px; }
