@font-face { font-family: 'Discovery'; src: url('/fonts/Discovery_Fs-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Discovery'; src: url('/fonts/Discovery_Fs-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }

:root {
  --bg: #f4f4f5;
  --card: #ffffff;
  --ink: #0a0a0a;
  --ink-2: #52525b;
  --ink-3: #a1a1aa;
  --line: #e4e4e7;
  --soft: #f4f4f5;
  --accent: #0a0a0a;
  --on-accent: #ffffff;
  --danger: #dc2626;
  --radius: 22px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.05);
  --font: 'Discovery', -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Arial, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000; --card: #141414; --ink: #fafafa; --ink-2: #a1a1aa; --ink-3: #52525b;
    --line: #262626; --soft: #1c1c1c; --accent: #fafafa; --on-accent: #0a0a0a;
    --shadow: 0 0 0 1px #1f1f1f; color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; text-wrap: pretty; overscroll-behavior-y: none;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
input, textarea, select { background: var(--soft); border: 1px solid transparent; border-radius: 14px; padding: 12px 14px; width: 100%; outline: none; transition: border-color .15s; }
input:focus, textarea:focus, select:focus { border-color: var(--ink); }
textarea { resize: vertical; min-height: 90px; line-height: 1.5; }
a { color: inherit; }
svg { display: block; flex: none; }
.hidden { display: none !important; }

/* ---------- layout ---------- */
.app { display: flex; min-height: 100%; }
.sidebar { display: none; }
.main { flex: 1; min-width: 0; padding: calc(var(--safe-t) + 18px) 18px calc(var(--safe-b) + 120px); max-width: 780px; margin: 0 auto; width: 100%; }

@media (min-width: 900px) {
  .sidebar {
    display: flex; flex-direction: column; gap: 4px; width: 260px; flex: none; position: sticky; top: 0; height: 100vh;
    padding: 28px 16px; border-inline-end: 1px solid var(--line); background: var(--card);
  }
  .main { padding: 40px 40px 80px; }
  .tabbar, .fab { display: none !important; }
}

.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 22px; letter-spacing: -.02em; padding: 0 10px 18px; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--ink); color: var(--bg); display: grid; place-items: center; }
.nav-btn { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--ink-2); font-size: 15px; width: 100%; text-align: start; }
.nav-btn:hover { background: var(--soft); color: var(--ink); }
.nav-btn.on { background: var(--ink); color: var(--bg); }
.nav-btn .count { margin-inline-start: auto; font-size: 12px; opacity: .7; }
.nav-label { font-size: 12px; color: var(--ink-3); padding: 18px 12px 6px; letter-spacing: .04em; }
.side-capture { margin-top: 10px; background: var(--ink); color: var(--bg); justify-content: center; font-weight: 700; }
.side-capture:hover { background: var(--ink); color: var(--bg); opacity: .9; }

/* bottom tab bar (phones) */
.tabbar {
  position: fixed; bottom: calc(var(--safe-b) + 14px); inset-inline: 0; margin: 0 auto; width: min(380px, calc(100% - 28px));
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; padding: 6px; border-radius: 999px;
  background: color-mix(in srgb, var(--card) 82%, transparent); backdrop-filter: blur(18px) saturate(1.6); -webkit-backdrop-filter: blur(18px) saturate(1.6);
  box-shadow: 0 10px 30px rgba(0,0,0,.12), 0 0 0 1px var(--line); z-index: 20;
}
.tab { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--ink-3); padding: 7px 0; border-radius: 999px; }
.tab.on { color: var(--ink); background: var(--soft); }
.tab-mic { justify-self: center; width: 54px; height: 54px; border-radius: 50%; background: var(--ink); color: var(--bg); display: grid; place-items: center; margin: -2px 0; box-shadow: 0 6px 18px rgba(0,0,0,.25); }

/* ---------- headings ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 6px 4px 18px; }
.page-title { font-size: 36px; line-height: 1.05; font-weight: 700; letter-spacing: -.03em; margin: 0; }
.page-sub { color: var(--ink-2); font-size: 15px; margin-top: 6px; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--card); box-shadow: var(--shadow); flex: none; }
.section-title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; margin: 26px 6px 10px; }
.section-title .n { color: var(--ink-3); font-weight: 400; }
.section-title.alert { color: var(--danger); }

/* ---------- cards ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.progress-card { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px; gap: 16px; }
.progress-card h3 { margin: 0; font-size: 19px; }
.progress-card p { margin: 4px 0 0; color: var(--ink-2); font-size: 14px; }
.ring { width: 64px; height: 64px; position: relative; flex: none; }
.ring svg { transform: rotate(-90deg); }
.ring span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px; }
.stat { padding: 14px 16px; text-align: start; }
.stat b { display: block; font-size: 24px; letter-spacing: -.02em; }
.stat small { color: var(--ink-2); font-size: 13px; }

.quick-add { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 16px; margin-top: 14px; }
.quick-add input { background: transparent; padding: 10px 4px; }
.quick-add input:focus { border-color: transparent; }
.quick-add .go { width: 38px; height: 38px; border-radius: 50%; background: var(--ink); color: var(--bg); display: grid; place-items: center; flex: none; }
.hint { color: var(--ink-3); font-size: 12px; margin: 6px 10px 0; }

/* ---------- task rows ---------- */
.list { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--card); border-radius: 18px; box-shadow: var(--shadow); cursor: pointer; position: relative; transition: transform .12s, opacity .3s; }
.row:active { transform: scale(.99); }
.row.done .row-title { text-decoration: line-through; color: var(--ink-3); }
.row-body { flex: 1; min-width: 0; }
.row-title { font-size: 16px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.row-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 3px; color: var(--ink-2); font-size: 12.5px; }
.row-meta .late { color: var(--danger); }
.row-meta span { display: inline-flex; align-items: center; gap: 4px; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background: var(--soft); font-size: 11.5px; color: var(--ink); }
.pill.dark { background: var(--ink); color: var(--bg); }
.pri { width: 6px; height: 6px; border-radius: 50%; background: var(--ink); }
.kind-ico { width: 34px; height: 34px; border-radius: 11px; background: var(--soft); display: grid; place-items: center; flex: none; }

.check { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--ink-3); display: grid; place-items: center; flex: none; transition: all .2s; color: transparent; }
.check:hover { border-color: var(--ink); }
.check.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.check.doing { border-color: var(--ink); background: conic-gradient(var(--ink) 0 50%, transparent 50% 100%); }
.check.pop { animation: pop .45s ease; }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }
.burst { position: absolute; width: 4px; height: 10px; border-radius: 2px; background: var(--ink); pointer-events: none; animation: burst .6s ease-out forwards; }
@keyframes burst { from { opacity: 1; transform: rotate(var(--r)) translateY(0); } to { opacity: 0; transform: rotate(var(--r)) translateY(-30px); } }

.empty { text-align: center; color: var(--ink-3); padding: 34px 20px; font-size: 15px; }
.empty b { display: block; color: var(--ink); font-size: 18px; margin-bottom: 4px; }

