:root { --maroon: #22070E; --wine: #140308; --surface: #2B0A12; --surface2: #3A1019; --line: #4D1A24; --gold: #D4AF37; --cream: #F5E9D0; --muted: #B79E8F; --bad: #FF8A80; --good: #9CCC65; color-scheme: dark; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--maroon); color: var(--cream); font: 16px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif; }
body { min-height: 100vh; padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
button, input, select { font: inherit; color: inherit; }
.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(--wine); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; font-size: 18px; } .brand b { color: var(--gold); }
.who { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface2); font-weight: 700; }
.who.synced { background: var(--gold); color: var(--wine); border-color: var(--gold); }
.view { padding: 16px 16px 24px; max-width: 720px; margin: 0 auto; }
.h h1 { font-size: 24px; margin: 4px 0 4px; } .h p { margin: 0 0 12px; }
h2 { font-size: 15px; color: var(--gold); margin: 20px 0 8px; }
.muted { color: var(--muted); } .small { font-size: 13px; } .center { text-align: center; margin-top: 24px; }
.hero { text-align: center; padding: 26px 0 8px; } .hero .word { font-size: 34px; font-weight: 700; margin: 0; } .hero .word b { color: var(--gold); } .hero p { margin: 4px 0; }
input, select { width: 100%; padding: 12px 14px; margin: 6px 0; border-radius: 12px; border: 1px solid var(--line); background: var(--wine); color: var(--cream); font-size: 16px; }
input::placeholder { color: var(--muted); }
.search input { border-radius: 24px; padding: 14px 18px; background: var(--surface); }
button.primary, button.ghost, button.link, .sync-panel button { padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface2); cursor: pointer; font-size: 15px; }
button.primary { background: var(--gold); color: var(--wine); border-color: var(--gold); font-weight: 600; }
button:disabled { opacity: .55; }
button.link { background: none; border: 0; color: var(--gold); text-decoration: underline; padding: 6px 0; }
button.danger { color: var(--bad); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.card, .sync-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin: 12px 0; display: grid; gap: 6px; }
.link-card { width: 100%; text-align: left; color: var(--cream); cursor: pointer; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--line); }
.list li.day { color: var(--gold); font-weight: 600; font-size: 13px; padding: 14px 0 6px; border: 0; }
.list li.pwrow { display: block; padding: 8px 0; }
.row { flex: 1; min-width: 0; display: grid; text-align: left; background: none; border: 0; padding: 10px 2px; cursor: pointer; }
.row.static { cursor: default; }
.row b, .row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .row span { color: var(--muted); font-size: 13px; }
.row .flag { color: var(--bad); }
.del { background: none; border: 0; color: var(--muted); padding: 10px; font-size: 16px; }
code.pw { font: 600 15px ui-monospace, Menlo, monospace; color: var(--gold); word-break: break-all; padding: 4px 0; }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.tile { display: grid; justify-items: center; gap: 6px; padding: 10px 4px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); font-size: 12px; overflow: hidden; }
.tile .dot { width: 34px; height: 34px; border-radius: 50%; background: var(--gold); color: var(--wine); display: grid; place-items: center; font-weight: 700; font-size: 16px; }
.checkup { grid-template-columns: auto auto auto; align-items: center; } .checkup b { grid-column: 1 / -1; } .checkup .muted { grid-column: 1 / -1; }
.bad { color: var(--bad); font-weight: 600; } .good { color: var(--good); font-weight: 600; }
.tabbar { position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: var(--wine); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); z-index: 6; }
.tabbar button { flex: 1; background: none; border: 0; padding: 8px 0 6px; display: grid; justify-items: center; gap: 2px; font-size: 11px; color: var(--muted); }
.tabbar button span { font-size: 20px; line-height: 1; } .tabbar button.on { color: var(--gold); }
.install, .tabbar-inbox { display: flex; align-items: center; gap: 10px; margin: 10px 16px 0; padding: 12px; border-radius: 14px; background: var(--surface2); border: 1px solid var(--gold); font-size: 14px; }
.install { display: grid; grid-template-columns: 1fr auto; } .install b, .install span { grid-column: 1; } .install .x { grid-column: 2; grid-row: 1 / span 2; background: none; border: 0; color: var(--muted); }
.tabbar-inbox .ic { font-size: 22px; } .tabbar-inbox .tx { flex: 1; display: grid; min-width: 0; } .tabbar-inbox .tx span { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[hidden] { display: none !important; }
.toast { position: fixed; left: 16px; right: 16px; bottom: calc(76px + env(safe-area-inset-bottom)); background: var(--cream); color: var(--wine); padding: 12px 14px; border-radius: 12px; z-index: 9; font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.sheet-bg { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 10; display: flex; align-items: flex-end; }
.sheet { width: 100%; background: var(--surface); border-radius: 18px 18px 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); display: grid; gap: 8px; }
/* the shared H1 Sync panel */
.sync-panel { display: grid; gap: 4px; } .sync-panel p { margin: 4px 0; }
.sync-tabs { display: flex; gap: 18px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.sync-tabs button { background: none !important; border: 0 !important; border-bottom: 2px solid transparent !important; border-radius: 0 !important; padding: 6px 0 !important; color: var(--muted); }
.sync-tabs button[aria-selected="true"] { color: var(--cream); border-bottom-color: var(--gold) !important; }
.sync-field { display: grid; gap: 2px; font-size: 14px; color: var(--muted); }
.sync-who { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px; }
.sync-key { font: 700 20px ui-monospace, Menlo, monospace; color: var(--gold); letter-spacing: .04em; word-break: break-all; padding: 8px 0; }
.set-check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; } .set-check input { width: auto; margin-top: 3px; }
.ext-msg { background: var(--surface2); border: 1px solid var(--gold); padding: 10px 12px; border-radius: 10px; } .ext-msg.bad { border-color: var(--bad); color: var(--cream); font-weight: 400; }
.sync-more summary { color: var(--gold); padding: 10px 0; cursor: pointer; }
.sync-locked ul { margin: 0; padding-left: 20px; }
