/* Social — same calm Nordic workshop look as Studio.
   Birch-grey base, slate ink, spruce actions; each channel brings its own colour. */
:root {
  --bg: #ECEEE9; --surface: #FFFFFF; --surface-2: #F5F6F2;
  --ink: #1D2A2E; --muted: #5F6D72; --faint: #8C979A; --line: #D8DDD5;
  --spruce: #2E6A5C; --spruce-dark: #23544A; --spruce-soft: #E1EEE8; --spruce-text: #2E6A5C;
  --honey: #D9A441; --honey-soft: #F5EBCB; --honey-ink: #7C5E0E;
  --loss: #B3362C; --loss-bg: #FBE7E3; --loss-line: #EBB5AD; --loss-ink: #7E2620;
  --sel: #1D2A2E; --on-sel: #FFFFFF; --inverse: #1D2A2E;
  --hover: rgba(29, 42, 46, .06); --seg-bg: #DFE3DC; --track: #D3D8D0;
  --r-lg: 22px; --r-md: 14px; --r-sm: 10px;
  --shadow: 0 1px 0 rgba(29, 42, 46, .04), 0 8px 24px -16px rgba(29, 42, 46, .35);
  --font: "Schibsted Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --tabbar: 68px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111819; --surface: #1A2326; --surface-2: #212C2F;
    --ink: #E3E9E7; --muted: #9BA9AC; --faint: #75858A; --line: #2D3A3D;
    --spruce: #3B8A73; --spruce-dark: #4A9C84; --spruce-soft: #1C3530; --spruce-text: #6FC6A8;
    --honey: #E0AE4E; --honey-soft: #362F1C; --honey-ink: #E2C371;
    --loss: #FF8B7F; --loss-bg: #3A2220; --loss-line: #6A3530; --loss-ink: #FFB3AA;
    --sel: #E3E9E7; --on-sel: #111819; --inverse: #22353A;
    --hover: rgba(255, 255, 255, .07); --seg-bg: #0D1415; --track: #33413F;
    --shadow: 0 1px 0 rgba(0, 0, 0, .25), 0 8px 24px -16px rgba(0, 0, 0, .7);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -0.015em; }