/* segmented + chips */
.seg { display: flex; background: var(--card); box-shadow: var(--shadow); border-radius: 14px; padding: 4px; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { flex: 1; padding: 8px 12px; border-radius: 10px; font-size: 14px; color: var(--ink-2); white-space: nowrap; }
.seg button.on { background: var(--ink); color: var(--bg); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 12px 2px 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { padding: 7px 13px; border-radius: 999px; background: var(--card); box-shadow: var(--shadow); font-size: 13.5px; white-space: nowrap; color: var(--ink-2); }
.chip.on { background: var(--ink); color: var(--bg); }
.toggle-line { display: flex; justify-content: center; margin-top: 18px; }
.link-btn { color: var(--ink-2); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }

/* projects */
.proj { display: flex; align-items: center; gap: 14px; padding: 16px 18px; }
.proj-emoji { width: 42px; height: 42px; border-radius: 13px; background: var(--soft); display: grid; place-items: center; font-size: 20px; flex: none; }
.proj b { font-size: 16px; }
.proj small { display: block; color: var(--ink-2); font-size: 13px; }
.bar { height: 4px; border-radius: 4px; background: var(--soft); margin-top: 8px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--ink); border-radius: 4px; }

/* ---------- sheets ---------- */
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 40; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.sheet {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 41; background: var(--card); border-radius: 26px 26px 0 0;
  max-height: 92vh; overflow-y: auto; padding: 10px 20px calc(var(--safe-b) + 24px); animation: up .28s cubic-bezier(.2,.9,.3,1);
}
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 12px; }
@media (min-width: 700px) {
  .sheet { inset: 50% auto auto 50%; transform: translate(-50%, -50%); width: 560px; border-radius: 26px; max-height: 88vh; padding: 22px 26px 26px; animation: fade .2s; }
  .grab { display: none; }
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.sheet-head h2 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
.title-input { font-size: 22px; font-weight: 700; background: transparent; padding: 6px 2px; border-radius: 0; border: 0; border-bottom: 1px solid var(--line); }
.title-input:focus { border-color: transparent; border-bottom-color: var(--ink); }
.field { margin-top: 14px; }
.field > label { display: block; font-size: 12px; color: var(--ink-2); margin: 0 4px 6px; letter-spacing: .03em; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 18px; border-radius: 14px; background: var(--ink); color: var(--bg); font-weight: 700; font-size: 15px; }
.btn.ghost { background: var(--soft); color: var(--ink); }
.btn.danger { background: transparent; color: var(--danger); }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.actions { display: flex; gap: 10px; margin-top: 20px; }
.actions .btn { flex: 1; }

.history { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 14px; }
.ev { display: flex; gap: 10px; padding: 7px 0; font-size: 14px; }
.ev-who { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; background: var(--soft); }
.ev-who.ai { background: var(--ink); color: var(--bg); }
.ev small { display: block; color: var(--ink-3); font-size: 11.5px; }
.ev p { margin: 0; white-space: pre-wrap; }
.note-add { display: flex; gap: 8px; margin-top: 8px; }
.note-add input { flex: 1; }

/* capture */
.cap-center { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 18px 0 8px; }
.mic-big { width: 96px; height: 96px; border-radius: 50%; background: var(--ink); color: var(--bg); display: grid; place-items: center; position: relative; }
.mic-big.rec::before { content: ''; position: absolute; inset: -10px; border-radius: 50%; border: 2px solid var(--ink); animation: pulse 1.4s infinite; }
@keyframes pulse { from { transform: scale(.9); opacity: 1; } to { transform: scale(1.25); opacity: 0; } }
.timer { font-variant-numeric: tabular-nums; font-size: 15px; color: var(--ink-2); }
.or { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: 13px; margin: 10px 0; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--ink); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.transcript { background: var(--soft); border-radius: 14px; padding: 12px 14px; font-size: 14px; color: var(--ink-2); margin-bottom: 12px; }
.item { border: 1px solid var(--line); border-radius: 18px; padding: 12px; margin-top: 10px; }
.item.off { opacity: .45; }
.item-top { display: flex; align-items: center; gap: 10px; }
.item-top input[type=text] { font-weight: 700; background: transparent; padding: 6px 4px; }
.item-opts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.item-opts select, .item-opts input { width: auto; padding: 7px 10px; font-size: 13px; border-radius: 10px; }
.mini-seg { display: inline-flex; background: var(--soft); border-radius: 10px; padding: 3px; }
.mini-seg button { padding: 4px 10px; border-radius: 8px; font-size: 13px; color: var(--ink-2); }
.mini-seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.box { width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--ink); display: grid; place-items: center; flex: none; color: transparent; }
.box.on { background: var(--ink); color: var(--bg); }

/* auth */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: calc(var(--safe-t) + 24px) 24px calc(env(safe-area-inset-bottom, 0px) + 24px); box-sizing: border-box; }
.auth-card { width: min(420px, 100%); padding: 32px 26px; }
.auth h1 { font-size: 44px; line-height: 1; letter-spacing: -.04em; margin: 18px 0 8px; }
.auth p { color: var(--ink-2); margin: 0 0 22px; }
.auth form { display: flex; flex-direction: column; gap: 10px; }
.err { color: var(--danger); font-size: 14px; min-height: 20px; }

/* settings */
.set-card { padding: 18px 20px; margin-top: 12px; }
.set-card h3 { margin: 0 0 6px; font-size: 17px; }
.set-card p { margin: 0 0 12px; color: var(--ink-2); font-size: 14px; }
.code { direction: ltr; text-align: left; font-family: ui-monospace, 'JetBrains Mono', Menlo, monospace; font-size: 12.5px; background: var(--soft); border-radius: 12px; padding: 12px; word-break: break-all; white-space: pre-wrap; }
.tok { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }

/* toast */
.toast { position: fixed; top: calc(var(--safe-t) + 16px); inset-inline: 0; margin: 0 auto; width: max-content; max-width: calc(100% - 32px); background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 999px; font-size: 15px; font-weight: 700; z-index: 60; box-shadow: 0 10px 30px rgba(0,0,0,.25); animation: drop .3s cubic-bezier(.2,.9,.3,1); display: flex; align-items: center; gap: 8px; }
@keyframes drop { from { transform: translateY(-20px); opacity: 0; } }

