/* CR8 shared workspace shell: brand blue, deep navy surfaces and image-led cards. */
:root {
  --bg: #0c0d0f; --canvas: #071124; --panel: rgba(3, 21, 58, 0.3); --panel-2: rgba(3, 21, 58, 0.3); --field: rgba(3, 21, 58, 0.3);
  --line: #093055; --line-soft: #093055; --text: #f4f3f0; --muted: #a1a3a4;
  --accent: #168DFF; --accent-ink: #002B54; --accent-soft: rgba(22, 141, 255, 0.17);
  --danger: #ff766d; --warn: #ffc86b; --ok: #62d5a0;
  --radius: 5px; --radius-sm: 4px; --topbar-h: 0px; --rail-w: 60px;
  --list-bg: #0b1830; --list-ink: var(--text);
  --shadow: 0 14px 34px rgba(0,0,0,.34), 0 2px 9px rgba(0,0,0,.2);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f0eee9; --canvas: #e4e1da; --panel: rgba(255,255,255,.94); --panel-2: #f3f0e9; --field: #fff;
  --line: #d1cbc0; --line-soft: #e3ded4; --text: #202123; --muted: #62615e;
  --list-bg: #ffffff; --list-ink: var(--text);
  --accent: #0b6fd6; --accent-ink: #ffffff; --accent-soft: rgba(11, 111, 214, .14);
  --shadow: 0 12px 30px rgba(20,18,15,.12), 0 2px 8px rgba(20,18,15,.07);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { min-height: 100vh; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font-body, Outfit, "Segoe UI", Arial, sans-serif); }
