/*
 * House of Marketers app look, copied from Scout's mock-up (valerisem/scout
 * design/mockup) and the Agreements app (Adminhom/agreements frontend), which
 * both take their basics from the Ollie CRM (Twenty design tokens): Inter at
 * 13px, soft neutral greys, the HoM fuchsia accent, hairline borders, compact controls.
 */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");

:root {
	--font: #333333; --font-2: #666666; --font-3: #999999; --font-light: #b3b3b3;
	--bg: #ffffff; --bg-2: #fcfcfc; --bg-3: #f1f1f1; --bg-4: #ebebeb;
	--hover: rgba(0, 0, 0, .04); --hover-strong: rgba(0, 0, 0, 0.078); --border: #ebebeb; --border-light: #f1f1f1; --border-strong: #d6d6d6;
	--brand-fuchsia: #fe489c; --brand-navy: #270f95; --brand-purple: #8e2a90; --brand-coral: #f28a63;
	--accent: #dc3486; --accent-hover: #c02c72; --accent-bg: #fdebf4; --accent-border: #f5a9cc; --danger: #d4544f;
	--shadow: 0 2px 4px rgba(0, 0, 0, .04), 0 0 4px rgba(0, 0, 0, .08);
	--shadow-strong: 2px 4px 16px rgba(0, 0, 0, .12), 0 2px 4px rgba(0, 0, 0, .04);
	--gray-bg: #f1f1f1; --gray: #666666; --green-bg: #e9f6ec; --green: #308052; --turquoise-bg: #e4f8f3; --turquoise: #147f6e;
	--sky-bg: #e5f6fc; --sky: #31729a; --blue-bg: #eef2fd; --blue: #415ac1; --purple-bg: #f6eefc; --purple: #7948af;
	--pink-bg: #fae9f5; --pink: #b23887; --orange-bg: #fcefd9; --orange: #c25700; --yellow-bg: #fef9c3; --yellow: #997000;
	--red-bg: #fbecec; --red: #be3b38;
	color-scheme: light;
}

* { box-sizing: border-box; }
html { font-size: 13px; -webkit-font-smoothing: antialiased; }
html, body { height: 100%; margin: 0; background: var(--bg-2); }
body { font-family: Inter, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--font); line-height: 1.4; }
a { color: inherit; text-decoration: none; }
input[type=range] { accent-color: var(--accent); min-width: 0; }
.t-field-value-num { width: 36px; text-align: right; flex-shrink: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
.muted { color: var(--font-3); } .num { font-variant-numeric: tabular-nums; } .grow { flex: 1; }
.icon { width: 16px; height: 16px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon.sm { width: 14px; height: 14px; }

/* Buttons */
.t-btn { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; border-radius: 4px; border: 1px solid var(--border); background: var(--bg); color: var(--font-2); font-weight: 500; white-space: nowrap; cursor: pointer; }
.t-btn:hover { background: var(--hover); }
.t-btn.big { height: 32px; padding: 0 12px; }
.t-btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.t-btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.t-btn.tertiary { border-color: transparent; background: transparent; }
.t-btn.danger { color: var(--danger); }
.t-btn.icon-only { width: 24px; padding: 0; justify-content: center; }
.t-btn:disabled { opacity: .5; cursor: default; }
.t-segmented { display: inline-flex; background: var(--bg-3); border-radius: 4px; padding: 2px; gap: 2px; }
.t-segmented button { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 8px; border-radius: 3px; color: var(--font-3); font-weight: 500; border: 0; background: transparent; cursor: pointer; }
.t-segmented button.active { background: var(--bg); color: var(--font); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }

/* Tags */
.t-tag { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 8px; border-radius: 4px; white-space: nowrap; }
.c-gray { background: var(--gray-bg); color: var(--gray); } .c-green { background: var(--green-bg); color: var(--green); }
.c-turquoise { background: var(--turquoise-bg); color: var(--turquoise); } .c-sky { background: var(--sky-bg); color: var(--sky); }
.c-blue { background: var(--blue-bg); color: var(--blue); } .c-purple { background: var(--purple-bg); color: var(--purple); }
.c-pink { background: var(--pink-bg); color: var(--pink); } .c-orange { background: var(--orange-bg); color: var(--orange); }
.c-yellow { background: var(--yellow-bg); color: var(--yellow); } .c-red { background: var(--red-bg); color: var(--red); }
.t-avatar { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; font-size: 10px; font-weight: 600; color: #fff; background: var(--brand-navy); flex-shrink: 0; }
.nav-badge { margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bg-4); color: var(--font-2); font-size: 11px; font-weight: 600; line-height: 18px; text-align: center; }
.nav-badge.accent { background: var(--accent-bg); color: var(--accent); }

/* Shell */
.shell { display: flex; height: 100vh; overflow: hidden; background: var(--bg-2); }
.sidebar { width: 220px; flex-shrink: 0; display: flex; flex-direction: column; gap: 4px; padding: 12px 8px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px; font-weight: 600; font-size: 17px; letter-spacing: -.01em; }
.brand-logo { display: block; flex: none; object-fit: contain; }
.brand-mark { width: 28px; height: 28px; border-radius: 8px; background: linear-gradient(135deg, var(--brand-fuchsia), var(--brand-purple) 55%, var(--brand-navy)); display: inline-flex; align-items: center; justify-content: center; color: #fff; }
.gs-button { display: flex; align-items: center; gap: 8px; margin: 4px 8px 8px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--font-3); }
.gs-button input { border: 0; outline: 0; background: transparent; flex: 1; min-width: 0; }
.nav-head { padding: 12px 8px 4px; color: var(--font-3); font-weight: 500; font-size: 11px; }
.nav-item { display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 8px; border-radius: 4px; color: var(--font-2); font-weight: 500; cursor: pointer; }
.nav-item:hover { background: var(--hover); }
.nav-item .icon { color: var(--font-3); }
.nav-item.active { background: var(--accent-bg); color: var(--accent); }
.nav-item.active .icon { color: var(--accent); }
.nav-user { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 8px; margin-top: auto; font-weight: 500; }
.nav-user small { display: block; color: var(--font-3); font-weight: 400; font-size: 11px; }
.nav-user[role="button"] { cursor: pointer; border-radius: 6px; }
.nav-user[role="button"]:hover { background: var(--hover); }
.nav-user[role="button"]:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg); border-left: 1px solid var(--border); overflow: hidden; }

.t-topbar { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 8px 24px; border-bottom: 1px solid var(--border); }
.t-topbar .title { font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 8px; }
.t-topbar .crumb { color: var(--font-3); font-weight: 500; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.tabs { display: flex; gap: 2px; align-items: center; padding: 0 24px; border-bottom: 1px solid var(--border); min-height: 40px; }
.tab { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 8px; color: var(--font-3); font-weight: 500; border-bottom: 1px solid transparent; margin-bottom: -1px; cursor: pointer; }
.tab.active { color: var(--font); border-bottom-color: var(--font); }
.table-tools { display: flex; align-items: center; gap: 8px; padding: 8px 24px; border-bottom: 1px solid var(--border); }
.filter-pick { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 10px; border: 1px solid var(--border); border-radius: 13px; background: var(--bg); cursor: pointer; }
.filter-pick.on { border-color: var(--accent-border); background: var(--accent-bg); }
.content { flex: 1; min-height: 0; overflow: auto; }

/* Tables */
.t-table { border-collapse: collapse; width: 100%; }
.t-table th { height: 32px; padding: 0 8px; text-align: left; font-weight: 500; color: var(--font-3); white-space: nowrap; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border-light); background: var(--bg); position: sticky; top: 0; z-index: 2; }
.t-table td { height: 44px; padding: 0 8px; border-bottom: 1px solid var(--border-light); border-right: 1px solid var(--border-light); white-space: nowrap; }
.t-table th:last-child, .t-table td:last-child { border-right: 0; }
.t-table th:first-child, .t-table td:first-child { padding-left: 24px; }
.t-table tbody tr { cursor: pointer; }
.t-table tbody tr:hover td { background: var(--hover); }
.thumb { width: 64px; height: 36px; border-radius: 4px; object-fit: cover; background: var(--bg-3); vertical-align: middle; border: 1px solid var(--border); }
.video-name { display: inline-flex; align-items: center; gap: 10px; font-weight: 500; }

/* Cards, fields */
.t-card { border: 1px solid var(--border); border-radius: 8px; background: var(--bg); overflow: hidden; }
.card-box { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--bg); }
.card-box > h3 { margin: 0; padding: 0 12px; height: 40px; display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; border-bottom: 1px solid var(--border); }
.card-body { padding: 12px; }
.t-field { display: flex; align-items: center; gap: 12px; min-height: 34px; }
.t-field-label { width: 130px; flex-shrink: 0; color: var(--font-3); display: flex; align-items: center; gap: 8px; }
.t-input { height: 28px; padding: 0 8px; border: 1px solid var(--border); border-radius: 4px; background: var(--bg); outline: none; }
.t-input:focus { border-color: var(--accent-border); box-shadow: 0 0 0 3px var(--accent-bg); }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.kpi { border: 1px solid var(--border); border-radius: 8px; padding: 12px; }
.kpi .label { color: var(--font-3); font-weight: 500; }
.kpi .value { font-size: 20px; font-weight: 600; margin-top: 6px; }

/* Video page */
.video-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; padding: 16px 24px; }
.player { position: relative; background: #111; border-radius: 8px; overflow: hidden; aspect-ratio: 16 / 9; }
.player video { width: 100%; height: 100%; display: block; background: #111; }
.chapter-bar { display: flex; gap: 2px; height: 4px; margin-top: 8px; }
.chapter-bar span { background: var(--bg-4); border-radius: 2px; }
.chapter-bar span.active { background: var(--accent); }
.list-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--border-light); cursor: pointer; }
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: var(--hover); }
.list-row.active { background: var(--accent-bg); }
.list-row.active .time { color: var(--accent); }
.time { font-variant-numeric: tabular-nums; color: var(--font-3); font-weight: 500; min-width: 40px; }
.summary { line-height: 1.6; color: var(--font-2); white-space: pre-wrap; }
.transcript-seg { display: flex; gap: 12px; padding: 6px 12px; border-radius: 4px; cursor: pointer; line-height: 1.55; }
.transcript-seg:hover { background: var(--hover); }
.transcript-seg.active { background: var(--accent-bg); }
.note { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.note-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }

