:root {
  color-scheme: dark;
  --bg: #0f1115;
  --panel: #171a21;
  --line: #2a2f3a;
  --text: #e8eaf0;
  --muted: #9aa3b2;
  --accent: #4f8cff;
  --ok: #3ecf8e;
  --warn: #f5a623;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, sans-serif; }
.bar { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 20px; background: var(--panel); border-bottom: 1px solid var(--line); }
.bar h1 { font-size: 18px; margin: 0; }
.bar-right { display: flex; align-items: center; gap: 14px; }
.counter { background: var(--warn); color: #111; font-weight: 600; border-radius: 999px; padding: 2px 10px; font-size: 13px; }
.status { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.status::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--warn); }
.status[data-state="open"]::before { background: var(--ok); }
.link { background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; text-decoration: underline; }
main { max-width: 820px; margin: 0 auto; padding: 20px; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 28px 0 10px; }
.empty { color: var(--muted); padding: 12px 0; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-bottom: 14px; }
.card.fresh { border-color: var(--accent); }
.card h3 { margin: 0 0 4px; font-size: 16px; }
.card .question { margin: 6px 0 10px; }
.tags { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.tag { font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; }
details.context { margin: 6px 0 10px; color: var(--muted); font-size: 14px; }
details.context p { white-space: pre-wrap; margin: 6px 0 0; }
.option { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 6px; cursor: pointer; }
.option:hover { border-color: var(--accent); }
.option input { margin-top: 4px; }
.option .desc { display: block; color: var(--muted); font-size: 13px; }
textarea, input[type="password"] { width: 100%; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: inherit; margin-top: 6px; }
textarea { min-height: 64px; resize: vertical; }
.actions { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
button.primary { background: var(--accent); color: #fff; border: 0; border-radius: 8px; padding: 8px 16px; font: inherit; font-weight: 600; cursor: pointer; }
button.primary:disabled { opacity: .5; cursor: default; }
.error { color: #ff6b6b; font-size: 13px; }
.answer { border-left: 3px solid var(--ok); padding-left: 10px; margin-top: 8px; }
.answer small { color: var(--muted); display: block; }
.login { max-width: 340px; margin: 18vh auto 0; }
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--accent); color: #fff; padding: 10px 14px; border-radius: 8px; box-shadow: 0 4px 16px #0008; max-width: 320px; }
.option .grow { flex: 1; }
.option .remove { font-size: 18px; line-height: 1; text-decoration: none; padding: 0 4px; }
.add-option { display: flex; gap: 8px; margin: 8px 0 4px; }
.add-option input, .field input { flex: 1; width: 100%; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: inherit; }
button.secondary { background: none; color: var(--accent); border: 1px solid var(--accent); border-radius: 8px; padding: 8px 12px; font: inherit; cursor: pointer; white-space: nowrap; }
.hint { color: var(--muted); font-size: 13px; margin: 0 0 8px; }
.field { display: block; margin-bottom: 10px; }
.field-label { display: block; font-size: 14px; color: var(--muted); }
.picked { margin: 4px 0; padding-left: 18px; }