h1, h2, h3 { font-family: var(--font-head, inherit); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
svg.fa { width: 1em; height: 1em; vertical-align: -0.125em; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Persistent shortcut rail and header. */
#app { min-height: 100vh; }
.side-rail { position: fixed; inset: 0 auto 0 0; z-index: 80; width: var(--rail-w); height: 100vh; height: 100dvh; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 8px 8px; background: var(--rail-bg, var(--accent)); color: var(--rail-ink, #fffaf1); box-shadow: 2px 0 10px rgba(0,0,0,.14); }
.rail-mark { width: 50px; height: 50px; display: grid; place-items: center; margin: 0 0 6px; }
.rail-logo { width: 50px; height: 50px; display: grid; place-items: center; border-radius: 6px; box-shadow: 0 2px 6px rgba(0,0,0,.16); }
.rail-mark img { width: 50px; height: 50px; object-fit: contain; }
.rail-group { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; }
.rail-spacer { flex: 1; }
.rail-company { width: 42px; max-height: 44px; overflow: hidden; color: color-mix(in srgb, var(--rail-ink, #fff) 78%, transparent); font-size: 9px; font-weight: 700; line-height: 1.1; text-align: center; text-overflow: ellipsis; overflow-wrap: anywhere; text-transform: uppercase; }
.side-link { position: relative; width: 50px; height: 50px; display: grid; place-items: center; border: 0; border-radius: 4px; color: var(--rail-ink, #fffaf1); background: transparent; cursor: pointer; opacity: .94; transition: background .15s, opacity .15s; }
.side-link:hover { background: rgba(3, 21, 58, 0.22); color: var(--rail-ink, #fff); opacity: 1; text-decoration: none; }
.side-link.active { background: rgba(3, 21, 58, 0.5); color: var(--rail-ink, #fff); opacity: 1; text-decoration: none; }
.side-link.active::before { content: ''; position: absolute; left: -8px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--rail-ink, #fff); }
.side-link.side-control.active::before { display: none; }
.theme-moon { display: none; }
:root[data-theme="light"] .theme-sun { display: none; }
:root[data-theme="light"] .theme-moon { display: inline; }

.side-rail > * { flex-shrink: 0; }
.side-link svg.fa { width: 24px; height: 24px; }   /* Font Awesome: solid shapes read larger than outlines */
.shell-main { width: calc(100% - var(--rail-w)); min-height: 100vh; margin-left: var(--rail-w); background: radial-gradient(ellipse at 50% 15%, #252321 0, var(--bg) 58%); }
.badge { position: absolute; top: 1px; right: 1px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 9px; background: var(--danger); color: white; font: 11px/16px Outfit, sans-serif; text-align: center; }
.side-link .badge { top: 0; right: -1px; }
.avatar { width: 30px; height: 30px; display: inline-grid; place-items: center; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 700; }
.side-avatar .avatar { width: 32px; height: 32px; background: #fff8e9; color: #0b1a33; border: 2px solid rgba(3,21,58,.25); }

/* Workspace and reusable surfaces. */
main { width: min(1440px, 100%); margin: 0 auto; padding: 30px 40px 30px calc(var(--rail-w) + 40px); }
main.full { width: auto; max-width: none; margin: 0; padding: 0; height: 100vh; }
h1 { margin: 0 0 18px; font-size: clamp(27px, 3vw, 36px); font-weight: 500; letter-spacing: -.025em; }
h2 { margin: 0 0 12px; font-size: 20px; font-weight: 600; }
h3 { font-weight: 600; }
.page-heading { margin: 4px 0 20px; }
.page-heading h1 { margin: 0; }
.lead { margin: -8px 0 24px; color: var(--muted); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.card { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 18px; box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.card + .card { margin-top: 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.tile { display: flex; flex-direction: column; align-items: flex-start; min-height: 190px; padding: 20px; background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius); color: var(--text); box-shadow: 0 5px 16px rgba(0,0,0,.12); transition: transform .15s, border-color .15s, background .15s; }
.tile:hover { border-color: var(--accent); background: color-mix(in srgb, var(--panel) 86%, var(--accent-soft)); text-decoration: none; transform: translateY(-2px); }
.tile .tile-icon { display: grid; place-items: center; width: 42px; height: 42px; color: var(--accent); background: var(--accent-soft); border-radius: 5px; }
.tile .tile-icon svg { width: 21px; height: 21px; }
.tile .t { margin: 15px 0 4px; font-size: 18px; font-weight: 600; }
.tile .muted { font-size: 13px; }
.tile-action { margin-top: auto; padding-top: 14px; color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: .08em; }
.two-col { display: grid; grid-template-columns: 220px 1fr; gap: 20px; }

/* Forms and calls to action. */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field[hidden] { display: none; }
.btn[hidden] { display: none; }
.field label { font-weight: 600; font-size: 13px; }
.field .hint { color: var(--muted); font-size: 12px; }
.field .error { color: var(--danger); font-size: 12px; }
input[type=text], input[type=password], input[type=email], input[type=search], input[type=url], input[type=number], select, textarea { width: 100%; min-height: 38px; padding: 0 11px; background: var(--field); border: 1px solid var(--line); border-radius: var(--radius-sm); }
textarea { height: auto; min-height: 120px; padding: 9px 11px; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
/* the list a drop-down opens: solid (the fields are see-through), in the company's colours if set (How CR8 looks) */
select option, select optgroup { background-color: var(--list-bg); color: var(--list-ink); }
select option:disabled { color: color-mix(in srgb, var(--list-ink) 50%, var(--list-bg)); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.invalid input, .invalid textarea, .invalid select { border-color: var(--danger); }
.check { display: flex; gap: 8px; align-items: center; }
input[type=checkbox] { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); flex: none; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; padding: 0 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel-2); color: var(--text); cursor: pointer; white-space: nowrap; font-size: 13px; font-weight: 600; transition: filter .15s, border-color .15s, transform .15s; }
.btn:hover { border-color: var(--accent); filter: brightness(1.04); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { color: var(--danger); }
.btn.danger.solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.small { min-height: 29px; padding: 0 11px; font-size: 12px; }
.btn-row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.link-btn { border: 0; background: none; color: var(--accent); cursor: pointer; padding: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; min-height: 38px; background: var(--field); border: 1px solid var(--line); border-radius: 4px; }
.chip { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 4px 0 9px; border-radius: 12px; background: var(--accent-soft); font-size: 13px; }
.chip button { border: 0; background: none; width: 18px; height: 18px; border-radius: 9px; cursor: pointer; color: var(--muted); }
.chips input[type=text] { flex: 1; min-width: 120px; min-height: 24px !important; border: 0 !important; background: none !important; box-shadow: none !important; padding: 0 4px !important; }

/* Navigation and dense data. */
.nav { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line-soft); width: 100%; }
.nav a { padding: 9px 15px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; text-decoration: none; }
.nav a:hover { color: var(--text); }
.nav a.active { color: var(--accent); border-bottom-color: var(--accent); }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: var(--radius-sm); background: none; cursor: pointer; color: var(--muted); font-size: 18px; }
.icon-btn:hover { background: var(--panel-2); color: var(--text); }
.icon-btn svg { width: 16px; height: 16px; }
.menu { position: fixed; z-index: 6000; min-width: 220px; padding: 6px; background: color-mix(in srgb, var(--bg) 70%, #0a1a33); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
:root[data-theme="light"] .menu { background: #fff; }
.menu button, .menu a { display: flex; width: 100%; gap: 8px; align-items: center; padding: 8px 10px; border: 0; border-radius: var(--radius-sm); background: none; text-align: left; color: var(--text); cursor: pointer; }
.menu button:hover, .menu a:hover { background: var(--accent-soft); text-decoration: none; }
.menu .sep { height: 1px; margin: 6px 4px; background: var(--line-soft); }
.menu .head { padding: 8px 10px; color: var(--muted); font-size: 12px; }
.notif-list { width: 360px; max-height: 420px; overflow: auto; }
.notif { display: block; padding: 10px; border-radius: var(--radius-sm); color: inherit; }
a.notif:hover { background: var(--accent-soft); }
.notif.unread { background: var(--accent-soft); }
.notif .when { color: var(--muted); font-size: 12px; }
.table-wrap { overflow-x: auto; }
.create { display: grid; grid-template-columns: minmax(220px, 280px) 1fr; gap: 16px; align-items: start; margin-top: 16px; }
.create-side { position: sticky; top: 12px; padding: 14px; }
.create-side .field { margin-bottom: 8px; }
.tree { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
.tree-item { display: block; width: 100%; text-align: left; background: none; border: 0; border-left: 2px solid transparent; color: var(--text); padding: 7px 10px; border-radius: var(--radius-sm); cursor: pointer; font: inherit; font-size: 14px; text-decoration: none; }
.tree-item:hover { background: var(--accent-soft); text-decoration: none; }
.tree-item.on { background: var(--accent-soft); border-left-color: var(--accent); color: var(--accent); font-weight: 600; }
.ex-tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line-soft); margin-top: 8px; }
.ex-tabs a { padding: 9px 15px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; text-decoration: none; }
.ex-tabs a:hover { color: var(--text); }
.ex-tabs a.active { color: var(--accent); border-bottom-color: var(--accent); }
table.list { width: 100%; border-collapse: collapse; }
.list th, .list td { padding: 11px 13px; text-align: left; border-bottom: 1px solid var(--line-soft); }
.list th { color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.list tbody tr { cursor: pointer; }
.list tbody tr:hover { background: var(--panel-2); }
.pill { display: inline-block; padding: 2px 9px; border-radius: 12px; font-size: 11px; background: var(--panel-2); border: 1px solid var(--line); }
.pill.live { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.pill.suspended { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.pill.waiting { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.pill.unconfirmed { color: var(--muted, inherit); border-style: dashed; }
.signin-links.signin-join { display: flex; justify-content: center; align-items: baseline; gap: 4px; }
.signin-links.signin-join:empty { display: none; }
.pill.locked { color: var(--danger); }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; color: var(--muted); }
.tabs { display: flex; flex-direction: column; gap: 2px; }
.tabs a { padding: 8px 12px; border-radius: 4px; color: var(--muted); }
.tabs a.active { background: var(--accent-soft); color: var(--accent); }
.tabs a:hover { text-decoration: none; color: var(--text); }

/* Sign-in. */
main.signin-wrap { width: auto; max-width: none; min-height: 100vh; margin: 0; display: grid; place-items: center; padding: 24px; background: radial-gradient(1000px 560px at 12% 0, var(--accent-soft), transparent), var(--canvas); }
.signin { width: 100%; max-width: 410px; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 650; color: var(--text); }
.brand:hover { text-decoration: none; }
.signin .brand { justify-content: center; font-size: 26px; line-height: 1; letter-spacing: -.01em; margin: 0 0 22px; }
.signin .brand img { width: 40px; height: 40px; border-radius: 8px; }
.signin .card { padding: 28px; box-shadow: var(--shadow); }
.signin h1 { font-size: 24px; margin: 0 0 6px; }
.signin .lead { margin: 0 0 18px; }
.signin-links { display: grid; gap: 8px; justify-items: center; margin-top: 18px; }
.sso { display: grid; gap: 10px; }
.sso:empty { display: none; }
.sso-or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 18px 0 4px; }
.sso-or::before, .sso-or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.sso-btn { width: 100%; justify-content: center; }
.qr { display: grid; place-items: center; padding: 12px; background: #fff; border-radius: var(--radius); margin: 8px 0 12px; }
.qr svg, .qr img { width: 180px; height: 180px; }
.secret { font-family: ui-monospace, Consolas, monospace; letter-spacing: .08em; word-break: break-all; background: var(--field); padding: 8px 10px; border-radius: 4px; }
.otp-input { letter-spacing: .5em; text-align: center; font-size: 20px !important; height: 46px !important; }

/* Windows, feedback, and shared page utilities. */
/* pop-up windows: the window's own background blurs what is behind it; a window never grows past the screen — its body scrolls instead,
   with the title and the buttons always in view */
.overlay { position: fixed; inset: 0; z-index: 4000; background: rgba(0,0,0,.58);
  display: flex; align-items: center; justify-content: center; padding: 16px; overflow: hidden; }
.win { position: relative; display: flex; flex-direction: column; width: 100%; max-width: min(560px, 100%); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); min-height: 0;
  background: var(--panel); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.win:has(.publish-form), .win:has(.idml-form), .win:has(.import-report) { max-width: min(640px, 100%); }
.win header { flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line-soft); font-weight: 650; overflow-wrap: anywhere; }
.win .body { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 16px; overflow-wrap: anywhere; }
.win .body input, .win .body select, .win .body textarea { max-width: 100%; }
.win footer { flex-shrink: 0; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line-soft); }
#toasts { position: fixed; z-index: 7000; right: 16px; bottom: 16px; display: grid; gap: 8px; }
.toast { min-width: 260px; max-width: 420px; padding: 10px 14px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--accent); box-shadow: var(--shadow); animation: in .18s ease-out; }
.toast.error { border-left-color: var(--danger); }
.toast.ok { border-left-color: var(--ok); }
@keyframes in { from { transform: translateY(8px); opacity: 0; } }
.notice { padding: 12px 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel-2); }
.notice.error { border-color: var(--danger); }
.spinner { width: 24px; height: 24px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.center { display: grid; place-items: center; min-height: 40vh; }

/* Editor-adjacent screens. */
.tools-row { flex-wrap: wrap; }
.tools-row > input, .tools-row > select { width: auto; }
.tools-row > input[type=search] { flex: 1 1 220px; max-width: 360px; }
.tools-row > input[type=text] { flex: 1 1 220px; max-width: 360px; }
.small { font-size: 12px; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.tpl { display: flex; flex-direction: column; gap: 7px; min-height: 150px; margin: 0; }
.card + .tpl, .tpl + .tpl { margin-top: 0; }
.tpl h3 { margin: 0; font-size: 16px; }
.tpl p { margin: 0; font-size: 13px; }
.tpl .btn { align-self: flex-start; }
.tpl-kind { font-size: 11px; text-transform: uppercase; letter-spacing: .09em; color: var(--accent); }
.row-actions { width: 1%; white-space: nowrap; }
.image-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 16px; align-items: start; }
.image-side { position: sticky; top: calc(var(--topbar-h) + 12px); }
.image-side select { width: 100%; margin-top: 8px; }
.image-folder-list { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
.image-folder-entry { display: flex; align-items: center; gap: 4px; }
.image-folder-entry > .tree-item { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.image-folder-actions { display: flex; align-items: center; gap: 5px; }
.image-folder-actions .danger { color: var(--danger); }
.image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.image-card { min-width: 0; padding: 10px; }
.image-preview { display: grid; place-items: center; width: 100%; height: 160px; overflow: hidden; background: var(--panel-2); border: 1px solid var(--line-soft); border-radius: 4px; }
.image-preview img { width: 100%; height: 100%; object-fit: contain; }
.image-preview svg { width: 42px; height: 42px; color: var(--muted); }
.image-title { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 8px 0 3px; }
.image-actions { gap: 6px; margin-top: 8px; }
.image-actions .btn { flex: 1; }
.qr-destination { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset-share { color: var(--accent); }
.view-toggle { display: inline-flex; gap: 0; }
.view-toggle .btn { border-radius: 0; }
.view-toggle .btn:first-child { border-radius: 4px 0 0 4px; }
.view-toggle .btn:last-child { border-radius: 0 4px 4px 0; }
.view-toggle .btn + .btn { margin-left: -1px; }
.view-toggle .btn.active { position: relative; z-index: 1; color: var(--accent); background: var(--accent-soft); border-color: var(--accent); }
.doc-grid, .template-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; padding: 14px; }
.doc-card, .template-card { min-width: 0; padding: 0; margin: 0 !important; overflow: hidden; cursor: pointer; background: color-mix(in srgb, var(--canvas) 90%, transparent); border-color: color-mix(in srgb, var(--line) 70%, transparent); transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease; }
.doc-card:hover, .template-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.doc-card-preview, .template-card-preview { display: block; width: 100%; padding: 10px; border: 0; background: color-mix(in srgb, var(--canvas) 68%, transparent); cursor: pointer; }
.doc-card .thumb.large, .template-card .thumb.large { height: 190px; aspect-ratio: auto; max-height: none; margin: 0; border: 0; border-radius: 3px; background: color-mix(in srgb, var(--panel-2) 80%, transparent); }
.doc-card .thumb.large img, .template-card .thumb.large img { object-fit: contain; }
.doc-card-info, .template-card-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 12px 14px 14px; }
.doc-card-name, .template-card-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; }
.doc-card-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.doc-card-meta .pill { font-size: 11px; }
.doc-card-submeta, .template-card-meta { font-size: 12px; }
.doc-card-actions, .template-card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.doc-card-actions .actions-wrap { margin-left: auto; }
.doc-card-actions > .btn.primary, .template-card-open { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.template-card-published { display: flex; flex-wrap: wrap; gap: 4px; min-height: 24px; }
.actions-wrap { position: relative; }
.actions-menu { max-height: calc(100vh - 16px); overflow-y: auto; }
.actions-menu button.danger { color: var(--danger); }
.btn-cell { white-space: nowrap; text-align: right; }
.btn-cell .btn { margin-left: 4px; }
.print-jobs { display: flex; flex-direction: column; gap: 10px; max-height: 50vh; overflow: auto; margin-top: 8px; }
.print-job .muted, .print-job div { overflow-wrap: anywhere; }
.print-job { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.print-job:first-child { border-top: 0; }
.print-job-name { font-weight: 600; font-size: 1.05em; }
.print-files { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
/* an animation's videos and GIFs (editor/common/animjobs.ts) */
.anim-file { display: inline-flex; gap: 2px; }
.anim-viewer img, .anim-viewer video { display: block; max-width: 100%; max-height: 360px; margin-top: 8px; border: 1px solid var(--line); background: repeating-conic-gradient(#ccc 0 25%, #fff 0 50%) 0 0/16px 16px; }
.anim-formats { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 4px 16px; }
.anim-format { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; }
.anim-format input { margin-top: 3px; flex: none; }
.anim-format span { display: flex; flex-direction: column; min-width: 0; }
.anim-format small { font-size: 12px; line-height: 1.3; }
.anim-choices h4 { margin: 10px 0 2px; }
.version-list, .person-list { display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow: auto; margin-top: 8px; }
.publish-form { min-width: 0; }
.folder-checks { display: flex; flex-direction: column; gap: 4px; max-height: 220px; overflow: auto; }
.stages { display: flex; flex-direction: column; gap: 8px; }
.stage { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.stage-n { font-size: 12px; color: var(--muted); min-width: 56px; }
.stage select { width: auto; }
.folders { margin-top: 8px; }
.folder-row { display: flex; gap: 6px; align-items: center; padding: 4px 0; border-bottom: 1px solid var(--line-soft); }
.stages > .btn { align-self: flex-start; }

/* Thumbnail placeholders and loaded previews. */
.thumb { display: flex; align-items: center; justify-content: center; background: var(--panel-2); border: 1px solid var(--line-soft); border-radius: 3px; color: var(--muted); overflow: hidden; }
.thumb.small { width: 44px; height: 58px; }
.thumb.large { width: 100%; aspect-ratio: 3 / 4; max-height: 260px; margin-bottom: 4px; }
.doc-card .thumb.large, .template-card .thumb.large { aspect-ratio: auto; }
.thumb > span { display: grid; width: 26%; min-width: 14px; max-width: 72px; aspect-ratio: 1; opacity: .4; }
.thumb > span svg { width: 100%; height: 100%; }
.thumb.has-img { background: #191a1b; }
.thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.thumb-cell { width: 1%; padding-right: 0 !important; }
/* a thumbnail that opens its item in the editor (lists and grids) */
.thumb-open { display: block; width: 100%; padding: 0; margin: 0; border: 0; background: none; color: inherit; cursor: pointer; border-radius: 4px; }
.thumb-open .thumb { transition: outline-color .15s ease, opacity .15s ease; outline: 2px solid transparent; outline-offset: 1px; }
.thumb-open:hover .thumb, .thumb-open:focus-visible .thumb { outline-color: var(--accent); }
.thumb-open:focus-visible { outline: none; }

/* API explorer. */
.ex { display: grid; grid-template-columns: minmax(240px, 340px) 1fr; gap: 16px; margin-top: 16px; align-items: start; }
.ex-list { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 10px; max-height: calc(100vh - 220px); overflow: auto; position: sticky; top: calc(var(--topbar-h) + 12px); }
.ex-list input[type=search] { width: 100%; margin-bottom: 8px; }
.ex-tag { font-size: 11px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); margin: 10px 4px 4px; }
.ex-op { display: flex; gap: 8px; align-items: center; width: 100%; text-align: left; background: none; border: 0; color: var(--text); padding: 5px 6px; border-radius: 4px; cursor: pointer; font-size: 13px; }
.ex-op:hover { background: var(--panel-2); }
.ex-op.on { background: var(--accent-soft); }
.ex-p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, Consolas, monospace; }
.ex-m { flex: none; min-width: 52px; text-align: center; font: 600 11px/18px ui-monospace, Consolas, monospace; border-radius: 4px; padding: 0 4px; background: var(--panel-2); color: var(--muted); }
.ex-m.get { color: var(--ok); } .ex-m.post { color: var(--accent); } .ex-m.put, .ex-m.patch { color: var(--warn); } .ex-m.delete { color: var(--danger); }
.ex-detail { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 16px; min-width: 0; }
.ex-title { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.ex-title code { font-size: 14px; word-break: break-all; }
.ex-params { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0 12px; }
.ex-detail details { margin: 4px 0 8px; } .ex-detail summary { cursor: pointer; color: var(--muted); margin-bottom: 6px; }
.ex-code { width: 100%; font: 12.5px/1.5 ui-monospace, Consolas, monospace; white-space: pre-wrap; word-break: break-word; }
pre.ex-code { background: var(--field); border: 1px solid var(--line-soft); border-radius: 4px; padding: 10px; max-height: 60vh; overflow: auto; margin: 8px 0 0; }
.ex-out { margin-top: 14px; }
.ex-keys { margin: 4px 0 6px; } .ex-keys summary { cursor: pointer; color: var(--muted); }
.ex-keys input { font-family: ui-monospace, Consolas, monospace; }
.ex-count { margin: 0 4px 4px; }
.ex-badge { flex: none; margin-left: auto; font: 600 10px/16px ui-monospace, Consolas, monospace; padding: 0 5px; border-radius: 3px; background: var(--panel-2); color: var(--muted); }
.ex-badge.internal, .ex-badge.events, .ex-badge.bridge { color: var(--warn); }
.ex-badge.worker { color: var(--accent); }
.ex-badge.public { color: var(--ok); }
.ex-detail select { max-width: 100%; }
.ex-status { font-weight: 600; } .ex-status.ok { color: var(--ok); } .ex-status.bad { color: var(--danger); }
.ex-img { max-width: 100%; max-height: 50vh; margin-top: 8px; border-radius: 4px; background: repeating-conic-gradient(#8883 0 25%, transparent 0 50%) 0 0 / 16px 16px; }
.st-draft { color: var(--text); }
.st-in_review { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 50%, transparent); }
.st-approved { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 50%, transparent); }
.st-changes_requested { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 50%, transparent); }
.approval-history { margin: 0; padding-left: 20px; display: grid; gap: 10px; }
.approval-note { margin-top: 4px; padding: 6px 10px; border-left: 3px solid var(--line); white-space: pre-wrap; }

/* Responsive shell and grids. */
@media (max-width: 980px) {
  .side-rail { gap: 6px; }
}
@media (max-width: 760px) {
  :root { --rail-w: 52px; }
  .side-rail { padding: 8px 4px; gap: 4px; }
  .rail-group { gap: 4px; }
  .side-link { width: 42px; height: 42px; }
  .side-link svg.fa { width: 20px; height: 20px; }
  .side-link.active::before { left: -4px; }
  .rail-mark, .rail-logo { width: 40px; height: 40px; }
  .rail-mark img { width: 40px; height: 40px; }
  .rail-company { width: 44px; font-size: 8px; }
  main { padding: 20px 12px 48px calc(var(--rail-w) + 12px); }
  .two-col, .image-layout { grid-template-columns: 1fr; }
  .image-side, .create-side { position: static; }
  .nav a { padding: 0 8px; }
  .list th, .list td { padding: 8px; }
  .notif-list { width: min(360px, calc(100vw - 32px)); }
  .menu { max-width: calc(100vw - 64px); }
  .ex { grid-template-columns: 1fr; }
  .ex-list { position: static; max-height: 40vh; }
  .create { grid-template-columns: 1fr; }
  .doc-grid, .template-grid { grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 9px; padding: 8px; }
  .doc-card .thumb.large, .template-card .thumb.large { height: 132px; }
  .doc-card-info, .template-card-body { padding: 10px; }
  .doc-card-actions .btn, .template-card-actions .btn { padding: 0 8px; }
  .row > input[type=search], .row > select { max-width: none !important; width: 100% !important; }
}

/* InDesign import */
.import-report p { margin: 0 0 10px; }
.import-list { margin: 10px 0; }
.import-list ul { margin: 4px 0 0; padding-left: 20px; max-height: 160px; overflow: auto; }
.import-list.warn strong { color: var(--warn, #b26a00); }
.overlay .win progress { display: block; margin-bottom: 10px; height: 10px; }

/* sync (offline first): the rail's button and its panel */
.side-sync .sync-dot { position: absolute; right: 2px; bottom: 2px; }
/* the count of changes waiting (not .badge: that is the bell's) */
.side-sync .sync-count { position: absolute; top: 0; right: -1px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 9px; background: var(--accent, #3d8bfd); color: white; font: 11px/16px Outfit, sans-serif; text-align: center; }
.side-sync .sync-count[hidden] { display: none; }
.sync-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--ok, #2fb171); flex: none; }
.sync-dot.sending, .sync-dot.fetching, .sync-dot.starting { background: var(--accent, #3d8bfd); animation: sync-pulse 1s ease-in-out infinite; }
.sync-dot.offline { background: var(--muted, #8a94a6); }
.sync-dot.signin { background: var(--danger, #e5484d); }
@keyframes sync-pulse { 50% { opacity: .35; } }
.side-sync.spinning svg { animation: sync-spin 1.2s linear infinite; }
@keyframes sync-spin { to { transform: rotate(360deg); } }
.sync-menu { width: 340px; }
.sync-menu .btn.primary { width: 100%; margin: 4px 0; }
.sync-failed { display: grid; gap: 6px; padding: 8px 10px; border-top: 1px solid var(--line-soft); }
.sync-failed .btn.small { width: auto; }
.offline-chip { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 9px; font-size: 11px; background: var(--accent-soft); color: var(--muted); }
.sub-card { margin: 4px 0 14px 26px; padding: 4px 0 4px 14px; border-left: 2px solid var(--line); }
.copy-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 10px; }
.copy-row code { flex: 1 1 260px; min-width: 0; overflow-wrap: anywhere; background: var(--field); padding: 6px 8px; border-radius: 4px; font-size: 13px; }

/* content library (pages/library.ts) */
.lib-main { display: grid; grid-template-columns: minmax(160px, 220px) 1fr; gap: 16px; align-items: start; }
.lib-side { display: flex; flex-direction: column; gap: 2px; }
.lib-side a { display: flex; gap: 8px; padding: 6px 10px; border-radius: 6px; color: inherit; text-decoration: none; }
.lib-side a:hover { background: var(--panel-2); }
.lib-side a.active { background: var(--panel-2); font-weight: 600; }
.lib-list { min-width: 0; }
.badge { display: inline-block; padding: 1px 6px; border-radius: 999px; font-size: 11px; background: var(--panel-2); border: 1px solid var(--line); }
@media (max-width: 700px) { .lib-main { grid-template-columns: 1fr; } }

/* the media library (pages/media.ts) and wide dialogs */
.win:has(.media-details), .win:has(.media-wide), .win:has(.xp-report), .win:has(.web-publish) { max-width: min(1000px, 100%); }
.media-details-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
@media (max-width: 760px) { .media-details-grid { grid-template-columns: 1fr; } }
.media-section { margin-top: 12px; }
.media-section > summary { cursor: pointer; font-weight: 600; margin-bottom: 6px; }
.media-card .image-preview { cursor: pointer; padding: 0; }
.pill.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.pill.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.media-filters select, .media-details select[aria-label=Format] { width: auto; min-height: 34px; padding: 0 8px; }
.tools-row input[type=search] { flex: 1 1 320px; max-width: 560px; }
.pill.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.pill.bad { color: var(--danger, #e5484d); border-color: color-mix(in srgb, var(--danger, #e5484d) 40%, transparent); }
.chips-note { color: var(--danger, #e5484d); font-size: 12px; margin-top: 4px; }
.chips-note:empty { display: none; }
.mail-report { margin: 14px 0 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.mail-report h2 { font-size: 15px; margin: 0; }
.mail-report select { width: auto; }
.mail-stats { display: flex; flex-wrap: wrap; gap: 10px 26px; margin: 10px 0 4px; }
.mail-stat { display: flex; flex-direction: column; min-width: 80px; }
.mail-stat strong { font-size: 22px; line-height: 1.1; }
.mail-stat.bad strong { color: var(--danger, #e5484d); }
.mail-stat.warn strong { color: var(--warn); }
.mail-stat small { font-size: 11px; }
.mail-report-more summary { cursor: pointer; margin-top: 6px; }
.mail-since .pill, .mail-list td .pill + .pill { margin: 0 4px 2px 0; }
.mail-events ol { margin: 6px 0 0; padding-left: 18px; }
.mail-events li { margin: 2px 0; overflow-wrap: anywhere; }
.mail-events .ev-bounced strong, .mail-events .ev-rejected strong, .mail-events .ev-complained strong { color: var(--danger, #e5484d); }
.mail-facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; }
.mail-facts dt { color: var(--muted); }
.mail-facts dd { margin: 0; overflow-wrap: anywhere; }

/* ---- Social (pages/social.ts) */
.social-tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin: 6px 0 14px; }
.social-tabs a { padding: 8px 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.social-tabs a.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.social-tabs a:hover { text-decoration: none; color: var(--text); }
.social-filters { margin-bottom: 12px; gap: 6px; }
.chip-link { padding: 4px 11px; border-radius: 14px; border: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.chip-link.active { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.chip-link:hover { text-decoration: none; color: var(--text); }
.social-posts { display: flex; flex-direction: column; gap: 8px; }
.social-post-row { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: 8px; background: var(--panel); color: var(--text); }
.social-post-row:hover { border-color: var(--accent); text-decoration: none; }
.social-best { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.social-best:empty { display: none; }
/* the calendar: a month of days, posts dragged between them */
.social-cal-head { gap: 8px; align-items: center; margin: 4px 0 6px; }
.social-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.social-cal-dow { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 2px 6px; }
.social-cal-day { min-height: 108px; border: 1px solid var(--line-soft); border-radius: 8px; background: var(--panel); padding: 4px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.social-cal-day.other { opacity: .55; }
.social-cal-day.today { border-color: var(--accent); }
.social-cal-day.drop { outline: 2px dashed var(--accent); outline-offset: -2px; }
.social-cal-date { font-size: 12px; font-weight: 600; color: var(--muted); }
.social-cal-add { font-size: 14px; line-height: 1; padding: 0 5px; border-radius: 4px; color: var(--muted); visibility: hidden; }
.social-cal-day:hover .social-cal-add, .social-cal-add:focus { visibility: visible; text-decoration: none; }
.social-cal-post { display: flex; gap: 4px; align-items: center; font-size: 12px; padding: 3px 5px; border-radius: 5px; background: var(--bg); border: 1px solid var(--line-soft); border-left: 3px solid var(--muted); color: var(--text); min-width: 0; cursor: pointer; }
.social-cal-post[draggable="true"] { cursor: grab; }
.social-cal-post:hover { text-decoration: none; border-color: var(--accent); }
.social-cal-post.ok { border-left-color: var(--ok); }
.social-cal-post.warn { border-left-color: var(--warn); }
.social-cal-post.bad { border-left-color: var(--danger); }
.social-cal-post.ghost { border-style: dashed; border-left-style: dashed; opacity: .7; background: transparent; }
.social-cal-post.dragging { opacity: .4; }
.social-cal-time { color: var(--muted); flex: none; }
.social-cal-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.social-cal-nets { display: inline-flex; gap: 2px; flex: none; }
.social-cal-nets .net-badge { transform: scale(.8); }
@media (max-width: 760px) {
  .social-cal { grid-template-columns: 1fr; }
  .social-cal-dow { display: none; }
  .social-cal-day { min-height: 0; }
  .social-cal-day.other { display: none; }
}
.social-post-row .thumb { width: 56px; height: 56px; flex: none; border-radius: 6px; overflow: hidden; display: grid; place-items: center; background: var(--panel-2); color: var(--muted); }
.social-post-row .thumb img, .social-post-row .thumb video { width: 100%; height: 100%; object-fit: cover; }
.social-post-row .thumb svg { width: 22px; height: 22px; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.social-mini { display: flex; gap: 16px; text-align: right; }
.social-mini div { display: flex; flex-direction: column; }
.social-mini strong { font-size: 18px; }
.social-mini span { font-size: 11px; color: var(--muted); }
.net-badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 3px; border-radius: 4px; color: #fff; font: 700 10px/1 system-ui, sans-serif; letter-spacing: -.02em; flex: none; }
.net-avatar { position: relative; display: inline-grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 50%; background: var(--panel-2); font-weight: 700; }
.net-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.net-avatar .net-badge { position: absolute; right: -4px; bottom: -3px; box-shadow: 0 0 0 2px var(--bg); }
.social-actions { gap: 8px; margin-bottom: 12px; }
.social-post-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.social-compose { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(280px, 1fr); gap: 24px; align-items: start; }
@media (max-width: 900px) { .social-post-grid, .social-compose { grid-template-columns: 1fr; } }
.social-previews { display: flex; flex-direction: column; gap: 12px; }
.social-preview { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--panel); }
.social-preview header { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.social-preview p { white-space: pre-wrap; margin: 6px 0; overflow-wrap: anywhere; }
.social-preview .pics { display: grid; gap: 3px; border-radius: 6px; overflow: hidden; margin-top: 6px; }
.social-preview .pics.n2, .social-preview .pics.n4 { grid-template-columns: 1fr 1fr; }
.social-preview .pics.n3 { grid-template-columns: 2fr 1fr; }
.social-preview .pics img, .social-preview .pics video { width: 100%; max-height: 360px; object-fit: cover; display: block; }
.social-preview.net-instagram .pics img, .social-preview.net-instagram .pics video { aspect-ratio: 1; }
.social-preview .link-card { margin-top: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); font-size: 13px; }
.social-accounts-pick { display: flex; flex-direction: column; gap: 6px; }
.social-account-pick { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border: 1px solid var(--line-soft); border-radius: 8px; cursor: pointer; }
.social-account-pick.on { border-color: var(--accent); background: var(--accent-soft); }
.social-counts { display: flex; gap: 14px; font-size: 12px; margin-top: -6px; }
.social-counts span { display: inline-flex; gap: 4px; align-items: center; }
.social-media-list { display: flex; flex-direction: column; gap: 6px; min-height: 44px; padding: 6px; border: 1px dashed var(--line); border-radius: 8px; }
.social-media-item { display: flex; gap: 10px; align-items: center; }
.social-media-item > img, .social-media-item > video, .social-media-item > .thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 4px; flex: none; background: var(--panel-2); }
.social-targets td.num, .list td.num { text-align: right; font-variant-numeric: tabular-nums; }
.social-chart { width: 100%; height: auto; margin-top: 8px; }
.social-chart .axis { stroke: var(--line); }
.social-chart .lbl { fill: var(--muted); font-size: 10px; }
.social-bars { display: flex; align-items: flex-end; gap: 3px; height: 120px; margin-top: 12px; overflow-x: auto; }
.social-bars .bar { flex: 1 0 14px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; }
.social-bars .bar span { width: 100%; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px; }
.social-bars .bar small { font-size: 9px; color: var(--muted); white-space: nowrap; margin-top: 2px; }
.social-account { padding: 12px 14px; }
.social-account + .social-account { margin-top: 0; }
.notice.warn { border-color: var(--warn); }
.stack { display: flex; flex-direction: column; gap: 10px; }
.social-preview .pics.n1 img, .social-preview .pics.n1 video { max-height: 520px; object-fit: contain; background: rgba(0,0,0,.15); }
.social-made { display: flex; flex-direction: column; gap: 8px; max-height: 60vh; overflow: auto; }
.win:has(.social-made) { width: min(880px, 94vw); max-width: none; }
.win:has(.camp-make-ad) { width: min(640px, 94vw); max-width: none; }
.camp-make-ad { max-height: 70vh; overflow: auto; padding-right: 4px; }
.social-made-row { display: flex; gap: 12px; align-items: flex-start; padding: 8px; border: 1px solid var(--line-soft); border-radius: 8px; }
.social-made-row .thumb { width: 72px; height: 72px; flex: none; border-radius: 6px; overflow: hidden; display: grid; place-items: center; background: var(--panel-2); color: var(--muted); }
.social-made-row .thumb img { width: 100%; height: 100%; object-fit: cover; }
.social-made-row .thumb svg { width: 24px; height: 24px; }
.camp-section { margin-top: 22px; }
.camp-section h3 { margin: 0 0 8px; }
.camp-section h4 { margin: 14px 0 6px; font-size: 13px; }

/* reports and the audit log (pages/insights.ts) */
.ins-figure { margin: 14px 0 0; }
.ins-figure figcaption { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.ins-sort { all: unset; cursor: pointer; font: inherit; }
.ins-sort:hover, .ins-sort:focus-visible { color: var(--accent); }
.ins-row { cursor: pointer; }
.ins-row:hover td { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
.ins-detail { min-width: min(720px, 86vw); max-height: 70vh; overflow: auto; }
.ins-detail th { width: 9em; text-align: left; vertical-align: top; color: var(--muted); font-weight: 500; }
.ins-pre { margin: 0; max-height: 40vh; overflow: auto; white-space: pre-wrap; word-break: break-word; font-size: 12px; }
.ins-hash { font-size: 11px; word-break: break-all; }
.ins-filters select, .ins-filters input { width: auto; max-width: 100%; }
.ins-filters input[type=search] { flex: 1 1 16em; }
.ins-detail td { max-width: 0; width: 100%; }

/* Automation (pages/automation.ts): a workflow's steps as a chain of blocks, its conditions, its runs */
.auto-build { display: grid; gap: 16px; max-width: 860px; }
.auto-build .card + .card { margin-top: 0; }
.auto-build h2 { margin: 0 0 12px; font-size: 16px; }
.auto-build select, .auto-build input[type=text], .auto-build input[type=email], .auto-build textarea { max-width: 100%; }
.auto-state { margin-bottom: 16px; max-width: 860px; }
.auto-state p { margin: 8px 0 0; }
.auto-conds { display: grid; gap: 8px; justify-items: start; }
.auto-cond { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.auto-cond input, .auto-cond select { width: auto; min-width: 0; }
.auto-cond input[type=text] { width: 190px; }
.auto-and { width: 26px; }
.auto-cond:first-child { padding-left: 0; }
.auto-conds .auto-cond + .auto-cond { margin-left: 0; }
.auto-steps { display: grid; gap: 0; }
.auto-start, .auto-end, .auto-add { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 6px 0; }
.auto-end { padding-left: 38px; }
.auto-step { position: relative; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius); background: var(--panel-2); padding: 12px 14px 4px; margin: 22px 0 0; }
.auto-step::before, .auto-add::before, .auto-end::before { content: ''; position: absolute; left: 12px; top: -23px; height: 22px; border-left: 2px solid var(--line); }
.auto-add, .auto-end { position: relative; margin-top: 22px; }
.auto-add::before, .auto-end::before { left: 16px; top: -22px; }
.auto-step.auto-wait { border-left-color: var(--warn); }
.auto-step.auto-stop { border-left-color: var(--danger); }
.auto-step.auto-crm { border-left-color: var(--ok); }
.auto-step-head { display: flex; gap: 10px; align-items: center; }
.auto-step-tools { display: flex; gap: 4px; }
.auto-step > .hint { margin: 4px 0 12px; color: var(--muted); font-size: 12px; }
.auto-num { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; flex: none; }
.auto-check { display: flex; gap: 8px; align-items: center; font-weight: 400 !important; }
.auto-check input { width: auto; }
.auto-only { border-top: 1px dashed var(--line); padding: 10px 0; display: grid; gap: 8px; }
.auto-log { list-style: none; padding: 0; margin: 14px 0; display: grid; gap: 10px; }
.auto-log li { border-left: 3px solid var(--line); padding: 2px 0 2px 12px; }
.auto-log-done { border-left-color: var(--ok) !important; }
.auto-log-failed { border-left-color: var(--danger) !important; }
.auto-log-skipped, .auto-log-ignored, .auto-log-stopped, .auto-log-cancelled { border-left-color: var(--warn) !important; }
.auto-log-now { border-left-style: dashed !important; }
.auto-data { max-height: 240px; overflow: auto; font-size: 12px; background: var(--panel-2); padding: 10px; border-radius: 4px; }

/* The side menu as a tree (main.ts sideNav): sections of areas, the area shown opening into its parts. Narrow: the icon
   rail as before (sections are thin rules). Wide (html.nav-wide, or .side-rail.open on a phone): names, sections that
   fold, and branches. */
.rail-head { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100%; }
.rail-tree { display: flex; flex-direction: column; align-items: center; gap: 6px; width: calc(100% + 16px); margin: 0 -8px; padding: 0 8px 4px;
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; }
.side-rail .rail-spacer { display: none; }
.rail-bottom { margin-top: auto; }
.rail-section { display: contents; }
.rail-items { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; }
.rail-section-head { display: block; width: 28px; height: 0; margin: 4px 0; padding: 0; border: 0; border-top: 1px solid color-mix(in srgb, var(--rail-ink, #fff) 28%, transparent); background: none; font-size: 0; color: transparent; cursor: default; pointer-events: none; }
.rail-section-head > * { display: none; }
.side-label, .rail-children, .rail-scrim { display: none; }
.rail-branch { display: contents; }
.rail-bottom { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; }
.rail-tools { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.rail-toggle-icon { font-size: 20px; line-height: 1; font-weight: 700; }
.rail-wrap { display: contents; }

/* wide */
:root.nav-wide { --rail-w: 236px; }
:root.nav-wide .side-rail, .side-rail.open { align-items: stretch; padding: 10px 10px; gap: 6px; }
:root.nav-wide .rail-head, .side-rail.open .rail-head { flex-direction: row; gap: 10px; padding: 2px 4px 8px; }
:root.nav-wide .rail-mark, .side-rail.open .rail-mark { margin: 0; width: 40px; height: 40px; }
:root.nav-wide .rail-logo, :root.nav-wide .rail-mark img, .side-rail.open .rail-logo, .side-rail.open .rail-mark img { width: 40px; height: 40px; }
:root.nav-wide .rail-company, .side-rail.open .rail-company { width: auto; max-height: none; flex: 1; font-size: 12px; letter-spacing: .06em; text-align: left; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
:root.nav-wide .rail-tree, .side-rail.open .rail-tree { align-items: stretch; gap: 2px; width: calc(100% + 20px); margin: 0 -10px; padding: 0 10px 6px; scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--rail-ink, #fff) 35%, transparent) transparent; }
:root.nav-wide .rail-items, .side-rail.open .rail-items { align-items: stretch; gap: 2px; padding-bottom: 6px; }
:root.nav-wide .rail-section, .side-rail.open .rail-section { display: block; }
:root.nav-wide .rail-section:not(.open) .rail-items, .side-rail.open .rail-section:not(.open) .rail-items { display: none; }
:root.nav-wide .rail-section-head, .side-rail.open .rail-section-head { display: flex; align-items: center; width: 100%; height: auto; margin: 8px 0 2px; padding: 4px 10px; border: 0; border-radius: 4px;
  font: 600 10.5px/1.3 Outfit, sans-serif; letter-spacing: .09em; text-transform: uppercase; color: color-mix(in srgb, var(--rail-ink, #fff) 72%, transparent); cursor: pointer; pointer-events: auto; text-align: left; }
:root.nav-wide .rail-section-head > *, .side-rail.open .rail-section-head > * { display: inline; }
:root.nav-wide .rail-section-head:hover, .side-rail.open .rail-section-head:hover { color: var(--rail-ink, #fff); background: rgba(3,21,58,.16); }
:root.nav-wide .rail-section.here .rail-section-head, .side-rail.open .rail-section.here .rail-section-head { cursor: default; }
.rail-caret { display: inline-block; font-size: 10px; transition: transform .15s; }
.rail-section.open .rail-caret { transform: rotate(90deg); }
.rail-section.here .rail-caret { opacity: 0; }
:root.nav-wide .side-link, .side-rail.open .side-link { width: 100%; height: 38px; display: flex; align-items: center; justify-content: flex-start; gap: 12px; padding: 0 10px; }
:root.nav-wide .side-link svg.fa, .side-rail.open .side-link svg.fa { width: 18px; height: 18px; }
:root.nav-wide .side-link.active::before, .side-rail.open .side-link.active::before { left: -10px; top: 8px; bottom: 8px; }
:root.nav-wide .side-label, .side-rail.open .side-label { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
:root.nav-wide .rail-branch, .side-rail.open .rail-branch { display: block; }
:root.nav-wide .rail-children, .side-rail.open .rail-children { display: flex; flex-direction: column; gap: 1px; margin: 2px 0 6px 19px; padding-left: 12px; border-left: 1px solid color-mix(in srgb, var(--rail-ink, #fff) 30%, transparent); }
.rail-sub { display: block; padding: 6px 10px; border-radius: 4px; color: color-mix(in srgb, var(--rail-ink, #fffaf1) 82%, transparent); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-sub:hover { color: var(--rail-ink, #fff); background: rgba(3,21,58,.2); text-decoration: none; }
.rail-sub.active { color: var(--rail-ink, #fff); background: rgba(3,21,58,.42); font-weight: 600; }
/* (the area shown, opened into its parts: its own row is quieter, the part shown carries the mark) */
:root.nav-wide .rail-branch > .side-link.active, .side-rail.open .rail-branch > .side-link.active { background: rgba(3,21,58,.22); }
:root.nav-wide .rail-branch > .side-link.active::before, .side-rail.open .rail-branch > .side-link.active::before { display: none; }
:root.nav-wide .rail-bottom, .side-rail.open .rail-bottom { align-items: stretch; gap: 6px; padding-top: 8px; border-top: 1px solid color-mix(in srgb, var(--rail-ink, #fff) 22%, transparent); }
:root.nav-wide .rail-tools, .side-rail.open .rail-tools { flex-direction: row; justify-content: space-between; }
:root.nav-wide .rail-tools .side-link, .side-rail.open .rail-tools .side-link { width: 42px; height: 40px; padding: 0; justify-content: center; }
:root.nav-wide .rail-tools .side-label, .side-rail.open .rail-tools .side-label { display: none; }
:root.nav-wide .side-avatar, .side-rail.open .side-avatar { height: 46px; }
:root.nav-wide .side-avatar .avatar, .side-rail.open .side-avatar .avatar { flex: none; }
.side-avatar.active::before { display: none; }

/* a phone: the narrow rail; the tree opens over the page */
@media (max-width: 760px) {
  .rail-tree { width: calc(100% + 8px); margin: 0 -4px; padding: 0 4px 4px; }
  .side-rail.open { width: min(280px, 86vw); box-shadow: 4px 0 24px rgba(0,0,0,.4); }
  .side-rail.open + .rail-scrim { display: block; position: fixed; inset: 0; z-index: 79; background: rgba(0,0,0,.45); }
}
.rail-logo.own { background: #fff; box-shadow: none; }
.rail-logo.own img { object-fit: contain; padding: 3px; }

/* The brand hub (pages/brandhub.ts): guidelines, articles and news, as cards and as pages to read; the block editor;
   a guideline shared by link; how CR8 looks. */
.bh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.bh-grid.news { grid-template-columns: 1fr; max-width: 860px; }
.bh-section + .bh-section { margin-top: 26px; }
.bh-card { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--panel); color: var(--text); transition: border-color .15s, transform .15s; }
.bh-card:hover { border-color: var(--accent); transform: translateY(-2px); text-decoration: none; }
.bh-card.news { flex-direction: row; }
.bh-cover { aspect-ratio: 16 / 9; background: var(--panel-2); overflow: hidden; }
.bh-card.news .bh-cover { width: 220px; flex: none; aspect-ratio: auto; }
.bh-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bh-card-body { padding: 14px 16px; display: grid; gap: 6px; align-content: start; }
.bh-card-body p { margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.bh-card-title { font-size: 17px; font-family: var(--font-head, inherit); }
.bh-card-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 12px; min-height: 0; }
.bh-lang { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.bh-lang .flag { border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.15); }
.bh-langs { display: inline-flex; gap: 3px; }
.bh-versions { flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.bh-versions .btn { display: inline-flex; align-items: center; gap: 4px; }
.bh-card-meta:empty { display: none; }
.bh-card-by { font-size: 12px; }
@media (max-width: 640px) { .bh-card.news { flex-direction: column; } .bh-card.news .bh-cover { width: auto; aspect-ratio: 16 / 9; } }

.bh-crumbs { margin-bottom: 12px; }
.bh-read { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; max-width: 900px; }
.bh-read.with-toc { grid-template-columns: 210px minmax(0, 1fr); max-width: 1150px; }
.bh-toc { position: sticky; top: 20px; align-self: start; display: grid; gap: 2px; max-height: calc(100vh - 40px); overflow: auto; font-size: 13.5px; }
.bh-toc-title { font-weight: 700; text-transform: uppercase; font-size: 11px; letter-spacing: .08em; color: var(--muted); margin-bottom: 6px; }
.bh-toc a { color: var(--muted); padding: 4px 8px; border-left: 2px solid var(--line); }
.bh-toc a:hover { color: var(--accent); border-left-color: var(--accent); text-decoration: none; }
.bh-toc a.l3 { padding-left: 20px; font-size: 13px; }
.bh-head { margin-bottom: 18px; }
.bh-head h1 { margin: 2px 0 8px; }
.bh-kicker { color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.bh-summary { font-size: 18px; color: var(--muted); margin: 0 0 8px; }
.bh-hero { display: block; width: 100%; max-height: 420px; object-fit: cover; border-radius: var(--radius); margin-top: 16px; }
.bh-body { display: grid; gap: 16px; line-height: 1.65; }
.bh-body > * { margin: 0; }
.bh-h { scroll-margin-top: 16px; }
.bh-body h2.bh-h { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.bh-text p { margin: 0 0 10px; } .bh-text p:last-child { margin: 0; }
.bh-text ul, .bh-text ol, .bh-note ul, .bh-note ol { margin: 0 0 10px; padding-left: 22px; }
.bh-text code { background: var(--panel-2); padding: 1px 5px; border-radius: 3px; font-size: .92em; }
.bh-note { padding: 12px 16px; border-left: 4px solid var(--accent); background: var(--accent-soft); border-radius: var(--radius-sm); }
.bh-note.warn { border-left-color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.bh-note.tip { border-left-color: var(--ok); background: color-mix(in srgb, var(--ok) 13%, transparent); }
.bh-note p { margin: 0 0 6px; } .bh-note p:last-child { margin: 0; }
.bh-hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.bh-img img { display: block; max-width: 100%; border-radius: var(--radius-sm); }
.bh-img.full img { width: 100%; } .bh-img.half { max-width: 50%; } .bh-img.small { max-width: 240px; }
.bh-img figcaption, .bh-dodont figcaption { margin-top: 6px; font-size: 13px; color: var(--muted); }
.bh-noimg { display: grid; place-items: center; min-height: 120px; background: var(--panel-2); color: var(--muted); border-radius: var(--radius-sm); }
.bh-colours { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.bh-swatch { border: 1px solid var(--line-soft); border-radius: var(--radius); overflow: hidden; background: var(--panel); }
.bh-chip { display: flex; align-items: flex-end; width: 100%; height: 96px; padding: 10px 12px; border: 0; font-weight: 700; text-align: left; cursor: copy; }
.bh-swatch dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 0; padding: 10px 12px; font-size: 12.5px; }
.bh-swatch dt { color: var(--muted); } .bh-swatch dd { margin: 0; font-family: ui-monospace, Consolas, monospace; }
.bh-swatch p { margin: 0; padding: 0 12px 10px; font-size: 12.5px; }
.bh-fonts { display: grid; gap: 14px; }
.bh-font { border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 16px 18px; background: var(--panel); }
.bh-font-sample { font-size: 34px; line-height: 1.2; overflow-wrap: anywhere; }
.bh-font-name { margin: 8px 0 4px; }
.bh-font-abc { color: var(--muted); font-size: 15px; overflow-wrap: anywhere; }
.bh-dodont { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.bh-dodont figure { margin: 0; border-radius: var(--radius); overflow: hidden; border: 2px solid var(--ok); background: var(--panel); }
.bh-dodont .bh-dont { border-color: var(--danger); }
.bh-dodont img { display: block; width: 100%; }
.bh-dodont figcaption { padding: 0 12px 10px; }
.bh-dd-label { padding: 6px 12px; font-weight: 700; color: var(--ok); }
.bh-dont .bh-dd-label { color: var(--danger); }
.bh-files { list-style: none; padding: 0; display: grid; gap: 6px; }
.bh-files a { font-weight: 600; }
.bh-share { margin-bottom: 16px; }
@media (max-width: 860px) { .bh-read.with-toc { grid-template-columns: 1fr; } .bh-toc { position: static; max-height: none; } .bh-dodont { grid-template-columns: 1fr; } .bh-img.half { max-width: 100%; } }

/* writing */
.bh-write { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.bh-form { display: grid; gap: 16px; }
.bh-form .card + .card { margin-top: 0; }
.bh-preview-wrap { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; border: 1px dashed var(--line); border-radius: var(--radius); padding: 18px 22px; background: var(--bg); }
.bh-preview-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; }
.bh-blocks { display: grid; gap: 10px; }
.bh-block-edit { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line-soft); border-left: 3px solid var(--accent); border-radius: var(--radius-sm); background: var(--panel-2); }
.bh-block-edit[data-type="heading"] { border-left-color: var(--warn); }
.bh-block-head { gap: 6px; }
.bh-adder { width: auto; max-width: 240px; font-size: 13px; color: var(--muted); background: transparent; border-style: dashed; }
.bh-adder.small { justify-self: start; min-height: 28px; padding: 2px 8px; }
.bh-rows { display: grid; gap: 8px; }
.bh-row { display: flex; gap: 6px; align-items: flex-start; }
.bh-row-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 6px; flex: 1; align-items: center; }
.bh-row-fields input[type=color] { width: 44px; height: 36px; padding: 2px; }
.bh-pic img, .bh-cover-pick { max-height: 70px; max-width: 160px; border-radius: 4px; }
.bh-dd-edit { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.bh-dd-edit > div { display: grid; gap: 6px; }
.bh-pick-list { display: grid; gap: 6px; max-height: 50vh; overflow: auto; min-width: 280px; }
.bh-dot { display: inline-block; width: 14px; height: 14px; border-radius: 3px; border: 1px solid var(--line); vertical-align: -2px; }
@media (max-width: 1000px) { .bh-write { grid-template-columns: 1fr; } .bh-preview-wrap { position: static; max-height: none; } }

/* a guideline shared by link */
main.bh-public { width: auto; max-width: none; padding: 0; }
.bh-public-wrap { max-width: 1200px; margin: 0 auto; padding: 0 28px 40px; }
.bh-public-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 16px 0; margin-bottom: 26px; border-bottom: 3px solid var(--rail-bg, var(--accent)); }
.bh-public-logo { height: 40px; width: auto; }
.bh-public-others { display: flex; gap: 14px; flex-wrap: wrap; margin-left: auto; font-size: 14px; }
.bh-public-foot { margin-top: 40px; font-size: 12px; text-align: center; }
@media (max-width: 760px) { .bh-public-wrap { padding: 0 16px 32px; } }

/* how CR8 looks */
.bh-look { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.bh-look > div { display: grid; gap: 16px; } .bh-look .card + .card { margin-top: 0; }
.bh-look aside { position: sticky; top: 16px; }
.bh-sample h2 { margin-top: 0; }
.bh-logo-pick { height: 48px; width: auto; border-radius: 4px; background: #fff; padding: 3px; }
@media (max-width: 900px) { .bh-look { grid-template-columns: 1fr; } .bh-look aside { position: static; } }

/* The dashboard (pages/dashboard.ts): widgets on a grid of three, each a third, two thirds or a whole row wide. */
.dash-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-flow: row dense; gap: 16px; align-items: start; }
.dash-card { grid-column: span 1; min-width: 0; background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 10px; }
.dash-card.s2 { grid-column: span 2; } .dash-card.s3 { grid-column: 1 / -1; }
.dash-card.editing { border-style: dashed; cursor: grab; }
.dash-card.dragging { opacity: .45; }
.dash-card.drop { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.dash-head { display: flex; align-items: center; gap: 8px; }
.dash-head h2 { margin: 0; font-size: 15px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-icon { color: var(--accent); display: inline-grid; }
.dash-icon svg.fa { width: 16px; height: 16px; }
.dash-tools { display: flex; gap: 3px; flex-wrap: wrap; justify-content: flex-end; }
.dash-tools .btn.small { min-height: 26px; padding: 0 8px; }
.dash-body { min-height: 40px; display: grid; gap: 10px; }
.dash-body > .spinner.small { width: 18px; height: 18px; border-width: 2px; }
.dash-empty { margin: 0; }
.dash-more { font-size: 13px; font-weight: 600; justify-self: start; }
.dash-sub { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.dash-shortcuts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.dash-shortcut { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: var(--radius); color: var(--text); background: var(--panel-2); font-weight: 600; font-size: 14px; }
.dash-shortcut:hover { border-color: var(--accent); text-decoration: none; }
.dash-shortcut .tile-icon { width: 34px; height: 34px; flex: none; }
.dash-docs, .dash-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.dash-docs a { display: flex; gap: 10px; align-items: center; color: var(--text); padding: 4px; border-radius: var(--radius-sm); }
.dash-docs a:hover { background: var(--accent-soft); text-decoration: none; }
.dash-docs a > span { display: grid; min-width: 0; } .dash-docs strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-docs .thumb.small { width: 44px; height: 44px; flex: none; }
.dash-list li { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-templates { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.dash-template { display: grid; gap: 6px; color: var(--text); font-size: 13px; }
.dash-template .thumb.large { width: 100%; height: auto; aspect-ratio: 3 / 4; }
.dash-template:hover { text-decoration: none; color: var(--accent); }
.dash-big { display: flex; align-items: baseline; gap: 8px; } .dash-big strong { font-size: 30px; line-height: 1; }
.dash-news { display: grid; gap: 10px; }
.dash-story { display: flex; gap: 12px; color: var(--text); padding: 6px; border-radius: var(--radius-sm); }
.dash-story:hover { background: var(--accent-soft); text-decoration: none; }
.dash-story img { width: 96px; height: 64px; object-fit: cover; border-radius: 4px; flex: none; }
.dash-story > span { display: grid; gap: 2px; min-width: 0; }
.dash-story > span > .muted:last-child { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; }
.dash-figures { margin: 0; }
.dash-bars { height: 120px; }
.dash-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; max-height: 60vh; overflow: auto; min-width: min(640px, 80vw); }
.dash-pick { display: flex; gap: 10px; align-items: flex-start; text-align: left; padding: 10px; border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--panel-2); cursor: pointer; }
.dash-pick > span:last-child { display: grid; gap: 2px; }
.dash-pick.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.dash-pick .tile-icon { width: 34px; height: 34px; flex: none; }
.dash-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px 12px; }
.dash-settings { min-width: min(520px, 80vw); }
@media (max-width: 1100px) { .dash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dash-card.s3, .dash-card.s2 { grid-column: 1 / -1; } }
@media (max-width: 700px) { .dash-grid { grid-template-columns: 1fr; } .dash-card, .dash-card.s2 { grid-column: 1 / -1; } }
.dash-shortcut .tile-icon, .dash-pick .tile-icon { display: grid; place-items: center; color: var(--accent); background: var(--accent-soft); border-radius: var(--radius-sm); }
.dash-shortcut .tile-icon svg, .dash-pick .tile-icon svg { width: 17px; height: 17px; }
.dash-body > .btn, .dash-body > .row > .btn { justify-self: start; }

/* print ordering */
.order-strip { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 12px; margin: 0 0 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); background: var(--accent-soft, transparent); border-radius: var(--radius, 6px); }
.order-strip[hidden] { display: none; }
.order-form select { min-width: 120px; }
.order-quote { margin: 4px 0 14px; }
.price-table { border-collapse: collapse; min-width: min(360px, 100%); }
.price-table td { padding: 3px 18px 3px 0; }
.price-table td.num { text-align: right; padding-right: 0; font-variant-numeric: tabular-nums; }
.price-table tr.strong td { font-weight: 600; border-top: 1px solid var(--line, #ddd); }
.grid-table { border-collapse: collapse; }
.grid-table th, .grid-table td { padding: 3px 6px 3px 0; text-align: left; font-weight: normal; }
.grid-table input { width: 110px; }
.grid-table th input { width: 140px; font-weight: 600; }
.order-dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0 0 12px; }
.order-dl dt { color: var(--muted, #666); }
.order-dl dd { margin: 0; }
.ship-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ship-list li { padding: 6px 8px; border: 1px solid var(--line, #e3e3e3); border-radius: 6px; }
.ship-list a { font-weight: 500; }
.ship-edit { display: grid; gap: 8px; max-height: 420px; overflow: auto; }
.ship-row { border: 1px solid var(--line, #e3e3e3); border-radius: 8px; padding: 8px 10px; }
.ship-edit .ship-row:only-child { border: 0; padding: 0; }
.ship-sum { align-items: center; flex-wrap: nowrap; }
.ship-sum > * { flex: none; }
.ship-sum > .ship-sum-text { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ship-sum select { width: 110px; min-height: 32px; }
.ship-form { margin-top: 6px; }
.ship-edit .ship-row:only-child .ship-form { margin-top: 0; }

/* the company's background picture (How CR8 looks ▸ Background picture): darkened by --backdrop-dim */
main.signin-wrap.has-backdrop, html[data-backdrop="everywhere"] body, html[data-backdrop="home"] body[data-page="home"] {
  background: linear-gradient(rgba(5, 10, 20, var(--backdrop-dim, .4)), rgba(5, 10, 20, var(--backdrop-dim, .4))), var(--backdrop) center / cover fixed no-repeat, var(--bg);
}
html[data-backdrop="everywhere"] body .card, html[data-backdrop="home"] body[data-page="home"] .card, main.signin-wrap.has-backdrop .card { backdrop-filter: blur(6px); }
/* the sign-in page's welcome (Company settings ▸ Sign-in page), beside or above the sign-in box */
.signin-split { display: grid; grid-template-columns: minmax(0, 1fr) 410px; gap: 40px; align-items: center; width: 100%; max-width: 1080px; }
.signin-split[data-place="right"] { grid-template-columns: 410px minmax(0, 1fr); }
.signin-split[data-place="right"] .signin-welcome { order: 2; }
.signin-split[data-place="above"] { grid-template-columns: minmax(0, 640px); justify-content: center; gap: 24px; }
.signin-split[data-place="above"] .signin { justify-self: center; }
.signin-split .signin { max-width: 410px; width: 100%; }
.signin-welcome { background: color-mix(in srgb, var(--panel, #0d1626) 82%, transparent); border: 1px solid var(--line, rgba(255,255,255,.1)); border-radius: var(--radius, 12px); padding: 28px 32px; box-shadow: var(--shadow); max-height: 80vh; overflow: auto; }
.signin-welcome > .bh-body > :first-child { margin-top: 0; }
@media (max-width: 860px) {
  /* on a phone: the sign-in box first, the welcome under it; the picture scrolls with the page */
  .signin-split, .signin-split[data-place="right"] { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .signin-split .signin-welcome, .signin-split[data-place="right"] .signin-welcome { order: 2; max-height: none; }
  .signin-split .signin { justify-self: center; }
  main.signin-wrap.has-backdrop, html[data-backdrop="everywhere"] body, html[data-backdrop="home"] body[data-page="home"] { background-attachment: scroll; }
}
/* its preview in Company settings: the sign-in page, smaller */
.signin-preview { border: 1px solid var(--line, #333); border-radius: var(--radius, 8px); overflow: hidden; }
.signin-wrap-preview { min-height: 420px; display: grid; place-items: center; padding: 24px; background: radial-gradient(800px 400px at 12% 0, var(--accent-soft), transparent), var(--bg); }
.signin-wrap-preview.has-backdrop { background: linear-gradient(rgba(5, 10, 20, var(--backdrop-dim, .4)), rgba(5, 10, 20, var(--backdrop-dim, .4))), var(--backdrop) center / cover no-repeat, var(--bg); }
.signin-wrap-preview .signin-split { grid-template-columns: minmax(0, 1fr); gap: 16px; }
.signin-wrap-preview .signin .card { padding: 18px; }
.bh-backdrop-pick { width: 160px; height: 90px; object-fit: cover; border-radius: var(--radius-sm, 6px); }
.nav-sub a { font-size: 14px; }

/* Search everything (Ctrl+K, src/search.ts): a box near the top of the screen, results grouped under it */
.pal-overlay { position: fixed; inset: 0; z-index: 4500; background: rgba(0,0,0,.45); display: flex; justify-content: center; align-items: flex-start; padding: min(12vh, 96px) 16px 16px; }
.pal { width: min(680px, 100%); max-height: min(72vh, 640px); display: flex; flex-direction: column; background: var(--panel); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  border: 1px solid var(--line); border-radius: calc(var(--radius) + 3px); box-shadow: var(--shadow); overflow: hidden; animation: in .14s ease-out; }
:root:not([data-theme="light"]) .pal { background: color-mix(in srgb, var(--bg) 88%, var(--accent) 12%); }
.pal-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line-soft); }
.pal-head > span { opacity: .7; display: inline-flex; }
.pal-input { flex: 1; min-width: 0; border: 0 !important; background: transparent !important; box-shadow: none !important; font-size: 17px; padding: 6px 0; outline: none; }
.pal-input::-webkit-search-cancel-button { display: none; }
.pal-kbd { font: 12px/1 inherit; padding: 4px 6px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); }
.pal-list { overflow-y: auto; overscroll-behavior: contain; padding: 6px; }
.pal-group + .pal-group { margin-top: 4px; }
.pal-group-head { font-size: 12px; font-weight: 650; letter-spacing: .02em; color: var(--muted); padding: 8px 10px 4px; }
.pal-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius); cursor: pointer; min-width: 0; }
.pal-item > span:first-child { display: inline-flex; opacity: .75; flex-shrink: 0; }
.pal-item .fa { width: 16px; height: 16px; }
.pal-item.on { background: var(--accent-soft); }
.pal-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pal-sub { margin-left: auto; padding-left: 12px; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; flex-shrink: 1; }
.pal-status { padding: 6px 16px 10px; border-top: 1px solid var(--line-soft); }
@media (max-width: 760px) { .pal-overlay { padding-top: 8px; } .pal-sub { display: none; } }

/* Home ▸ My work: waiting for you, going out this week, needs attention */
.mywork { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 900px) { .mywork { grid-template-columns: 1fr; } }
.mywork-head { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 13px; font-weight: 650; letter-spacing: .02em; text-transform: uppercase; color: var(--muted); }
.mywork-count { font-size: 12px; text-transform: none; letter-spacing: 0; padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--text); }
.mywork-count.bad { background: color-mix(in srgb, var(--danger) 22%, transparent); }
.mywork-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.mywork-list li { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.mywork-list li:last-child { border-bottom: 0; }
.mywork-list li > span:first-child { display: inline-flex; margin-top: 3px; opacity: .7; }
.mywork-list li.bad > span:first-child { color: var(--danger); opacity: 1; }
.mywork-list .fa { width: 15px; height: 15px; }
.mywork-text { display: grid; min-width: 0; }
.mywork-text a, .mywork-text > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Translations of the content library (pages/translations.ts) */
.tr-chips { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-left: 8px; vertical-align: middle; }
.tr-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 650; letter-spacing: .03em; padding: 1px 6px; border-radius: 999px; border: 1px solid var(--line); color: var(--text); }
.tr-chip .tr-dot, .tr-cell::before { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); display: inline-block; }
.tr-cell { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.tr-cell::before { content: ''; }
.tr-chip.ok .tr-dot, .tr-cell.ok::before { background: var(--ok, #2e9e5b); }
.tr-chip.review .tr-dot, .tr-cell.review::before { background: var(--accent); }
.tr-chip.old .tr-dot, .tr-cell.old::before, .tr-chip.back .tr-dot, .tr-cell.back::before { background: #e0a100; }
.tr-chip.draft .tr-dot, .tr-cell.draft::before { background: transparent; border: 1.5px solid var(--accent); }
.tr-chip.none { opacity: .55; }
.tr-chip.none .tr-dot, .tr-cell.none::before { background: transparent; border: 1.5px dashed var(--muted); }
.tr-status { padding: 10px 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel-2); margin: 8px 0 16px; }
.tr-status.ok { border-left: 4px solid var(--ok, #2e9e5b); } .tr-status.review { border-left: 4px solid var(--accent); }
.tr-status.old, .tr-status.back { border-left: 4px solid #e0a100; } .tr-status.draft { border-left: 4px solid var(--muted); }
.tr-note { margin-top: 6px; }
.tr-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 900px) { .tr-cols { grid-template-columns: 1fr; } }
.tr-col h2 { font-size: 15px; margin: 0 0 8px; }
.tr-col .lib-editor-text { min-height: 180px; }
.tr-source-text { opacity: .9; }
.tr-title { font-weight: 650; margin: 0 0 6px; }
.tr-changes { margin-top: 14px; padding: 10px 12px; border: 1px dashed #e0a100; border-radius: var(--radius); }
.tr-changes h3 { font-size: 13px; margin: 0 0 6px; }
.tr-diff del { background: color-mix(in srgb, var(--danger) 22%, transparent); text-decoration: line-through; }
.tr-diff ins { background: color-mix(in srgb, var(--ok, #2e9e5b) 25%, transparent); text-decoration: none; }
.tr-actions { margin-top: 12px; }
.tr-table td, .tr-table th { white-space: nowrap; } .tr-table td:first-child { white-space: normal; min-width: 240px; }
.tr-market { border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 8px 10px; margin: 0 0 10px; }
.tr-market select { width: 100%; }

/* plans and credits (pages/plan.ts) */
.notice.ok { border-color: var(--ok); }
.plan-banner { width: min(1440px, 100%); margin: 0 auto; padding: 16px 40px 0 calc(var(--rail-w) + 40px); }
.plan-banner + main { padding-top: 14px; }
.plan-banner .notice a { font-weight: 600; white-space: nowrap; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.plan-grid > .plan-card { margin: 0; }
.plan-usage-head select { width: auto; }
.plan-modules { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; }
.plan-modules li { display: flex; gap: 8px; align-items: baseline; }
.plan-modules li.yes > span:first-child { color: var(--ok); font-weight: 700; }
.plan-modules li.no { color: var(--muted); }
.plan-meter { display: grid; gap: 6px; margin: 0 0 16px; }
.plan-bar { height: 8px; border-radius: 4px; background: var(--panel-2); border: 1px solid var(--line); overflow: hidden; }
.plan-bar span { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.plan-meter.high .plan-bar span { background: var(--warn); }
.plan-meter.full .plan-bar span { background: var(--danger); }
.plan-note { display: block; margin: -8px 0 16px; }
.plan-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 0 24px; }
@media (max-width: 760px) { .plan-banner { padding: 12px 12px 0 calc(var(--rail-w) + 12px); } .plan-modules { grid-template-columns: 1fr; } }

/* team and person details for templates (pages/details.ts) */
.detail-pic-row { display: flex; gap: 12px; align-items: flex-start; }
.detail-pic { width: 72px; height: 72px; object-fit: contain; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel-2); }
.detail-fields input, .detail-fields select { min-width: 120px; }

/* template sets (pages/sets.ts) */
.register-filters { display: grid; grid-template-columns: minmax(0, 1fr) 200px 140px; gap: 8px; margin-bottom: 12px; }
@media (max-width: 700px) { .register-filters { grid-template-columns: 1fr; } }
.team-checks { display: grid; gap: 4px; max-height: 180px; overflow: auto; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.team-ownership .hint { margin-top: -4px; }
.record-teams { margin-top: 12px; }
.record-teams summary { cursor: pointer; color: var(--muted); }
.team-owner { margin: 4px 0 0; }
.number-register tr.voided code { text-decoration: line-through; color: var(--muted); }
.coverage { display: grid; gap: 10px; max-width: 720px; }
.coverage h3 { margin: 8px 0 4px; font-size: 1rem; }
.coverage .list th, .coverage .list td { padding: 6px 10px; }
.coverage-person p { margin: 0; }
.pe-preview-as.on { background: var(--accent-soft, var(--panel-2)); border-color: var(--accent, var(--line)); }
.set-order { margin: 0; padding-left: 22px; display: grid; gap: 4px; }
.set-order li { display: flex; gap: 6px; align-items: center; }
.set-pick select { width: auto; max-width: 100%; }
.stack { display: grid; gap: 8px; }

/* ---- promotions (pages/promotions.ts) ---- */
.promo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.promo-card h2 { margin: 0 0 6px; }
.promo-designs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 12px; }
.promo-design, .promo-prod { position: relative; display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--field, transparent); color: var(--text); font: inherit; cursor: pointer; }
.promo-design img, .promo-noimg { width: 100%; aspect-ratio: 3 / 4; object-fit: contain; background: var(--line-soft); border-radius: 4px; display: block; }
.promo-design.on, .promo-prod.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.promo-products { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.promo-prod img, .promo-prod .promo-noimg { aspect-ratio: 1; width: 100%; object-fit: contain; }
.promo-badge { position: absolute; top: 6px; left: 6px; background: var(--accent); color: #fff; border-radius: 999px; min-width: 20px; height: 20px; font-size: 12px; display: grid; place-items: center; }
.promo-start { min-width: min(640px, 80vw); }
.promo-opt { display: flex; gap: 8px; align-items: flex-start; margin: 6px 0; }
.promo-opt textarea { flex: 1; }
.promo-opt .grow { display: flex; flex-direction: column; gap: 4px; }
.promo-optpic { width: 64px; height: 48px; object-fit: cover; border-radius: 4px; background: var(--line-soft); }
.promo-attrs { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; margin-top: 8px; }
.promo-attrs .ed-field { display: flex; flex-direction: column; gap: 2px; }
.promo-found { max-height: 50vh; overflow: auto; margin-top: 8px; display: flex; flex-direction: column; gap: 4px; min-width: min(520px, 80vw); }
.promo-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.promo-stat-n { font-size: 28px; font-weight: 700; }
.promo-version { display: flex; flex-direction: column; gap: 0; }
.promo-vrow { display: grid; grid-template-columns: 160px 1fr 1fr; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); align-items: start; }
.promo-vrow textarea, .promo-vrow input { width: 100%; box-sizing: border-box; }
.promo-vsrc ul { margin: 0; padding-left: 18px; }
@media (max-width: 760px) { .promo-vrow { grid-template-columns: 1fr; } .promo-vhead { display: none; } }
.chip.ok { background: color-mix(in srgb, var(--ok, #2a8) 18%, transparent); padding-right: 9px; }
.chip.info { background: color-mix(in srgb, var(--accent) 20%, transparent); padding-right: 9px; }
.chip.warn { background: color-mix(in srgb, var(--warn, #c80) 22%, transparent); padding-right: 9px; }
.win:has(.promo-start) { width: min(760px, 94vw); max-width: none; }
.promo-start { min-width: 0; }
.promo-vrow textarea { font: inherit; min-height: 0; }

/* ---- the interface's language (language.ts) ---- */
.lang-flag { display: inline-flex; line-height: 0; }
.lang-flag svg { border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.15); }
.lang-menu { min-width: 230px; max-height: 70vh; overflow: auto; }
.lang-menu .lang-item { display: flex; align-items: center; gap: 10px; width: 100%; }
.lang-menu .lang-item[aria-checked="true"] { font-weight: 600; background: var(--accent-soft); }

/* the company's fields (docs/fields.md): a thing's values small, and their place in a form */
.info-line { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.info-line .info-pill { font-size: 11px; padding: 1px 7px; background: var(--chip-bg, rgba(0,0,0,.06)); }
td .info-line, .doc-card-info .info-line { display: flex; }
.company-fields-box { border: 1px solid var(--line, #ddd); border-radius: 8px; padding: 8px 12px 2px; margin: 0 0 12px; }
.company-fields-box legend { padding: 0 4px; font-weight: 600; }
.company-fields-box .hint { margin: 0 0 8px; }
.fields-filter select, .fields-filter input { min-width: 0; }

/* help (src/help.ts): a panel at the right, beside the page (the page makes room on a wide screen), or over it */
:root { --help-w: 440px; }
.help-panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 4500; width: var(--help-w); max-width: 100vw; display: flex; flex-direction: column;
  background: var(--panel-solid, var(--bg, #fff)); color: var(--text); border-left: 1px solid var(--line); box-shadow: -8px 0 24px rgba(0,0,0,.18); }
@media (min-width: 1100px) { html.help-open #app > :not(.full) { margin-right: var(--help-w); } }
@media (max-width: 640px) { .help-panel { width: 100vw; } .help-grip, .help-wide { display: none; } }
.help-grip { position: absolute; left: -4px; top: 0; bottom: 0; width: 8px; cursor: ew-resize; touch-action: none; z-index: 1; }
.help-grip:hover, .help-grip:active { background: linear-gradient(90deg, transparent 3px, var(--accent) 3px, var(--accent) 5px, transparent 5px); }
.help-head { flex: none; padding: 8px 12px 10px; border-bottom: 1px solid var(--line-soft, var(--line)); display: grid; gap: 8px; }
.help-head-row { display: flex; align-items: center; gap: 4px; }
.help-head-row .icon-btn:disabled { opacity: .35; cursor: default; }
.help-title { margin-left: 6px; }
.help-fwd svg { transform: scaleX(-1); }
.help-ico { font-size: 16px; line-height: 1; }
.help-head input[type=search] { width: 100%; }
.help-here { flex: none; padding: 7px 14px; font-size: 13px; background: var(--chip-bg, rgba(127,127,127,.1)); border-bottom: 1px solid var(--line-soft, var(--line)); }
.help-body { flex: 1 1 auto; overflow: auto; overscroll-behavior: contain; padding: 14px 18px 32px; line-height: 1.55; }
.help-body:focus { outline: none; }
.help-crumbs { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.help-h1 { font-size: 22px; margin: 2px 0 12px; line-height: 1.25; }
.help-article h2 { font-size: 17px; margin: 22px 0 6px; }
.help-article h3 { font-size: 15px; margin: 18px 0 4px; }
.help-article p, .help-article ul, .help-article ol { margin: 0 0 10px; }
.help-article ul, .help-article ol { padding-left: 22px; }
.help-article li { margin: 3px 0; }
.help-article code { font-size: .9em; padding: 1px 4px; border-radius: 4px; background: var(--chip-bg, rgba(127,127,127,.12)); }
.help-article kbd, .help-panel kbd { font: 600 12px/1 inherit; padding: 2px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; background: var(--panel); white-space: nowrap; }
.help-article a[data-app]::after { content: ' ↗'; font-size: .85em; }
.help-note { padding: 9px 12px; border-left: 3px solid var(--accent); background: var(--chip-bg, rgba(127,127,127,.1)); border-radius: 0 8px 8px 0; }
.help-table { overflow-x: auto; margin: 0 0 12px; }
.help-table table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
.help-table th, .help-table td { text-align: left; vertical-align: top; padding: 6px 8px; border-bottom: 1px solid var(--line-soft, var(--line)); }
.help-table th { font-weight: 650; }
.help-foot { margin-top: 28px; padding-top: 12px; border-top: 1px solid var(--line-soft, var(--line)); font-size: 14px; }
.help-also ul { padding-left: 18px; margin: 6px 0 12px; }
.help-current { font-weight: 650; }
.help-steps { justify-content: space-between; gap: 8px; }
.help-section h2 { font-size: 15px; margin: 18px 0 4px; }
.help-section ul { list-style: none; padding: 0; margin: 0; }
.help-section li { padding: 3px 0; display: flex; align-items: center; gap: 8px; }
.help-here-link { font-weight: 650; }
.help-results { list-style: none; padding: 0; }
.help-results li { padding: 8px 0; border-bottom: 1px solid var(--line-soft, var(--line)); }
.help-lang { font-size: 12.5px; margin: 0 0 8px; }
.side-help.active { color: var(--accent); }

/* pop-up windows' widths (ui.ts fitWindow): windows with a table start wider; their sides drag; ⇔ makes them wide */
.win:has(> .body table) { max-width: min(820px, 100%); }
.win-grip { position: absolute; top: 12px; bottom: 12px; width: 10px; cursor: ew-resize; touch-action: none; z-index: 2; }
.win-grip.l { left: -5px; } .win-grip.r { right: -5px; }
.win-grip:hover, .win-grip:active { background: linear-gradient(90deg, transparent 4px, var(--accent) 4px, var(--accent) 6px, transparent 6px); }
.win > header { gap: 4px; }
.win > header .win-wide { margin-left: auto; font-size: 15px; }
@media (max-width: 640px) { .win-grip, .win-wide { display: none; } }
.win .body th { overflow-wrap: normal; word-break: normal; }
/* sizes in the order dialog (apparel) */
.size-count { display: flex; flex-direction: column; gap: 2px; }
.price-more { margin: 8px 0; }
.price-more > summary { cursor: pointer; font-weight: 500; margin-bottom: 6px; }
/* a request for a template: its brief and creators beside the conversation (one above the other on a phone) */
.request-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 16px; align-items: start; }
.request-layout > div:first-child { display: grid; gap: 12px; }
@media (max-width: 860px) { .request-layout { grid-template-columns: minmax(0, 1fr); } }

/* customer data: following up and dashboards (pages/crm.ts, pages/crmDashboards.ts) */
.pill.crm-status { white-space: nowrap; }
.pill.crm-status-new { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); font-weight: 600; }
.pill.crm-status-last { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.crm-follow { border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 12px; background: var(--panel-2); }
.crm-follow h3 { margin: 0 0 8px; font-size: 14px; }
.crm-follow textarea { width: 100%; }
.crm-notes { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; max-height: 180px; overflow: auto; }
.crm-notes li { font-size: 13px; border-top: 1px solid var(--line-soft); padding-top: 6px; }
/* follow-ups: who has a record and by when (due ones stand out) */
.crm-followups { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.crm-followups li { border-top: 1px solid var(--line-soft); padding-top: 6px; }
.crm-followups li:first-child { border-top: 0; padding-top: 0; }
.crm-due-count { margin: 0 0 8px; }
.crm-follow .field { margin-bottom: 0; }
.crm-figure { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.crm-figure-value { font-size: 34px; font-weight: 700; line-height: 1; color: var(--text); }
.crm-figure-value:hover { color: var(--accent); text-decoration: none; }
.crm-change { font-size: 12px; color: var(--muted); }
.crm-change.up { color: var(--ok); } .crm-change.down { color: var(--warn); }
.crm-bars { height: 140px; margin-top: 0; }
.crm-hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.crm-hbars li { display: grid; grid-template-columns: minmax(70px, 34%) 1fr auto; gap: 8px; align-items: center; font-size: 13px; }
.crm-hbar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-hbar { height: 10px; background: var(--panel-2); border-radius: 5px; overflow: hidden; }
.crm-hbar > span { display: block; height: 100%; background: var(--accent); border-radius: 5px; }
.crm-hbar-count { font-variant-numeric: tabular-nums; text-align: right; }
.crm-dash-list select { min-height: 28px; padding: 2px 6px; }

/* Getting started (the home dashboard): a new company's first steps */
.setup-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.setup-bar { flex: 1; height: 8px; border-radius: 4px; background: var(--line-soft); overflow: hidden; }
.setup-bar span { display: block; height: 100%; background: var(--accent); }
.setup-steps { list-style: none; margin: 0 0 12px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px 20px; }
.setup-steps li { display: flex; gap: 10px; align-items: flex-start; }
.setup-mark { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600; border: 1px solid var(--line); }
.setup-steps li.done .setup-mark { background: var(--accent); border-color: var(--accent); color: #fff; }
.setup-steps li.done a { color: var(--muted); }

/* the installation's terms (#/legal/…), and their links under the sign-in card */
.legal-page { max-width: 760px; margin: 0 auto; padding: 8px 0 40px; }
.signin-terms { text-align: center; margin: 14px 0 0; }

/* Platform ▸ Health */
.health-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