/* Editor */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; padding: 16px 24px; }
.preview-frame { position: relative; overflow: hidden; border-radius: 8px; background: #111; aspect-ratio: 16 / 9; }
.preview-frame video { width: 100%; height: 100%; display: block; transform-origin: 50% 50%; transition: transform .25s ease-out; }
.preview-cursor { position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; background: rgba(255, 212, 0, .4); pointer-events: none; display: none; }
.timeline { margin-top: 12px; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; background: var(--bg); user-select: none; }
.track-label { color: var(--font-3); font-weight: 500; font-size: 11px; margin: 6px 0 4px; display: flex; align-items: center; gap: 6px; }
.track { position: relative; height: 28px; border-radius: 4px; background: repeating-linear-gradient(45deg, var(--bg-3), var(--bg-3) 6px, var(--bg-4) 6px, var(--bg-4) 12px); cursor: pointer; }
.track.zoom-track, .track.click-track { background: var(--bg-2); border: 1px solid var(--border-light); height: 22px; }
.keep { position: absolute; top: 0; bottom: 0; background: var(--accent-bg); border: 1px solid var(--accent-border); border-radius: 4px; }
.zoomseg { position: absolute; top: 2px; bottom: 2px; background: var(--purple-bg); border: 1px solid color-mix(in srgb, var(--purple) 45%, transparent); border-radius: 3px; color: var(--purple); font-size: 10px; font-weight: 600; padding: 0 4px; overflow: hidden; white-space: nowrap; line-height: 16px; }
.zoomseg.sel { background: var(--purple); color: #fff; }
.click-dot { position: absolute; top: 6px; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; background: var(--brand-coral); }
.mark-in { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--blue); }
.mark-region { position: absolute; top: 0; bottom: 0; background: rgba(65, 90, 193, .18); border: 1px dashed var(--blue); }
.playhead { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--font); pointer-events: none; }
.ruler { display: flex; justify-content: space-between; color: var(--font-light); font-size: 10px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.toolbar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.panel-group { padding: 14px 0 6px; color: var(--font-3); font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.switch { position: relative; width: 28px; height: 16px; border-radius: 8px; background: var(--bg-4); border: 0; cursor: pointer; flex-shrink: 0; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: left .15s; }
.switch.on { background: var(--accent); }
.switch.on::after { left: 14px; }
.progress { height: 6px; border-radius: 3px; background: var(--bg-3); overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); transition: width .3s; }

/* Recorder */
.recorder { max-width: 760px; margin: 24px auto; padding: 0 24px; display: flex; flex-direction: column; gap: 16px; }
.rec-preview { aspect-ratio: 16 / 9; background: #111; border-radius: 8px; overflow: hidden; display: flex; align-items: center; justify-content: center; color: var(--font-light); position: relative; }
.rec-preview video { width: 100%; height: 100%; object-fit: contain; }
.rec-live { position: absolute; top: 12px; left: 12px; display: inline-flex; align-items: center; gap: 6px; background: rgba(0, 0, 0, .65); color: #fff; border-radius: 12px; padding: 3px 10px; font-weight: 600; font-variant-numeric: tabular-nums; }
.rec-dot { width: 8px; height: 8px; border-radius: 50%; background: #ff3b5c; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .3; } }
.meter { flex: 1; height: 6px; border-radius: 3px; background: var(--bg-3); overflow: hidden; }
.meter > div { height: 100%; width: 0; background: var(--green); transition: width .08s; }
.option-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--border-light); }
.option-row:last-child { border-bottom: 0; }
.callout { display: flex; gap: 10px; padding: 10px 12px; border-radius: 8px; background: var(--blue-bg); color: var(--blue); line-height: 1.5; }

/* Login, dialogs, toasts */
/* Sign-in and "no access": the office, blurred, behind the card (the same in every House of Marketers app). */
.login, .no-access { position: relative; height: 100vh; display: flex; align-items: center; justify-content: center; overflow: hidden; background: #2a1830; }
.login::before, .no-access::before { content: ""; position: absolute; inset: -40px; background: url("/assets/brand/office-front.jpg") center / cover no-repeat; filter: blur(18px) brightness(0.7); }
.login-card { position: relative; width: 340px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); padding: 28px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35); display: flex; flex-direction: column; gap: 12px; }
.no-access { height: auto; min-height: 100vh; min-height: 100dvh; box-sizing: border-box; padding: 24px 16px; }
/* Liquid glass, like the sign-in box. */
.no-access-card { position: relative; max-width: 440px; width: 100%; box-sizing: border-box; padding: 32px 28px; border-radius: 28px; color: #fff; text-align: center; background: linear-gradient(160deg, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0.08) 45%, rgba(255, 255, 255, 0.14)); -webkit-backdrop-filter: blur(26px) saturate(180%); backdrop-filter: blur(26px) saturate(180%); border: 1px solid rgba(255, 255, 255, 0.38); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65), inset 0 0 30px rgba(255, 255, 255, 0.08), 0 30px 80px rgba(20, 0, 30, 0.45); }
.no-access-card h1 { margin: 0 0 10px; font-size: 1.4rem; font-weight: 600; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); }
.no-access-card p { margin: 0 0 6px; color: rgba(255, 255, 255, 0.85); }
.no-access-card a { font-weight: 600; color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.no-access-apps { position: absolute; z-index: 1; top: calc(16px + env(safe-area-inset-top)); right: calc(16px + env(safe-area-inset-right)); }
.no-access-apps .apps-btn { width: 44px; height: 44px; margin: 0; border-radius: 14px; color: #fff; background: rgba(255, 255, 255, 0.18); -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%); border: 1px solid rgba(255, 255, 255, 0.38); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 8px 24px rgba(0, 0, 0, 0.3); }
.no-access-apps .apps-btn:hover, .no-access-apps .apps-btn.open { background: rgba(255, 255, 255, 0.3); }
.empty { padding: 48px 24px; text-align: center; color: var(--font-3); }
.toast { position: fixed; bottom: 20px; right: 20px; background: var(--font); color: #fff; padding: 8px 14px; border-radius: 6px; box-shadow: var(--shadow-strong); z-index: 50; }
.dialog-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .25); display: flex; align-items: center; justify-content: center; z-index: 40; }
.dialog { width: 420px; background: var(--bg); border-radius: 8px; box-shadow: var(--shadow-strong); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.dialog h3 { margin: 0; font-size: 14px; }
.annseg { position: absolute; top: 2px; bottom: 2px; border-radius: 3px; font-size: 10px; font-weight: 600; padding: 0 4px; overflow: hidden; white-space: nowrap; line-height: 16px; cursor: pointer;
	background: color-mix(in srgb, var(--c) 14%, var(--bg)); border: 1px solid color-mix(in srgb, var(--c) 45%, var(--bg)); color: color-mix(in srgb, var(--c) 85%, var(--font)); }
.annseg.sel { background: var(--c); color: #fff; }
#panel .t-field { flex-wrap: wrap; gap: 8px; }
#panel .t-field-label { width: 92px; }
#panel .t-field > .grow { min-width: 120px; }

/* Step-by-step guide (video on top, steps below) */
.guide { margin-top: 20px; }
.guide-head { display: flex; align-items: center; gap: 8px; padding: 0 0 10px; border-bottom: 1px solid var(--border); }
.guide-head .title { font-weight: 600; font-size: 15px; display: inline-flex; align-items: center; gap: 8px; }
.guide-empty { padding: 28px 0; text-align: center; color: var(--font-3); }
.guide-step { padding: 18px 0 20px; border-bottom: 1px solid var(--border-light); }
.guide-step-head { display: flex; align-items: center; gap: 12px; }
.step-num { width: 26px; height: 26px; flex-shrink: 0; border-radius: 50%; border: 1px solid var(--border-strong); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 12px; color: var(--font); background: var(--bg); }
.step-title { font-size: 14px; font-weight: 500; outline: none; border-radius: 4px; padding: 2px 4px; margin-left: -4px; }
.step-title[contenteditable]:hover, .step-desc[contenteditable]:hover { background: var(--hover); }
.step-title[contenteditable]:focus, .step-desc[contenteditable]:focus { background: var(--bg); box-shadow: 0 0 0 2px var(--accent-border); }
.step-time { color: var(--font-3); }
.step-desc { margin: 6px 0 0 38px; color: var(--font-2); line-height: 1.5; outline: none; border-radius: 4px; padding: 2px 4px; min-height: 1em; }
.step-desc:empty::before { content: attr(data-placeholder); color: var(--font-light); }
.step-img { display: block; margin: 12px 0 0 38px; width: calc(100% - 38px); max-width: 860px; border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); }

/* Collapsible sidebar (as in Scout) */
.sidebar { transition: width .15s ease; overflow: hidden; }
.nav-item.fold { color: var(--font-3); }
.shell.collapsed .sidebar { width: 52px; padding: 12px 6px; }
.shell.collapsed .label, .shell.collapsed .nav-head, .shell.collapsed .gs-button input { display: none; }
.shell.collapsed .brand { padding: 4px 6px; }
.shell.collapsed .gs-button { margin: 4px 0 8px; justify-content: center; cursor: pointer; padding: 6px 0; }
.shell.collapsed .nav-item { justify-content: center; padding: 0; }
.shell.collapsed .nav-user { justify-content: center; padding: 0; }

/* Chapter editor */
.ch-row { display: flex; align-items: center; gap: 4px; }
.ch-time { width: 60px; text-align: center; }
.chapter-bar span.active { background: var(--accent); }

/* ================= Millo UX overhaul (2026-11-07) ================= */

/* Dark mode: Twenty / Ollie dark palette, same pink accent. */
/* Dark mode: exactly the House of Marketers Admin Hub / Ollie dark palette (hub.css, oli.css tokens).
   Light unless Dark was picked with the sun/moon button; the choice is kept in localStorage "millo_theme". */
:root[data-theme="dark"] {
	color-scheme: dark;
	--font: #ebebeb; --font-2: #b3b3b3; --font-3: #818181; --font-light: #666666;
	--bg: #171717; --bg-2: #1b1b1b; --bg-3: #222222; --bg-4: #292929;
	--hover: rgba(255, 255, 255, 0.06); --hover-strong: rgba(255, 255, 255, 0.1);
	--border: #292929; --border-light: #222222; --border-strong: #333333;
	--accent: #ff6aae; --accent-hover: #c02c72; --accent-bg: #3a1529; --accent-border: #7a2f57;
	--gray-bg: #262626; --gray: #b3b3b3; --green-bg: #17291d; --green: #6cc48d;
	--blue-bg: #1b2140; --blue: #9eb1ff; --purple-bg: #261c33; --purple: #c9a4f0;
	--pink-bg: #2d1828; --pink: #f19cd0; --orange-bg: #2d1f12; --orange: #ffa057;
	--red-bg: #2f1716; --red: #ff8f8a;
	/* Not in the hub: Millo-only tag colours, in the same dark style. */
	--turquoise-bg: #12302b; --turquoise: #5cd1bd; --sky-bg: #142b38; --sky: #79b8de; --yellow-bg: #332b0d; --yellow: #e5c454;
}
/* As in the hub: the primary button keeps the light fuchsia (the dark --accent is for text and icons). */
:root[data-theme="dark"] .t-btn.primary { background: #dc3486; border-color: #dc3486; }
:root[data-theme="dark"] .t-btn.primary:hover { background: #c02c72; border-color: #c02c72; }
:root { --toast-bg: #333333; --toast-fg: #ffffff; --tlabel: 104px; }
.toast { background: var(--toast-bg); color: var(--toast-fg); }
.step-img { background: #fff; }

/* Sidebar additions */
#nav-folders { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; min-height: 0; flex-shrink: 1; }
.sidebar > .grow { flex: 1; min-height: 8px; }
.nav-user { margin-top: 0; }
.nav-item.drop-on { background: var(--accent-bg); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent-border); }

/* Click-to-rename */
.editable { cursor: text; border-radius: 4px; padding: 2px 4px; margin: -2px -4px; outline: none; }
.editable:hover { background: var(--hover); box-shadow: inset 0 0 0 1px var(--border); }
.editable.editing { background: var(--bg); box-shadow: 0 0 0 2px var(--accent-border); cursor: text; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.row { display: inline-flex; align-items: center; gap: 6px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.gap { gap: 8px; }
.small { font-size: 11px; }
.w70 { width: 70px; }
.t-btn.danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.t-btn.danger-solid:hover { filter: brightness(.95); }

/* Popover menu */
.menu { position: fixed; z-index: 60; min-width: 200px; max-height: 70vh; overflow-y: auto; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow-strong); padding: 4px; display: flex; flex-direction: column; }
.menu-item { display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 8px; border: 0; border-radius: 4px; background: transparent; color: var(--font-2); font-weight: 500; text-align: left; cursor: pointer; }
.menu-item:hover, .menu-item:focus-visible { background: var(--hover); color: var(--font); outline: none; }
.menu-item.on { color: var(--font); }
.menu-item.danger { color: var(--danger); }
.menu-ic { width: 14px; flex-shrink: 0; }
.menu-sep { height: 1px; background: var(--border); margin: 4px 0; }
.menu-head { padding: 6px 8px 2px; color: var(--font-3); font-size: 11px; font-weight: 500; }

/* Library toolbar & filters */
.table-tools { flex-wrap: wrap; }
.filter-pick { color: var(--font-2); font-weight: 500; }
.filter-pick:hover { background: var(--hover); }
.filter-pick b { color: var(--font); font-weight: 600; }
.search-in { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 8px; border: 1px solid var(--border); border-radius: 13px; color: var(--font-3); background: var(--bg); }
.search-in input { border: 0; outline: 0; background: transparent; width: 170px; color: var(--font); }
.thumb.ph { display: inline-flex; align-items: center; justify-content: center; color: var(--font-light); }
.video-name .ellipsis { max-width: 340px; }
.t-table tr.dragging td { opacity: .45; }
.t-table tbody tr[draggable="true"] { cursor: pointer; }
.empty-big { margin: 48px auto; max-width: 460px; padding: 32px; border: 2px dashed var(--border-strong); border-radius: 12px; text-align: center; color: var(--font-2); display: flex; flex-direction: column; gap: 6px; align-items: center; }
.empty-big > .icon { width: 28px; height: 28px; color: var(--accent); }
.dropzone-host { position: relative; }
.dropzone-host.file-over::after { content: "Drop to upload"; position: absolute; inset: 8px; border: 2px dashed var(--accent); border-radius: 12px; background: color-mix(in srgb, var(--accent-bg) 80%, transparent); display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 600; color: var(--accent); pointer-events: none; z-index: 5; }

/* Board (kanban by folder) */
.board { display: flex; gap: 12px; padding: 16px 24px; align-items: flex-start; min-height: 100%; overflow-x: auto; }
.board-col { width: 272px; flex-shrink: 0; background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; display: flex; flex-direction: column; max-height: 100%; }
.board-col.drop-on { border-color: var(--accent); background: var(--accent-bg); }
.board-head { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.board-title { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.board-cards { display: flex; flex-direction: column; gap: 8px; padding: 8px; overflow-y: auto; min-height: 60px; }
.deal-card { background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 8px; cursor: grab; display: flex; flex-direction: column; gap: 6px; box-shadow: 0 1px 2px rgba(0, 0, 0, .04); }
.deal-card:hover { border-color: var(--border-strong); }
.deal-card.dragging { opacity: .45; }
.card-thumb { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 4px; background: var(--bg-3); }
.deal-name { display: flex; align-items: center; gap: 6px; font-weight: 500; }
.deal-meta { display: flex; align-items: center; gap: 6px; }
.board-empty { padding: 18px 8px; text-align: center; color: var(--font-light); border: 1px dashed var(--border-strong); border-radius: 6px; }
.board-add { flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border: 1px dashed var(--border-strong); border-radius: 8px; background: transparent; color: var(--font-3); font-weight: 500; cursor: pointer; }
.board-add:hover { color: var(--accent); border-color: var(--accent); }

/* Upload panel */
.upload-panel { position: fixed; right: 20px; bottom: 64px; width: 320px; z-index: 55; display: flex; flex-direction: column; gap: 8px; }
.upload-row { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow-strong); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.upload-row.failed { border-color: var(--danger); }
.upload-row.failed [data-s] { color: var(--danger); }
.upload-row a { color: var(--accent); font-weight: 600; }
.progress > span { display: block; height: 100%; background: var(--accent); transition: width .3s; }

/* ---------- Editor ---------- */
.editor2 { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; padding: 16px 24px; }
.ed-main { min-width: 0; }
.stage { background: var(--bg-3); border-radius: 10px; padding: 12px; display: flex; justify-content: center; }
.ed-frame { width: 100%; max-height: 62vh; max-width: calc(62vh * 16 / 9); user-select: none; }
.zoom-layer { position: absolute; inset: 0; transition: transform .25s ease-out; will-change: transform; }
.zoom-layer video { width: 100%; height: 100%; display: block; transition: none; }
.fill-layer { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
#ann-layer { pointer-events: none; }
.handles { pointer-events: none; z-index: 3; touch-action: none; }
.handles .hdl:hover { filter: brightness(1.15); }
.tools { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-top: 12px; padding: 6px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); }
.tool { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 64px; height: 52px; padding: 0 8px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--font-2); font-size: 11px; font-weight: 600; cursor: pointer; }
.tool .icon { width: 20px; height: 20px; }
.tool:hover:not(:disabled) { background: var(--accent-bg); color: var(--accent); border-color: var(--accent-border); }
.tool.danger:not(:disabled) { color: var(--danger); }
.tool:disabled { opacity: .4; cursor: default; }
.tools-sep { width: 1px; align-self: stretch; background: var(--border); margin: 4px 4px; }
.clock { font-weight: 600; min-width: 56px; text-align: right; margin-left: 6px; }
.hint { margin: 10px 0 0; padding: 8px 12px; border-radius: 8px; background: var(--blue-bg); color: var(--blue); line-height: 1.5; min-height: 36px; }
.hint b { font-weight: 600; }
.timeline2 { position: relative; margin-top: 10px; border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px 10px; background: var(--bg); user-select: none; touch-action: none; }
.ruler2 { position: relative; height: 16px; margin-left: var(--tlabel); color: var(--font-light); font-size: 10px; font-variant-numeric: tabular-nums; }
.ruler2 span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.ruler2 span:first-child { transform: none; }
.ruler2 span:last-child { transform: translateX(-100%); }
.trow { display: flex; align-items: flex-start; margin-top: 6px; }
.tlabel { width: var(--tlabel); flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; height: 28px; color: var(--font-3); font-size: 11px; font-weight: 600; }
.ttrack { position: relative; flex: 1; min-width: 0; height: 28px; border-radius: 6px; background: var(--bg-2); border: 1px solid var(--border-light); cursor: pointer; }
.ttrack.clip { background: repeating-linear-gradient(45deg, var(--bg-3), var(--bg-3) 6px, var(--bg-4) 6px, var(--bg-4) 12px); cursor: crosshair; }
.ttrack.thin { height: 18px; }
.ttrack .keep { pointer-events: none; }
.ttrack .range { position: absolute; top: -2px; bottom: -2px; background: color-mix(in srgb, var(--danger) 22%, transparent); border: 2px solid var(--danger); border-radius: 4px; pointer-events: none; }
.seg { position: absolute; top: 2px; height: 22px; border-radius: 4px; font-size: 11px; font-weight: 600; padding: 0 10px; overflow: hidden; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; cursor: grab; }
.seg:active { cursor: grabbing; }
.seg .edge { position: absolute; top: 0; bottom: 0; width: 7px; cursor: ew-resize; }
.seg .edge.l { left: 0; } .seg .edge.r { right: 0; }
.seg .edge:hover, .seg.sel .edge { background: rgba(255, 255, 255, .35); }
.zoomseg2 { background: var(--purple-bg); border: 1px solid color-mix(in srgb, var(--purple) 45%, transparent); color: var(--purple); }
.zoomseg2.sel { background: var(--purple); color: #fff; box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--purple); }
.zoomseg2.off { opacity: .45; }
.annseg2 { background: color-mix(in srgb, var(--c) 16%, var(--bg)); border: 1px solid color-mix(in srgb, var(--c) 55%, var(--bg)); color: var(--font); }
.annseg2.sel { background: var(--c); color: #fff; box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--c); }
.annseg2 .icon { color: var(--c); }
.annseg2.sel .icon { color: #fff; }
.click-dot.marker { background: var(--blue); }
.tplayhead { position: absolute; top: 4px; bottom: 4px; width: 2px; margin-left: -1px; background: var(--accent); pointer-events: none; z-index: 4; }
.tplayhead::before { content: ""; position: absolute; top: 0; left: -4px; width: 10px; height: 10px; border-radius: 2px; background: var(--accent); }
.ed-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.fld { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.fld > span:first-child { color: var(--font-3); font-weight: 500; font-size: 11px; }
.fld.row-between { flex-direction: row; align-items: center; }
.fld.row-between > span:first-child { font-size: 13px; color: var(--font-2); }
.fld .t-input { width: 100%; }
.fld .row .t-input { width: 70px; }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.swatch { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--bg); box-shadow: 0 0 0 1px var(--border-strong); cursor: pointer; padding: 0; }
.swatch.on { box-shadow: 0 0 0 2px var(--accent); }
.t-segmented.wrap { flex-wrap: wrap; }
.color-in { width: 26px; height: 20px; border: 0; padding: 0; background: transparent; cursor: pointer; }

@media (max-width: 1100px) {
	.editor2 { grid-template-columns: 1fr; }
	.video-layout { grid-template-columns: 1fr; }
}

/* Guide steps: text on the left, pictures (screenshots / GIFs, with drawings) on the right */
.step-body { margin: 8px 0 0 38px; }
.step-body.has-media { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(0, 1.7fr); gap: 20px; align-items: start; }
.step-body .step-desc { margin: 0; }
.step-media-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.step-media { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.media-wrap { position: relative; width: 100%; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; box-shadow: var(--shadow); background: #fff; }
.media-wrap img { display: block; width: 100%; height: 100%; object-fit: fill; }
.media-ann { pointer-events: none; }
.media-kind { position: absolute; top: 8px; left: 8px; padding: 1px 6px; border-radius: 4px; background: rgba(17, 17, 17, .75); color: #fff; font-size: 10px; font-weight: 700; letter-spacing: .04em; }
.media-actions { display: flex; align-items: center; gap: 6px; }
.add-media { align-self: flex-start; height: 32px; border-style: dashed; color: var(--font-3); }
.add-media:hover { color: var(--accent); border-color: var(--accent); }
@media (max-width: 900px) { .step-body.has-media { grid-template-columns: 1fr; } }

/* Picture drawing editor */
.img-ed-backdrop { z-index: 70; }
.img-ed { width: min(1200px, 96vw); max-height: 96vh; background: var(--bg); border-radius: 12px; box-shadow: var(--shadow-strong); display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; overflow: auto; }
.img-ed-top { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.img-ed-tools { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; padding: 6px; border: 1px solid var(--border); border-radius: 10px; }
.img-ed-stage { background: var(--bg-3); border-radius: 10px; padding: 12px; display: flex; justify-content: center; }
.img-ed-frame { position: relative; width: 100%; max-width: calc(64vh * var(--ar, 1.78)); max-height: 64vh; user-select: none; touch-action: none; }
.img-ed-frame img { display: block; width: 100%; height: 100%; object-fit: fill; border-radius: 6px; }
#ie-ann { pointer-events: none; }
#ie-handles { z-index: 2; }

/* "Our Systems": the 9-dot menu at the right end of the top bar (apps.js), matching Ollie, Agreements and Scout. */
.apps-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; margin-left: 4px; border: 0; border-radius: 6px; background: transparent; color: var(--font-2); cursor: pointer; flex: none; }
.apps-btn:hover, .apps-btn.open { background: var(--hover); color: var(--font); }
.t-topbar > .apps-btn { margin-left: auto; }
.t-topbar > .grow ~ .apps-btn { margin-left: 4px; }
.apps-pop { position: fixed; z-index: 1000; width: 300px; max-width: calc(100vw - 24px); padding: 8px 6px 10px; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-strong); }
.apps-head { font-weight: 600; font-size: 14px; padding: 2px 8px 10px; border-bottom: 1px solid var(--border); margin-bottom: 10px; }
.apps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.apps-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 4px; border-radius: 8px; color: var(--font); text-decoration: none; text-align: center; font-size: 12px; }
.apps-tile:hover { background: var(--hover); }
.apps-logo { display: flex; align-items: center; justify-content: center; width: 52px; height: 52px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); }
.apps-logo img { width: 34px; height: 34px; object-fit: contain; }
.apps-empty { grid-column: 1 / -1; padding: 8px; color: var(--font-3); font-size: 13px; }
.apps-tile.soon { cursor: default; }
.apps-tile.soon:hover { background: transparent; }
a.apps-tile.soon { cursor: pointer; }
a.apps-tile.soon:hover { background: var(--hover); }
.apps-tile.soon .apps-logo img { opacity: .55; filter: grayscale(.4); }
.apps-tile.soon .apps-name { color: var(--font-3); }
.apps-soon { margin-top: -3px; padding: 1px 6px; border-radius: 999px; background: var(--bg-3); color: var(--font-2); font-size: 10px; font-weight: 500; }

/* Guide step: number, title, note and controls on the left; pictures in a fuchsia frame on the right */
.step-body { margin: 0; }
.step-text { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.step-text .guide-step-head { align-items: flex-start; }
.step-text .step-title { font-weight: 600; line-height: 1.4; }
.step-text .step-desc { margin: 0 0 0 38px; }
.step-meta { display: flex; align-items: center; gap: 2px; margin-left: 32px; }
.step-body.has-media { grid-template-columns: minmax(220px, 1fr) minmax(0, 1.6fr); gap: 28px; }
.media-wrap { border: 3px solid #dc3486; border-radius: 12px; box-shadow: 0 4px 14px rgba(220, 52, 134, .18); }

/* ---------- Millo player controls (player.js): chapters on the timeline ---------- */
.player.has-pc { outline: none; }
.player.has-pc video { cursor: pointer; }
.pc { position: absolute; left: 0; right: 0; bottom: 0; padding: 28px 12px 6px; background: linear-gradient(transparent, rgba(0, 0, 0, .72)); color: #fff; opacity: 0; transition: opacity .2s; z-index: 2; }
.player.paused .pc, .player.awake .pc, .player:focus-within .pc { opacity: 1; }
.pc-track { position: relative; display: flex; gap: 3px; height: 16px; align-items: center; cursor: pointer; touch-action: none; }
.pc-seg { position: relative; height: 4px; background: rgba(255, 255, 255, .3); border-radius: 2px; overflow: hidden; transition: height .12s; min-width: 3px; }
.pc-track:hover .pc-seg { height: 6px; }
.pc-seg.hover { height: 9px !important; }
.pc-buf { position: absolute; inset: 0 auto 0 0; background: rgba(255, 255, 255, .35); }
.pc-fill { position: absolute; inset: 0 auto 0 0; background: #dc3486; }
.pc-tip { position: absolute; bottom: 44px; transform: translateX(-50%); background: rgba(17, 17, 17, .92); color: #fff; padding: 5px 9px; border-radius: 6px; font-size: 12px; white-space: nowrap; display: flex; flex-direction: column; align-items: center; gap: 1px; pointer-events: none; max-width: 260px; }
.pc-tip b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
.pc-tip span { opacity: .8; font-variant-numeric: tabular-nums; }
.pc-bar { display: flex; align-items: center; gap: 4px; height: 36px; }
.pc-btn { width: 34px; height: 34px; border: 0; border-radius: 6px; background: transparent; color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.pc-btn:hover { background: rgba(255, 255, 255, .15); }
.pc-btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pc-speed { width: auto; min-width: 34px; padding: 0 6px; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }

.pc-btn.on { color: #ff7ab8; }
.pc-vol { width: 70px; accent-color: #dc3486; }
.pc-time { font-size: 13px; font-variant-numeric: tabular-nums; margin-left: 6px; white-space: nowrap; }
.pc-chapter { font-size: 13px; font-weight: 600; margin-left: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.pc-grow { flex: 1; }
.pc-big { position: absolute; left: 50%; top: 50%; width: 68px; height: 68px; margin: -34px 0 0 -34px; border-radius: 50%; border: 0; background: rgba(220, 52, 134, .92); color: #fff; display: none; align-items: center; justify-content: center; cursor: pointer; z-index: 2; box-shadow: 0 6px 20px rgba(0, 0, 0, .3); }
.pc-big svg { width: 30px; height: 30px; margin-left: 4px; }
.player.paused .pc-big { display: inline-flex; }
.player:fullscreen { border-radius: 0; display: flex; align-items: center; background: #000; }
.player video::cue { font-size: 1.1em; }
.render-note { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; padding: 8px 12px; border-radius: 8px; background: var(--purple-bg); color: var(--purple); }
.render-note .muted { margin-left: auto; }
.render-note[hidden] { display: none; }

/* Right-hand panel beside the video: stays in view, cards fold away */
.side-col { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 16px; align-self: start; max-height: calc(100vh - 120px); overflow-y: auto; min-width: 0; }
.card-box.collapsible > h3 { cursor: pointer; user-select: none; }
.card-box.collapsible > h3::after { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--font-3); border-bottom: 2px solid var(--font-3); transform: rotate(45deg); margin: -3px 4px 0 6px; transition: transform .15s; flex: none; }
.card-box.collapsible.collapsed > h3::after { transform: rotate(-45deg); margin-top: 0; }
.card-box.collapsible.collapsed > :not(h3) { display: none; }
.card-box.collapsible.collapsed > h3 { border-bottom: 0; }
.steps-index { max-height: 320px; overflow-y: auto; }
.steps-index .list-row { gap: 8px; }
.step-num.sm { width: 20px; height: 20px; font-size: 11px; }
.side-transcript { max-height: 360px; overflow-y: auto; padding: 6px; }
.guide-step { scroll-margin-top: 16px; }
.guide-step.flash { animation: stepflash 1.6s ease-out; border-radius: 10px; }
@keyframes stepflash { 0%, 30% { background: var(--accent-bg); box-shadow: 0 0 0 6px var(--accent-bg); } 100% { background: transparent; box-shadow: 0 0 0 6px transparent; } }
@media (max-width: 1100px) { .side-col { position: static; max-height: none; } }
/* Cards in the side panel keep their full height; the panel scrolls instead of squashing them. */
.side-col > * { flex-shrink: 0; }
.side-col { scrollbar-width: thin; }

/* "Capture step" on the video */
.capture-btn { position: absolute; top: 12px; right: 12px; z-index: 3; display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border: 0; border-radius: 17px; background: rgba(17, 17, 17, .72); color: #fff; font-weight: 600; cursor: pointer; backdrop-filter: blur(4px); opacity: 0; transition: opacity .2s; }
.player.paused .capture-btn, .player.awake .capture-btn, .player:hover .capture-btn, .capture-btn.on { opacity: 1; }
.capture-btn:hover { background: rgba(17, 17, 17, .88); }
.capture-btn .rec { width: 10px; height: 10px; border-radius: 50%; background: #ff4d8d; box-shadow: 0 0 0 3px rgba(255, 77, 141, .3); }
.capture-btn.on { background: #dc3486; }
.capture-btn .stop { width: 10px; height: 10px; border-radius: 2px; background: #fff; animation: blink 1s infinite; }
.media-pending { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--font-3); background: var(--bg-3) !important; font-weight: 500; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border-strong); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
/* Reordering steps by drag-and-drop */
.step-grip { cursor: grab; color: var(--font-3); font-weight: 700; letter-spacing: -2px; padding: 4px 6px; border-radius: 4px; user-select: none; }
.step-grip:hover { background: var(--hover); color: var(--font); }
.guide-step.dragging { opacity: .4; }
.guide-step.drop-before { box-shadow: 0 -3px 0 0 var(--accent); }
.guide-step.drop-after { box-shadow: 0 3px 0 0 var(--accent); }
.steps-index .list-row.can-drag { cursor: grab; }
.steps-index .list-row.dragging { opacity: .4; }
.steps-index .list-row.drop-before { box-shadow: inset 0 3px 0 0 var(--accent); }
.steps-index .list-row.drop-after { box-shadow: inset 0 -3px 0 0 var(--accent); }
.step-grip.sm { padding: 0 2px; font-size: 12px; }
/* Subtitles sit above Millo's control bar, not under it */
.player.has-pc video::-webkit-media-text-track-container { transform: translateY(-58px); }
.player.has-pc video::cue { background: rgba(0, 0, 0, .72); }
/* Step numbers: fuchsia circle, white number (guide and Steps list) */
.step-num { background: #dc3486; border-color: #dc3486; color: #fff; }

/* "View as": a slim bar along the top of the page; fuchsia while using Millo as someone else. */
.view-as-bar { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; background: var(--bg-2); border-bottom: 1px solid var(--border); color: var(--font-2); }
.view-as-bar.active { background: var(--accent); border-bottom-color: var(--accent); color: #fff; }
html.has-view-as .shell { height: calc(100vh - 34px); height: calc(100dvh - 34px); }
.view-as-label { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; color: var(--font-3); white-space: nowrap; }
.view-as-bar.active .view-as-label { color: rgba(255, 255, 255, .85); }
.view-as-pick, .view-as-stop { display: inline-flex; align-items: center; gap: 6px; height: 24px; max-width: 260px; padding: 0 8px; border: 1px solid var(--border); border-radius: 4px; background: var(--bg); color: var(--font); font-weight: 500; white-space: nowrap; cursor: pointer; }
.view-as-pick:hover, .view-as-stop:hover { background: var(--hover); }
.view-as-pick .t-avatar { width: 18px; height: 18px; font-size: 9px; }
.view-as-bar.active .view-as-pick, .view-as-bar.active .view-as-stop { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .45); color: #fff; }
.view-as-bar.active .view-as-pick:hover, .view-as-bar.active .view-as-stop:hover { background: rgba(255, 255, 255, .28); }
.view-as-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.view-as-menu { width: 260px; }
.view-as-search { width: 100%; margin-bottom: 4px; flex: none; }
.view-as-list { display: flex; flex-direction: column; overflow-y: auto; }
.view-as-person { min-width: 0; }
@media (max-width: 760px) {
	.view-as-bar { padding-left: calc(12px + env(safe-area-inset-left)); padding-right: calc(12px + env(safe-area-inset-right)); }
}

/* Failed video: clear message, recovery actions, raw details folded away. */
.failed-box { border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); }
.failed-box h3 { color: var(--danger); }
.failed-box details summary { cursor: pointer; }
.failed-box .tech-detail { margin-top: 6px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; word-break: break-word; }
.login-notice { background: var(--accent-bg); border: 1px solid var(--accent-border); border-radius: 6px; padding: 8px 10px; font-size: 13px; }
#login-error:empty { display: none; }
#login-error { color: var(--danger); }

/* Visible keyboard focus everywhere (zero specificity: components can still restyle it). */
:where(button, a, summary, [role="link"], [role="tab"], [role="button"], [tabindex]):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
:where(.nav-item):focus-visible { outline-offset: -2px; }

/* Long names stay on one line: sidebar rows keep their height, the top bar keeps its buttons. */
.nav-item .label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item .icon, .nav-item svg { flex: none; }
.t-topbar .title { min-width: 0; flex: 0 1 auto; overflow: hidden; }
.t-topbar .title > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-topbar .title > span.editing { text-overflow: clip; }

/* Recorder */
.rec-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.danger-callout { background: color-mix(in srgb, var(--danger) 10%, var(--bg, #fff)); color: var(--font); border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent); }
.danger-callout > svg { color: var(--danger); }
[hidden] { display: none !important; }
.flip-x { display: inline-flex; transform: scaleX(-1); }
#p-emoji-note { margin: -2px 0 8px; }

/* ---------- Tablet and phone (quality review 2026-11-08) ---------- */
/* The top bar wraps rather than squeezing the page title to nothing or pushing buttons off screen. */
.t-topbar { flex-wrap: wrap; row-gap: 6px; }
.t-topbar .title { flex: 1 1 140px; }
.t-topbar .crumb + .muted + .title { flex-basis: 100px; }
@media (max-width: 900px) {
	/* The sidebar becomes the icon rail (same look as "Collapse"); names show as tooltips. */
	.sidebar { width: 52px; padding: 12px 6px; }
	.sidebar .label, .sidebar .nav-head, .sidebar .gs-button input, #sidebar-toggle { display: none; }
	.sidebar .brand { padding: 4px 6px; }
	.sidebar .gs-button { margin: 4px 0 8px; justify-content: center; padding: 6px 0; }
	.sidebar .nav-item, .sidebar .nav-user { justify-content: center; padding: 0; }
	.t-topbar, .tabs { padding-left: 12px; padding-right: 12px; }
	.tabs { overflow-x: auto; scrollbar-width: none; }
	.tabs .tab { flex: none; }
}
@media (max-width: 600px) {
	.t-topbar .t-btn.big { padding: 0 10px; }
	.t-topbar .crumb { display: none; }
	.t-topbar .crumb + .muted { display: none; }
	.option-row { flex-wrap: wrap; }
	.option-row > .grow { min-width: 0; flex: 1 1 160px; }
	.option-row .t-input.grow { flex: 1 1 100%; min-width: 0; }
	.table-tools { flex-wrap: wrap; }
	.table-tools .search-in { flex: 1 1 100%; }
	.rec-actions > .grow { display: none; }
}
@media (max-width: 1100px) { .video-layout { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 600px) {
	.pc-vol { display: none; }
	.step-body { margin-left: 0; }
	.guide-head { flex-wrap: wrap; row-gap: 6px; }
	.kpis { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
	.ruler2 span:nth-child(even) { display: none; }
}
@media (max-width: 900px) { .step-body.has-media { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 420px) { .ruler2 span { display: none; } .ruler2 span:first-child, .ruler2 span:last-child { display: inline; } }

/* ---------- Phones, tablets and the installed app (PWA) ---------- */
/* Height follows the visible screen (mobile browser bars come and go); notches and rounded corners are kept clear. */
.shell { height: 100vh; height: 100dvh; box-sizing: border-box; padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left); }
.login { height: auto; min-height: 100vh; min-height: 100dvh; box-sizing: border-box; padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)); }
.login-card { max-width: 100%; box-sizing: border-box; }
html.standalone, html.standalone body { overscroll-behavior: none; }
body.no-scroll { overflow: hidden; }
.tabbar, .m-back, .m-search { display: none; }
.dialog-actions { justify-content: flex-end; }
.dialog { max-width: calc(100vw - 32px); max-height: calc(100dvh - 32px); overflow: auto; box-sizing: border-box; }
.img-ed { max-height: 96dvh; }

/* Bottom sheet (phones): menus, "New" and "More". */
.sheet-backdrop { position: fixed; inset: 0; z-index: 70; background: rgba(0, 0, 0, .35); display: flex; align-items: flex-end; justify-content: center; animation: sheet-fade .15s ease-out; }
.sheet { width: 100%; max-width: 560px; max-height: 85vh; max-height: 85dvh; box-sizing: border-box; display: flex; flex-direction: column; background: var(--bg); border-radius: 14px 14px 0 0; box-shadow: var(--shadow-strong); padding: 6px 8px max(12px, env(safe-area-inset-bottom)); animation: sheet-up .2s ease-out; }
.sheet-grip { width: 36px; height: 4px; border-radius: 2px; background: var(--border-strong); margin: 4px auto 6px; flex: none; }
.sheet-body { overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; min-height: 0; }
.sheet-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--font); font: inherit; font-size: 15px; font-weight: 500; text-align: left; cursor: pointer; flex: none; }
.sheet-item .icon { color: var(--font-3); flex: none; }
.sheet-item:active, .sheet-item:focus-visible { background: var(--hover); outline: none; }
.sheet-item.active, .sheet-item.on { color: var(--accent); }
.sheet-item.active .icon, .sheet-item.on .icon { color: var(--accent); }
.sheet-item.danger, .sheet-item.danger .icon { color: var(--danger); }
.sheet-item > span:not(.grow) { min-width: 0; }
.sheet-head { padding: 12px 12px 4px; color: var(--font-3); font-size: 12px; font-weight: 500; }
.sheet-sep { height: 1px; background: var(--border); margin: 6px 4px; flex: none; }
.sheet-empty { padding: 8px 12px; }
.sheet-user { display: flex; align-items: center; gap: 10px; padding: 8px 12px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.sheet-user .t-avatar { width: 32px; height: 32px; font-size: 13px; }
.sheet-user b { display: block; }
@keyframes sheet-up { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
@keyframes sheet-fade { from { background: rgba(0, 0, 0, 0); } }
@media (prefers-reduced-motion: reduce) { .sheet, .sheet-backdrop { animation: none; } }

/* Touch screens: controls big enough for a finger; no zoom-in when a field gets focus (iOS zooms below 16px). */
@media (pointer: coarse) {
	input, select, textarea, [contenteditable="true"] { font-size: 16px; }
	.t-input { height: 40px; }
	.t-btn { min-height: 32px; }
	.t-btn.big { height: 40px; }
	.t-btn.icon-only { width: 36px; height: 36px; }
	.t-btn.big.icon-only, .t-topbar .t-btn.icon-only { width: 40px; height: 40px; }
	.menu-item { height: 44px; }
	.filter-pick { height: 34px; padding: 0 12px; border-radius: 17px; }
	.t-segmented button { height: 30px; padding: 0 10px; }
	.search-in { height: 36px; border-radius: 18px; }
	.tab { height: 44px; }
	.nav-item { height: 38px; }
	.pc-btn { width: 40px; height: 40px; }
	.pc-track { height: 28px; }
	.switch { transform: scale(1.15); }
	/* Hidden player controls do not catch taps: the first tap shows them. */
	.player:not(.paused):not(.awake):not(:focus-within) .pc { pointer-events: none; }
	/* Hover-only reveals stay visible on touch. */
	.capture-btn { opacity: 1; }
}

/* Phones (up to 720 px): bottom tab bar instead of the sidebar; single-column pages. */
@media (max-width: 720px) {
	.shell { flex-direction: column; padding-top: env(safe-area-inset-top); }
	.sidebar { display: none; }
	.main { flex: 1; min-height: 0; border-left: 0; }
	/* Floating glass bar; pages scroll underneath it. */
	.tabbar { display: flex; position: fixed; z-index: 45; left: max(10px, env(safe-area-inset-left)); right: max(10px, env(safe-area-inset-right)); bottom: max(10px, env(safe-area-inset-bottom)); max-width: 560px; margin: 0 auto; height: 60px; box-sizing: border-box; align-items: stretch; justify-content: space-around; padding: 0 6px; border-radius: 24px; background: color-mix(in srgb, var(--bg) 84%, transparent); -webkit-backdrop-filter: blur(22px) saturate(180%); backdrop-filter: blur(22px) saturate(180%); border: 1px solid color-mix(in srgb, var(--font) 10%, transparent); box-shadow: 0 10px 30px rgba(0, 0, 0, .16), inset 0 1px 0 rgba(255, 255, 255, .35); }
	.main .content { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
	body.kb-open .main .content { padding-bottom: 0; }
	body.kb-open .tabbar { display: none; }
	.tb-item { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 0; background: transparent; color: var(--font-3); font: inherit; font-size: 11px; font-weight: 500; cursor: pointer; padding: 0; -webkit-tap-highlight-color: transparent; }
	.tb-item .icon { width: 22px; height: 22px; }
	.tb-item span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
	.tb-item { border-radius: 16px; margin: 6px 0; }
	.tb-item.active { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
	.tb-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -4px; border-radius: 8px; }

	.t-topbar { padding: 6px 12px; min-height: 52px; gap: 6px; flex-wrap: nowrap; }
	.t-topbar .title { flex: 1 1 auto; min-width: 0; overflow: hidden; white-space: nowrap; }
	.t-topbar .title > span { overflow: hidden; text-overflow: ellipsis; }
	.t-topbar .title + .t-tag, .t-topbar .t-tag.c-purple { display: none; }
	.t-topbar .crumb, .t-topbar .crumb + .muted { display: none; }
	.t-topbar .grow { display: none; }
	.m-back { display: inline-flex; flex: none; margin-left: -6px; }
	/* Top-bar buttons become icons (their names stay as aria-labels); the main one keeps its words. */
	.t-topbar .t-btn.big:not(.primary) { font-size: 0; gap: 0; width: 40px; padding: 0; justify-content: center; flex: none; }
	.t-topbar .t-btn.big:not(.primary) .icon { width: 18px; height: 18px; }
	.t-topbar .t-btn.big.primary { flex: none; padding: 0 12px; }
	/* "New" in the tab bar replaces the library's Upload / New recording buttons. */
	.t-topbar #upload-btn, .t-topbar [data-go="#/record"] { display: none; }
	.t-topbar #redo { display: none; }
	.m-search { display: block; padding: 8px 12px; border-bottom: 1px solid var(--border); }
	.m-search .search-in { display: flex; height: 40px; border-radius: 20px; }
	.m-search .search-in input { width: 100%; flex: 1; min-width: 0; }

	.tabs { padding: 0 8px; }
	.table-tools { padding: 8px 12px; gap: 6px; }
	.table-tools .t-segmented { order: -2; }
	.table-tools #count { order: -1; margin-left: auto; }
	.table-tools .grow { display: none; }

	/* Library table as cards: picture, name and the essentials; the rest is on the video page. */
	.t-table, .t-table tbody { display: block; }
	.t-table thead { display: none; }
	.t-table tbody tr { display: grid; grid-template-columns: 106px max-content max-content minmax(0, 1fr) 40px; grid-template-areas: "name name name name menu" ". status len date menu"; align-items: center; column-gap: 8px; row-gap: 2px; padding: 10px 8px 10px 12px; border-bottom: 1px solid var(--border-light); }
	.t-table td { display: none; height: auto; padding: 0 !important; border: 0 !important; white-space: nowrap; background: transparent !important; }
	.t-table td.c-name { display: block; grid-area: name; min-width: 0; }
	.t-table td.c-name .video-name { display: flex; min-width: 0; font-size: 14px; }
	.t-table td.c-name .thumb { width: 96px; height: 54px; flex: none; }
	.t-table td.c-name .ellipsis { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
	.t-table td.c-status { display: block; grid-area: status; }
	.t-table td.c-len { display: block; grid-area: len; color: var(--font-3); }
	.t-table td.c-date { display: block; grid-area: date; }
	.t-table td.c-menu { display: flex; grid-area: menu; justify-content: flex-end; }
	.t-table tbody tr:active td { background: transparent; }
	.t-table tbody tr:active { background: var(--hover); }

	/* Board: one column at a time, swiped sideways. */
	.board { scroll-snap-type: x mandatory; padding: 12px; gap: 10px; }
	.board-col { scroll-snap-align: start; flex: 0 0 calc(100vw - 48px); width: calc(100vw - 48px); max-width: 360px; }

	.video-layout { padding: 12px; gap: 12px; }
	.toast { left: 12px; right: 12px; bottom: calc(82px + env(safe-area-inset-bottom)); text-align: center; }
	.upload-panel { left: 12px; right: 12px; width: auto; bottom: calc(82px + env(safe-area-inset-bottom)); }

	/* Dialogs rise from the bottom, full width; their buttons stay reachable above the home indicator. */
	.dialog-backdrop { align-items: flex-end; }
	.dialog { width: 100%; max-width: 100%; max-height: 90dvh; border-radius: 14px 14px 0 0; padding: 16px 16px max(16px, env(safe-area-inset-bottom)); }
	.dialog-actions > .t-btn { flex: 1; justify-content: center; }
	.img-ed-backdrop { align-items: stretch; }
	.img-ed { width: 100vw; max-height: none; height: 100dvh; border-radius: 0; padding: max(10px, env(safe-area-inset-top)) 12px max(10px, env(safe-area-inset-bottom)); }
	.img-ed-frame { max-height: 55dvh; max-width: calc(55dvh * var(--ar, 1.78)); }
	.empty-big { margin: 24px 12px; padding: 24px 16px; }
	.menu { max-width: calc(100vw - 16px); }
}
/* Phone held sideways: the bar stays clear of the notch and the home indicator. */
@supports not (background: color-mix(in srgb, red 50%, transparent)) {
	@media (max-width: 720px) { .tabbar { background: var(--bg); } }
}
/* "View as" bar on phones and in the installed app: it takes the status-bar area instead of the shell. */
html.has-view-as .view-as-bar { padding-top: env(safe-area-inset-top); padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
html.has-view-as .shell { padding-top: 0; height: calc(100vh - 34px - env(safe-area-inset-top)); height: calc(100dvh - 34px - env(safe-area-inset-top)); }
@media (max-width: 720px) {
	.view-as-label { display: none; }
	.view-as-pick { min-width: 0; flex: 0 1 auto; overflow: hidden; }
	.view-as-pick, .view-as-stop { height: 28px; }
}

/* "Millo is thinking…": the loading text, with a light sweeping across it. */
:root { --thinking-base: #404040; --thinking-shine: #ffffff; }
:root[data-theme="dark"] { --thinking-base: #8a8a8a; --thinking-shine: #ffffff; }
.thinking {
	display: inline-block;
	background: linear-gradient(110deg, var(--thinking-base) 35%, var(--thinking-shine) 50%, var(--thinking-base) 75%);
	background-size: 200% 100%;
	-webkit-background-clip: text; background-clip: text;
	color: transparent; -webkit-text-fill-color: transparent;
	animation: thinking-shine 2s linear infinite;
}
@keyframes thinking-shine { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) {
	.thinking { animation: none; background: none; color: var(--font-2); -webkit-text-fill-color: currentColor; }
}

/* Fills with white text keep the light fuchsia in dark mode too, as in the hub. */
:root[data-theme="dark"] .switch.on, :root[data-theme="dark"] .view-as-bar.active { background: #dc3486; border-color: #dc3486; }

/* Light/dark button beside the logo, the same as the Admin Hub and Ollie: one 30px ghost button,
   the sun draws itself into a moon and back. */
.brand-row { display: flex; align-items: center; gap: 4px; padding-right: 4px; }
.brand-row .brand { flex: 1; min-width: 0; }
.theme-btn { width: 30px; height: 30px; flex: none; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 6px; background: transparent; color: var(--font-3); cursor: pointer; padding: 0; }
.theme-btn:hover { background: var(--hover); color: var(--font); }
.theme-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.theme-btn svg path, .theme-ic svg path { stroke-dasharray: 1; transform-box: fill-box; transform-origin: center; transition: stroke-dashoffset 0.7s ease, transform 0.7s ease; }
.theme-btn .sun, .theme-ic .sun { stroke-dashoffset: 0; transform: scale(1); }
.theme-btn .moon, .theme-ic .moon { stroke-dashoffset: 1; transform: scale(0); }
.theme-btn.dark .sun, .theme-ic.dark .sun { stroke-dashoffset: 1; transform: scale(0); }
.theme-btn.dark .moon, .theme-ic.dark .moon { stroke-dashoffset: 0; transform: scale(1); }
@media (prefers-reduced-motion: reduce) { .theme-btn svg path, .theme-ic svg path { transition: none; } }
.shell.collapsed .brand-row { justify-content: center; padding-right: 0; }
.shell.collapsed .brand-row .theme-btn { display: none; }
/* In the phone "More" sheet the same icon sits in a normal row. */
.sheet-item .theme-ic { display: inline-flex; flex: none; width: 16px; height: 16px; color: var(--font-3); }
.sheet-item .theme-ic svg { width: 16px; height: 16px; }

/* Notifications bell (beside the light/dark button, as in Ollie and the Admin Hub) */
.bell-btn { position: relative; }
.bell-dot { position: absolute; top: 5px; right: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--bg-2); }
.notif-panel { position: fixed; z-index: 1000; width: 360px; max-width: calc(100vw - 16px); max-height: min(70vh, 520px); display: flex; flex-direction: column; background: var(--bg); color: var(--font); border: 1px solid var(--border-strong); border-radius: 8px; box-shadow: 0 12px 32px rgba(0, 0, 0, .18); overflow: hidden; font-size: 13px; text-align: left; }
.notif-h { padding: 10px 14px; border-bottom: 1px solid var(--border); }
.notif-list { overflow-y: auto; }
.notif-item { display: flex; gap: 10px; padding: 10px 14px; color: inherit; text-decoration: none; border-bottom: 1px solid var(--border); }
.notif-item:hover { background: var(--hover); }
.notif-item.unread { background: var(--accent-bg); }
.notif-ic { flex: none; width: 24px; height: 24px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; background: var(--bg-3); color: var(--font-3); }
.notif-ic svg { width: 14px; height: 14px; }
.notif-ic.failed { color: var(--red); }
.notif-ic.ready, .notif-ic.new { color: var(--accent); }
.notif-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.notif-t { font-weight: 500; }
.notif-d, .notif-at { color: var(--font-3); font-size: 12px; overflow-wrap: anywhere; }
.notif-empty { padding: 18px 14px; color: var(--font-3); }
.shell.collapsed .bell-btn { display: none; }

/* ---------------- Knowledge: map, folders, search, documents, Ask Milo ---------------- */
.kn-page { padding: 16px 24px 48px; display: flex; flex-direction: column; gap: 12px; }
.kn-page > * { flex: none; max-width: 1040px; }
.kn-small { font-size: 12px; margin: 0; }
.kn-note { margin: 0; }
.kn-note.warn { background: var(--orange-bg); color: var(--orange); }
.kn-note a { color: inherit; text-decoration: underline; }
#kn-search { display: flex; min-width: 0; }
#kn-search .search-in input { width: 220px; }
.kn-tools-note { color: var(--font-3); font-size: 12px; min-width: 0; flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kn-count { color: var(--font-3); font-size: 12px; white-space: nowrap; }
#kn-doc-edit, #kn-edit-slot { display: contents; }

/* The map: one card per stage, a row per step, a compact line per item. */
.kn-phase > h3 { gap: 10px; }
.kn-phase-n { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--accent-bg); color: var(--accent); font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.kn-phase-title { flex: none; white-space: nowrap; }
.kn-gate { min-width: 0; color: var(--font-3); font-weight: 400; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kn-group-n { flex: none; min-width: 18px; color: var(--font-3); font-weight: 500; font-size: 12px; text-align: right; }
.kn-steps { display: flex; flex-direction: column; }
.kn-steps > .kn-step { border-bottom: 1px solid var(--border-light); scroll-margin-top: 12px; }
.kn-steps > .kn-step:last-child { border-bottom: 0; }
.kn-step-head { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 6px 12px 2px; }
.kn-step-n { flex: none; width: 26px; color: var(--font-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.kn-step-text { flex: 1; min-width: 0; font-weight: 500; }
.kn-who { flex: none; }
.kn-step.kn-focus { background: var(--accent-bg); }
.kn-empty { padding: 0 12px 10px 46px; font-size: 12px; color: var(--font-3); }
.kn-mi-list { list-style: none; margin: 0; padding: 0 8px 6px 38px; }
.kn-mi { display: flex; align-items: center; gap: 4px; border-radius: 6px; }
.kn-mi:hover { background: var(--hover); }
.kn-mi-link { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; height: 32px; padding: 0 6px; color: var(--font); text-decoration: none; }
.kn-mi-link:hover .kn-mi-title { color: var(--accent); }
.kn-mi-ic { flex: none; display: inline-flex; color: var(--font-3); }
.kn-mi-thumb { flex: none; width: 36px; height: 20px; object-fit: cover; border-radius: 3px; background: var(--bg-3); }
.kn-mi-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kn-mi-tag { flex: none; height: 18px; font-size: 11px; }
.kn-mi-meta { flex: 0 1 auto; max-width: 45%; min-width: 0; margin-left: auto; padding-left: 12px; font-size: 12px; color: var(--font-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kn-mi-tools { flex: none; display: inline-flex; align-items: center; justify-content: flex-end; gap: 2px; min-width: 190px; padding-right: 4px; }
.kn-mi-tools a { text-decoration: none; }
.kn-add { flex: none; }
.kn-section-head { padding: 8px 2px 0; color: var(--font-3); font-weight: 500; font-size: 11px; }
.kn-other { display: flex; flex-direction: column; gap: 8px; }
.kn-group-h { list-style: none; cursor: pointer; user-select: none; display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; font-size: 13px; font-weight: 600; }
.kn-group-h::-webkit-details-marker { display: none; }
.kn-group-h::before { content: ""; flex: none; width: 6px; height: 6px; border-right: 2px solid var(--font-3); border-bottom: 2px solid var(--font-3); transform: rotate(-45deg); margin-right: 2px; transition: transform .15s; }
.kn-group[open] > .kn-group-h::before { transform: rotate(45deg); margin-top: -3px; }
.kn-group[open] > .kn-group-h { border-bottom: 1px solid var(--border); }
.kn-group-h:hover { background: var(--hover); }
.kn-cat-title { flex: none; white-space: nowrap; }
.kn-group-desc { flex: 1; min-width: 0; color: var(--font-3); font-weight: 400; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kn-group .kn-mi-list { padding: 6px 8px; }
.kn-group .kn-empty { padding: 10px 12px; }

/* Search results and related documents: rows in a card. */
#kn-results { display: flex; flex-direction: column; gap: 12px; }
.kn-result { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-bottom: 1px solid var(--border-light); color: var(--font); text-decoration: none; }
.kn-result:last-child { border-bottom: 0; }
.kn-result:hover { background: var(--hover); }
.kn-result:hover .kn-item-title { color: var(--accent); }
.kn-item-title { font-weight: 500; line-height: 1.4; }
.kn-item-meta { font-size: 12px; color: var(--font-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kn-snippet { color: var(--font-2); font-size: 13px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kn-tags { display: flex; flex-wrap: wrap; gap: 4px; }

/* A document. */
.kn-doc { max-width: 760px; display: flex; flex-direction: column; gap: 10px; }
.kn-doc h1 { margin: 0; font-size: 22px; line-height: 1.3; }
.kn-crumbs { font-size: 12px; color: var(--font-3); }
.kn-docmeta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: 12px; color: var(--font-3); }
.kn-docmeta a, .kn-onmap a { color: var(--accent); }
.kn-onmap { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 13px; color: var(--font-2); }
.kn-onmap:empty { display: none; }
.kn-onmap .icon { color: var(--font-3); margin-right: 6px; vertical-align: -3px; }
.kn-body { margin-top: 6px; font-size: 14px; line-height: 1.6; color: var(--font); }
.kn-body h2 { font-size: 15px; margin: 20px 0 6px; }
.kn-body h3, .kn-bubble h3 { font-size: 14px; font-weight: 600; margin: 16px 0 4px; }
.kn-bubble h3 { margin-top: 8px; }
.kn-body p { margin: 0 0 10px; }
.kn-body ul, .kn-body ol { margin: 0 0 10px; padding-left: 22px; }
.kn-body li + li { margin-top: 2px; }
.kn-body section + section { border-top: 1px solid var(--border-light); padding-top: 4px; }
.kn-body a, .kn-bubble a:not(.kn-source):not(.kn-cite) { color: var(--accent); overflow-wrap: anywhere; }
.kn-table-wrap, .kn-table-scroll { overflow-x: auto; }
.kn-table { border-collapse: collapse; font-size: 13px; }
.kn-table { margin: 4px 0 12px; }
.kn-table td, .kn-table th { border: 1px solid var(--border); padding: 6px 8px; vertical-align: top; text-align: left; }
.kn-table th { background: var(--bg-3); font-weight: 600; }
.kn-terms { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 8px 0; }
.kn-terms dt { font-weight: 600; color: var(--accent); }
.kn-terms dd { margin: 0; }
.kn-terms dd.kn-row { grid-column: 1 / -1; padding: 4px 0; border-bottom: 1px solid var(--border-light); }
.kn-related { margin-top: 16px; }

/* Ask Milo. */
.kn-ask { display: flex; flex: 1; min-height: 0; }
.kn-convs { width: 240px; flex: none; border-right: 1px solid var(--border); overflow: auto; padding: 4px 0; }
.kn-conv { display: block; padding: 6px 12px; color: var(--font); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-radius: 6px; margin: 0 6px; }
.kn-conv small { display: block; color: var(--font-3); font-size: 11px; }
.kn-conv:hover { background: var(--hover); }
.kn-conv.active { background: var(--accent-bg); }
.kn-chat { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.kn-thread { flex: 1; overflow: auto; padding: 16px 24px; display: flex; flex-direction: column; gap: 10px; }
.kn-welcome { margin: auto; max-width: 560px; text-align: center; }
.kn-welcome h2 { margin: 8px 0 4px; font-size: 18px; }
.kn-welcome p { margin: 0; }
.kn-suggest { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 16px; }
.kn-msg { display: flex; }
.kn-q { justify-content: flex-end; }
.kn-bubble { max-width: min(760px, 92%); padding: 10px 14px; border-radius: 12px; line-height: 1.55; font-size: 14px; overflow-wrap: anywhere; }
.kn-q .kn-bubble { background: var(--accent); color: #fff; border-bottom-right-radius: 4px; white-space: pre-wrap; }
.kn-a .kn-bubble { background: var(--bg); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.kn-a.unanswered .kn-bubble { border-color: var(--accent-border); }
.kn-bubble p { margin: 0 0 8px; }
.kn-bubble ol, .kn-bubble ul { margin: 4px 0 8px; padding-left: 20px; }
.kn-cite { display: inline-flex; align-items: center; justify-content: center; min-width: 16px; height: 16px; padding: 0 4px; margin: 0 1px; border-radius: 8px; background: var(--accent-bg); color: var(--accent); font-size: 10px; font-weight: 600; text-decoration: none; vertical-align: 2px; }
.kn-sources { margin-top: 8px; border-top: 1px solid var(--border-light); padding-top: 8px; display: flex; flex-direction: column; gap: 2px; }
.kn-sources-h { font-size: 11px; font-weight: 500; color: var(--font-3); padding: 0 8px 2px; }
.kn-source { display: flex; gap: 8px; align-items: flex-start; padding: 6px 8px; border-radius: 6px; color: inherit; text-decoration: none; font-size: 13px; }
.kn-source:hover, .kn-source:target { background: var(--hover); }
.kn-source small { display: block; color: var(--font-3); font-size: 12px; }
.kn-n { flex: none; width: 18px; height: 18px; border-radius: 9px; background: var(--accent-bg); color: var(--accent); font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; margin-top: 1px; }
.kn-fb { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 8px; }
.kn-fb .t-btn.on { background: var(--accent-bg); color: var(--accent); }
.kn-err { color: var(--danger); }
.kn-compose { border-top: 1px solid var(--border); padding: 10px 24px calc(10px + env(safe-area-inset-bottom)); background: var(--bg); }
.kn-compose-row { display: flex; gap: 8px; align-items: flex-end; max-width: 860px; margin: 0 auto; }
.kn-compose .kn-context, .kn-compose .kn-disclaimer { max-width: 860px; margin-left: auto; margin-right: auto; }
.kn-thread > * { width: 100%; max-width: 860px; margin-left: auto; margin-right: auto; }
.kn-thread > .kn-welcome { margin: auto; max-width: 560px; }
.kn-compose textarea { flex: 1; resize: none; min-height: 40px; max-height: 160px; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--bg); color: var(--font); font: inherit; line-height: 1.45; }
.kn-compose textarea:focus { outline: 0; border-color: var(--accent-border); box-shadow: 0 0 0 3px var(--accent-bg); }
.kn-context { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--font-2); margin-bottom: 6px; }
.kn-disclaimer { font-size: 11px; margin-top: 6px; }

/* Admin: gaps and usage. */
.kn-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.kn-stats > div { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; background: var(--bg); display: flex; flex-direction: column; gap: 2px; }
.kn-stats b { font-size: 18px; font-weight: 600; }
.kn-stats span { font-size: 12px; color: var(--font-3); }
.kn-box-body { padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.kn-gap { padding: 8px 12px; border-bottom: 1px solid var(--border-light); }
.kn-gap:last-child { border-bottom: 0; }
.kn-gap summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.kn-gap summary .muted { font-size: 12px; }
.kn-gap-ex { border-top: 1px solid var(--border-light); margin-top: 8px; padding-top: 8px; font-size: 13px; }
.kn-src td, .kn-src th { white-space: normal; }

/* Dialogs, the SOP editor and the video page's map card. */
.kn-dialog select[size] { width: 100%; height: auto; margin-top: 8px; }
.kn-dialog .t-input { width: 100%; margin-top: 6px; }
.kn-add-list { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.kn-add-opt { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; }
.kn-add-opt:hover { background: var(--hover); }
.kn-add-opt:has(input:checked) { border-color: var(--accent-border); background: var(--accent-bg); }
.kn-add-opt small { display: block; color: var(--font-3); font-size: 12px; }
.kn-add-ic { flex: none; display: inline-flex; color: var(--font-3); }
.kn-editor { max-width: 900px; display: flex; flex-direction: column; gap: 14px; }
.kn-field { display: flex; flex-direction: column; gap: 6px; font-weight: 500; }
.kn-field .muted { font-weight: 400; font-size: 12px; }
.kn-editor textarea { height: auto; padding: 8px 10px; font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; resize: vertical; }
.kn-preview { border: 1px dashed var(--border-strong); border-radius: 8px; padding: 12px; }
.kn-revs summary { cursor: pointer; font-weight: 500; }
.kn-revs pre { white-space: pre-wrap; max-height: 240px; overflow: auto; background: var(--bg-3); padding: 8px; border-radius: 6px; font-size: 12px; }
.kn-rev { padding: 6px 0; border-bottom: 1px solid var(--border-light); }
.kn-vplace { display: flex; flex-direction: column; gap: 6px; }
.kn-vplace a { color: var(--accent); }

@media (max-width: 720px) {
	.kn-hide-phone { display: none !important; }
	.kn-page { padding: 12px 12px calc(80px + env(safe-area-inset-bottom)); }
	.kn-tools-note { display: none; }
	#kn-search { flex: 1; }
	#kn-search .search-in { flex: 1; }
	#kn-search .search-in input { width: 100%; }
	.kn-gate, .kn-group-desc, .kn-mi-meta { display: none; }
	.kn-step-head { padding: 6px 10px 2px; }
	.kn-mi-list, .kn-group .kn-mi-list { padding: 0 4px 6px; }
	.kn-empty { padding: 0 10px 10px; }
	.kn-mi { flex-wrap: wrap; }
	.kn-mi-link { flex-basis: 100%; }
	.kn-mi-tools { min-width: 0; width: 100%; justify-content: flex-start; padding: 0 0 4px 28px; }
	.kn-mi-tools .t-btn:not(.icon-only) { padding: 0 6px; }
	.kn-convs { display: none; }
	.kn-thread { padding: 12px; }
	.kn-compose { padding: 8px 12px calc(72px + env(safe-area-inset-bottom)); }
	.kn-terms { grid-template-columns: 1fr; }
	.kn-doc h1 { font-size: 19px; }
}

/* Sidebar: Knowledge first; Recordings below, greyed out for people who do not record. */
.nav-recordings { display: flex; flex-direction: column; margin-top: 8px; border-top: 1px solid var(--border-light); padding-top: 4px; }
.nav-recordings.muted-section { opacity: .55; }
.nav-recordings.muted-section:hover, .nav-recordings.muted-section:focus-within { opacity: .8; }
.nav-item.disabled { cursor: not-allowed; color: var(--font-light); }
.nav-item.disabled:hover { background: none; }
.nav-item.disabled .icon { color: var(--font-light); }
.shell.collapsed .nav-recordings { border-top: 0; }