/* wall screen (always dark, big type, readable from across the room) */
.wall { position: fixed; inset: 0; background: #000; color: #fafafa; padding: 3.2vw 3.6vw; display: flex; flex-direction: column; gap: 2.4vw; overflow: hidden; --ink: #fafafa; --bg: #000; --ink-3: #52525b; }
.w-head { display: flex; justify-content: space-between; align-items: flex-end; }
.w-clock { font-size: clamp(48px, 7vw, 140px); font-weight: 700; line-height: .9; letter-spacing: -.04em; font-variant-numeric: tabular-nums; direction: ltr; text-align: right; }
.w-date { font-size: clamp(16px, 1.6vw, 30px); color: #a1a1aa; margin-top: .4vw; }
.w-done { text-align: center; color: #a1a1aa; font-size: clamp(13px, 1.1vw, 20px); }
.w-done b { display: block; color: #fafafa; font-size: clamp(36px, 4vw, 80px); line-height: 1; }
.w-grid { flex: 1; display: grid; grid-template-columns: 1.4fr 1fr; gap: 3vw; min-height: 0; }
.w-side { display: flex; flex-direction: column; gap: 2.4vw; min-height: 0; }
.wall h2 { font-size: clamp(16px, 1.4vw, 26px); color: #a1a1aa; font-weight: 400; margin: 0 0 1vw; letter-spacing: .02em; }
.wall h2 span { color: #52525b; }
.w-row { display: flex; align-items: center; gap: 1.1vw; padding: .9vw 0; border-bottom: 1px solid #1c1c1c; }
.w-row .check { border-color: #52525b; }
.w-row.big .check { width: 2.2vw; height: 2.2vw; min-width: 28px; min-height: 28px; }
.w-body { min-width: 0; }
.w-title { font-size: clamp(15px, 1.4vw, 28px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-row.big .w-title { font-size: clamp(18px, 2vw, 40px); font-weight: 700; letter-spacing: -.01em; }
.w-pri { display: inline-block; background: #fafafa; color: #000; border-radius: 6px; padding: 0 .45em; margin-inline-end: .5em; font-size: .8em; }
.w-meta { color: #71717a; font-size: clamp(12px, 1vw, 20px); margin-top: .2vw; }
.w-meta .late { color: #f87171; }
.w-empty { color: #52525b; font-size: clamp(15px, 1.3vw, 26px); padding: 1vw 0; }
.w-more { color: #71717a; padding-top: .8vw; font-size: clamp(13px, 1vw, 20px); }
.w-exit { position: fixed; bottom: 10px; left: 14px; color: #27272a; font-size: 12px; }
.w-exit:hover { color: #71717a; }
@media (max-aspect-ratio: 1/1) { .w-grid { grid-template-columns: 1fr; } }
@media (min-width: 900px) { .settings-btn { display: none; } }

/* iOS Safari gives date/time inputs an intrinsic min width, so they spill out of grid cells */
.grid2 > * { min-width: 0; }
input[type=date], input[type=time] { -webkit-appearance: none; appearance: none; min-width: 0; max-width: 100%; display: block; min-height: 48px; text-align: start; }
input[type=date]::-webkit-date-and-time-value, input[type=time]::-webkit-date-and-time-value { text-align: start; }
.item-opts input[type=date] { width: auto; min-height: 0; }

/* chips sit in a horizontal scroller, which clips shadows: use a hairline border instead */
.chip { box-shadow: none; border: 1px solid var(--line); }
.chip.on { border-color: var(--ink); }
.chips { padding: 12px 0 0; }
.chips.cats { padding-top: 8px; }
.chip small { opacity: .6; margin-inline-start: 4px; }

/* ---------- social ---------- */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-inline-end: 6px; vertical-align: middle; }
.tab { position: relative; }
.badge { position: absolute; top: 6px; inset-inline-end: calc(50% - 16px); width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
.vcard { display: flex; gap: 14px; align-items: center; padding: 10px; background: var(--card); border-radius: 18px; box-shadow: var(--shadow); width: 100%; text-align: start; }
.vthumb { position: relative; width: 62px; height: 110px; border-radius: 12px; background: var(--soft); flex: none; display: grid; place-items: center; overflow: hidden; color: var(--ink-3); }
.vthumb img { width: 100%; height: 100%; object-fit: cover; }
.vplay { position: absolute; inset: auto 6px 6px auto; width: 24px; height: 24px; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; display: grid; place-items: center; }
.vbody { flex: 1; min-width: 0; }
.vhook { color: var(--ink-2); font-size: 13.5px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.vplayer { display: block; width: 100%; max-height: 62vh; aspect-ratio: 9 / 16; background: #000; border-radius: 18px; object-fit: contain; }
.empty-player { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: #a1a1aa; font-size: 14px; max-height: 260px; aspect-ratio: auto; height: 220px; }
.vnote { margin-top: 14px; background: var(--soft); border-radius: 14px; padding: 12px 14px; font-size: 14px; color: var(--ink-2); white-space: pre-wrap; }
.vinfo { display: grid; gap: 10px; margin-top: 14px; }
.vinfo label { display: block; font-size: 12px; color: var(--ink-2); margin-bottom: 2px; }
.vinfo p { margin: 0; font-size: 15px; white-space: pre-wrap; word-break: break-word; }
.vscript { margin-top: 14px; background: var(--soft); border-radius: 14px; padding: 12px 14px; }
.vscript summary { cursor: pointer; font-weight: 700; }
.vscript p { white-space: pre-wrap; font-size: 14px; margin: 10px 0 0; }
.drive-hint { display: block; width: 100%; text-align: start; margin-top: 14px; }
.drive-hint h3 { display: flex; align-items: center; gap: 8px; }
.set-card h3 { display: flex; align-items: center; gap: 8px; }
.steps { margin: 0 0 12px; padding-inline-start: 20px; color: var(--ink-2); font-size: 14px; line-height: 1.6; }
.steps li { margin-bottom: 8px; }
.lesson { padding: 16px 18px; }
.lesson.off { opacity: .5; }
.lesson h3 { margin: 2px 0 6px; font-size: 16px; }
.lesson p, .lesson li { margin: 4px 0; color: var(--ink-2); font-size: 14px; }
.lesson ul { margin: 0; padding-inline-start: 18px; }
.stable { margin-top: 12px; padding: 6px 0; overflow-x: auto; }
.st-row { display: grid; grid-template-columns: minmax(140px, 1fr) 64px 60px 82px 56px; gap: 8px; align-items: center; padding: 10px 16px; font-size: 13.5px; width: 100%; text-align: start; border-top: 1px solid var(--line); min-width: 440px; }
.st-head { color: var(--ink-3); font-size: 12px; border-top: 0; }
.st-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 520px) {
  .st-row { grid-template-columns: minmax(0, 1fr) 56px 56px; min-width: 0; }
  .st-row > :nth-child(4), .st-row > :nth-child(5) { display: none; }
  .stable { overflow: hidden; }
}

/* capture review: big, tap-only choices */
.item { padding: 14px; border-radius: 20px; }
.item .box { width: 28px; height: 28px; border-radius: 9px; }
.item-top input[type=text] { font-size: 17px; }
.big-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 12px; }
.big-seg.two { grid-template-columns: 1fr 1fr; margin-top: 8px; }
.big-seg button { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; border-radius: 14px; background: var(--soft); color: var(--ink-2); font-size: 16px; font-weight: 700; }
.big-seg button.on { background: var(--ink); color: var(--bg); }
.pick-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.pick-chips .chip { padding: 10px 14px; font-size: 15px; }
.due-chip { margin-top: 10px; display: inline-flex; align-items: center; gap: 6px; }

/* ---------- wall widgets ---------- */
.wall { overflow-y: auto; }
.w-grid2 { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: calc((100vh - 6.4vw - 2 * 1.6vw - 64px) / 3); gap: 1.6vw; grid-auto-flow: dense; }
.wg { position: relative; background: #0f0f0f; border: 1px solid #1c1c1c; border-radius: 1.6vw; padding: 1.6vw 1.8vw; overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.wg.sz-s { grid-column: span 1; }
.wg.sz-m { grid-column: span 2; }
.wg.sz-w { grid-column: span 4; }
.wg.sz-l { grid-column: span 2; grid-row: span 2; }
.wg h2 { display: flex; align-items: baseline; gap: .6em; flex-wrap: wrap; margin: 0 0 .8vw; }
.wg h2 small { color: #52525b; font-size: .8em; }
.w-big { font-size: clamp(36px, 4.6vw, 110px); font-weight: 700; letter-spacing: -.03em; line-height: 1; margin-top: auto; font-variant-numeric: tabular-nums; }
.wg .w-clock { margin-top: auto; text-align: right; }
.wg .w-date { margin-bottom: auto; }
.w-trend { margin-top: .6vw; font-size: clamp(12px, 1vw, 20px); color: #71717a; }
.w-trend.up { color: #4ade80; }
.w-trend.down { color: #f87171; }
.w-goal { display: flex; align-items: baseline; gap: .8vw; margin-top: auto; }
.w-of { color: #71717a; font-size: clamp(13px, 1.2vw, 24px); }
.w-bar { height: 1vw; min-height: 8px; border-radius: 99px; background: #1f1f1f; margin: 1vw 0 .6vw; overflow: hidden; }
.w-bar i { display: block; height: 100%; background: #fafafa; border-radius: 99px; transition: width .8s; }
.w-dim { color: #71717a; font-weight: 400; }
.w-cta { margin: auto 0; color: #a1a1aa; font-size: clamp(13px, 1.1vw, 20px); }
.w-cta p { margin: 0 0 .8vw; }
.w-btn { background: #fafafa; color: #000; border-radius: 99px; padding: .7em 1.3em; font-weight: 700; font-size: clamp(13px, 1vw, 18px); }
.w-ghost { color: #3f3f46; font-size: 13px; padding: 6px 10px; }
.w-ghost:hover { color: #a1a1aa; }
.w-corner { position: fixed; bottom: 10px; left: 14px; display: flex; gap: 6px; z-index: 5; }
.w-stale { position: fixed; bottom: 12px; right: 16px; color: #71717a; font-size: 12px; }
.wg.editing { outline: 2px dashed #3f3f46; outline-offset: -2px; }
.wg-tools { position: absolute; inset: auto 10px 10px auto; display: flex; gap: 6px; }
.wg-tools button { background: #fafafa; color: #000; border-radius: 10px; min-width: 40px; height: 40px; padding: 0 10px; font-weight: 700; display: grid; place-items: center; }
.wg.add { border: 2px dashed #3f3f46; background: transparent; color: #a1a1aa; align-items: center; justify-content: center; gap: 8px; font-size: 18px; }
.w-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.w-picker button { background: var(--soft); border-radius: 14px; min-height: 64px; padding: 10px; font-weight: 700; font-size: 15px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.w-picker small { color: var(--ink-3); font-weight: 400; font-size: 12px; }
@media (max-width: 800px) { .w-grid2 { grid-template-columns: 1fr 1fr; grid-auto-rows: 180px; } .wg.sz-w, .wg.sz-l, .wg.sz-m { grid-column: span 2; } .wg { border-radius: 18px; padding: 16px; } }

/* new-sale celebration */
.sale-alert { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: rgba(0,0,0,.82); animation: fade .4s; overflow: hidden; }
.sale-alert.out { opacity: 0; transition: opacity .6s; }
.sa-card { text-align: center; color: #fff; animation: saPop .7s cubic-bezier(.2,1.4,.4,1); }
.sa-kicker { font-size: clamp(20px, 2.4vw, 44px); color: #c8ff3d; font-weight: 700; letter-spacing: .02em; }
.sa-amount { font-size: clamp(80px, 13vw, 260px); font-weight: 700; letter-spacing: -.04em; line-height: 1; margin: 1vw 0; }
.sa-who { font-size: clamp(18px, 2vw, 40px); color: #d4d4d8; }
@keyframes saPop { from { transform: scale(.6); opacity: 0; } }
.confetti { position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 3px; animation: fall linear forwards; }
@keyframes fall { to { transform: translate(var(--x), 110vh) rotate(720deg); } }
.mo-form { display: flex; flex-direction: column; gap: 8px; }

/* wall corner controls: clearly visible, touch-sized */
.w-corner { bottom: 14px; left: 14px; gap: 8px; }
.w-ghost { color: #d4d4d8; background: #161616; border: 1px solid #2a2a2a; border-radius: 999px; padding: 10px 18px; min-height: 44px; font-size: 15px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.w-ghost:hover { color: #fff; background: #222; }
.w-grid2 { padding-bottom: 64px; }

/* widget lists scroll inside their card */
.w-list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; margin-inline-end: -.8vw; padding-inline-end: .8vw; scrollbar-width: thin; scrollbar-color: #3f3f46 transparent; mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent); }
.w-list::-webkit-scrollbar { width: 6px; }
.w-list::-webkit-scrollbar-thumb { background: #3f3f46; border-radius: 3px; }
.w-list .w-row:last-child { margin-bottom: 24px; }
/* the big number sits right under its title, not at the bottom of the card */
.wg .w-big { margin-top: .4vw; }
.wg .w-goal { margin-top: .4vw; }

/* edit mode: drag to move, corner handle to resize, two small buttons in the empty top-left corner */
.wg.editing { cursor: grab; touch-action: none; user-select: none; }
.wg.editing > *:not(.wg-tools):not(.wg-resize) { pointer-events: none; opacity: .75; }
.wg.dragging { cursor: grabbing; z-index: 10; box-shadow: 0 20px 60px rgba(0,0,0,.6); opacity: .92; transition: none; }
.wg.drop-target { outline: 2px solid #fafafa; outline-offset: -2px; }
.wg.resizing { outline: 2px solid #c8ff3d; outline-offset: -2px; }
.wg-tools { position: absolute; inset: 10px auto auto 10px; display: flex; gap: 6px; z-index: 2; }
.wg-tools button { background: #262626; color: #fafafa; border-radius: 50%; width: 36px; height: 36px; min-width: 0; padding: 0; display: grid; place-items: center; }
.wg-tools button:hover { background: #3f3f46; }
.wg-resize { position: absolute; left: 0; bottom: 0; width: 40px; height: 40px; cursor: nesw-resize; z-index: 2; touch-action: none; }
.wg-resize::after { content: ''; position: absolute; left: 10px; bottom: 10px; width: 16px; height: 16px; border-left: 3px solid #a1a1aa; border-bottom: 3px solid #a1a1aa; border-radius: 0 0 0 6px; }
.w-hint { color: #71717a; font-size: 13px; align-self: center; margin-inline-end: 8px; }

/* big numbers: fill the card and sit in the middle of the space under the title (scales with widget size) */
.wg { container-type: size; }
.w-stat { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: center; }
.wg .w-stat .w-big { margin: 0; font-size: clamp(32px, min(34cqh, 19cqw), 220px); }
.w-stat .w-trend, .w-stat .w-meta { font-size: clamp(12px, min(7cqh, 4cqw), 26px); }

/* edit mode: the buttons get their own strip at the top, so they never cover the title */
.wg.editing { padding-top: 58px; }
.wg-tools { inset: 12px auto auto 12px; }
.wg.editing::before { content: '⋮⋮'; position: absolute; top: 14px; right: 16px; color: #52525b; font-size: 18px; letter-spacing: -2px; }
.wg.placeholder { outline: 2px dashed #a1a1aa; outline-offset: -2px; background: transparent; }
.wg.placeholder > * { visibility: hidden; }
.wg-ghost { z-index: 90; pointer-events: none; opacity: .95; box-shadow: 0 24px 70px rgba(0,0,0,.7); transform: rotate(-1.2deg) scale(1.02); outline: 2px solid #fafafa; outline-offset: -2px; }

/* home: one-line links to videos and the AI */
.jumps { display: flex; flex-direction: column; gap: 8px; margin-top: 22px; }
.jump { display: flex; align-items: center; gap: 12px; padding: 14px 16px; width: 100%; text-align: start; border-radius: 18px; }
.jump span { flex: 1; min-width: 0; }
.jump b { display: block; font-size: 15px; }
.jump small { display: block; color: var(--ink-2); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* tasks: one filter button + a sheet with big choices */
.filter-line { display: flex; align-items: center; gap: 12px; padding-top: 12px; }
.filter-line .chip { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; font-size: 14px; }
.big-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.big-list button { min-height: 52px; border-radius: 14px; background: var(--soft); font-weight: 700; font-size: 15px; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 8px; }
.big-list button.on { background: var(--ink); color: var(--bg); }
.big-list small { opacity: .55; font-weight: 400; }

/* rows (layout inspired by Clearli): title + one quiet line with the project's coloured label; our own look stays */
.row-meta { margin-top: 6px; gap: 8px 12px; font-size: 13px; }
.ptag { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-weight: 700; font-size: 12.5px; color: color-mix(in srgb, var(--pc) 62%, black); background: color-mix(in srgb, var(--pc) 16%, transparent); }
@media (prefers-color-scheme: dark) { .ptag { color: color-mix(in srgb, var(--pc) 75%, white); background: color-mix(in srgb, var(--pc) 22%, transparent); } }
.pri-mark { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 6px; background: var(--danger); color: #fff; font-size: 12px; margin-inline-end: 8px; vertical-align: 2px; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 40px; height: 40px; border-radius: 50%; border: 3px solid transparent; outline: 2px solid transparent; }
.swatch.on { border-color: var(--card); outline-color: var(--ink); }

/* first-time setup */
.sheet-ob { min-height: 86vh; display: flex; flex-direction: column; }
.ob { display: flex; flex-direction: column; flex: 1; }
.ob-dots { display: flex; gap: 6px; justify-content: center; margin: 4px 0 18px; }
.ob-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); transition: all .2s; }
.ob-dots i.on { width: 22px; border-radius: 4px; background: var(--ink); }
.ob-hero { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 10px 0 18px; }
.ob-hero h2 { font-size: 30px; letter-spacing: -.02em; margin: 14px 0 4px; }
.ob-hero p, .ob-sub { color: var(--ink-2); margin: 0 0 6px; font-size: 15.5px; line-height: 1.5; }
.ob-title { font-size: 28px; letter-spacing: -.02em; margin: 4px 0 8px; }
.ob-list { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.ob-list > div, .ob-card { display: flex; gap: 14px; align-items: flex-start; background: var(--soft); border-radius: 18px; padding: 14px 16px; }
.ob-card { flex-direction: column; gap: 2px; margin-top: 10px; }
.ob-list b, .ob-card b { display: flex; align-items: center; gap: 6px; font-size: 16px; }
.ob-list small, .ob-card small { display: block; color: var(--ink-2); font-size: 13.5px; line-height: 1.45; margin-top: 2px; }
.ob-chips .chip { padding: 10px 14px; font-size: 15px; display: inline-flex; align-items: center; }
.ob-nav { margin-top: auto; padding-top: 20px; }

/* language */
.lang-seg { box-shadow: none; background: var(--soft); }
/* English (left to right): mirror the few physical positions */
[dir=ltr] .w-clock, [dir=ltr] .wg .w-clock { text-align: left; }
[dir=ltr] .w-exit, [dir=ltr] .w-corner { left: auto; right: 14px; }
[dir=ltr] .w-stale { right: auto; left: 16px; }
[dir=ltr] .wg-resize { left: auto; right: 0; cursor: nwse-resize; }
[dir=ltr] .wg-resize::after { left: auto; right: 10px; border-left: 0; border-right: 3px solid #a1a1aa; border-radius: 0 0 6px 0; }
[dir=ltr] .wg.editing::before { right: auto; left: 16px; }
[dir=ltr] .jump > svg:last-child { transform: scaleX(-1); }
/* swipe to delete */
.row[data-open] { touch-action: pan-y; }
.swipe-wrap { position: relative; border-radius: 18px; transition: height .2s, margin .2s, opacity .2s; }
.swipe-wrap.gone { height: 0 !important; opacity: 0; margin-bottom: -8px; overflow: hidden; }
.swipe-bg { position: absolute; inset: 0; border-radius: 18px; background: var(--soft); color: var(--ink-3); display: flex; align-items: center; justify-content: flex-end; padding: 0 22px; transition: background .15s, color .15s; }
.swipe-wrap.from-left .swipe-bg { justify-content: flex-start; }
[dir=rtl] .swipe-bg { justify-content: flex-start; }
[dir=rtl] .swipe-wrap.from-left .swipe-bg { justify-content: flex-end; }
.swipe-wrap.armed .swipe-bg { background: var(--danger); color: #fff; }
.row.swiping { transition: none; }
.swipe-wrap .row { transition: transform .2s ease-out; }
.toast-undo { gap: 10px; pointer-events: auto; }
.toast-undo button { margin-inline-start: 6px; padding: 4px 12px; border-radius: 999px; background: var(--bg); color: var(--ink); font-weight: 700; font-size: 14px; }

/* compact rows: one line, project and date at the end of the title line */
.row { padding: 11px 14px; gap: 10px; }
.row-title { -webkit-line-clamp: 2; font-size: 15.5px; line-height: 1.3; }
.row-side { flex: none; max-width: 46%; margin: 0; flex-wrap: nowrap; gap: 6px; font-size: 12px; overflow: hidden; }
.row-side .ptag { padding: 2px 8px; font-size: 11.5px; min-width: 0; max-width: 104px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; }
.row-side > span { white-space: nowrap; }
.row .check { width: 24px; height: 24px; }
.pri-mark { width: 16px; height: 16px; font-size: 11px; margin-inline-end: 6px; vertical-align: 1px; }

/* ---------- Open projects board ---------- */
.board { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 10px; margin-bottom: 8px; }
.bigp { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; text-align: start; width: 100%; border-inline-start: 3px solid var(--pc, var(--line)); }
.bigp-top { display: flex; align-items: center; gap: 12px; }
.bigp-top .proj-emoji { width: 38px; height: 38px; font-size: 18px; border-radius: 11px; }
.bigp-main { flex: 1; min-width: 0; }
.bigp-main b { display: block; font-size: 15.5px; line-height: 1.25; }
.bigp-main small { display: block; color: var(--ink-2); font-size: 12.5px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bigp-next { font-size: 13.5px; line-height: 1.4; color: var(--ink); background: var(--soft); border-radius: 10px; padding: 8px 10px; text-wrap: pretty; }
.bigp-next b { display: block; font-size: 11px; font-weight: 600; color: var(--ink-2); margin-bottom: 2px; }
.bigp-foot { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--ink-2); }
.bigp-foot .bar { flex: 1; margin: 0; }
.stage-pill { flex: none; font-size: 11.5px; font-weight: 600; padding: 4px 9px; border-radius: 99px; background: var(--soft); color: var(--ink-2); white-space: nowrap; }
.st-active { background: color-mix(in srgb, #3b82f6 16%, transparent); color: #3b82f6; }
.st-waiting { background: color-mix(in srgb, #eab308 18%, transparent); color: #b48a00; }
.st-idea { background: color-mix(in srgb, #a855f7 15%, transparent); color: #a855f7; }
.st-live { background: color-mix(in srgb, #22c55e 16%, transparent); color: #16a34a; }
.board-chips { margin: 4px 0 6px; }
.proj-info { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.pi-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pi-biz { font-size: 12.5px; color: var(--ink-2); }
.pi-notes { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); white-space: pre-wrap; text-wrap: pretty; }
.pi-link { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--accent, #3b82f6); text-decoration: none; direction: ltr; }
.pi-kids { display: flex; flex-wrap: wrap; gap: 6px; }
.nav-btn.nav-kid { padding-inline-start: 30px; font-size: 13.5px; opacity: .9; }

/* Tab bar lower and slimmer: sits just above the home indicator instead of floating high */
@media (max-width: 899px) {
  .tabbar { bottom: max(8px, calc(var(--safe-b) - 12px)); padding: 4px; width: min(360px, calc(100% - 24px)); }
  .tab { padding: 5px 0; }
  .tab-mic { width: 48px; height: 48px; }
  .main { padding-bottom: calc(var(--safe-b) + 92px); }
}

/* Account deletion */
.del-warn { margin: 0 4px 14px; color: var(--ink-2); line-height: 1.5; text-wrap: pretty; }
.btn.del-go { background: var(--danger); color: #fff; }

/* ---------- Sort menu ---------- */
.sort-sel { width: auto; flex: none; appearance: none; -webkit-appearance: none; border-radius: 999px; padding: 7px 30px 7px 14px; font-size: 13.5px; font-weight: 600; background: var(--soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.6' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat left 12px center; cursor: pointer; }
[dir=ltr] .sort-sel { padding: 7px 30px 7px 14px; background-position: right 12px center; }
[dir=rtl] .sort-sel { padding: 7px 14px 7px 30px; }
.filter-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---------- Wall pages ---------- */
.w-dots { position: fixed; bottom: 18px; inset-inline: 0; margin: 0 auto; width: max-content; display: flex; align-items: center; gap: 10px; z-index: 6; padding: 8px 12px; border-radius: 99px; background: rgba(24,24,27,.7); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.w-dot { width: 9px; height: 9px; border-radius: 50%; background: #52525b; padding: 0; transition: background .2s, transform .2s; }
.w-dot.on { background: #fafafa; transform: scale(1.25); }
.w-dot-add { width: 22px; height: 22px; border-radius: 50%; background: #262626; color: #fafafa; display: grid; place-items: center; padding: 0; }
.w-grid2.anim-next { animation: wpage-next .32s cubic-bezier(.2,.9,.3,1); }
.w-grid2.anim-prev { animation: wpage-prev .32s cubic-bezier(.2,.9,.3,1); }
@keyframes wpage-next { from { opacity: 0; transform: translateX(-6%); } }
@keyframes wpage-prev { from { opacity: 0; transform: translateX(6%); } }
[dir=ltr] .w-grid2.anim-next { animation-name: wpage-prev; }
[dir=ltr] .w-grid2.anim-prev { animation-name: wpage-next; }
.w-proj { align-items: flex-start; }
.w-pemoji { font-size: clamp(18px, 1.6vw, 30px); width: 1.6em; text-align: center; flex: none; }
.w-next { color: #a1a1aa; font-size: clamp(12px, 1vw, 19px); margin-top: .3vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Simple task sheet: title + one row (project, category, urgent); the rest folded ---------- */
.ts-head { margin-bottom: 2px; }
.ts-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 6px; }
.pill-sel { position: relative; display: inline-flex; align-items: center; gap: 6px; background: var(--soft); border-radius: 999px; padding-inline-start: 12px; max-width: 100%; color: var(--ink-2); }
.pill-sel select { background: transparent; border: 0; padding: 9px 12px 9px 0; padding-inline-start: 0; padding-inline-end: 12px; width: auto; max-width: 210px; font-size: 14px; font-weight: 600; color: var(--ink); appearance: none; -webkit-appearance: none; text-overflow: ellipsis; }
.pill-sel select:focus { border: 0; }
.pill-sel:focus-within { box-shadow: 0 0 0 1.5px var(--ink); }
.pill-hot { border-radius: 999px; padding: 9px 14px; font-size: 14px; font-weight: 600; background: var(--soft); color: var(--ink-2); }
.pill-hot.on { background: color-mix(in srgb, #ef4444 16%, transparent); color: #ef4444; box-shadow: 0 0 0 1.5px #ef4444; }
.more-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 14px 2px 4px; padding: 6px 0; color: var(--ink-2); font-size: 14px; font-weight: 600; text-align: start; }
.more-line small { font-weight: 400; color: var(--ink-3); }
.ts-more { margin-top: 10px; padding-top: 6px; border-top: 1px solid var(--line); }
textarea.title-input { resize: none; overflow: hidden; line-height: 1.3; min-height: 0; display: block; }

/* ---------- Task sheet v3: title with close beside it, settings-style rows ---------- */
.ts-top { display: flex; align-items: flex-start; gap: 10px; margin-top: 2px; }
.ts-top .title-input { flex: 1; border-bottom: 0; padding: 6px 2px 4px; font-size: 22px; }
.ts-top .title-input:focus { border-bottom: 0; }
.ts-close { flex: none; width: 36px; height: 36px; margin-top: 2px; background: var(--soft); box-shadow: none; }
.props { margin: 14px 0 4px; background: var(--soft); border-radius: 18px; overflow: hidden; }
.prop { position: relative; display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 0 16px; text-align: start; cursor: pointer; font-size: 15.5px; }
.prop + .prop { box-shadow: 0 -1px 0 var(--line); }
.prop-k { display: flex; align-items: center; gap: 10px; flex: none; font-weight: 600; color: var(--ink); }
.prop-k svg { color: var(--ink-2); }
.prop-emoji { width: 18px; text-align: center; font-size: 16px; }
.prop-v { flex: 1; min-width: 0; text-align: end; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prop-more .prop-k { color: var(--ink-2); font-weight: 500; }
.prop-more .prop-v { font-size: 13.5px; color: var(--ink-3); }
.prop select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; padding: 0; border: 0; }
.chev { flex: none; width: 8px; height: 8px; border-inline-start: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3); transform: rotate(45deg); margin-inline-start: 2px; }
[dir=ltr] .chev { transform: rotate(-135deg); }
.switch { margin-inline-start: auto; flex: none; width: 46px; height: 28px; border-radius: 99px; background: color-mix(in srgb, var(--ink) 18%, transparent); position: relative; transition: background .2s; }
.switch i { position: absolute; top: 3px; inset-inline-start: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: inset-inline-start .2s; }
.switch.on { background: #ef4444; }
.switch.on i { inset-inline-start: 21px; }
.ts-more { border-top: 0; margin-top: 6px; }
.sheet .actions .btn { min-height: 52px; border-radius: 16px; }
.history { margin-top: 18px; }
.history .ev { font-size: 13.5px; color: var(--ink-2); }
.history .ev-who { width: 24px; height: 24px; font-size: 10px; }
.note-add input { padding: 10px 14px; border-radius: 12px; }
.note-add .go { width: 40px; height: 40px; flex: none; }
.chev { border-inline-start: 0; border-left: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3); transform: rotate(45deg); }
[dir=ltr] .chev { transform: rotate(-135deg); }

/* ---------- Boards (computer) ---------- */
.desk-only { display: none; }
@media (min-width: 1100px) {
  .desk-only { display: inline-flex; align-items: center; gap: 8px; }
  .main:has(.boards) { max-width: 1400px; }
}
.lay-ctl .mini-seg button { display: inline-flex; align-items: center; gap: 5px; }
.boards { columns: 3 300px; column-gap: 14px; margin-top: 18px; }
.board-pan { break-inside: avoid; margin-bottom: 14px; background: var(--card); border-radius: 18px; box-shadow: var(--shadow); padding: 6px 14px 8px; border-top: 3px solid var(--bc); transition: box-shadow .15s, transform .15s; }
.board-pan header { display: flex; align-items: center; gap: 8px; padding: 8px 0 6px; font-size: 15px; }
.board-pan header .n { color: var(--ink-3); font-size: 13px; }
.bdot { width: 9px; height: 9px; border-radius: 50%; background: var(--bc); flex: none; }
.b-add { margin-inline-start: auto; width: 28px; height: 28px; box-shadow: none; background: transparent; color: var(--ink-3); }
.b-add:hover { background: var(--soft); color: var(--ink); }
.brow { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); cursor: pointer; }
.brow .check { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.brow-body { flex: 1; min-width: 0; }
.brow-title { font-size: 14px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.brow-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; font-size: 11.5px; color: var(--ink-3); }
.brow-meta .ptag { font-size: 11px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brow-meta .late { color: var(--danger); }
.brow:hover .brow-title { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.brow.dragging { opacity: .35; }
.b-more { width: 100%; padding: 8px 0 4px; font-size: 13px; color: var(--ink-2); border-top: 1px solid var(--line); text-align: start; }
.board-pan.empty { padding-bottom: 6px; }
.b-empty { display: none; font-size: 12.5px; color: var(--ink-3); padding: 4px 0 8px; }
body.is-dragging .board-pan.empty .b-empty { display: block; }
.board-pan.drop-on { box-shadow: 0 0 0 2px var(--bc), var(--shadow); transform: translateY(-1px); }

/* ---------- Board extras: add line at the bottom, project rows ---------- */
.b-addform { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line); padding: 8px 0 4px; color: var(--ink-3); }
.b-addform input { flex: 1; background: transparent; border: 0; padding: 4px 0; font-size: 14px; border-radius: 0; }
.b-addform input:focus { border: 0; }
.b-addform:focus-within { color: var(--bc); }
.b-addform input::placeholder { color: var(--ink-3); }
.b-emoji { width: 22px; text-align: center; font-size: 17px; flex: none; margin-top: 1px; }
.b-next { font-size: 12.5px; color: var(--ink-2); margin-top: 3px; line-height: 1.35; }
.brow-title b { font-weight: 600; }

/* ---------- Sidebar v2: calmer, fewer items ---------- */
@media (min-width: 900px) {
  .sidebar { width: 248px; padding: 22px 12px 14px; gap: 0; overflow: hidden; }
}
.brand { font-size: 20px; padding: 0 8px 16px; }
.brand-mark { width: 26px; height: 26px; border-radius: 8px; }
.side-nav { display: flex; flex-direction: column; gap: 1px; }
.sidebar .nav-btn { gap: 10px; padding: 7px 10px; border-radius: 10px; font-size: 14.5px; color: var(--ink-2); }
.sidebar .nav-btn svg { flex: none; opacity: .8; }
.sidebar .nav-btn.on { background: var(--soft); color: var(--ink); font-weight: 600; }
.sidebar .nav-btn.on svg { opacity: 1; }
.sidebar .nav-btn .count { font-size: 11.5px; opacity: 1; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.sidebar .nav-label { padding: 20px 10px 6px; font-size: 11.5px; font-weight: 600; letter-spacing: .02em; }
.side-projects { flex: 1; min-height: 0; overflow-y: auto; margin: 0 -4px; padding: 0 4px; scrollbar-width: thin; }
.side-item { position: relative; display: flex; align-items: center; }
.side-item .nav-btn { flex: 1; min-width: 0; padding-inline-end: 30px; }
.side-emoji { width: 18px; text-align: center; font-size: 14px; flex: none; }
.side-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-fold { position: absolute; inset-inline-end: 4px; width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; opacity: .55; }
.side-fold:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); opacity: 1; }
.side-fold .chev { width: 6px; height: 6px; margin: 0; transition: transform .15s; }
.side-fold.open .chev { transform: rotate(-45deg); }
.side-item .nav-btn:has(+ .side-fold) .count { margin-inline-end: 4px; }
.side-kids { margin-inline-start: 18px; padding-inline-start: 8px; border-inline-start: 1px solid var(--line); margin-bottom: 4px; }
.side-item.kid .nav-btn { font-size: 13.5px; padding-top: 5px; padding-bottom: 5px; }
.side-foot { display: flex; flex-direction: column; gap: 2px; padding-top: 10px; margin-top: 8px; border-top: 1px solid var(--line); }
.sidebar .side-capture { margin: 0 0 6px; background: var(--ink); color: var(--bg); justify-content: flex-start; font-weight: 600; padding: 10px 12px; }
.sidebar .side-capture:hover { background: var(--ink); color: var(--bg); }

/* ---------- Baskets: urgent + for today (drop targets above the boards) ---------- */
.baskets { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px; }
.basket { --bk: #f97316; --bk-bg: #fff7ed; background: var(--bk-bg); border: 2px dashed color-mix(in srgb, var(--bk) 45%, transparent); border-radius: 18px; padding: 8px 14px 10px; min-height: 96px; transition: border-color .15s, background .15s, transform .15s; }
.basket.bk-today { --bk: #eab308; --bk-bg: #fefce8; }
.basket header { display: flex; align-items: center; gap: 8px; padding: 4px 0 6px; font-size: 15px; }
.basket header .n { color: var(--ink-3); font-size: 13px; }
.bk-ic { font-size: 18px; }
.basket .b-empty { display: block; padding: 10px 0 4px; color: color-mix(in srgb, var(--bk) 70%, var(--ink-3)); }
.bk-list { display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow-y: auto; }
.bk-item { display: flex; align-items: center; gap: 9px; background: var(--card); border-radius: 12px; padding: 7px 10px; font-size: 13.5px; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.bk-item .check { width: 18px; height: 18px; flex: none; }
.bk-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk-title .late { color: var(--danger); font-size: 11px; }
.bk-out { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; color: var(--ink-3); opacity: 0; transition: opacity .15s, background .15s; }
.bk-item:hover .bk-out { opacity: 1; }
.bk-out:hover { background: var(--soft); color: var(--ink); }
.bk-item.dragging { opacity: .35; }
.basket.drop-on { border-style: solid; border-color: var(--bk); background: color-mix(in srgb, var(--bk) 14%, var(--card)); transform: translateY(-1px); }
body.is-dragging .basket { border-color: var(--bk); }
@media (prefers-color-scheme: dark) { .basket { --bk-bg: color-mix(in srgb, #f97316 10%, var(--card)); } .basket.bk-today { --bk-bg: color-mix(in srgb, #eab308 10%, var(--card)); } }

/* ---------- Urgent projects ---------- */
.urgent-pill { flex: none; font-size: 11.5px; font-weight: 700; padding: 4px 9px; border-radius: 99px; background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); white-space: nowrap; }
.bigp.is-urgent { box-shadow: 0 0 0 2px color-mix(in srgb, var(--danger) 55%, transparent), var(--shadow); }
.bigp-top .urgent-pill { margin-inline-start: auto; }
.bigp-top .urgent-pill + .stage-pill { margin-inline-start: 6px; }
.urg-toggle { flex: none; }
.urg-toggle.on { background: var(--danger); color: #fff; border-color: var(--danger); }
.side-urg { width: 14px; height: 14px; font-size: 10px; margin-inline: 4px 0; }
.head-acts { display: flex; align-items: center; gap: 8px; }

/* ---------- Shopping list ---------- */
.shop-mic { background: var(--ink); color: var(--bg); }
.shop-add { position: sticky; top: calc(var(--safe-t, 0px) + 8px); z-index: 5; }
.aisle { margin-top: 18px; }
.aisle h3 { display: flex; align-items: center; gap: 8px; margin: 0 6px 8px; font-size: 14px; font-weight: 700; color: var(--ink-2); }
.aisle h3 span { font-size: 18px; }
.aisle h3 small { color: var(--ink-3); font-weight: 500; font-size: 13px; }
.shop-item { display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 8px 14px; margin-bottom: 6px; background: var(--card); border-radius: 16px; box-shadow: var(--shadow); cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; transition: transform .12s, opacity .2s; }
.shop-item:active { transform: scale(.985); }
.shop-box { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--ink-3); color: transparent; transition: background .15s, border-color .15s, color .15s; }
.shop-name { flex: 1; min-width: 0; font-size: 16.5px; line-height: 1.3; }
.shop-del { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; color: var(--ink-3); opacity: .55; }
.shop-del:hover { opacity: 1; background: var(--soft); color: var(--ink); }
@media (hover: hover) { .shop-del { opacity: 0; } .shop-item:hover .shop-del { opacity: .8; } }
.shop-item.done { box-shadow: none; background: transparent; min-height: 44px; }
.shop-item.done .shop-box { background: #22c55e; border-color: #22c55e; color: #fff; }
.shop-item.done .shop-name { color: var(--ink-3); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--ink-3) 60%, transparent); }
.shop-again { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 2px; }
.shop-again .chip { gap: 5px; }
.shop-cart-title { color: #16a34a; }
.shop-cart-title .link-btn { margin-inline-start: auto; font-size: 14px; }
.shop-cart { margin-top: 2px; }
.shop-empty-ic { font-size: 44px; margin-bottom: 8px; }
@media (min-width: 1100px) { .main:has(.aisle) { max-width: 720px; } }

/* ---------- approve an AI connector in the app ---------- */
.approve-perm { display: flex; flex-direction: column; gap: 8px; margin: 0 0 18px; padding: 0; list-style: none; color: var(--ink-2); font-size: 15px; }
.approve-perm li::before { content: '✓'; margin-inline-end: 8px; color: var(--ink); font-weight: 700; }

/* ---------- Google / Apple sign-in ---------- */
.social-btns { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 4px; }
.social-btn { display: flex; align-items: center; justify-content: center; gap: 10px; }
.social-btn.apple { background: #000; color: #fff; }
@media (prefers-color-scheme: dark) { .social-btn.apple { background: #fff; color: #000; } }
.or-line { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: 13px; margin: 12px 0; }
.or-line::before, .or-line::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* ---------- settings: grouped list + sub-pages ---------- */
.set-me { display: flex; align-items: center; gap: 14px; padding: 16px 18px; }
.set-avatar { width: 48px; height: 48px; flex: none; border-radius: 50%; background: var(--ink); color: var(--bg); display: grid; place-items: center; font-weight: 700; font-size: 20px; }
.set-me-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.set-me-txt b { font-size: 17px; }
.set-me-txt span { color: var(--ink-2); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: start; }
.set-me .lang-seg { flex: none; box-shadow: none; background: var(--soft); }
.set-me .lang-seg button { padding: 6px 10px; font-size: 13px; }
.set-group-t { font-size: 13px; color: var(--ink-3); margin: 22px 8px 8px; letter-spacing: .03em; }
.set-group { padding: 0; overflow: hidden; }
.set-row { min-height: 56px; }
.set-row:hover { background: var(--soft); }
.set-ic { width: 32px; height: 32px; border-radius: 10px; background: var(--soft); display: grid; place-items: center; flex: none; }
.set-row .prop-k svg { color: var(--ink); }
.set-row .prop-v { font-size: 14px; }
.set-on { color: #16a34a !important; }
.set-on::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #16a34a; margin-inline-end: 6px; vertical-align: 1px; }
.set-danger .prop-k, .set-danger .prop-k svg { color: #dc2626; }
.set-danger .set-ic { background: color-mix(in srgb, #dc2626 10%, transparent); }
.set-sub { align-items: center; justify-content: flex-start; }
.set-sub .page-title { font-size: 26px; }
.chev.back { width: 10px; height: 10px; transform: rotate(-135deg); margin: 0; border-color: var(--ink); }
[dir=ltr] .chev.back { transform: rotate(45deg); }
.set-sub + .card.set-card, .set-sub + * { margin-top: 0; }
.card.props.set-group { background: var(--card); margin: 0; border-radius: var(--radius); }

/* ---------- comment → DM automation sheet ---------- */
.dm-status { background: var(--soft); border-radius: 18px; padding: 14px; margin-bottom: 8px; }
.dm-status-h { display: flex; align-items: center; gap: 10px; min-width: 0; }
.dm-pill { flex: none; font-size: 12.5px; font-weight: 700; padding: 4px 10px; border-radius: 99px; background: var(--card); color: var(--ink-2); }
.st-live .dm-pill { background: #16a34a; color: #fff; }
.st-armed .dm-pill { background: #f59e0b; color: #111; }
.st-paused .dm-pill { background: var(--ink-3); color: #fff; }
.dm-reel { min-width: 0; font-size: 14px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-reel a { color: var(--ink); }
.dm-stats { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.dm-stats span { flex: 1; min-width: 80px; background: var(--card); border-radius: 12px; padding: 8px 10px; font-size: 12px; color: var(--ink-2); display: flex; flex-direction: column; }
.dm-stats b { font-size: 20px; color: var(--ink); }
.dm-stats .bad b { color: #dc2626; }
.dm-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.dm-acts .dm-act { flex: none; padding: 9px 14px; font-size: 14px; border-radius: 12px; min-height: 0; }
.dm-acts .btn.ghost { background: var(--card); }
.dm-media, .dm-log { margin-top: 12px; background: var(--card); border-radius: 14px; overflow: hidden; max-height: 280px; overflow-y: auto; }
.dm-media-row { display: flex; width: 100%; gap: 10px; align-items: center; justify-content: space-between; padding: 11px 14px; text-align: start; font-size: 14px; }
.dm-media-row + .dm-media-row, .dm-log-row + .dm-log-row { box-shadow: 0 -1px 0 var(--line); }
.dm-media-row span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-media-row small, .dm-log-row small { flex: none; color: var(--ink-3); font-size: 12px; }
.dm-media-row:hover { background: var(--soft); }
.dm-log-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px; font-size: 14px; }
.dm-log-row > span:first-child { flex: 1; min-width: 0; text-align: start; }
.dm-st { font-size: 12px; padding: 2px 8px; border-radius: 99px; background: var(--soft); color: var(--ink-2); }
.dm-st.ls-link_sent { background: color-mix(in srgb, #16a34a 14%, transparent); color: #15803d; }
.dm-st.ls-failed { background: color-mix(in srgb, #dc2626 12%, transparent); color: #b91c1c; }
.dm-log-row .hint { flex-basis: 100%; margin: 0; }
.dm-form textarea { resize: none; min-height: 0; overflow: hidden; }
.dm-step { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.dm-step:first-child { border-top: 0; padding-top: 4px; }
.dm-step-h { display: flex; gap: 12px; align-items: flex-start; }
.dm-step-h > div { display: flex; flex-direction: column; gap: 2px; }
.dm-step-h b { font-size: 16px; }
.dm-step-h span { font-size: 13px; color: var(--ink-2); }
.dm-n { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: var(--bg); display: grid; place-items: center; font-size: 13px; font-weight: 700; margin-top: 1px; }
.dm-step .field { margin-top: 12px; }
.dm-switch { background: var(--soft); border-radius: 14px; margin-top: 10px; }
.dm-switch .prop-k { font-weight: 500; }
.dm-switch .switch.on { background: #16a34a; }
.dm-prev-t { font-size: 13px; color: var(--ink-3); margin: 24px 4px 8px; }
.dm-prev { background: var(--soft); border-radius: 18px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.dm-b { max-width: 82%; padding: 9px 13px; border-radius: 18px; font-size: 14px; line-height: 1.4; white-space: pre-wrap; word-break: break-word; }
.dm-b.them { align-self: flex-start; background: var(--card); border-end-start-radius: 6px; }
.dm-b.me { align-self: flex-end; background: #3b5bfd; color: #fff; border-end-end-radius: 6px; }
.dm-bb { display: block; margin: 8px -5px -3px; padding: 7px 10px; border-radius: 12px; background: rgba(255,255,255,.18); text-align: center; font-weight: 700; font-size: 13.5px; }
.dm-save-bar { position: sticky; bottom: calc(-1 * (var(--safe-b) + 24px)); margin: 18px -20px calc(-1 * (var(--safe-b) + 24px)); padding: 12px 20px calc(var(--safe-b) + 16px); background: var(--card); box-shadow: 0 -1px 0 var(--line); display: flex; align-items: center; gap: 16px; z-index: 2; }
.dm-save-bar .btn { flex: 1; min-height: 50px; }
.dm-del { color: #dc2626; flex: none; }
@media (min-width: 700px) { .dm-save-bar { bottom: -26px; margin: 18px -26px -26px; padding: 14px 26px 22px; } }
@media (max-width: 699px) { .sheet-dm .grid2 { grid-template-columns: 1fr; gap: 0; } }
a.nav-btn { text-decoration: none; }
.set-divider { height: 1px; background: var(--line); margin: 20px 0 4px; }
.set-card .actions .btn { min-width: 160px; }
.code.prompt-code { white-space: pre-wrap; word-break: normal; text-align: start; font-family: var(--font); font-size: 13.5px; line-height: 1.6; }
.set-row:hover .set-ic { background: var(--card); box-shadow: 0 0 0 1px var(--line); }
/* Native selects: own chevron, kept clear of the edge (RTL: left side, LTR: right side) */
select:not(.prop select) { appearance: none; -webkit-appearance: none; padding-inline-end: 42px; background-repeat: no-repeat; background-size: 12px; background-position: left 16px center;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2371717a' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
[dir=ltr] select:not(.prop select) { background-position: right 16px center; }
/* step numbers: beat `.dm-step-h span` grey */
.dm-step-h .dm-n { color: var(--card); font-size: 13px; }
/* sheets: no native scrollbar (it sat on the left in RTL and cut the rounded corner) */
.sheet { scrollbar-width: none; }
.sheet::-webkit-scrollbar { display: none; }
/* AI prompt follows the page language (.code forces ltr) */
.code.prompt-code[dir=rtl] { direction: rtl; text-align: right; }
.code.prompt-code[dir=ltr] { direction: ltr; text-align: left; }
/* DM automation as a sentence: "כאשר מישהו / הוא יקבל / ואז..." */
.dm-flow { position: relative; margin-top: 22px; }
.dm-flow:first-child { margin-top: 6px; }
.dm-flow h3 { margin: 0 0 10px; font-size: 21px; letter-spacing: -.02em; }
.dm-box { background: var(--soft); border-radius: 18px; padding: 14px 16px 16px; }
.dm-lead { margin: 0 0 10px; font-size: 15px; color: var(--ink); }
.dm-box .field:first-child, .dm-lead + .field { margin-top: 0; }
.dm-box .field { margin-top: 10px; }
.dm-box input, .dm-box textarea { background: var(--card); }
.dm-box .dm-switch { background: var(--card); margin-top: 0; }
.dm-box .dm-switch + .field { margin-top: 10px; }
.dm-reels { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; max-height: 360px; overflow-y: auto; scrollbar-width: none; }
.dm-reel { position: relative; aspect-ratio: 9 / 14; border-radius: 12px; overflow: hidden; background: var(--card); padding: 0; box-shadow: 0 0 0 1px var(--line); display: grid; place-items: center; }
.dm-reel img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dm-reel-cap { width: 100%; box-sizing: border-box; word-break: break-word; text-align: center; padding: 8px; font-size: 11.5px; line-height: 1.3; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.dm-reel small { position: absolute; inset-inline-start: 6px; bottom: 6px; font-size: 11px; color: #fff; background: rgba(0,0,0,.55); padding: 1px 6px; border-radius: 6px; }
.dm-reel i { position: absolute; inset-inline-end: 6px; top: 6px; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: var(--card); display: none; place-items: center; }
.dm-reel.on { box-shadow: 0 0 0 3px var(--ink); }
.dm-reel.on i { display: grid; }
.dm-reel.next { display: flex; flex-direction: column; gap: 6px; color: var(--ink-2); font-size: 12.5px; padding: 8px; text-align: center; }
.dm-reel.sk { background: linear-gradient(90deg, var(--card), var(--line), var(--card)); background-size: 200% 100%; animation: sk 1.2s infinite linear; }
@keyframes sk { to { background-position: -200% 0; } }
.dm-note { margin: 10px 2px 0; }
/* DM sheet on wide screens: settings on the start side, live preview pinned on the end side */
@media (min-width: 900px) {
  .sheet.sheet-dm { width: min(1000px, 94vw); }
  .dm-cols { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
  .dm-side { position: sticky; top: 0; }
  .dm-side .dm-prev-t { margin-top: 6px; }
  .dm-side .dm-prev { max-height: calc(88vh - 180px); overflow-y: auto; scrollbar-width: none; }
}
/* side-by-side fields: same top line (the first one lost its margin via :first-child) */
.dm-box .grid2 { margin-top: 10px; align-items: end; }
.dm-box .grid2 > .field { margin-top: 0; }
.dm-replies { display: flex; flex-direction: column; gap: 8px; }
.dm-reply { display: flex; align-items: center; gap: 6px; }
.dm-reply input { flex: 1; min-width: 0; }
.dm-reply .icon-btn { flex: none; background: transparent; box-shadow: none; color: var(--ink-3); }
.dm-reply .icon-btn:hover { color: var(--ink); background: var(--card); }
.dm-radd { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border-radius: 12px; background: var(--card); box-shadow: 0 0 0 1px var(--line); font-size: 14px; font-weight: 600; }
.dm-radd:hover { box-shadow: 0 0 0 1px var(--ink-3); }
.dm-reel video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.dm-reel-cap { white-space: normal; align-self: center; }
.dm-reel.next { justify-content: center; align-items: center; }
.dm-accts { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
