/* Tassel window. Brand: deep navy cover, paper page, gold tassel. System UI font (native app). */
:root {
  --navy: #13315c;
  --navy-2: #0c2242;
  --paper: #f7f5f0;
  --card: #ffffff;
  --line: #e4e0d6;
  --ink: #1b2233;
  --muted: #5d6679;
  --gold: #e2a93b;
  --gold-ink: #3b2a06;
  --ok: #1f8a4c;
  --warn: #b45309;
  --bad: #b91c1c;
  --r: 14px;
  color-scheme: light dark;
  font: 15px/1.5 "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --paper: #10141c; --card: #171d29; --line: #283044; --ink: #e9ecf2; --muted: #9aa4b8; }
}
* { box-sizing: border-box; }
body { margin: 0; overflow-x: hidden; background: var(--paper); color: var(--ink); -webkit-font-smoothing: antialiased; }
.app { max-width: 920px; margin: 0 auto; padding: 0 20px 28px; display: grid; gap: 16px; }
h1, h2 { margin: 0; letter-spacing: -0.01em; }
h2 { font-size: 17px; }
p { margin: 0; }
.muted { color: var(--muted); }
.tiny { font-size: 12.5px; color: var(--muted); }
.tiny.ok { color: var(--ok); } .tiny.bad { color: var(--bad); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.gap { justify-content: flex-start; flex-wrap: wrap; }

/* Hero: the cover of the book */
.hero {
  margin: 0 calc(50% - 50vw); padding: 34px max(28px, calc(50vw - 440px)) 30px; display: flex; gap: 26px; align-items: center;
  background: radial-gradient(120% 140% at 0% 0%, #1d4378 0%, var(--navy) 45%, var(--navy-2) 100%); color: #f4f1ea;
}
.ribbon { flex: 0 0 auto; width: 92px; }
.ribbon svg { width: 100%; height: auto; overflow: visible; }
.band { fill: #f4f1ea; }
.cord { stroke: var(--gold); stroke-width: 5; stroke-linecap: round; fill: none; }
.knot { fill: var(--gold); }
.fringe { stroke: var(--gold); stroke-width: 4; stroke-linecap: round; fill: none; transform-origin: 60px 134px; }
body[data-mood="ok"] .fringe { animation: sway 4.5s ease-in-out infinite; }
body.syncing .fringe { animation: sway 0.5s ease-in-out infinite; }
@keyframes sway { 0%, 100% { transform: rotate(-5deg); } 50% { transform: rotate(5deg); } }
body[data-mood="warn"] .band { fill: #fde7c2; }
body[data-mood="paused"] .band { fill: #c9cfda; }
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--gold); font-weight: 600; margin-bottom: 6px; }
.hero h1 { font-size: clamp(22px, 3.4vw, 30px); line-height: 1.2; font-weight: 650; }
.sub { margin-top: 8px; color: #cdd6e6; max-width: 56ch; }
.hero-actions { margin-top: 18px; display: flex; gap: 14px; align-items: center; flex-wrap: nowrap; }

/* Buttons */
button { font: inherit; cursor: pointer; border-radius: 10px; border: 0; white-space: nowrap; }
button:focus-visible, input:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.primary { background: var(--navy); color: #fff; padding: 9px 16px; font-weight: 600; display: inline-flex; gap: 8px; align-items: center; transition: transform 0.12s ease, background 0.15s; }
.hero .primary { background: var(--gold); color: var(--gold-ink); }
.primary:hover { transform: translateY(-1px); }
.primary:active { transform: translateY(0) scale(0.98); }
.primary:disabled { opacity: 0.5; transform: none; cursor: default; }
.primary.small, .gold.small { padding: 7px 13px; font-size: 14px; }
.gold { background: var(--gold); color: var(--gold-ink); padding: 11px 20px; font-weight: 700; transition: transform 0.12s ease, box-shadow 0.15s; }
.gold:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgb(226 169 59 / 0.35); }
.danger { background: transparent; color: var(--bad); padding: 9px 14px; border: 1px solid currentColor; }
.link { background: none; color: inherit; padding: 6px 2px; text-decoration: underline; text-underline-offset: 3px; opacity: 0.85; }
.hero .link { color: #e7ecf5; }
.icon { background: none; color: var(--muted); font-size: 20px; width: 32px; height: 32px; line-height: 1; }
.icon:hover { color: var(--bad); }
.spin { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: none; }
body.syncing .spin { display: inline-block; animation: turn 0.7s linear infinite; }
@keyframes turn { to { transform: rotate(360deg); } }

/* Cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; }
.card > header { margin-bottom: 12px; }
.pill { font-size: 12.5px; padding: 3px 10px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); color: var(--muted); }
.pill.gold { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); font-weight: 600; }

/* Setup checklist */
.setup { border: 2px solid var(--gold); }
.setup header p { margin-top: 4px; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.check { display: grid; grid-template-columns: 30px 1fr auto; gap: 12px; align-items: center; padding: 12px 4px; border-top: 1px solid var(--line); }
.check:first-child { border-top: 0; }
.check p { font-size: 13.5px; margin-top: 2px; }
.mark { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; transition: background 0.3s, border-color 0.3s; }
.check.ok .mark { background: var(--ok); border-color: var(--ok); }
.check.ok .mark::after { content: ""; width: 7px; height: 12px; border: solid #fff; border-width: 0 3px 3px 0; transform: translateY(-1px) rotate(45deg); animation: pop 0.35s ease-out; }
.check.ok b { color: var(--muted); }
@keyframes pop { from { transform: translateY(-1px) rotate(45deg) scale(0.2); } }

/* Held mass delete */
.held { display: grid; gap: 10px; }
.held-card { background: #fff7e8; color: #3d2b08; border: 1px solid #f2cf8d; border-radius: var(--r); padding: 16px 18px; display: grid; gap: 8px; }
.held-card .danger { color: var(--bad); }

/* Browsers */
.clients { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.client { display: grid; grid-template-columns: 40px 1fr auto auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--paper); }
.client.dim { opacity: 0.6; }
.client.locked { grid-template-columns: 40px 1fr auto; border: 1px dashed var(--gold); background: transparent; }
.c-body { display: grid; min-width: 0; }
.c-body span { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-name { cursor: text; border-radius: 4px; }
.c-name[contenteditable="plaintext-only"] { outline: 2px solid var(--gold); padding: 0 4px; }
.logo { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 700; color: #fff; background: #64748b; font-size: 17px; }
.b-chrome { background: #1a73e8; } .b-edge { background: #0c8ee8; } .b-firefox { background: #e8590c; }
.b-brave { background: #e2492d; } .b-safari { background: #0a84ff; } .b-opera { background: #d31c26; } .b-vivaldi { background: #c8243a; }
.lock { background: transparent; border: 2px dashed var(--gold); color: var(--gold); font-size: 22px; }
.empty { padding: 8px 2px; }
.switch { appearance: none; width: 44px; height: 26px; border-radius: 999px; background: #c3c9d4; position: relative; cursor: pointer; transition: background 0.2s; margin: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform 0.2s cubic-bezier(0.3, 1.4, 0.6, 1); box-shadow: 0 1px 3px rgb(0 0 0 / 0.25); }
.switch:checked { background: var(--ok); }
.switch:checked::after { transform: translateX(18px); }

/* Unlimited */
.unlimited { display: grid; grid-template-columns: 1fr minmax(260px, 340px); gap: 22px; align-items: start; background: linear-gradient(135deg, var(--card) 60%, rgb(226 169 59 / 0.12)); }
.unlimited.on { grid-template-columns: 1fr; }
.u-text p { margin-top: 6px; }
.u-buy { display: grid; gap: 8px; justify-items: start; }
.key { width: 100%; margin-top: 8px; display: grid; gap: 6px; }
.key label { font-size: 13.5px; font-weight: 600; }
.key-row { display: flex; gap: 8px; }
.key input { flex: 1; min-width: 0; font: 13px ui-monospace, Consolas, monospace; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); }
.pulse { animation: pulse 0.8s ease-in-out 2; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgb(226 169 59 / 0.45); } }

/* Activity */
.log { list-style: none; margin: 0; padding: 0; max-height: 260px; overflow: auto; font-size: 13.5px; }
.log li { display: grid; grid-template-columns: 130px 1fr; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); }
.log li:first-child { border-top: 0; }
.log time { color: var(--muted); font-variant-numeric: tabular-nums; }

.foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 0 4px; font-size: 13.5px; }
.switch-row { display: flex; gap: 8px; align-items: center; }

@media (max-width: 640px) {
  .hero { flex-direction: column; align-items: flex-start; padding: 24px 20px; gap: 14px; }
  .client { grid-template-columns: 40px 1fr auto; }
  .client .icon { display: none; }
  .client.locked { grid-template-columns: 40px 1fr; }
  .client.locked button { grid-column: 2; justify-self: start; }
  .c-body span { white-space: normal; }
  .ribbon { width: 54px; }
  .unlimited { grid-template-columns: 1fr; }
  .check { grid-template-columns: 26px 1fr; }
  .check button { grid-column: 2; justify-self: start; }
  .log li { grid-template-columns: 1fr; gap: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::after { animation: none !important; transition: none !important; }
}