h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; }
h2 { font-size: 20px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 700; }
p { margin: 0; }
a { color: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
:focus-visible { outline: 3px solid #5B8DB8; outline-offset: 2px; }

/* ---------- Header + tabs ---------- */
.top { position: sticky; top: 0; z-index: 20; background: var(--bg); border-bottom: 1px solid var(--hover); padding-top: env(safe-area-inset-top); }
.top-inner { max-width: 760px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; font-weight: 800; font-size: 18px; letter-spacing: -0.02em; }
.brand svg { width: 28px; height: 28px; }
.who { margin-left: auto; font: 600 13px var(--font); color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; white-space: nowrap; }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface); border-top: 1px solid var(--line); padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); }
.tabs button { display: flex; flex-direction: column; align-items: center; gap: 3px; background: none; border: 0; color: var(--faint); cursor: pointer; font: 600 12px var(--font); padding: 6px 0; min-height: 52px; border-radius: 12px; }
.tabs svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tabs button[aria-current="page"] { color: var(--ink); }
.tabs button[aria-current="page"] svg { stroke: var(--spruce-text); }
.tabs .tab-new svg { background: var(--spruce); stroke: #fff; border-radius: 10px; padding: 3px; width: 30px; height: 30px; margin-top: -3px; }
main { max-width: 760px; margin: 0 auto; padding: 8px 16px calc(var(--tabbar) + 40px + env(safe-area-inset-bottom)); }
.loading { color: var(--muted); padding: 40px 0; text-align: center; }
@media (min-width: 760px) {
  .tabs { position: static; display: flex; gap: 4px; background: none; border: 0; padding: 0; margin-left: 12px; }
  .tabs button { flex-direction: row; gap: 7px; font-size: 15px; padding: 0 12px; min-height: 40px; }
  .tabs svg { width: 19px; height: 19px; }
  .tabs .tab-new svg { width: 22px; height: 22px; margin: 0; padding: 2px; }
  .tabs button[aria-current="page"] { background: var(--surface); box-shadow: var(--shadow); }
  main { padding-bottom: 60px; }
  .who { order: 3; }
}

/* ---------- Buttons + fields ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 700 16px var(--font); min-height: 50px; padding: 0 20px; border-radius: var(--r-md); border: 1px solid transparent; cursor: pointer; touch-action: manipulation; background: var(--spruce); color: #fff; text-decoration: none; transition: background .15s, transform .08s; }
.btn:hover { background: var(--spruce-dark); }
.btn:active { transform: scale(.985); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.quiet { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn.quiet:hover { background: var(--surface-2); }
.btn.ghost { background: transparent; color: var(--ink); padding: 0 10px; }
.btn.ghost:hover { background: var(--hover); }
.btn.danger { background: var(--surface); color: var(--loss); border-color: var(--loss-line); }
.btn.honey { background: var(--honey); color: #2A2208; }
.btn.small { min-height: 40px; font-size: 14px; padding: 0 14px; border-radius: var(--r-sm); }
.btn.tiny { min-height: 34px; font-size: 13px; padding: 0 11px; border-radius: 9px; }
.btn.full { width: 100%; }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.btnrow { display: flex; gap: 8px; flex-wrap: wrap; }
.btnrow .btn { flex: 1 1 auto; }

.field { display: block; }
.field > span { display: block; font-size: 14px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.field small { display: block; font-size: 13px; color: var(--faint); margin-top: 5px; }
input, select, textarea { width: 100%; min-height: 50px; padding: 0 14px; font: 500 17px var(--font); color: var(--ink); background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-md); appearance: none; -webkit-appearance: none; }
textarea { padding: 12px 14px; min-height: 110px; line-height: 1.45; resize: vertical; }
textarea.script { min-height: 260px; font-size: 16px; }
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%235F6D72' stroke-width='2'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
input[type="color"] { padding: 4px; width: 60px; flex: none; }
input:focus, select:focus, textarea:focus { border-color: var(--spruce-text); outline: none; box-shadow: 0 0 0 3px rgba(46, 106, 92, .18); }
input::placeholder, textarea::placeholder { color: var(--faint); }
.stackf { display: grid; gap: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

/* ---------- Banner + toast ---------- */
.banner { background: var(--loss-bg); color: var(--loss-ink); border-radius: var(--r-md); padding: 12px 14px; margin: 8px 0 4px; font-weight: 600; font-size: 15px; }
.sheet-error { background: var(--loss-bg); color: var(--loss-ink); border-radius: var(--r-md); padding: 10px 12px; margin-bottom: 12px; font-weight: 600; font-size: 14px; }
.toast { position: fixed; left: 50%; z-index: 80; bottom: calc(var(--tabbar) + 18px + env(safe-area-inset-bottom)); transform: translate(-50%, 24px); opacity: 0; pointer-events: none; background: var(--sel); color: var(--on-sel); font-weight: 600; font-size: 15px; padding: 12px 18px; border-radius: 999px; max-width: calc(100% - 32px); transition: transform .22s ease, opacity .22s ease; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
@media (min-width: 760px) { .toast { bottom: 28px; } }

/* ---------- Page heads + chips ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 18px 2px 6px; }
.page-head p { color: var(--muted); margin-top: 4px; }
.section { margin-top: 26px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; padding: 0 2px; }
.section-head small { color: var(--faint); font-size: 13px; font-weight: 600; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 12px 2px 4px; scrollbar-width: none; margin: 0 -16px; padding-left: 18px; padding-right: 18px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 7px; font: 600 14px var(--font); color: var(--muted); background: transparent; border: 1.5px solid var(--line); border-radius: 999px; padding: 0 14px; min-height: 38px; cursor: pointer; white-space: nowrap; }
.chip i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.chip b { font-weight: 700; color: var(--faint); }
.chip[aria-pressed="true"] { background: var(--sel); color: var(--on-sel); border-color: var(--sel); }
.chip[aria-pressed="true"] b { color: inherit; opacity: .7; }
.searchbox { position: relative; margin-top: 10px; }
.searchbox svg { position: absolute; left: 14px; top: 50%; width: 19px; height: 19px; transform: translateY(-50%); fill: none; stroke: var(--faint); stroke-width: 2; }
.searchbox input { padding-left: 42px; }

/* ---------- Step board (home) ---------- */
.board { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.board button { background: var(--surface); border: 1.5px solid transparent; border-radius: var(--r-md); box-shadow: var(--shadow); padding: 8px 6px 7px; text-align: center; cursor: pointer; color: inherit; font: inherit; min-height: 58px; min-width: 0; }
.board button:hover { border-color: var(--line); }
.board b { display: block; font-size: 22px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.board span { display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board button.has { border-color: var(--honey); }
.board button.zero b { color: var(--faint); }
@media (min-width: 620px) { .board span { font-size: 13px; } }

/* ---------- Video cards ---------- */
.vlist { display: grid; gap: 10px; }
@media (min-width: 620px) { .vlist.two { grid-template-columns: 1fr 1fr; } }
.vcard { display: block; width: 100%; text-align: left; cursor: pointer; color: inherit; font: inherit; text-decoration: none; background: var(--surface); border: 1.5px solid transparent; border-radius: var(--r-lg); padding: 14px 16px; box-shadow: var(--shadow); transition: border-color .15s; position: relative; overflow: hidden; }
.vcard::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--c); }
.vcard:hover { border-color: var(--line); }
.vtop { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); font-weight: 600; }
.vtop .ch { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); }
.vtop .ch i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.vtop .date { margin-left: auto; white-space: nowrap; }
.vtop .date.late { color: var(--loss); }
.vhook { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.3; margin: 6px 0 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vhook.big { font-size: 24px; -webkit-line-clamp: unset; display: block; letter-spacing: -0.02em; margin: 0; }
.prog { display: grid; grid-template-columns: repeat(9, 1fr); gap: 3px; }
.prog i { height: 6px; border-radius: 3px; background: var(--track); }
.prog i.on { background: var(--c); }
.prog i.now { background: repeating-linear-gradient(135deg, var(--c) 0 3px, transparent 3px 6px); box-shadow: inset 0 0 0 1px var(--c); }
.vnext { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 14px; }
.vnext b { font-weight: 700; }
.vnext .who-tag { margin-left: auto; }
.who-tag { font-size: 12px; font-weight: 700; color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.who-tag.editor { color: #3F4B87; background: #E7E9F6; }
.who-tag.done { color: var(--spruce-text); background: var(--spruce-soft); }
@media (prefers-color-scheme: dark) { .who-tag.editor { color: #B9C2F2; background: #2A2F4D; } }
.group-label { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 18px 2px 8px; }
.group-label.late { color: var(--loss); }
.empty-state { background: var(--surface); border-radius: var(--r-lg); padding: 26px 20px; text-align: center; box-shadow: var(--shadow); }
.empty-state p { color: var(--muted); margin: 6px 0 16px; }

/* ---------- Video page ---------- */
.back { margin: 10px 0 0 -10px; }
.vhead { padding: 6px 2px 0; }
.vhead .vtop { font-size: 14px; }
.hookcard { background: var(--inverse); color: #fff; border-radius: 26px; padding: 20px; margin-top: 12px; position: relative; }
.hookcard .lbl { font-size: 13px; color: #B7C3C6; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.hookcard .vhook.big { color: #fff; margin-top: 6px; }
.hookcard .meta { color: #B7C3C6; font-size: 14px; margin-top: 8px; }
.hookcard .edit { position: absolute; right: 12px; top: 12px; color: #fff; }
.hookcard .edit:hover { background: rgba(255, 255, 255, .1); }
.stepper { display: flex; gap: 6px; overflow-x: auto; margin: 16px -16px 0; padding: 2px 16px 6px; scrollbar-width: none; }
.stepper::-webkit-scrollbar { display: none; }
.stepper a { flex: none; display: flex; align-items: center; gap: 6px; text-decoration: none; font-size: 13px; font-weight: 700; color: var(--muted); background: var(--surface); border-radius: 999px; padding: 6px 12px 6px 7px; border: 1.5px solid transparent; }
.stepper a .dot { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--faint); font-size: 11px; }
.stepper a.done .dot { background: var(--spruce); color: #fff; }
.stepper a.done .dot svg { width: 12px; height: 12px; fill: none; stroke: #fff; stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; }
.stepper a.now { border-color: var(--honey); color: var(--ink); }
.stepper a.now .dot { background: var(--honey); color: #2A2208; }
.nextcard { display: flex; align-items: center; gap: 12px; margin-top: 10px; background: var(--honey-soft); color: var(--honey-ink); border-radius: var(--r-lg); padding: 14px 16px; }
.nextcard.alldone { background: var(--spruce-soft); color: var(--spruce-text); }
.nextcard div { flex: 1; min-width: 0; }
.nextcard small { display: block; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; opacity: .8; }
.nextcard b { display: block; font-size: 17px; line-height: 1.3; color: var(--ink); }

.card { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 16px; margin-top: 12px; scroll-margin-top: 80px; }
.card.now { box-shadow: 0 0 0 2px var(--honey), var(--shadow); }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.card-head .num { width: 26px; height: 26px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 13px; font-weight: 800; background: var(--surface-2); color: var(--faint); }
.card-head .num svg { width: 14px; height: 14px; fill: none; stroke: #fff; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.card.done .card-head .num { background: var(--spruce); }
.card.now .card-head .num { background: var(--honey); color: #2A2208; }
.card-head h2 { font-size: 18px; flex: 1; }
.card-head .btn { margin-right: -6px; }
.card .hint { color: var(--muted); font-size: 14px; }
.kv { display: grid; gap: 10px; }
.kv > div > span { display: block; font-size: 12px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .04em; }
.kv > div > p { white-space: pre-wrap; word-break: break-word; }
.kv .empty { color: var(--faint); font-style: italic; }
.scriptbox { white-space: pre-wrap; background: var(--surface-2); border-radius: var(--r-md); padding: 12px 14px; font-size: 16px; line-height: 1.55; max-height: 420px; overflow: auto; }
.scriptbox .dir { color: var(--faint); font-size: 14px; }
.copyrow { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

/* Shots */
.shots { display: grid; gap: 2px; margin: 0 -6px; }
.shot { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 6px; padding: 4px 6px; border-radius: 12px; }
.shot:hover { background: var(--surface-2); }
.tick { width: 40px; height: 40px; border: 0; background: none; cursor: pointer; display: grid; place-items: center; padding: 0; }
.tick span { width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--line); display: grid; place-items: center; }
.tick svg { width: 15px; height: 15px; fill: none; stroke: #fff; stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.tick.on span { background: var(--spruce); border-color: var(--spruce); }
.tick.on svg { opacity: 1; }
.shot-name { font-weight: 600; min-width: 0; }
.shot-name small { display: block; font-size: 13px; color: var(--muted); font-weight: 500; }
.shot.on .shot-name > span { color: var(--muted); }

/* Files */
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; margin-top: 10px; }
.file { position: relative; border-radius: 12px; overflow: hidden; background: var(--surface-2); aspect-ratio: 9 / 13; border: 0; padding: 0; cursor: pointer; color: inherit; font: inherit; text-align: left; }
.file video, .file img { width: 100%; height: 100%; object-fit: cover; display: block; background: #0d1415; }
.file .ficon { width: 100%; height: 100%; display: grid; place-items: center; color: var(--faint); }
.file .ficon svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.file .fname { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 8px 6px; font-size: 11px; font-weight: 600; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, .7)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file .fkind { position: absolute; left: 6px; top: 6px; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; background: rgba(0, 0, 0, .55); color: #fff; padding: 2px 6px; border-radius: 6px; }
.files.wide { grid-template-columns: 1fr; }
.files.wide .file { aspect-ratio: auto; max-height: 70vh; }
.files.wide .file video { height: auto; max-height: 70vh; object-fit: contain; }
.audio { display: grid; gap: 8px; margin-top: 8px; }
.audio > div { display: flex; align-items: center; gap: 6px; background: var(--surface-2); border-radius: 12px; padding: 6px 8px; min-width: 0; }
.audio audio { flex: 1 1 0; min-width: 0; width: 100%; height: 40px; }
.audio small { font-size: 12px; color: var(--muted); white-space: nowrap; }
.viewer video, .viewer img { width: 100%; max-height: 62vh; object-fit: contain; border-radius: 14px; background: #0d1415; display: block; }
.viewer audio { width: 100%; }
.viewer .meta { color: var(--muted); font-size: 14px; margin: 10px 0 0; }
.cover { width: 120px; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 12px; background: var(--surface-2); display: block; }
.packgrid { display: grid; grid-template-columns: 120px 1fr; gap: 14px; align-items: start; }
@media (max-width: 400px) { .packgrid { grid-template-columns: 96px 1fr; } .cover { width: 96px; } }
.coverbox svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.files.mini { grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 6px; margin-top: 4px; }
.files.mini .fname { font-size: 10px; padding: 14px 5px 4px; }
.coverbox { border: 2px dashed var(--line); border-radius: 12px; aspect-ratio: 9 / 16; display: grid; place-items: center; text-align: center; color: var(--faint); font-size: 13px; font-weight: 600; padding: 8px; cursor: pointer; background: none; font-family: var(--font); }

/* Results */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stats div { background: var(--surface-2); border-radius: var(--r-md); padding: 10px 12px; }
.stats span { display: block; font-size: 12px; color: var(--muted); font-weight: 700; }
.stats b { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }

/* Links */
.links { display: grid; gap: 6px; }
.links a { display: flex; align-items: center; gap: 8px; font-weight: 600; text-decoration: none; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); overflow: hidden; }
.links a span { color: var(--muted); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }

/* Timeline */
.tl { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 2px; }
.tl li { display: grid; grid-template-columns: 28px 1fr; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.tl li:first-child { border-top: 0; }
.tl .av { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; background: var(--surface-2); color: var(--muted); }
.tl li.comment .av { background: var(--spruce); color: #fff; }
.tl .tl-who { font-size: 13px; color: var(--muted); }
.tl .tl-who b { color: var(--ink); }
.tl .tl-body { white-space: pre-wrap; word-break: break-word; }
.tl li.event .tl-body { color: var(--muted); font-size: 14px; }
.comment-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; }
.comment-form textarea { min-height: 50px; height: 50px; }

/* Channels */
.chlist { display: grid; gap: 10px; }
.chcard { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 14px 16px; width: 100%; text-align: left; border: 0; cursor: pointer; color: inherit; font: inherit; }
.chcard .sw { width: 44px; height: 44px; border-radius: 14px; background: var(--c); display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 18px; }
.chcard h3 { font-size: 17px; }
.chcard p { font-size: 14px; color: var(--muted); }
.chcard .counts { text-align: right; font-size: 13px; color: var(--muted); white-space: nowrap; }
.chcard .counts b { display: block; font-size: 18px; color: var(--ink); }
.chcard.archived { opacity: .55; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.swatches button { width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--surface); box-shadow: 0 0 0 1.5px var(--line); background: var(--c); cursor: pointer; }
.swatches button[aria-pressed="true"] { box-shadow: 0 0 0 2.5px var(--ink); }

/* Settings */
.panel { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 18px; }
.panel + .panel { margin-top: 12px; }
.panel h2 { margin-bottom: 4px; }
.panel > p { color: var(--muted); margin-bottom: 14px; font-size: 15px; }
.rows { display: grid; }
.rows > div { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.rows > div:first-child { border-top: 0; }
.rows .grow { flex: 1; min-width: 0; }
.rows small { display: block; color: var(--faint); font-size: 13px; }
.role { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; border-radius: 6px; padding: 2px 7px; background: var(--surface-2); color: var(--muted); }
.role.admin { background: var(--loss-bg); color: var(--loss-ink); }
.role.manager { background: var(--spruce-soft); color: var(--spruce-text); }
.keybox { font: 700 20px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .02em; background: var(--surface-2); border-radius: var(--r-md); padding: 14px; text-align: center; word-break: break-all; user-select: all; }
.code { font: 600 14px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2); border-radius: 10px; padding: 10px 12px; word-break: break-all; user-select: all; }

/* ---------- Bottom sheet ---------- */
dialog#sheet { border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; background: var(--surface); color: var(--ink); border-radius: 26px 26px 0 0; padding-bottom: env(safe-area-inset-bottom); }
dialog#sheet::backdrop { background: rgba(20, 29, 32, .45); }
@media (min-width: 760px) { dialog#sheet { margin: auto; border-radius: 26px; } }
@media (prefers-reduced-motion: no-preference) {
  dialog#sheet[open] { animation: rise .26s cubic-bezier(.2, .8, .2, 1); }
  @keyframes rise { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
}
.sheet-grip { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 10px auto 0; }
.sheet-body { padding: 14px 20px 22px; }
.sheet-body.busy { opacity: .6; pointer-events: none; }
.sheet-body h2 { font-size: 22px; margin-bottom: 4px; }
.sheet-body > p { color: var(--muted); margin-bottom: 16px; }
.sheet-actions { display: grid; gap: 10px; margin-top: 20px; }
.sheet-actions.split { grid-template-columns: 1fr 1fr; }
.pickch { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pickch label { display: block; }
.pickch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pickch span { display: flex; align-items: center; gap: 8px; min-height: 46px; border-radius: 12px; border: 1.5px solid var(--line); padding: 0 12px; font-weight: 600; cursor: pointer; }
.pickch span i { width: 12px; height: 12px; border-radius: 50%; background: var(--c); flex: none; }
.pickch input:checked + span { border-color: var(--c); box-shadow: inset 0 0 0 1.5px var(--c); background: var(--surface-2); }
.pickch input:focus-visible + span { outline: 3px solid #5B8DB8; }
.toggle { display: flex; align-items: center; gap: 12px; cursor: pointer; font-weight: 600; }
.toggle input { width: 22px; height: 22px; min-height: 0; accent-color: var(--spruce); appearance: auto; -webkit-appearance: checkbox; }

/* ---------- Upload tray ---------- */
.uploads { position: fixed; left: 12px; right: 12px; z-index: 70; bottom: calc(var(--tabbar) + 12px + env(safe-area-inset-bottom)); max-width: 520px; margin: 0 auto; background: var(--inverse); color: #fff; border-radius: 18px; padding: 10px 14px; box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .5); display: grid; gap: 8px; }
@media (min-width: 760px) { .uploads { bottom: 20px; } }
.up { display: grid; gap: 4px; font-size: 13px; }
.up-top { display: flex; gap: 8px; }
.up-top span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.up-top em { font-style: normal; color: #B7C3C6; }
.up-bar { height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .15); overflow: hidden; }
.up-bar i { display: block; height: 100%; background: var(--honey); width: 0; transition: width .2s; }
.up.err .up-top em { color: #FFB3AA; }

/* ---------- Lock screen ---------- */
body.locked .top, body.locked .tabs { display: none; }
body.locked main { padding-bottom: 40px; }
.lock { max-width: 400px; margin: 14vh auto 0; background: var(--surface); border-radius: 28px; box-shadow: var(--shadow); padding: 30px 22px 24px; text-align: center; }
.lock svg { width: 56px; height: 56px; margin-bottom: 14px; }
.lock > p { color: var(--muted); margin: 6px 0 22px; }
.lock form { text-align: left; display: grid; gap: 12px; }
.lock-msg { color: var(--loss); font-weight: 600; font-size: 15px; }
.lock small { display: block; color: var(--faint); font-size: 13px; margin-top: 16px; }
@media (max-width: 380px) { h1 { font-size: 26px; } .vhook.big { font-size: 21px; } }
