:root {
  --wine: #3b0d1a; --wine2: #8c2f45; --rose: #c97f90; --cream: #f1e6d8;
  --paper: #faf6f0; --card: #ffffff; --ink: #24161a; --muted: #7a6a6e; --line: #eadfd3;
  --ok: #1f8a4c; --bad: #b3261e;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --paper: #1a1012; --card: #24171a; --ink: #f1e6d8; --muted: #b9a7aa; --line: #3a2a2e; color-scheme: dark; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif; background: var(--paper); color: var(--ink); min-height: 100vh; padding-bottom: env(safe-area-inset-bottom); }
button, input { font: inherit; }
.top { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: var(--wine); color: var(--cream); }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 600; letter-spacing: .02em; }
.mark { font-family: Georgia, "Cormorant Garamond", serif; font-size: 1.25rem; letter-spacing: .12em; }
.who { display: flex; align-items: center; gap: 12px; font-size: .85rem; }
.who a { color: var(--cream); }
.link { background: none; border: 0; color: inherit; text-decoration: underline; cursor: pointer; padding: 0; }
main { max-width: 860px; margin: 0 auto; padding: 16px; }
.login { max-width: 380px; padding-top: 12vh; text-align: center; }
.login h1 { font-family: Georgia, serif; font-weight: 500; font-size: 1.8rem; margin: 0 0 6px; }
.login p { color: var(--muted); margin: 0 0 18px; }
.login form { display: flex; gap: 8px; }
.login input { flex: 1; min-width: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); letter-spacing: .12em; text-transform: uppercase; text-align: center; }
button[type=submit], .install button:not(.link), .btn { padding: 12px 18px; border: 0; border-radius: 10px; background: var(--wine); color: var(--cream); font-weight: 600; cursor: pointer; }
.err { color: var(--bad); min-height: 1.4em; margin-top: 12px; }
.err.big { padding: 14px; border: 1px solid var(--bad); border-radius: 10px; background: color-mix(in srgb, var(--bad) 8%, transparent); }
.bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.seg { display: flex; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: none; color: var(--muted); padding: 8px 14px; border-radius: 8px; cursor: pointer; font-weight: 600; }
.seg button.on { background: var(--wine); color: var(--cream); }
#q { flex: 1; min-width: 180px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0 4px; }
.chips button { border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 999px; padding: 6px 12px; cursor: pointer; font-size: .85rem; }
.chips button.on { border-color: var(--wine2); background: var(--wine2); color: #fff; }
.chips small { opacity: .7; margin-left: 4px; }
.meta { color: var(--muted); font-size: .8rem; margin: 6px 0 10px; }
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.list a { display: flex; gap: 12px; align-items: center; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; color: inherit; text-decoration: none; }
.list a:hover { border-color: var(--rose); }
.ic { flex: none; width: 38px; height: 46px; border-radius: 6px; background: var(--cream); color: var(--wine); display: grid; place-items: center; font-size: .62rem; font-weight: 700; letter-spacing: .05em; }
.nm { font-weight: 600; overflow-wrap: anywhere; }
.sub { color: var(--muted); font-size: .8rem; margin-top: 2px; }
.empty { color: var(--muted); text-align: center; padding: 30px 0; }
.install { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); max-width: 520px; margin: 0 auto; display: flex; gap: 10px; align-items: center; padding: 10px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 6px 24px rgba(0,0,0,.15); }
.install span { flex: 1; font-size: .9rem; }
table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: .88rem; vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; }
.tablewrap { overflow-x: auto; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .75rem; font-weight: 600; }
.pill.ok { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.pill.bad { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin: 0 0 16px; }
.card h2 { margin: 0 0 8px; font-size: 1rem; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row input { flex: 1; min-width: 160px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink); }
.newcode { margin-top: 12px; padding: 12px; border: 1px dashed var(--wine2); border-radius: 10px; }
.newcode code { font-size: 1.3rem; letter-spacing: .12em; font-weight: 700; }
.small { font-size: .8rem; color: var(--muted); }
