:root {
  --bg: #080b12;
  --text: #f2f5fb;
  --dim: rgba(235, 240, 255, .62);
  --glass: rgba(255, 255, 255, .075);
  --glass-hi: rgba(255, 255, 255, .16);
  --edge: rgba(255, 255, 255, .14);
  --accent: #3b82f6;
  --danger: #ef4444;
  --r: 22px;
  /* Speaker palette (index % 8). The app is always dark, so the dark values of the shared palette apply;
     PDF/DOCX exports use the light values from export.js. */
  --spk0: #6EA8FF; --spk1: #FF9A5C; --spk2: #5FD38A; --spk3: #E879F9;
  --spk4: #4FD1E0; --spk5: #FF7A7A; --spk6: #B69CFF; --spk7: #E5C350;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); }
body { margin: 0; background: transparent; color: var(--text); }
body {
  font: 16px/1.35 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Arabic", sans-serif;
  min-height: 100dvh; overscroll-behavior-y: none;
}
.backdrop {
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(420px 420px at 12% 0%, rgba(59,130,246,.38), transparent 70%),
    radial-gradient(360px 360px at 100% 35%, rgba(37,99,235,.2), transparent 70%),
    radial-gradient(420px 420px at 25% 100%, rgba(79,70,229,.22), transparent 70%),
    var(--bg);
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
.glass {
  background: linear-gradient(160deg, rgba(255,255,255,.13), rgba(255,255,255,.04));
  -webkit-backdrop-filter: blur(22px) saturate(160%); backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid var(--edge);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 8px 30px rgba(0,0,0,.35);
}
.press { transition: transform .12s ease, filter .12s; }
.press:active { transform: scale(.94); filter: brightness(1.25); }

#app { max-width: 720px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 8px) 14px calc(env(safe-area-inset-bottom) + 16px); }
.topbar { display: flex; align-items: center; gap: 8px; min-height: 48px; margin-bottom: 8px; }
.topbar h1 { flex: 1; font-size: 20px; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar h1.big { font-size: 32px; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.icon-btn svg { width: 22px; height: 22px; }

/* Clock */
.clock { border-radius: 28px; padding: 14px 12px 10px; text-align: center; position: relative; margin-bottom: 10px;
  background: linear-gradient(160deg, rgba(59,130,246,.30), rgba(59,130,246,.08)); }
.clock .tc { font: 600 min(84px, calc((100vw - 64px) / 6.9))/1 ui-monospace, "SF Mono", "Roboto Mono", Menlo, monospace; letter-spacing: -1px; font-variant-numeric: tabular-nums; direction: ltr; }
.clock .meta { color: var(--dim); font-size: 13px; margin-top: 6px; }
.clock .expand { position: absolute; top: 6px; inset-inline-end: 6px; }
.status { text-align: center; font-size: 13px; font-weight: 600; color: #f87171; margin: -2px 0 8px; }

/* Quick buttons */
.quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; margin-bottom: 10px; }
.quick button { min-height: 50px; border-radius: 16px; font-weight: 600; font-size: 15px; position: relative; padding: 6px 10px 6px 18px; }
.quick button::before { content: ""; position: absolute; inset-inline-start: 8px; top: 50%; width: 4px; height: 22px; margin-top: -11px; border-radius: 3px; background: var(--c); }
.quick button { background: linear-gradient(160deg, color-mix(in srgb, var(--c) 42%, transparent), color-mix(in srgb, var(--c) 14%, transparent)); }

.slate { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 14px; color: var(--dim); }
.slate input { width: 70px; text-align: center; border-radius: 12px; padding: 6px; background: var(--glass); border: 1px solid var(--edge); font-weight: 600; color: var(--text); }
.slate b { color: var(--text); min-width: 30px; text-align: center; font-size: 17px; }
.slate .sp { flex: 1; }

.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 4px; scrollbar-width: none; }
.chip { border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 500; white-space: nowrap; }
.chip.on { background: color-mix(in srgb, var(--c) 45%, transparent); border-color: var(--c); }

/* Composer */
.composer { display: flex; align-items: center; gap: 6px; border-radius: 30px; padding: 6px 6px 6px 12px; margin-bottom: 10px; }
.composer .dot { width: 26px; height: 26px; border-radius: 50%; flex: none; border: 2px solid rgba(255,255,255,.25); }
.composer .field { flex: 1; min-width: 0; }
.composer .at { font: 11px ui-monospace, monospace; color: var(--dim); display: block; direction: ltr; }
.composer input { width: 100%; border: 0; outline: 0; background: none; padding: 6px 2px; font-size: 16px; }
.composer input::placeholder { color: var(--dim); }
.circle { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.circle svg { width: 20px; height: 20px; }
.circle.send { width: 48px; height: 48px; background: linear-gradient(160deg, color-mix(in srgb, var(--c) 70%, transparent), color-mix(in srgb, var(--c) 35%, transparent)); }
.good { width: 46px; height: 46px; border-radius: 50%; position: relative; flex: none; padding: 0; border: 2px solid var(--c); }
.good img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.good .badge { position: absolute; right: -4px; bottom: -4px; width: 20px; height: 20px; border-radius: 50%; background: var(--c); display: grid; place-items: center; border: 1.5px solid rgba(0,0,0,.6); }
.good .badge svg { width: 11px; height: 11px; fill: #fff; }

.seg { display: flex; border-radius: 999px; padding: 4px; margin-bottom: 8px; }
.seg button { flex: 1; padding: 8px; border-radius: 999px; font-weight: 600; color: var(--dim); }
.seg button.on { background: var(--glass-hi); color: var(--text); }

.search { width: 100%; border-radius: 999px; padding: 10px 16px; margin-bottom: 8px; border: 1px solid var(--edge); background: var(--glass); outline: 0; }

/* Notes */
.list { list-style: none; margin: 0; padding: 0; }
.note { display: flex; gap: 10px; padding: 10px 4px; border-bottom: 1px solid rgba(255,255,255,.07); cursor: pointer; }
.note .bar { width: 4px; border-radius: 3px; background: var(--c); flex: none; }
.note .body { flex: 1; min-width: 0; }
.note .tcs { font: 600 15px ui-monospace, monospace; direction: ltr; display: inline-block; }
.note .sl { color: var(--dim); font-size: 12px; font-weight: 500; margin-inline-start: 8px; }
.note .who { float: inline-end; color: var(--dim); font-size: 12px; display: inline-flex; align-items: center; gap: 3px; }
.note .who svg, .note .file svg { width: 12px; height: 12px; vertical-align: -1px; }
.note .txt { margin-top: 2px; word-wrap: break-word; }
.note .file { color: var(--dim); font: 12px ui-monospace, monospace; margin-top: 2px; }
.note .tags span { display: inline-block; font-size: 11px; padding: 1px 8px; border-radius: 999px; margin: 4px 4px 0 0; background: color-mix(in srgb, var(--c) 30%, transparent); }
.empty { text-align: center; color: var(--dim); padding: 40px 20px; }
.line { padding: 8px 4px; border-bottom: 1px solid rgba(255,255,255,.07); }
.line.mark { border-inline-start: 4px solid var(--c); padding-inline-start: 10px; background: color-mix(in srgb, var(--c) 12%, transparent); border-radius: 6px; }
.line .tcs { font: 12px ui-monospace, monospace; color: var(--dim); direction: ltr; display: inline-block; }
.line.partial { color: var(--dim); font-style: italic; }
.spk { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; font: 600 .75em/1.3 system-ui, sans-serif; padding: 2px 6px;
  color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); border: 1px solid var(--c); margin-inline-start: 8px; vertical-align: baseline; cursor: pointer; }
.spk-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); display: inline-block; flex: none; }
.spk-banner { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.big-btn { display: block; width: 100%; border-radius: 999px; padding: 14px; font-weight: 600; margin: 8px 0; text-align: center; }
.big-btn.primary { background: linear-gradient(160deg, rgba(59,130,246,.6), rgba(59,130,246,.3)); }

/* Projects */
.card { border-radius: var(--r); overflow: hidden; margin-bottom: 14px; }
.row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid rgba(255,255,255,.07); width: 100%; text-align: start; }
.row:last-child { border-bottom: 0; }
.row .grow { flex: 1; min-width: 0; }
.row small { display: block; color: var(--dim); font-size: 13px; }
.row .chev, .shelf .chev { color: rgba(235,235,245,.3); display: inline-flex; }
.chev svg { width: 13px; height: 13px; }
.footer { display: flex; gap: 12px; align-items: center; border-radius: 26px; padding: 8px 12px; margin-top: 20px; }
.footer img { width: 72px; height: 72px; border-radius: 16px; object-fit: cover; }
.footer b { font-size: 17px; }
.footer a { color: #0a84ff; font-weight: 600; text-decoration: none; font-size: 15px; }
.footer .share-up { margin-inline-start: auto; background: none; border: 0; color: #0a84ff; padding: 8px; }
.footer .share-up svg { width: 24px; height: 24px; }

/* Sheets */
dialog { border: 0; padding: 0; background: transparent; color: var(--text); max-width: 720px; width: 100%; max-height: 92dvh; margin: auto auto 0; }
dialog::backdrop { background: rgba(0,0,0,.55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.sheet { border-radius: 28px 28px 0 0; padding: 16px 16px calc(env(safe-area-inset-bottom) + 20px); max-height: 92dvh; overflow-y: auto;
  background: linear-gradient(170deg, rgba(30,45,80,.92), rgba(12,16,28,.96)); border: 1px solid var(--edge); }
.sheet header { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.sheet header h2 { flex: 1; margin: 0; font-size: 30px; font-weight: 700; }
.pill { border-radius: 999px; padding: 8px 16px; font-weight: 600; }
.section { color: var(--dim); font-size: 15px; font-weight: 600; margin: 18px 16px 6px; }
.hint { color: var(--dim); font-size: 13px; margin: 6px 6px 0; }
.form { border-radius: 18px; overflow: hidden; }
.form label, .form .fr { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid rgba(255,255,255,.07); }
.form label:last-child, .form .fr:last-child { border-bottom: 0; }
.form label > span { flex: 1; }
.form input[type=text], .form input:not([type]), .form select, .form textarea { background: transparent; border: 0; outline: 0; text-align: end; max-width: 60%; }
.form textarea { width: 100%; max-width: none; text-align: start; min-height: 80px; resize: vertical; }
.form select option { background: #111827; }
.form input[type=checkbox] { width: 46px; height: 28px; appearance: none; border-radius: 999px; background: rgba(255,255,255,.18); position: relative; transition: .2s; flex: none; }
.form input[type=checkbox]::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: .2s; }
.form input[type=checkbox]:checked { background: #34c759; }
.form input[type=checkbox]:checked::after { left: 21px; }
.colors { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 14px; }
.colors button { width: 32px; height: 32px; border-radius: 50%; background: var(--c); border: 2px solid transparent; }
.colors button.on { border-color: #fff; box-shadow: 0 0 0 2px var(--c); }
.danger { color: var(--danger); }
.meter { height: 8px; border-radius: 4px; background: rgba(255,255,255,.1); overflow: hidden; margin: 10px 0; }
.meter i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #22c55e, #eab308, #ef4444); transition: width .1s; }
.ltc-tc { font: 600 40px ui-monospace, monospace; text-align: center; direction: ltr; }

/* Big clock */
.bigclock { position: fixed; inset: 0; background: #000; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; }
.bigclock .tc { font: 700 19vw/1 ui-monospace, "Roboto Mono", monospace; direction: ltr; font-variant-numeric: tabular-nums; }
.bigclock .cap { border-radius: 999px; padding: 10px 18px; color: rgba(255,255,255,.8); font-weight: 600; }
@media (orientation: portrait) { .bigclock .tc { font-size: 17vw; } }

#toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 24px); transform: translateX(-50%); padding: 10px 18px; border-radius: 999px; background: rgba(30,41,59,.95); border: 1px solid var(--edge); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 60; max-width: 90vw; text-align: center; }
#toast.show { opacity: 1; }

#print { display: none; }
@media print {
  body > *:not(#print) { display: none !important; }
  #print { display: block; color: #000; background: #fff; }
  html, body { background: #fff; }
}

/* Welcome */
.welcome { text-align: center; display: flex; flex-direction: column; gap: 14px; height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 20px); box-sizing: border-box; padding: 4px 8px 0; max-width: 560px; margin: 0 auto; }
.welcome > * { flex-shrink: 0; margin: 0; }
.welcome .hero { flex: 1 1 0; min-height: 0; max-height: 420px; width: 100%; object-fit: cover; object-position: top; border-radius: 20px; border: none; }
.welcome h1 { font-size: 28px; font-weight: 700; line-height: 1.15; margin: 0; }
.welcome .w-free { font-size: 17px; font-weight: 600; margin: 0 0 4px; }
.welcome .w-dim { color: var(--dim); font-size: 15px; margin: 0; }
.welcome .w-lead { font-size: 15px; }
.welcome .w-uae { padding: 12px; border-radius: 22px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.welcome .w-uae b { font-size: 17px; }
.welcome .w-uae p { color: var(--dim); font-size: 13px; margin: 0; }
.welcome .w-link { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; width: 100%; border-radius: 999px; color: #0a84ff; font-weight: 600; text-decoration: none; }
.welcome .w-link svg { width: 18px; height: 18px; }
.welcome .w-start { min-height: 50px; }
.welcome .wl { text-align: start; padding: 4px 18px; font-size: 15px; }
.welcome .wl p { margin: 14px 0; }
.welcome .wl a { color: #60a5fa; font-weight: 600; text-decoration: none; }

/* Boom Cat */
.bc-video { display: block; position: relative; margin: 10px 16px 14px; color: var(--text); text-decoration: none; }
.bc-video img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 16px; display: block; }
.bc-video .play { position: absolute; top: calc(50% - 40px); left: 50%; transform: translateX(-50%); width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: rgba(0,0,0,.55); font-size: 22px; }
.bc-video small { display: block; color: var(--dim); margin-top: 8px; }
.bc .row { color: var(--text); text-decoration: none; border-top: 1px solid rgba(255,255,255,.07); }

/* Bottom tab bar, like the iPhone app */
.tabbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom) + 10px); display: flex; gap: 4px; padding: 5px; border-radius: 999px; z-index: 20; }
.tabbar button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 22px; border-radius: 999px; color: var(--dim); font-size: 11px; font-weight: 600; }
.tabbar button svg { width: 24px; height: 24px; }
.tabbar button.on { background: var(--glass-hi); color: #60a5fa; }
#app { padding-bottom: calc(env(safe-area-inset-bottom) + 96px); }
.bc { padding-top: 4px; }

/* Scan timecode */
.clock { padding-top: 40px; }
.scan { position: relative; border-radius: 22px; overflow: hidden; background: #000; aspect-ratio: 4/3; }
.scan video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-box { position: absolute; left: 7%; right: 7%; top: 50%; height: 26%; transform: translateY(-50%); border: 3px solid #facc15; border-radius: 12px; box-shadow: 0 0 0 999px rgba(0,0,0,.45); transition: border-color .2s; }

/* Swipe to delete (projects, notes, buttons, tags) */
.swipe { position: relative; overflow: hidden; }
.swipe-del { position: absolute; inset-block: 0; inset-inline-end: 0; width: 96px; background: #e5484d; color: #fff; font-weight: 600; border: 0; }
.swipe-in { position: relative; background: var(--bg); transition: transform .2s ease; touch-action: pan-y; }
.card .swipe-in, .form .swipe-in { background: #121826; }
.swipe:last-child .row { border-bottom: 0; }
.list .swipe-in { background: transparent; }
.list .swipe.act .swipe-in { background: #0b0f18; }
/* Colour filter row */
.cfilter { display: flex; gap: 10px; align-items: center; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: none; }
.cfilter > button:not(.pill) { width: 26px; height: 26px; border-radius: 50%; background: var(--c); border: 0; flex: none; }
.cfilter > button.on { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4.5px #fff; }
.status { display: flex; align-items: center; gap: 6px; text-align: start; color: var(--text); padding: 0 4px; }
.status .rec { color: #ef4444; animation: pulse 1.2s ease-in-out infinite; }
.status .sp { flex: 1; }
.status .pill { padding: 4px 12px; font-size: 13px; }
@keyframes pulse { 50% { opacity: .3; } }
.line.mark { cursor: pointer; }
/* Shelf rows (On screen / Saved) */
.shelf { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid rgba(255,255,255,.07); width: 100%; text-align: start; color: var(--text); background: none; border-inline: 0; border-top: 0; }
.shelf .op { width: 24px; height: 24px; border-radius: 50%; color: #fff; font: 700 18px/22px system-ui; text-align: center; flex: none; border: 0; padding: 0; }
.shelf .op.minus { background: #ef4444; } .shelf .op.plus { background: #22c55e; }
.shelf .sw { width: 20px; height: 20px; border-radius: 5px; background: var(--c); flex: none; }
.shelf .tagi { flex: none; }
.shelf .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shelf small { color: var(--dim); font-size: 12px; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shelf .drag { color: var(--dim); font-size: 18px; padding: 0 4px; cursor: grab; touch-action: none; }
.shelf.dragging { opacity: .6; background: rgba(255,255,255,.06); }
.foot { color: var(--dim); font-size: 13px; padding: 6px 16px 14px; }
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper button { width: 44px; height: 34px; font-size: 20px; }
.helpi { padding: 10px 16px; border-bottom: 1px solid rgba(255,255,255,.07); }
.helpi b { display: block; margin-bottom: 2px; } .helpi span { color: var(--dim); font-size: 14px; }
.cmap { width: 100%; border-collapse: collapse; font-size: 13px; } .cmap td, .cmap th { padding: 8px 10px; text-align: start; border-bottom: 1px solid rgba(255,255,255,.07); }
.cmap i { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--c); margin-inline-end: 6px; vertical-align: -1px; }
.seg3 { display: flex; padding: 4px; gap: 4px; border-radius: 999px; } .seg3 button { flex: 1; padding: 8px; border-radius: 999px; border: 0; background: none; color: var(--text); }
.seg3 button.on { background: rgba(255,255,255,.16); font-weight: 600; }
.swipe:not(.act) .swipe-del { visibility: hidden; }
.bc-video b { display: block; margin-top: 8px; font-size: 16px; }

.good, .biggood { -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.good img, .biggood img { pointer-events: none; -webkit-user-drag: none; }
.holdring { position: absolute; inset: -6px; border-radius: inherit; pointer-events: none; --p: 0deg;
  background: conic-gradient(var(--c) var(--p), rgba(255,255,255,.12) 0); -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 0); mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 0); }
.biggood .holdring { inset: 4px; border-radius: 26px; -webkit-mask: none; mask: none; background: none; box-shadow: inset 0 0 0 5px rgba(255,255,255,.12); }
.biggood .holdring::after { content: ""; position: absolute; left: 0; bottom: 0; height: 6px; border-radius: 3px; background: var(--c); width: calc(var(--p) / 360deg * 100%); }
.biggood { position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); height: 50vh; z-index: 40;
  border-radius: 30px; border: 3px solid var(--c); background: color-mix(in srgb, var(--c) 22%, #0b0f18 78%);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: #fff; padding: 0; box-shadow: 0 -10px 40px rgba(0,0,0,.6); }
.biggood img { width: min(42vw, 26vh); height: min(42vw, 26vh); border-radius: 50%; object-fit: cover; border: 3px solid var(--c); }
.biggood b { font-size: 26px; font-weight: 600; }
.biggood small { color: rgba(255,255,255,.6); font-size: 13px; }
.biggood.flash { animation: gflash .35s ease-out; }
@keyframes gflash { from { background: var(--c); } }
body:has(.biggood) #list { padding-bottom: 52vh; }
.session { margin: -4px 0 8px; text-align: center; font-size: 12px; font-weight: 600; color: #34c759; }

/* Boom Cat: in landscape the picture and the latest video sit side by side; in portrait one under the other,
   each small enough that both fit on one screen. */
/* Both pictures in the same box, filled edge to edge. */
.bc-latest .bc-video { width: calc(100% - 32px) !important; margin: 16px !important; }
.bc-latest .bc-video { padding: 0 !important; }
/* Same frame for both cards: equal picture, then up to three lines of text in the same space. */
.bc-row .card { padding: 0 !important; }
.bc-intro .card > p, .bc-latest .bc-video b { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 4.2em; line-height: 1.4em; margin: 0 auto 16px !important; font-size: 15px; }
/* Text as wide as the picture above it and centred under it. */
.bc-intro .card > p, .bc-latest .bc-video b { text-align: center; }
.bc-intro .card > p { width: min(calc(100% - 32px), 31vh); box-sizing: border-box; }
.bc-latest .bc-video b { width: min(100%, 31vh); }
.bc-latest .bc-video { margin-bottom: 0 !important; }
.bc-latest .bc-video small { display: none; }
/* Both pictures are squares of the same side (the Boom Cat picture is square, so nothing of it is cut off). */
.bc-intro img, .bc-latest .bc-video img { width: min(calc(100% - 32px), 31vh) !important; height: auto; aspect-ratio: 1 / 1; object-fit: cover; margin: 16px auto !important; display: block; }
.bc-latest .bc-video img { width: min(100%, 31vh) !important; margin: 0 auto 16px !important; }
@media (orientation: landscape) and (min-width: 600px) {
  .bc-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: stretch; }
  .bc-row > div, .bc-row > div > .card { height: 100%; box-sizing: border-box; }
  .bc-row > div > .card { margin-left: 0; margin-right: 0; }
  .bc-latest .section { display: none; }  /* keeps both pictures on one line; the title is under the video */
  .bc-intro img { width: min(calc(100% - 32px), 60vh) !important; }
  .bc-latest .bc-video img { width: min(100%, 60vh) !important; }
  .bc-intro .card > p { width: min(calc(100% - 32px), 60vh); }
  .bc-latest .bc-video b { width: min(100%, 60vh); }
}

/* External audio input badge under the clock. */
.mic-badge { color: #34d399; font-size: 12px; font-weight: 600; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Bigger Stop button for the running transcript. */
.status [data-act="speech"] { min-height: 44px; padding: 0 22px; font-size: 16px; font-weight: 600; background: #dc2626; color: #fff; }

/* Script | Start speech recognition (Stop while running) | Notes */
.seg .seg-speech { flex: 0 0 64px; background: #0a84ff; color: #fff; font-size: 18px; display: flex; align-items: center; justify-content: center; }
.seg .seg-speech > svg { width: 22px; height: 22px; }
.seg .seg-speech.stop { background: #dc2626; }
.seg .seg-speech.stop { flex-basis: 64px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; line-height: 1; padding: 0 2px; }
.seg .seg-speech .ic { font-size: 11px; }
.seg .seg-speech .el { font: 600 11px/1 ui-monospace, "SF Mono", Menlo, "Roboto Mono", monospace; font-variant-numeric: tabular-nums; letter-spacing: -0.2px; white-space: nowrap; }
.spk-sugg { margin: 4px 0 10px; }
.clock.rec-on { box-shadow: inset 0 0 0 3px #ef4444; }

/* Call hint while a take starts (Do Not Disturb). Never blocks the screen; goes away by itself. */
#callHint { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 72px); transform: translateX(-50%); width: min(92vw, 460px); padding: 12px 14px; border-radius: 18px; background: rgba(30,41,59,.96); border: 1px solid var(--edge); z-index: 55; }
#callHint p { margin: 0 0 10px; line-height: 1.35; }
#callHint div { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

/* Projects / Boom Cat: the TC Logger card sits at the bottom of the screen, as on iPhone. */
#app:has(> .footer) { display: flex; flex-direction: column; min-height: 100dvh; box-sizing: border-box; }
#app > .footer { margin-top: auto; }
#app:has(> .footer) > * { flex-shrink: 0; }

/* iPhone parity: large title under the toolbar, one glass cell per project, one-line colour picker, sheet sizes */
h1.large { font-size: 34px; font-weight: 700; margin: 2px 4px 12px; }
.plist { display: flex; flex-direction: column; gap: 10px; }
.plist .swipe { border-radius: 22px; overflow: hidden; background: var(--glass); border: 1px solid var(--edge); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.plist .row { border-bottom: 0; padding: 12px 16px; }
.plist .row b { font-size: 17px; font-weight: 600; }
.plist .row small { font-size: 12px; margin-top: 4px; }
.empty .et { font-size: 20px; color: var(--text); }
.cpick { position: relative; }
.cpick .cdot { width: 12px; height: 12px; border-radius: 50%; background: var(--c); flex: none; margin-inline-start: auto; }
.cpick select { flex: 0 1 auto !important; width: auto !important; }
.sheet.full { min-height: 92dvh; }
.spin { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.25); border-top-color: var(--text); border-radius: 50%; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.form label.fr > input { flex: 1; text-align: start; }
.helpi b { font-size: 17px; font-weight: 600; }
.helpi span { font-size: 15px; color: var(--dim); }
#app:has(> .welcome) { padding-bottom: calc(env(safe-area-inset-bottom) + 12px); }
.plist .swipe-in { background: transparent; }
.plist .swipe.act .swipe-in { background: #0b0f18; }
.form label:has(> input:not([type=checkbox])) > span { white-space: nowrap; flex: 0 0 auto; }
.form label:has(> input:not([type=checkbox])) > input { flex: 1; min-width: 0; max-width: none; }
/* iOS large title: toolbar buttons on top, the title on its own line below */
.sheet header { flex-wrap: wrap; row-gap: 6px; }
.sheet header > h2 { order: 10; flex-basis: 100%; overflow-wrap: anywhere; }
.sheet header > h2 + * { margin-inline-start: auto; }
.form label.fr > input { width: 0; }
#sheet button:focus:not(:focus-visible), #sheet button:focus { outline: none; }
/* Digital slate */
.slate-page { position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; gap: 8px; padding: calc(env(safe-area-inset-top) + 8px) calc(env(safe-area-inset-right) + 8px) calc(env(safe-area-inset-bottom) + 8px) calc(env(safe-area-inset-left) + 8px); background: #000; container-type: size; }
body.slate-full { overflow: hidden; }
.slate-top { display: flex; gap: 8px; align-items: center; }
.slate-top .on { color: #4ade80; }
.slate-board { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: space-evenly; gap: 1.2cqh; background: #000; border-radius: 22px; padding: 1.5cqh 2.5cqw; border: 2px solid #222; user-select: none; -webkit-user-select: none; overflow: hidden; }
.slate-board.flash { animation: slateFlash .25s ease-out; }
@keyframes slateFlash { from { background: #fff; } to { background: #000; } }
.slate-prod { color: #fff; font: 800 min(6.5cqw, 5cqh)/1.2 system-ui, sans-serif; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slate-crew { display: grid; grid-template-columns: 1fr 1fr; gap: 1cqh 1.5cqw; }
.slate-crew label { display: flex; flex-direction: column; gap: 2px; border: 1px solid #333; border-radius: 10px; padding: .8cqh 2cqw; color: #aaa; font-size: min(2.6cqw, 1.7cqh); text-transform: uppercase; letter-spacing: .06em; }
.slate-crew input { background: none; border: 0; color: #fff; font: 600 min(4.5cqw, 3.2cqh)/1.1 system-ui, sans-serif; width: 100%; padding: 0; }
.slate-flags { display: flex; gap: 1.5cqw; }
.slate-flags .tk2 { flex: 1; border: 1px solid #444; border-radius: 10px; background: #111; color: #fff; font: 700 min(4cqw, 2.8cqh) system-ui, sans-serif; padding: 1.2cqh 0; }
.slate-fields { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 1.5cqw; }
.slate-fields label { display: flex; flex-direction: column; gap: 4px; border: 1px solid #333; border-radius: 12px; padding: 1cqh 2cqw; color: #aaa; font-size: min(3cqw, 2cqh); text-transform: uppercase; letter-spacing: .06em; }
.slate-fields input { background: none; border: 0; color: #fff; font: 700 min(7cqw, 5cqh)/1.1 system-ui, sans-serif; width: 100%; padding: 0; }
.slate-fields b { display: flex; align-items: center; justify-content: space-between; color: #fff; font-size: min(7cqw, 5cqh); }
.slate-fields .tk { width: min(8cqw, 6cqh); height: min(8cqw, 6cqh); border-radius: 50%; border: 1px solid #444; background: #111; color: #fff; font-size: 20px; }
.slate-tc { font: 700 min(12.8cqw, 24cqh)/1 ui-monospace, "Roboto Mono", monospace; color: #ff3b30; text-align: center; direction: ltr; font-variant-numeric: tabular-nums; text-shadow: 0 0 18px rgba(255,59,48,.45); }
.slate-tc.held { color: #fff; text-shadow: 0 0 18px rgba(255,255,255,.6); }

.slate-meta { text-align: center; color: #888; font-weight: 600; font-size: min(4cqw, 3cqh); }
.slate-hint { text-align: center; color: #666; font-size: min(3.4cqw, 2.4cqh); }
/* Landscape: crew and flags on the left, roll/scene/take on the right, the timecode across the bottom */
@container (min-aspect-ratio: 5/4) {
  .slate-board { display: grid; grid-template-columns: 1fr 1fr; grid-template-areas: "prod prod" "crew fields" "flags fields" "tc tc" "meta meta" "hint hint"; align-content: space-evenly; column-gap: 2cqw; }
  .slate-prod { grid-area: prod; font-size: min(4cqw, 7cqh); } .slate-crew { grid-area: crew; } .slate-flags { grid-area: flags; } .slate-fields { grid-area: fields; align-self: stretch; }
  .slate-tc { grid-area: tc; font-size: min(12.8cqw, 26cqh); } .slate-meta { grid-area: meta; } .slate-hint { grid-area: hint; }
  .slate-crew label, .slate-fields label { font-size: min(1.6cqw, 2.6cqh); } .slate-crew input, .slate-flags .tk2 { font-size: min(2.4cqw, 4cqh); }
  .slate-fields input, .slate-fields b { font-size: min(4cqw, 8cqh); } .slate-fields .tk { width: min(4.5cqw, 9cqh); height: min(4.5cqw, 9cqh); }
  .slate-meta { font-size: min(2.2cqw, 4cqh); } .slate-hint { font-size: min(1.8cqw, 3cqh); }
}
/* Speech button: clearly visible press (shrink, darken, glow ring) */
.seg .seg-speech { transition: transform .12s cubic-bezier(.3,1.6,.5,1), filter .12s, box-shadow .25s; -webkit-tap-highlight-color: transparent; }
.seg .seg-speech:active { transform: scale(.78); filter: brightness(.7); box-shadow: 0 0 0 8px rgba(10,132,255,.45); transition-duration: .05s; }
.seg .seg-speech.stop:active { box-shadow: 0 0 0 6px rgba(220,38,38,.45); }
/* Pop after toggle: the button is re-rendered on tap, so :active alone is lost */
.seg .seg-speech.pop { animation: speechPop .5s cubic-bezier(.3,1.6,.5,1); }
@keyframes speechPop { 0% { transform: scale(.78); box-shadow: 0 0 0 0 rgba(10,132,255,.6); } 35% { transform: scale(1.15); box-shadow: 0 0 0 10px rgba(10,132,255,.35); } 100% { transform: scale(1); box-shadow: 0 0 0 16px rgba(10,132,255,0); } }
.seg .seg-speech.stop.pop { animation-name: speechPopStop; }
@keyframes speechPopStop { 0% { transform: scale(.78); box-shadow: 0 0 0 0 rgba(220,38,38,.6); } 35% { transform: scale(1.15); box-shadow: 0 0 0 10px rgba(220,38,38,.35); } 100% { transform: scale(1); box-shadow: 0 0 0 16px rgba(220,38,38,0); } }
@media (prefers-reduced-motion: reduce) { .seg .seg-speech.pop { animation: none; } }

/* Level of the sound being recognised, behind the timecode at 50%; sound check; wrong-source banner. */
.clock .tc-wrap { position: relative; }
.clock .tc-wrap > #tcLvl { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 10px; background: #30d158; opacity: .5; transition: width .08s linear; pointer-events: none; }
.clock .tc-wrap > .tc { position: relative; }
button.mic-badge { cursor: pointer; max-width: 100%; padding: 2px 6px; }
.mic-wrong { background: #ff3b30; color: #fff; font-weight: 800; font-size: 14px; border-radius: 12px; padding: 10px; margin: 6px 0 2px; }
.snd-chk { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; font-size: 12px; margin-top: 4px; }
.snd-chk i { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.snd-chk small { color: var(--dim); flex-basis: 100%; }
/* Recorder Assistant (recorder.js) */
.rec-dot { width: 18px; height: 18px; border-radius: 50%; background: var(--dim); opacity: .35; flex: none; }
.rec-dot.on { background: #ef4444; opacity: 1; box-shadow: 0 0 12px #ef4444; animation: recpulse 1s ease-in-out infinite alternate; }
@keyframes recpulse { to { opacity: .55; } }
.rec-tc { font: 600 34px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 1px; font-variant-numeric: tabular-nums; }

/* Recorder: Wingman-style vertical meters */
.rec-vm { display: flex; align-items: flex-end; gap: 6px; padding: 14px 12px 10px; }
.vm-scale { position: relative; width: 22px; height: 260px; margin-bottom: 36px; font: 9px ui-monospace, monospace; color: var(--dim); }
.vm-scale span { position: absolute; right: 0; transform: translateY(-50%); }
.vm-col { flex: 1; max-width: 44px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.vm-col.mix { max-width: 36px; }
.vm-col:not(.mix) + .vm-col.mix { margin-left: 8px; }
.vm-clip { width: 6px; height: 6px; border-radius: 50%; background: var(--glass-hi); }
.vm-clip.on { background: #ef4444; }
.vm-bar { position: relative; width: 100%; height: 260px; border-radius: 3px; background: var(--glass-hi); overflow: hidden; }
.vm-fill { position: absolute; inset: 0; background: linear-gradient(to top, #22c55e 0%, #22c55e 70%, #facc15 85%, #ef4444 100%); clip-path: inset(100% 0 0 0); transition: clip-path .08s linear; }
.vm-peak { position: absolute; left: 0; right: 0; height: 2px; background: currentColor; }
.vm-n { font-size: 11px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vm-db { font: 9px ui-monospace, monospace; color: var(--dim); }
.rec-vm { background: #000; border: 2px solid rgba(255,255,255,.3); color: #fff; min-height: 330px; }
.rec-vm .vm-bar { background: rgba(255,255,255,.12); }

/* first-launch diagnostics consent (non-blocking) */
.diag-consent{position:fixed;left:16px;right:16px;bottom:calc(16px + env(safe-area-inset-bottom));z-index:9999;max-width:520px;margin:0 auto;padding:16px;border-radius:18px;background:rgba(28,28,30,.96);color:#fff;box-shadow:0 10px 40px rgba(0,0,0,.5)}
.diag-consent b{display:block;font-size:17px;margin-bottom:6px}
.diag-consent p{margin:0 0 12px;font-size:14px;line-height:1.4;opacity:.85}
.diag-consent-btns{display:flex;gap:10px}
.diag-consent-btns button{flex:1;min-height:44px;font-size:16px}
/* 20.11 user: on a computer the app fills the whole window (the script on a big screen); phones unchanged. */
@media (min-width: 900px) { #app { max-width: none; padding-left: 32px; padding-right: 32px; } }
