[hidden] { display: none !important; }
:root {
  --bg: #f6f1e8; --card: #fffdf8; --ink: #2a221d; --muted: #6e645a; --line: #e5dccd;
  --accent: #1f6f5c; --accent-ink: #ffffff; --accent-soft: #dcefe8;
  --sun: #ffc94d; --sun-soft: #fff1c9; --warn: #b5541c; --warn-soft: #fbe5d6; --urgent: #b3261e; --urgent-soft: #f9dedc;
  --ok: #2e7d4f; --ok-soft: #dff1e5; --shadow: 0 1px 2px rgba(60,40,20,.06), 0 4px 16px rgba(60,40,20,.06);
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #171411; --card: #211d19; --ink: #f1e9df; --muted: #a89d90; --line: #383029;
    --accent: #5cc3a5; --accent-ink: #0f2a22; --accent-soft: #1c3a32; --sun-soft: #3a3020;
    --warn: #f0a070; --warn-soft: #3d2a1d; --urgent: #ff8a80; --urgent-soft: #45211e; --ok: #7fd3a0; --ok-soft: #1d3527;
    --shadow: 0 1px 2px rgba(0,0,0,.3);
  }
}
:root[data-theme="dark"] {
  --bg: #171411; --card: #211d19; --ink: #f1e9df; --muted: #a89d90; --line: #383029;
  --accent: #5cc3a5; --accent-ink: #0f2a22; --accent-soft: #1c3a32; --sun-soft: #3a3020;
  --warn: #f0a070; --warn-soft: #3d2a1d; --urgent: #ff8a80; --urgent-soft: #45211e; --ok: #7fd3a0; --ok-soft: #1d3527;
  --shadow: 0 1px 2px rgba(0,0,0,.3);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.5 "Atkinson Hyperlegible", system-ui, sans-serif; }
h1, h2, h3 { font-family: Fraunces, Georgia, serif; font-weight: 700; line-height: 1.2; margin: 0 0 .4em; }
h1 { font-size: 30px; } h2 { font-size: 21px; } h3 { font-size: 17px; font-family: inherit; }
a { color: var(--accent); }
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 16px; padding: 10px 20px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { font-family: Fraunces, serif; font-weight: 700; font-size: 20px; color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 8px; }
.brand .dot { width: 22px; height: 22px; border-radius: 50%; background: var(--sun); box-shadow: inset 0 -3px 0 rgba(0,0,0,.08); }
nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
nav a { padding: 8px 12px; border-radius: 999px; text-decoration: none; color: var(--muted); white-space: nowrap; font-weight: 700; font-size: 15px; }
nav a.on { background: var(--accent-soft); color: var(--accent); }
main { max-width: 1040px; margin: 0 auto; padding: 24px 20px 80px; }
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.card + .card { margin-top: 18px; } .grid .card + .card { margin-top: 0; }
.muted { color: var(--muted); } .small { font-size: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.stack > * + * { margin-top: 12px; }
button, .btn { font: 700 16px/1 "Atkinson Hyperlegible", system-ui, sans-serif; border: 0; border-radius: 10px; padding: 12px 18px; background: var(--accent); color: var(--accent-ink); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }
button.ghost, .btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
button.danger { background: transparent; color: var(--urgent); border: 1px solid var(--line); }
button.small, .btn.small { padding: 8px 12px; font-size: 14px; min-height: 36px; }
button:disabled { opacity: .5; cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
label { display: block; font-weight: 700; font-size: 15px; margin-bottom: 4px; }
label .hint { font-weight: 400; color: var(--muted); }
input, select, textarea { width: 100%; font: 17px "Atkinson Hyperlegible", system-ui, sans-serif; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
textarea { min-height: 96px; resize: vertical; }
input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--accent); }
input[type=range] { padding: 0; accent-color: var(--accent); }
.check { display: flex; gap: 10px; align-items: center; font-weight: 400; }
.fields { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; background: var(--line); color: var(--ink); white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); } .pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.urgent { background: var(--urgent-soft); color: var(--urgent); } .pill.sun { background: var(--sun-soft); color: var(--ink); }
.list { list-style: none; padding: 0; margin: 0; }
.list > li { padding: 12px 0; border-top: 1px solid var(--line); display: flex; gap: 12px; align-items: flex-start; }
.list > li:first-child { border-top: 0; }
.list .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.time { font-variant-numeric: tabular-nums; font-weight: 700; min-width: 76px; }
.alert { border-left: 4px solid var(--warn); background: var(--warn-soft); padding: 12px 14px; border-radius: 10px; display: flex; gap: 12px; align-items: flex-start; }
.alert.urgent { border-color: var(--urgent); background: var(--urgent-soft); } .alert.info { border-color: var(--accent); background: var(--accent-soft); }
.alert + .alert { margin-top: 10px; }
.status-line { display: flex; gap: 10px; align-items: center; }
.led { width: 12px; height: 12px; border-radius: 50%; background: var(--muted); flex: none; } .led.on { background: #35b36b; box-shadow: 0 0 0 4px rgba(53,179,107,.18); }
.bubble { max-width: 80%; padding: 10px 14px; border-radius: 16px; background: var(--accent-soft); overflow-wrap: anywhere; }
.bubble.them { background: var(--sun-soft); }
.thread { display: flex; flex-direction: column; gap: 8px; }
.thread .me { align-self: flex-end; } .thread .them { align-self: flex-start; }
.hero { display: flex; gap: 18px; align-items: center; margin-bottom: 20px; flex-wrap: wrap; }
.smiley { width: 56px; height: 56px; border-radius: 50%; background: radial-gradient(circle at 50% 40%, #ffe8a3, #ffc94d); position: relative; flex: none; }
.smiley::before, .smiley::after { content: ""; position: absolute; top: 19px; width: 7px; height: 10px; border-radius: 50%; background: #3b2a20; }
.smiley::before { left: 17px; } .smiley::after { right: 17px; }
.smiley i { position: absolute; left: 16px; right: 16px; top: 30px; height: 10px; border: 4px solid #3b2a20; border-top: 0; border-radius: 0 0 20px 20px; }
.auth { max-width: 420px; margin: 8vh auto; }
.tabs { display: flex; gap: 6px; margin: 4px 0 14px; flex-wrap: wrap; }
.tabs button { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.tabs button.on { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips label { margin: 0; }
.chips input { display: none; }
.chips span { display: inline-block; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; font-weight: 700; cursor: pointer; font-size: 15px; }
.chips input:checked + span { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.times { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.times input { width: 130px; }
details summary { cursor: pointer; font-weight: 700; color: var(--accent); }
.empty { text-align: center; padding: 26px 10px; color: var(--muted); }
.code { font: 700 22px ui-monospace, monospace; letter-spacing: 3px; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(120px); background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 12px; transition: transform .25s, opacity .25s; z-index: 10; max-width: calc(100% - 32px); opacity: 0; visibility: hidden; }
#toast.show { transform: translateX(-50%) translateY(0); opacity: 1; visibility: visible; }
.modal-bg { position: fixed; inset: 0; background: rgba(20,15,10,.45); display: grid; place-items: center; padding: 16px; z-index: 8; }
.modal { background: var(--card); border-radius: var(--radius); padding: 22px; width: min(640px, 100%); max-height: 92vh; overflow: auto; }
@media (max-width: 640px) {
  main { padding: 16px 16px 72px; } h1 { font-size: 25px; }
  .top { padding: 8px 12px; gap: 8px; flex-wrap: wrap; } nav { order: 3; flex-basis: 100%; }
  .time { min-width: 64px; }
}
