/* Libresoft brand (libresoft.co.uk): navy text, Libresoft blue for actions, sunny yellow accents, pale blue page. */
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(../fonts/onest-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(../fonts/onest-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --navy: #435686;
  --navy-deep: #34446d;
  --blue: #337aca;
  --yellow: #ffc600;
  --orange: #f47529;
  --green: #8ec74b;
  --slate: #8492b1;

  --bg: #f0f4fb;
  --bg-tint: #e7eef9;
  --surface: #ffffff;
  --surface-2: #f5f8fd;
  --text: var(--navy);
  --muted: #64718f;
  --border: #dfe6f2;
  --border-strong: #c7d2e6;
  --accent: var(--blue);
  --accent-hover: #2867b0;
  --accent-soft: #e3eefa;
  --accent-softer: #f1f6fd;
  --accent-text: #ffffff;
  --article: #4f8a1f;
  --article-soft: #edf6e2;
  --danger: #c0392b;
  --danger-soft: #fdecea;
  --warn: #b4580f;
  --warn-soft: #fff1e6;
  --ok: #4e8a22;
  --ok-soft: #edf6e2;
  --highlight: #fff1b8;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgb(67 86 134 / 5%), 0 4px 14px rgb(67 86 134 / 7%);
  --shadow-lift: 0 2px 4px rgb(67 86 134 / 6%), 0 12px 30px rgb(67 86 134 / 12%);
  --font: 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; height: auto; }
h1, h2, h3 { line-height: 1.2; font-weight: 700; letter-spacing: -0.015em; color: var(--navy-deep); }
h1 { font-size: 1.85rem; margin: 0 0 .35rem; }
h2 { font-size: 1.3rem; }
input, select, textarea, button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }
[hidden] { display: none !important; }
kbd { font: inherit; font-size: .8em; padding: 1px 6px; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 5px; background: var(--surface); }

.muted { color: var(--muted); }
.small { font-size: .875rem; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 20px;
  padding: 12px 28px; background: rgb(255 255 255 / 85%); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--navy); text-decoration: none; white-space: nowrap; }
.brand:hover { color: var(--navy); }
.brand-logo { height: 30px; width: auto; display: block; }
.brand-name { padding-left: 12px; border-left: 2px solid var(--border-strong); font-weight: 700; font-size: 1.02rem; letter-spacing: -0.01em; }
.search { flex: 1; min-width: 160px; max-width: 520px; position: relative; }
.admin-menu > summary { list-style: none; cursor: pointer; }
.is-pending #search { visibility: hidden; }
.pending-row { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--border); }
.pending-row:last-child { border-bottom: 0; }
.pending-panel { border-color: var(--yellow); }
.admin-menu > summary::-webkit-details-marker { display: none; }
.search::before {
  content: ''; position: absolute; left: 14px; top: 50%; width: 14px; height: 14px; transform: translateY(-60%);
  border: 2px solid var(--muted); border-radius: 50%; opacity: .7; pointer-events: none;
}
.search::after {
  content: ''; position: absolute; left: 26px; top: 50%; width: 6px; height: 2px; transform: translateY(4px) rotate(45deg);
  background: var(--muted); opacity: .7; border-radius: 2px; pointer-events: none;
}
.search input {
  width: 100%; padding: 9px 14px 9px 40px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2);
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.search input:focus { background: var(--surface); border-color: var(--accent); outline: none; box-shadow: 0 0 0 4px var(--accent-soft); }
.nav { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.nav-link { color: var(--muted); text-decoration: none; font-weight: 600; padding: 6px 10px; border-radius: 8px; }
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: block; }
.avatar-letter { display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.avatar-btn { list-style: none; cursor: pointer; border-radius: 50%; }
.avatar-btn::-webkit-details-marker { display: none; }

.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-link { position: relative; }
.nav-link.active { color: var(--navy-deep); background: var(--accent-soft); }
.new-menu > summary.btn-primary { background: var(--yellow); border-color: var(--yellow); color: var(--navy-deep); box-shadow: none; }
.new-menu > summary.btn-primary:hover { background: #ffd23d; border-color: #ffd23d; }
.menu > summary.btn { list-style: none; cursor: pointer; }
.main-menu { display: none; }
.menu-item.menu-rich { display: grid; gap: 1px; min-width: 250px; }
.menu-sep { height: 1px; background: var(--border); margin: 6px 4px; }
a.menu-item { color: var(--text); text-decoration: none; display: flex; align-items: center; gap: 6px; }
a.menu-item.active { background: var(--accent-soft); font-weight: 600; }
.menu-item kbd { margin-left: 6px; }
@media (max-width: 1100px) {
  .nav-links, .new-menu { display: none; }
  .main-menu { display: block; }
}

/* ---------- menus ---------- */
.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-items {
  position: absolute; top: calc(100% + 8px); min-width: 230px; z-index: 30;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lift);
  padding: 6px;
}
.menu-right .menu-items { right: 0; }
.menu-label { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.menu-item { display: block; width: 100%; text-align: left; padding: 9px 10px; border: 0; border-radius: 8px; background: none; cursor: pointer; }
.menu-item:hover { background: var(--surface-2); }
.menu-danger { color: var(--danger); }

/* ---------- layout ---------- */
#app { padding: 32px 28px 96px; }
.view { max-width: 1060px; margin: 0 auto; }
.view:has(.editor) { max-width: 1400px; }
.view.reader { max-width: 820px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head p { margin: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.empty-state { text-align: center; padding: 72px 0; }
.empty { padding: 24px 0; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border: 1px solid var(--border-strong); border-radius: 999px;
  background: var(--surface); color: var(--text); font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.btn:hover { background: var(--surface-2); color: var(--text); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 30%, transparent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-text); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { color: var(--danger); }
.btn-sm { padding: 5px 12px; font-size: .875rem; }
.btn-block { width: 100%; }
.link-btn { border: 0; background: none; padding: 0; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.icon-btn { width: 32px; height: 32px; border: 1px solid transparent; border-radius: 8px; background: none; cursor: pointer; color: var(--muted); }
.icon-btn:hover:not(:disabled) { background: var(--surface); border-color: var(--border); color: var(--text); }
.icon-btn:disabled { opacity: .3; }
.icon-danger:hover:not(:disabled) { color: var(--danger); }

/* ---------- badges & alerts ---------- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 700; white-space: nowrap; background: var(--surface-2); color: var(--muted); }
.badge-draft { background: var(--surface-2); color: var(--muted); }
.badge-changes { background: var(--warn-soft); color: var(--warn); }
.badge-live { background: var(--ok-soft); color: var(--ok); }
.badge-start { background: var(--accent-soft); color: var(--accent); }
.kind { display: inline-flex; align-items: center; gap: 6px; font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--accent); }
.kind-article { color: var(--article); }
.alert { padding: 12px 16px; border-radius: var(--radius-sm); background: var(--warn-soft); color: var(--text); }
.alert-error { background: var(--danger-soft); }
.banner { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 18px; }
.banner-preview { background: var(--article-soft); }
.banner-error { background: var(--danger-soft); }

/* ---------- home ---------- */
.hello {
  position: relative; overflow: hidden; padding: 30px 34px; margin-bottom: 26px; border-radius: 22px;
  background: linear-gradient(120deg, var(--navy) 0%, var(--blue) 100%); color: #fff;
  display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap;
}
.hello::after { content: ''; position: absolute; right: 18px; top: 14px; width: 110px; height: 60px; background: url(../brand/stars.svg) no-repeat right top / contain; opacity: .95; pointer-events: none; }
.hello h1 { font-size: 1.95rem; color: #fff; }
.hello p { margin: 0; color: rgb(255 255 255 / 85%); max-width: 560px; }
.hello .actions { position: relative; z-index: 1; }
.hello .btn { background: rgb(255 255 255 / 14%); border-color: rgb(255 255 255 / 45%); color: #fff; }
.hello .btn:hover { background: rgb(255 255 255 / 24%); color: #fff; }
.hello .btn-primary { background: var(--yellow); border-color: var(--yellow); color: var(--navy-deep); box-shadow: 0 4px 14px rgb(0 0 0 / 15%); }
.hello .btn-primary:hover { background: #ffd23d; border-color: #ffd23d; color: var(--navy-deep); }
.tabs { display: flex; gap: 6px; margin-bottom: 18px; overflow-x: auto; padding-bottom: 2px; }
.tab { padding: 7px 14px; color: var(--muted); text-decoration: none; border-radius: 999px; white-space: nowrap; font-weight: 600; border: 1px solid transparent; }
.tab:hover { background: var(--surface); color: var(--text); }
.tab-active { background: var(--surface); color: var(--text); border-color: var(--border); box-shadow: var(--shadow); }
.count { margin-left: 6px; font-size: .75rem; color: var(--muted); }
.card-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; transition: box-shadow .2s, transform .2s, border-color .2s; }
.card:hover { box-shadow: var(--shadow-lift); transform: translateY(-2px); border-color: var(--border-strong); }
.card-link { display: flex; gap: 14px; align-items: flex-start; padding: 18px 18px 10px; text-decoration: none; color: var(--text); flex: 1; }
.card-link:hover { color: var(--text); }
.card-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.card-title { font-weight: 650; font-size: 1.02rem; }
.card-meta { display: flex; gap: 8px; align-items: center; justify-content: space-between; min-height: 40px; padding: 0 12px 10px 72px; }
.card-actions { display: inline-flex; align-items: center; gap: 4px; flex: none; }
.card-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.card-edit { font-size: .875rem; font-weight: 600; text-decoration: none; padding: 6px 8px; border-radius: 8px; }
.card-edit:hover { background: var(--surface-2); }
.card-icon { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.card-icon-article { background: var(--article-soft); color: var(--article); }
.card-icon svg { width: 22px; height: 22px; }

.results { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.result { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.result-title { display: flex; flex-direction: column; gap: 2px; font-weight: 650; font-size: 1.08rem; text-decoration: none; color: var(--text); }
.result-matches { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 4px; }
.result-matches a { color: var(--text); text-decoration: none; display: block; padding: 8px 10px; border-radius: 8px; }
.result-matches a:hover { background: var(--accent-softer); }
.snippet { color: var(--muted); }
mark { background: var(--highlight); color: inherit; border-radius: 3px; padding: 0 1px; }

/* ---------- collections ---------- */
.collection-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.chip {
  --c: var(--accent);
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none; font-weight: 600; box-shadow: var(--shadow);
}
.chip:hover { border-color: var(--c); color: var(--text); }
.chip-active { background: color-mix(in srgb, var(--c) 14%, white); border-color: var(--c); }
.chip .count { margin-left: 0; }
.chip-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--accent)); flex: none; }
.chip-lock { font-size: .75rem; }
.pill { --c: var(--accent); display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: .75rem; font-weight: 650; color: color-mix(in srgb, var(--c) 75%, black); background: color-mix(in srgb, var(--c) 13%, white); white-space: nowrap; }
.pill .chip-dot { width: 7px; height: 7px; }
.list-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.organise-bar {
  position: sticky; bottom: 16px; z-index: 15; margin-top: 18px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-lift);
}
.organise-spacer { flex: 1; }
.bar-group { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* organise grid */
.org-toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.org-filter { flex: 1; min-width: 220px; padding: 9px 16px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); }
.org-filter:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.org-summary { margin: 10px 2px; }
.org-start { text-align: center; }
.org-wrap { overflow: auto; max-height: calc(100vh - 290px); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.org-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.org-table th { position: sticky; top: 0; z-index: 1; background: var(--surface-2); text-align: left; padding: 10px 12px; font-size: .8rem; font-weight: 700; color: var(--muted); border-bottom: 1px solid var(--border); white-space: nowrap; }
.org-table td { padding: 6px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.org-table tbody tr:last-child td { border-bottom: 0; }
.org-table tbody tr:hover td { background: var(--accent-softer); }
.org-table tr.org-selected td { background: var(--accent-soft); }
.org-check { width: 44px; text-align: center; }
.org-check input, .org-toggle { width: 20px; height: 20px; cursor: pointer; accent-color: var(--accent); vertical-align: middle; }
th.org-col, td.org-col { text-align: center; width: 140px; }
th.org-col .pill { margin-right: 6px; }
.org-cell { display: flex; justify-content: center; align-items: center; padding: 6px; border-radius: 8px; cursor: pointer; }
.org-cell:hover { background: color-mix(in srgb, var(--c) 16%, white); }
.org-toggle { accent-color: var(--c); }
.org-title { display: flex; gap: 12px; align-items: center; min-width: 240px; }
.org-title a { color: var(--text); font-weight: 600; text-decoration: none; }
.org-title a:hover { color: var(--accent); text-decoration: underline; }
.card-icon.org-icon { width: 32px; height: 32px; border-radius: 9px; }
.card-icon.org-icon svg { width: 18px; height: 18px; }
.org-empty { text-align: center; padding: 32px !important; color: var(--muted); }
.editor-collections { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.editor-collections .menu-items { left: 0; }
.menu-check { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.menu-check input { accent-color: var(--accent); width: 16px; height: 16px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 24px; margin-bottom: 22px; box-shadow: var(--shadow); }
.panel h2 { margin-top: 0; }
.panel .table { box-shadow: none; }
.collection-rows { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 8px; }
.collection-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.collection-main { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 200px; }
.collection-main .pill { font-size: .85rem; padding: 4px 12px; }
.swatches-sm { gap: 6px; }
.swatches-sm .swatch { width: 22px; height: 22px; border-width: 2px; border-color: transparent; }
.swatches-sm .swatch-on { border-color: white; box-shadow: 0 0 0 2px var(--text); }
.access-toggles { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.toggle-pill { --c: var(--accent); border: 1px dashed var(--border-strong); background: var(--surface); border-radius: 999px; padding: 3px 10px; font-size: .8rem; font-weight: 600; cursor: pointer; color: var(--muted); }
.toggle-pill:hover { border-color: var(--c); color: var(--text); }
.toggle-pill.on { border-style: solid; border-color: var(--c); background: color-mix(in srgb, var(--c) 14%, white); color: color-mix(in srgb, var(--c) 75%, black); }

/* ---------- import ---------- */
.import-flow { list-style: none; counter-reset: flow; padding: 0; margin: 0; display: grid; gap: 16px; }
.import-flow > li { counter-increment: flow; position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 24px 20px 72px; box-shadow: var(--shadow); }
.import-flow > li::before { content: counter(flow); position: absolute; left: 22px; top: 18px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 800; }
.import-flow h3 { margin: 4px 0 6px; }
.import-flow .actions { margin-top: 10px; }
.import-or { margin: 16px 0 0; }
.ask-box { border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); padding: 10px 14px; margin-top: 10px; background: var(--surface-2); }
.ask-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.ask-box p { margin: 6px 0 0; font-size: .93rem; }
.import-input { width: 100%; font: .85rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; padding: 12px 14px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); resize: vertical; }
.import-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.import-input.drop { border-color: var(--accent); background: var(--accent-softer); }
.import-modes .radio-card { align-items: flex-start; }
.import-extra { display: grid; gap: 8px; margin-top: 10px; }
.import-extra input[type='text'] { padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); }
.import-preview { margin-top: 16px; display: grid; gap: 10px; }
.import-preview .alert ul { margin: 6px 0 0; padding-left: 20px; }
.import-preview .alert p { margin: 6px 0 0; }
.import-stats { margin: 0; }
.import-steps-preview { margin: 0; padding-left: 22px; max-height: 420px; overflow: auto; display: grid; gap: 8px; background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px 12px 12px 34px; }
.import-steps-preview .badge { margin-left: 8px; }
.import-steps-preview ul { margin: 4px 0 0; padding-left: 18px; }

/* ---------- reader (tree & article viewer) ---------- */
.tree-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 6px; }
.trail { list-style: none; padding: 0; margin: 4px 0 18px; display: flex; flex-wrap: wrap; gap: 6px; font-size: .875rem; color: var(--muted); }
.trail li { display: flex; align-items: center; gap: 6px; }
.trail li:not(:last-child)::after { content: '›'; opacity: .6; }
.trail a { color: var(--muted); text-decoration: none; padding: 2px 8px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); }
.trail a:hover { color: var(--accent); border-color: var(--accent); }
.trail [aria-current] { font-weight: 600; color: var(--text); }
.step-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 30px 34px; box-shadow: var(--shadow); margin: 14px 0 22px; animation: rise .25s ease-out; }
.step-card-tinted { background: color-mix(in srgb, var(--tint) 75%, white); border-color: color-mix(in srgb, var(--tint) 60%, var(--border)); }
.step-title { margin: 0 0 14px; font-size: 1.4rem; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .step-card { animation: none; } .card:hover { transform: none; } }
.choices { margin: 0 0 20px; }
.choices-prompt { font-weight: 650; margin: 0 0 10px; color: var(--muted); }
.choice-list { display: grid; gap: 10px; }
.choice {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: left;
  padding: 16px 20px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); cursor: pointer; font-weight: 600; font-size: 1.02rem;
  box-shadow: var(--shadow); transition: border-color .15s, background .15s, transform .15s;
}
.choice:hover { border-color: var(--accent); background: var(--accent-softer); transform: translateX(2px); }
.choice-arrow { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 1rem; }
.checklist { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; }
.checklist label { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; }
.checklist label:has(input:checked) { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.checklist label:has(input:checked) span { text-decoration: line-through; color: var(--muted); }
.checklist input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--accent); }
.end-note { display: flex; gap: 14px; align-items: center; padding: 18px 22px; border-radius: var(--radius); background: var(--ok-soft); margin: 0 0 20px; }
.end-note .end-icon { font-size: 1.6rem; }
.end-note p { margin: 0; }
.step-nav { display: flex; gap: 8px; }

/* fill-in fields, copy buttons, feedback, practice */
.fields-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 18px; margin: 10px 0 14px; box-shadow: var(--shadow); }
.fields-panel summary { cursor: pointer; }
.fields-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-top: 12px; }
.field-input { display: grid; gap: 4px; font-size: .85rem; font-weight: 600; color: var(--muted); }
.field-input input { padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font-weight: 400; color: var(--text); background: var(--surface); }
.field-input input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.fillin { background: var(--accent-soft); border-radius: 4px; padding: 0 2px; font-weight: 600; }
.fillin-empty { background: var(--highlight); color: var(--warn); font-weight: 600; }
.prose blockquote.copyable { position: relative; padding-right: 76px; }
.copy-btn { position: absolute; top: 8px; right: 8px; border: 1px solid var(--border-strong); background: var(--surface); border-radius: 999px; padding: 3px 12px; font-size: .8rem; font-weight: 600; cursor: pointer; color: var(--accent); }
.copy-btn:hover { border-color: var(--accent); background: var(--accent-softer); }
.report-wrap { margin-top: 18px; padding-top: 10px; border-top: 1px dashed var(--border); }
.report-toggle { color: var(--muted); }
.report { margin-top: 8px; display: grid; gap: 8px; }
.report textarea, .helpful textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font: inherit; background: var(--surface); }
.helpful { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; }
.helpful p { flex-basis: 100%; margin: 0; }
.end-note { align-items: flex-start; }
.end-note p { margin: 0 0 6px; }
.choice-highlight { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.tried { margin-left: auto; font-size: .75rem; font-weight: 600; color: var(--muted); }
.tried-yes { color: var(--ok); }
.practice-bar { background: linear-gradient(135deg, #fff8dc 0%, #e3eefa 100%); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 16px; display: grid; gap: 10px; }
.practice-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.practice-head .actions { margin-left: auto; }
.meter { height: 8px; border-radius: 999px; background: rgb(255 255 255 / 70%); overflow: hidden; }
.meter-fill { height: 100%; background: var(--accent); border-radius: 999px; transition: width .4s; }
.practice-try { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.practice-done { margin: 0; font-weight: 600; }

/* ---------- rich content ---------- */
.prose { overflow-wrap: anywhere; }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose img { border-radius: var(--radius-sm); border: 1px solid var(--border); box-shadow: var(--shadow); }
.reader .prose img, .article img { cursor: zoom-in; }
.prose figure { margin: 18px 0; }
.prose figcaption { font-size: .875rem; color: var(--muted); margin-top: 6px; }
.prose blockquote { margin: 18px 0; padding: 12px 18px; border-left: 4px solid var(--accent); background: var(--accent-softer); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.prose table { border-collapse: collapse; width: 100%; margin: 18px 0; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; vertical-align: top; }
.prose th { background: var(--surface-2); }
.prose pre { background: var(--surface-2); padding: 12px; border-radius: var(--radius-sm); overflow-x: auto; }
.prose video { max-width: 100%; border-radius: var(--radius-sm); }
.article { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 30px 34px; margin-top: 16px; box-shadow: var(--shadow); }

.lightbox { width: min(1200px, calc(100vw - 32px)); max-width: none; background: transparent; border: 0; padding: 0; box-shadow: none; }
.lightbox::backdrop { background: rgb(34 45 72 / 80%); }
.lightbox img { display: block; margin: 0 auto; max-height: calc(100vh - 64px); width: auto; border-radius: var(--radius-sm); cursor: zoom-out; background: white; }

/* ---------- editor shell ---------- */
.editor-bar {
  position: sticky; top: 61px; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 14px 0; margin-bottom: 18px; background: var(--bg); border-bottom: 1px solid var(--border);
}
.editor-title { display: flex; flex-direction: column; flex: 1; min-width: 260px; }
.title-input { font-size: 1.5rem; font-weight: 700; border: 1px solid transparent; border-radius: var(--radius-sm); padding: 4px 10px; margin-left: -10px; background: transparent; }
.title-input:hover { border-color: var(--border); background: var(--surface); }
.title-input:focus { border-color: var(--accent); background: var(--surface); outline: none; box-shadow: 0 0 0 4px var(--accent-soft); }
.editor-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.save-status { font-size: .8rem; color: var(--muted); min-width: 110px; text-align: right; }
.save-ok { color: var(--ok); }
.save-ok::before { content: '✓ '; }
.save-error { color: var(--danger); font-weight: 650; }

.tree-editor { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 22px; align-items: start; }
.steps-pane { position: sticky; top: 150px; max-height: calc(100vh - 170px); overflow-y: auto; overflow-x: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.pane-head { display: flex; justify-content: space-between; align-items: center; margin: 14px 0 8px; }
.pane-head h2 { font-size: 1rem; margin: 0; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface-2); border-radius: 999px; padding: 4px; }
.seg { border: 0; background: none; padding: 7px; border-radius: 999px; cursor: pointer; font-weight: 600; color: var(--muted); }
.seg-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.step-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
.step-item { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 8px 10px; border: 0; border-radius: var(--radius-sm); background: none; cursor: pointer; }
.step-item:hover { background: var(--surface-2); }
.step-item.active { background: var(--accent-soft); }
.step-num { flex: none; min-width: 22px; height: 22px; padding: 0 4px; border-radius: 999px; display: grid; place-items: center; font-size: .72rem; font-weight: 700; color: var(--muted); background: var(--surface-2); }
.step-item.active .step-num { background: var(--accent); color: var(--accent-text); }
.step-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .93rem; }
.dot { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: .72rem; font-weight: 800; }
.dot-warn { background: var(--warn-soft); color: var(--warn); }
.dot-error { background: var(--danger-soft); color: var(--danger); }

.step-pane { container-type: inline-size; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 26px; min-width: 0; scroll-margin-top: 150px; box-shadow: var(--shadow); }
.step-pane-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.step-pane-head .badge { margin-left: 8px; }
.problems { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 6px; }
.problems li { padding: 8px 14px; border-radius: var(--radius-sm); font-size: .92rem; }
.problem-warn { background: var(--warn-soft); }
.problem-error { background: var(--danger-soft); }
.field { margin-bottom: 20px; }
.field-label { display: block; font-weight: 650; margin-bottom: 6px; }
.hint { margin: 6px 0 0; font-size: .84rem; color: var(--muted); }
.field input[type='text'], .field input:not([type]), .choice-row input[type='text'], .target-extra input, .inline-form input[type='email'] {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface);
}
.field input:focus, .choice-row input:focus, .target-extra input:focus, .inline-form input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
select { padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); max-width: 100%; }
.section-title { font-size: 1.02rem; margin: 26px 0 12px; padding-top: 20px; border-top: 1px solid var(--border); }

.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--border-strong); cursor: pointer; transition: transform .15s; }
.swatch:hover { transform: scale(1.08); }
.swatch-on { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

.radio-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.radio-card { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; }
.radio-card-on { border-color: var(--accent); background: var(--accent-softer); }
.radio-card input { margin-top: 4px; accent-color: var(--accent); }

.choices-editor { display: grid; gap: 10px; justify-items: start; }
.choice-row { display: grid; grid-template-columns: minmax(140px, 1fr) auto minmax(220px, 1.4fr) auto; gap: 8px; align-items: start; width: 100%; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.choice-row:has(.check-icon) { grid-template-columns: auto 1fr auto; }
.choice-row .arrow { padding-top: 9px; }
.check-icon { padding-top: 7px; color: var(--muted); }
.row-buttons { display: flex; }
.target-picker { display: grid; gap: 6px; min-width: 0; }
.target-main { display: flex; gap: 6px; align-items: center; }
.target-select { flex: 1; min-width: 0; }
.target-extra { display: grid; gap: 6px; }
.target-extra:empty { display: none; }
.incoming ul { margin: 0; padding-left: 18px; }

/* rich text */
.rt { position: relative; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); }
.rt:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.rt-toolbar { display: flex; flex-wrap: wrap; gap: 2px; align-items: center; padding: 5px; border-bottom: 1px solid var(--border); background: var(--surface-2); border-radius: var(--radius-sm) var(--radius-sm) 0 0; position: sticky; top: 150px; z-index: 2; }
.rt-btn { border: 0; background: none; padding: 5px 9px; border-radius: 7px; cursor: pointer; font-size: .86rem; }
.rt-btn:hover { background: var(--surface); }
.rt-btn-on { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.rt-btn-image { color: var(--accent); font-weight: 650; }
.rt-danger { color: var(--danger); }
.rt-block { padding: 4px 8px; font-size: .86rem; border-radius: 7px; }
.rt-sep { width: 1px; height: 20px; background: var(--border-strong); margin: 0 4px; }
.rt-area { min-height: 170px; padding: 14px 16px; outline: none; transition: background .15s; }
.rt-area.rt-drop { background: var(--accent-softer); box-shadow: inset 0 0 0 2px var(--accent); border-radius: 0 0 var(--radius-sm) var(--radius-sm); }
.rt-tall { min-height: 60vh; }
.rt-area.rt-empty::before { content: attr(data-placeholder); color: var(--muted); pointer-events: none; position: absolute; }
.rt-area img { cursor: pointer; }
.rt-area img.rt-img-selected { outline: 3px solid var(--accent); outline-offset: 2px; }
.rt-hint { margin: 6px 0 0; font-size: .82rem; color: var(--muted); }
.img-bar { position: absolute; z-index: 3; display: flex; align-items: center; gap: 2px; padding: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; box-shadow: var(--shadow-lift); }
.img-bar .rt-btn { border-radius: 999px; }
.article-editor { max-width: 900px; }

/* ---------- map (editable canvas) ---------- */
.map-pane { display: none; min-width: 0; }
.tree-editor.mode-map { grid-template-columns: minmax(0, 1fr) 440px; }
.mode-map .steps-pane { display: none; }
.mode-map .map-pane { display: flex; flex-direction: column; gap: 10px; position: sticky; top: 150px; }
.mode-map .step-pane { position: sticky; top: 150px; max-height: calc(100vh - 170px); overflow-y: auto; }
.mode-map .rt-toolbar { position: static; }
.steps-pane .segmented { margin-bottom: 4px; }
.map-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.map-toolbar .segmented { width: 160px; flex: none; }
.map-hint { flex: 1; min-width: 200px; font-size: .82rem; color: var(--muted); }
.map-hint-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--accent); background: var(--surface); vertical-align: -1px; }
.btn-icon { width: 34px; padding-left: 0; padding-right: 0; font-size: 1.05rem; }
.map-canvas {
  height: calc(100vh - 220px); min-height: 380px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  background-color: var(--bg-tint); background-image: radial-gradient(circle, #c7d2e6 1px, transparent 1.2px); background-size: 22px 22px;
  box-shadow: inset 0 1px 3px rgb(67 86 134 / 5%); cursor: grab; touch-action: none; user-select: none;
}
.map-canvas.map-panning { cursor: grabbing; }
.map-svg { display: block; width: 100%; height: 100%; }
.map-node { cursor: move; }
.map-node .map-body { stroke: var(--border-strong); stroke-width: 1.5; filter: drop-shadow(0 2px 4px rgb(67 86 134 / 10%)); }
.map-node .map-body:not([fill]) { fill: var(--surface); }
.map-node:hover .map-body { stroke: var(--accent); }
.map-node:focus { outline: none; }
.map-node:focus-visible .map-body { stroke: var(--accent); stroke-width: 3; }
.map-start .map-body { stroke: var(--accent); stroke-width: 2.5; }
.map-end .map-body:not([fill]) { fill: #f4faf6; }
.map-problem .map-body { stroke: var(--warn); stroke-dasharray: 5 4; }
.map-selected .map-body { stroke: var(--accent); stroke-width: 3; stroke-dasharray: none; filter: drop-shadow(0 4px 14px rgb(51 122 202 / 30%)); }
.map-drop .map-body { stroke: var(--accent); stroke-width: 3; fill: var(--accent-soft); }
.map-title { font-size: 13.5px; font-weight: 650; fill: var(--text); pointer-events: none; }
.map-sub { font-size: 11px; fill: var(--muted); pointer-events: none; }
.map-flag rect { fill: var(--accent); }
.map-flag text { font-size: 9.5px; font-weight: 800; letter-spacing: .08em; fill: #fff; text-anchor: middle; pointer-events: none; }
.map-handle { fill: var(--surface); stroke: var(--accent); stroke-width: 2.5; cursor: crosshair; opacity: .35; transition: opacity .15s, r .15s; }
.map-node:hover .map-handle, .map-selected .map-handle { opacity: 1; }
.map-handle:hover { fill: var(--accent); r: 10; }
.map-edge { fill: none; stroke: #9fb6af; stroke-width: 1.8; pointer-events: none; }
.map-edge-on { stroke: var(--accent); stroke-width: 2.4; }
.map-edge-hit { fill: none; stroke: transparent; stroke-width: 14; cursor: pointer; pointer-events: stroke; }
.map-arrow { fill: #9fb6af; }
.map-arrow-on { fill: var(--accent); }
.map-label { pointer-events: none; }
.map-label rect { fill: var(--surface); stroke: var(--border-strong); }
.map-label text { font-size: 11px; font-weight: 600; fill: var(--muted); text-anchor: middle; }
.map-label-on rect { stroke: var(--accent); fill: var(--accent-softer); }
.map-label-on text { fill: var(--accent-hover); }
.map-temp { fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-dasharray: 6 5; pointer-events: none; }
.choice-row.flash { animation: flash 1.6s ease-out; }
@keyframes flash { 0%, 30% { background: var(--accent-soft); border-color: var(--accent); } 100% { background: var(--surface-2); } }

/* ---------- feedback inbox, check-up, diffs, usage ---------- */
.nav-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 6px; border-radius: 999px; background: var(--orange); color: #fff; font-size: .72rem; font-weight: 800; }
.feedback-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.feedback-item { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: start; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; box-shadow: var(--shadow); }
.feedback-done { opacity: .65; }
.feedback-icon { font-size: 1.4rem; line-height: 1; }
.feedback-comment { margin: 6px 0; white-space: pre-wrap; }
.feedback-body a { color: var(--text); text-decoration: none; }
.feedback-body a:hover { color: var(--accent); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 22px; }
.tile { display: grid; gap: 2px; padding: 14px 16px; border-radius: var(--radius); background: var(--warn-soft); color: var(--text); text-decoration: none; border: 1px solid transparent; }
.tile:hover { border-color: var(--warn); color: var(--text); }
.tile-good { background: var(--ok-soft); }
.tile-good:hover { border-color: var(--ok); }
.tile-n { font-size: 1.6rem; font-weight: 800; }
.overdue { color: var(--danger); font-weight: 600; }
.issue-list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.issue-list li { padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.issue-url { word-break: break-all; color: var(--muted); }
.editor-meta { margin-top: 2px; }
.meta-form { display: grid; gap: 4px; }
.meta-form select { width: 100%; }
.diff { display: grid; gap: 14px; }
.diff-summary { margin: 0; font-weight: 600; }
.diff-step { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; }
.diff-step h3 { margin: 0 0 8px; font-size: 1rem; }
.diff-text { white-space: pre-wrap; font-size: .92rem; line-height: 1.6; background: var(--surface-2); border-radius: 8px; padding: 8px 10px; margin: 4px 0 8px; }
.diff-text ins { background: #dcefc8; text-decoration: none; border-radius: 3px; }
.diff-text del { background: #fbe0dc; color: #8a3a30; border-radius: 3px; }
.diff-added { border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.diff-removed { border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.btn-on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-hover); }
.usage-summary { font-size: .9rem; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--article-soft); }
.map-heat { fill: var(--accent); pointer-events: none; }
.map-dropoff .map-body { stroke: #e0a030; stroke-width: 3; stroke-dasharray: none; }
.map-edge-usage { stroke: #7fa6d8; }
.reader .tree-head { flex-direction: column; gap: 6px; }
.reader .tree-head .actions { gap: 2px; margin-left: -10px; }
.reader .tree-head .btn { padding: 6px 10px; font-size: .9rem; }

/* in-app replacements for prompt() and confirm() */
.ask-dialog { width: min(460px, calc(100vw - 32px)); }
.ask-message { margin: 0; white-space: pre-line; }
.ask-input { width: 100%; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font: inherit; margin-top: 4px; }
.ask-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.dialog-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 0 20px 18px; }
.btn-danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger-solid:hover { background: #a93226; border-color: #a93226; color: #fff; }

/* API keys */
.key-form { display: grid; gap: 10px; }
.check-line { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.check-line input { accent-color: var(--accent); }
.new-key { border-color: var(--yellow); box-shadow: 0 0 0 4px #fff4cc; }
.key-box { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px 14px; background: var(--surface-2); border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); margin-bottom: 16px; }
.key-box code { font-size: .95rem; word-break: break-all; flex: 1; min-width: 200px; }
.key-inactive { opacity: .55; }

/* ---------- quick jump (Ctrl/⌘ K) ---------- */
.palette { width: min(640px, calc(100vw - 32px)); margin: 12vh auto auto; padding: 0; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgb(67 86 134 / 25%); }
.palette::backdrop { background: rgb(52 68 109 / 35%); backdrop-filter: blur(2px); }
.palette-input { width: 100%; border: 0; border-bottom: 1px solid var(--border); padding: 18px 20px; font-size: 1.1rem; background: transparent; outline: none; }
.palette-list { list-style: none; margin: 0; padding: 6px; max-height: 55vh; overflow-y: auto; }
.palette-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; cursor: pointer; }
.palette-item.active { background: var(--accent-soft); }
.palette-group { cursor: default; padding: 10px 12px 4px; font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.palette-label { display: grid; min-width: 0; }
.palette-detail { font-size: .8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.palette-hint { flex: none; font-size: .75rem; color: var(--muted); }
.palette-foot { padding: 8px 16px; border-top: 1px solid var(--border); font-size: .78rem; color: var(--muted); }

/* ---------- dialogs, toasts, tables ---------- */
.dialog { border: 1px solid var(--border); border-radius: 20px; padding: 0; width: min(580px, calc(100vw - 32px)); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lift); }
.dialog-wide { width: min(900px, calc(100vw - 32px)); }
.dialog::backdrop { background: rgb(52 68 109 / 35%); backdrop-filter: blur(2px); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.dialog-head h2 { margin: 0; font-size: 1.15rem; }
.dialog-body { padding: 14px 20px 20px; max-height: 70vh; overflow-y: auto; }
.history { list-style: none; padding: 0; margin: 0; display: grid; }
.history li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.history li:last-child { border-bottom: 0; }
.history .badge { margin-left: 8px; }

#toasts, .toasts { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 100; width: max-content; max-width: calc(100vw - 32px); }
.toast { padding: 11px 18px; border-radius: 999px; background: var(--text); color: #fff; box-shadow: var(--shadow-lift); transition: opacity .4s; font-weight: 500; }
.toast-error { background: var(--danger); }
.toast-hide { opacity: 0; }

.table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-top: 20px; overflow: hidden; box-shadow: var(--shadow); }
.table th, .table td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table th { font-size: .76rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; background: var(--surface-2); }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; max-width: 660px; }
.inline-form input { flex: 1; min-width: 220px; }
.roles { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0 0 28px; padding: 16px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.roles dt { font-weight: 700; }
.roles dd { margin: 0; color: var(--muted); }

/* ---------- login ---------- */
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: linear-gradient(160deg, var(--navy) 0%, var(--blue) 100%); }
.login-card { width: min(420px, 100%); background: var(--surface); border: 0; border-radius: 26px; padding: 38px 34px; text-align: center; box-shadow: 0 30px 60px rgb(0 0 0 / 22%); }
.login-card .brand-logo { height: 44px; margin: 0 auto; }
.login-card h1 { margin: 16px 0 6px; }
.login-stars { display: block; height: 22px; margin: 0 auto 4px; }
.login-card .btn { margin-top: 8px; }
.dev-login { margin-top: 26px; padding-top: 18px; border-top: 1px dashed var(--border-strong); display: grid; gap: 8px; }
.dev-login input { padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); }

/* ---------- small screens ---------- */
@media (max-width: 1100px) {
  .tree-editor.mode-map { grid-template-columns: minmax(0, 1fr) 360px; }
}
@media (max-width: 860px) {
  .tree-editor, .tree-editor.mode-map { grid-template-columns: 1fr; }
  .mode-map .map-pane, .mode-map .step-pane { position: static; max-height: none; }
  .map-canvas { height: 60vh; }
  .steps-pane { position: static; max-height: 320px; }
  .editor-bar { position: static; }
  .rt-toolbar { top: 61px; }
  .radio-cards { grid-template-columns: 1fr; }
}
@container (max-width: 520px) {
  .radio-cards { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .feedback-item { grid-template-columns: auto 1fr; }
  .feedback-item .actions { grid-column: 1 / -1; }
  .import-flow > li { padding: 56px 16px 16px; }
  .import-modes { grid-template-columns: 1fr; }
}
@container (max-width: 680px) {
  .choice-row { grid-template-columns: 1fr auto; }
  .choice-row .arrow { display: none; }
  .choice-row .target-picker { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 480px) {
  .brand { gap: 8px; }
  .brand-logo { height: 22px; }
  .brand-name { padding-left: 8px; font-size: .9rem; }
  .menu-word { display: none; }
  .nav { gap: 8px; }
}
@media (max-width: 600px) {
  #app { padding: 18px 16px 64px; }
  .topbar { flex-wrap: wrap; padding: 10px 16px; gap: 10px; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .hello { padding: 22px 20px; }
  .step-card, .article { padding: 20px 18px; border-radius: var(--radius); }
  .tree-head { flex-direction: column; }
  .step-pane { padding: 16px; }
  .card-meta { padding-left: 18px; }
}

/* ---------------------------------------------------------------- welcome questions and settings */
.welcome { max-width: 760px; margin: 0 auto; }
.welcome-hello { margin-bottom: 18px; }
.welcome-card { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 26px 28px; box-shadow: var(--shadow); }
.welcome-card h2 { margin: 6px 0 4px; }
.welcome-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 22px; }
.welcome-foot .btn-primary { margin-left: auto; }
.step-dots { display: flex; gap: 6px; }
.step-dots span { width: 28px; height: 6px; border-radius: 999px; background: var(--border); }
.step-dots span.on { background: var(--accent); }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin-top: 14px; }
.pick-card {
  --c: var(--accent);
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s;
}
.pick-card:hover { border-color: var(--c); }
.pick-card.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 10%, white); }
.pick-card input { accent-color: var(--c); margin: 0; }
.pick-card:has(input:focus-visible) { outline: 3px solid var(--accent-soft); outline-offset: 1px; }
.pick-text { display: flex; flex-direction: column; min-width: 0; }
.settings-q2 { margin-top: 28px; }
.settings-save { margin-top: 20px; }
.chip-star { color: #e0a800; font-size: .85rem; }
.chip-toggle { cursor: pointer; font: inherit; }
.collection-more { display: contents; }
.collection-more[hidden] { display: none; }
.collection-settings { align-self: center; margin-left: 4px; }
.picked { flex-basis: 100%; margin-top: 2px; }
.domain-list { list-style: none; padding: 0; margin: 0 0 14px; display: flex; flex-direction: column; gap: 6px; }
.domain { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }

/* ---------------------------------------------------------------- change log */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.filters input { flex: 1 1 200px; }
.audit-list { list-style: none; padding: 0; margin: 0; }
.audit-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--border); }
.audit-row:last-child { border-bottom: 0; }
.audit-icon { width: 28px; flex: none; text-align: center; font-size: 1.05rem; line-height: 1.5; }
.audit-main { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.audit-actions { flex: none; }
.audit-entry > p:first-child { font-weight: 600; margin-bottom: 2px; }
.audit-undo { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); align-items: center; }
.audit-values { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.audit-json { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; font-size: .8rem; overflow-x: auto; max-height: 300px; }
.step-undo { margin-left: 10px; vertical-align: middle; font-weight: 600; }
@media (max-width: 600px) {
  .audit-row { flex-wrap: wrap; }
  .audit-actions { margin-left: 40px; }
}
.settings-sub { margin: 24px 0 8px; font-size: 1rem; }

/* ---------------------------------------------------------------- your home page */
.home-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 18px; box-shadow: var(--shadow); }
.home-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.home-head h2 { margin: 0; font-size: 1.1rem; }
.home-head-extra { display: flex; gap: 10px; align-items: center; }
.home-empty { margin: 0; }
.home-guides { margin-top: 6px; }
.mini-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.mini-card { position: relative; display: flex; align-items: center; gap: 4px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); transition: border-color .2s, background .2s; }
.mini-card:hover { border-color: var(--border-strong); background: var(--accent-softer); }
.mini-link { flex: 1; display: flex; gap: 10px; align-items: center; padding: 10px 12px; text-decoration: none; color: var(--text); min-width: 0; }
.mini-link:hover { color: var(--text); }
.mini-link .card-icon { width: 32px; height: 32px; border-radius: 9px; }
.mini-link .card-icon svg { width: 18px; height: 18px; }
.mini-text { display: flex; flex-direction: column; min-width: 0; }
.mini-title { font-weight: 650; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mini-text .badge-new { margin-left: 8px; padding: 1px 8px; }
.badge-new { background: var(--yellow); color: var(--navy-deep); }
.pin-icon { border: 0; background: none; cursor: pointer; font-size: 1.15rem; line-height: 1; padding: 6px 8px; color: var(--slate); border-radius: 8px; }
.pin-icon:hover { color: var(--orange); background: var(--warn-soft); }
.pin-on, .pin-btn.pin-on { color: var(--orange); }
.change-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.change-row { display: flex; gap: 12px; align-items: flex-start; padding: 8px 4px; border-bottom: 1px solid var(--border); }
.change-row:last-child { border-bottom: 0; }
.change-row .badge { margin-left: 8px; vertical-align: 1px; }
.change-title { font-weight: 650; text-decoration: none; }
.change-dot { flex: none; width: 10px; height: 10px; margin-top: 7px; border-radius: 50%; background: var(--warn); }
.change-dot-new { background: var(--yellow); box-shadow: 0 0 0 3px rgb(255 198 0 / 25%); }
.change-dot-due { background: var(--orange); }
.deal-strip { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 2px 24px; }
.deal-strip-row { display: flex; gap: 10px; align-items: baseline; padding: 4px 4px; min-width: 0; }
.deal-strip-row .change-dot { margin-top: 0; align-self: center; }
.deal-strip-row .change-title { flex: 0 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deal-strip-meta { flex: 1 1 0; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deal-strip-row .badge { margin-left: 0; }
.recent-list { list-style: none; padding: 0; margin: 0; display: flex; gap: 8px; flex-wrap: wrap; }
.recent-link { display: inline-flex; gap: 6px; align-items: center; padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2); text-decoration: none; color: var(--text); font-size: .9rem; }
.recent-link:hover { border-color: var(--accent); color: var(--text); }
.recent-link svg { width: 16px; height: 16px; color: var(--accent); flex: none; }
.recent-article svg { color: var(--article); }
.order-list { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 6px; }
.order-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.order-arrows { display: flex; gap: 2px; flex: none; }
.order-row .check-line { flex-wrap: nowrap; align-items: flex-start; }
.order-row .check-line input { margin-top: 4px; }
.customise h3 { margin: 4px 0 6px; font-size: 1rem; }

/* ---------------------------------------------------------------- this call */
.callbar { background: var(--highlight); border-bottom: 1px solid #f1d77a; }
.callbar-inner { max-width: 1060px; margin: 0 auto; padding: 8px 28px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; font-size: .9rem; }
.callbar-facts { display: flex; gap: 14px; flex-wrap: wrap; flex: 1; min-width: 0; }
.callbar-fact { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.callbar-actions { display: flex; gap: 8px; }
.callbar .btn:not(.btn-primary) { background: rgb(255 255 255 / 70%); }

/* ---------------------------------------------------------------- settings bits */
.device-list, .backup-list { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 6px; }
.device { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.device .badge { margin-left: 8px; }
.key-snippet { align-items: flex-start; }
.key-snippet pre { flex: 1; min-width: 200px; margin: 0; white-space: pre-wrap; word-break: break-all; font-size: .82rem; }
.missing h3 { margin: 18px 0 6px; font-size: 1rem; }
.missing h3:first-child { margin-top: 4px; }
.missing .badge { margin-left: 8px; }

@media (max-width: 600px) {
  .home-section { padding: 14px; }
  .callbar-inner { padding: 8px 16px; gap: 6px 12px; }
  .callbar-actions { margin-left: auto; }
  .callbar-facts { order: 3; flex-basis: 100%; gap: 4px 12px; }
  .mini-grid { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------- locking, auto-answers, ticket links */
.badge-locked { background: var(--danger-soft); color: var(--danger); margin-left: 8px; }
.menu-danger strong { color: var(--danger); }
.person-actions { display: grid; gap: 4px; min-width: min(420px, 80vw); }
.person-actions .alert { margin: 0 0 8px; }
.choice-match { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.choice-match input { flex: 1; min-width: 200px; padding: 6px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); }
.auto-answer { width: 100%; padding: 10px 12px; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); }
.auto-answer summary { cursor: pointer; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.auto-answer input { padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); min-width: 240px; }
.auto-note { margin: 0 0 14px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--accent-softer); border: 1px solid var(--accent-soft); font-size: .92rem; }
.auto-note p { margin: 0; }
.auto-note p + p { margin-top: 4px; }
.ticket-link { width: 100%; margin-top: 14px; font-family: ui-monospace, Menlo, monospace; font-size: .85rem; }

/* ---------------------------------------------------------------- variables */
.variable { white-space: pre-line; }
.variable-add { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.variable-add input { flex: 1 1 180px; padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); }
.variable-filter, .variable-picker + input, .dialog .variable-picker ~ input { width: 100%; }
.variable-filter { padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); }
.variables-table td { vertical-align: top; }
.variable-name { display: inline-block; font-size: .88rem; padding: 2px 6px; border-radius: 6px; background: var(--accent-softer); color: var(--navy-deep); white-space: nowrap; margin-bottom: 4px; }
.variables-table td:first-child { min-width: 190px; }
.variable-cell { min-width: 240px; }
.variable-value { width: 100%; padding: 7px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font: inherit; resize: vertical; }
.variable-value[readonly] { border-color: transparent; background: none; padding-left: 0; resize: none; }
.variable-cell input[type="url"] { width: 100%; margin-top: 6px; padding: 5px 8px; border: 1px solid var(--border); border-radius: 8px; font-size: .85rem; }
.variable-meta { display: grid; grid-template-columns: 1fr 2fr; gap: 6px; margin: 6px 0; }
.variable-meta input { padding: 5px 8px; border: 1px solid var(--border); border-radius: 8px; font-size: .85rem; min-width: 0; }
.used-in summary { cursor: pointer; color: var(--accent); }
.used-in ul { margin: 6px 0 0; padding-left: 18px; }
.variable-picker { list-style: none; padding: 0; margin: 10px 0 0; max-height: 50vh; overflow: auto; display: grid; gap: 2px; }
.dialog input[type="search"] { width: 100%; padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); }
@media (max-width: 760px) {
  .variables-table thead { display: none; }
  .variables-table tr { display: grid; gap: 6px; padding: 10px 0; }
  .variables-table td { border: 0; padding: 2px 0; }
}

/* ---------------------------------------------------------------- current deals and access areas */
.no-guides #search { display: none; }
.area-pick { margin-top: 6px; }
.area-pick select, .domain-areas select { font-size: .85rem; }
.area-note { margin-top: 6px; }
.domain-areas { margin-left: auto; margin-right: 8px; display: inline-flex; gap: 6px; align-items: center; color: var(--muted); }
.deal-tools { margin-bottom: 14px; }
.deal-search { max-width: 320px; }
.deal-group { margin-bottom: 26px; }
.deal-group-title { font-size: 1.05rem; color: var(--muted); margin: 6px 0 12px; }
.deal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; align-items: stretch; }
.deal-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; scroll-margin-top: 90px; }
.deal-card:target { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.deal-upcoming { border-style: dashed; }
.deal-ended { opacity: .75; }
.deal-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.deal-products { display: flex; gap: 6px; flex-wrap: wrap; }
.deal-product { font-size: .78rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--navy-deep); }
.deal-title { margin: 0; font-size: 1.15rem; }
.deal-label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 3px; }
.deal-offer { white-space: pre-line; }
.deal-reqs { list-style: none; padding: 0; margin: 0; display: grid; gap: 3px; }
.deal-reqs li::before { content: '✓'; color: var(--ok); font-weight: 800; margin-right: 8px; }
.deal-code { display: flex; gap: 8px; align-items: center; }
.deal-code code { font-size: 1rem; font-weight: 700; padding: 3px 10px; border-radius: 8px; background: var(--highlight); letter-spacing: .04em; }
.deal-code .deal-label { margin: 0; }
.deal-dates { font-size: .9rem; color: var(--muted); margin-top: auto; padding-top: 4px; }
.deal-note { margin: 0; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--surface-2); font-size: .85rem; }
.deal-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 2px; }
.deal-edit { display: inline-flex; gap: 2px; margin-left: auto; flex-wrap: wrap; }
.deal-updated { margin: 0; }
.deal-form { display: grid; gap: 12px; min-width: 0; }
.deal-field { display: grid; gap: 4px; min-width: 0; }
.deal-field > input, .deal-field > textarea, .deal-field > select { width: 100%; min-width: 0; box-sizing: border-box; }
.deal-field input[type="text"], .deal-field input[type="date"], .deal-field textarea, .deal-field select { padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font: inherit; background: var(--surface); }
.deal-field input:disabled { opacity: .45; }
.deal-product-pick { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.deal-product-pick .toggle-pill input { display: none; }
.deal-product-pick input[type="text"] { padding: 5px 10px; border: 1px dashed var(--border-strong); border-radius: 999px; width: 170px; }
.deal-dates-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: end; }
.deal-indef { grid-column: 1 / -1; }
@media (max-width: 600px) { .deal-grid { grid-template-columns: 1fr; } .deal-edit { margin-left: 0; } }

/* ---------------------------------------------------------------- training */
.course-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.course-draft { border-style: dashed; }
.course-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: .85rem; color: var(--muted); }
.course-desc { margin: 0; }
.course-card .deal-title a { color: var(--text); text-decoration: none; }
.course-card .deal-title a:hover { color: var(--accent); }
.course-notice { padding: 10px 14px; border-radius: var(--radius-sm); font-size: .9rem; margin: 0 0 18px; }
.course-notice-warn { background: var(--warn-soft); color: var(--warn); }
.course-notice-ok { background: var(--ok-soft); color: var(--ok); }
.course-head h1 { margin: 4px 0 2px; }
.course-admin-links { display: inline-flex; gap: 8px; align-items: center; }
.center { text-align: center; }

.slide-stage { margin-top: 6px; }
.slide { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lift); padding: 34px 44px; min-height: 380px; display: flex; flex-direction: column; justify-content: center; }
.slide-title { margin: 0 0 18px; font-size: 1.7rem; line-height: 1.2; }
.slide-body { font-size: 1.12rem; line-height: 1.6; }
.slide-body ul, .slide-body ol { padding-left: 1.3em; }
.slide-body li { margin: 6px 0; }
.slide-body img { max-height: 55vh; width: auto; max-width: 100%; display: block; margin: 10px auto; }
.slide-notes { margin-top: 22px; font-size: .95rem; color: var(--muted); }
.slide-notes summary { cursor: pointer; font-weight: 600; }
.slide-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 16px 0 10px; flex-wrap: wrap; }
.slide-progress { display: flex; align-items: center; gap: 12px; flex: 1; justify-content: center; }
.slide-dots { display: flex; gap: 5px; flex-wrap: wrap; justify-content: center; max-width: 420px; }
.slide-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--border-strong); border: 0; padding: 0; cursor: pointer; }
.slide-dot.seen { background: var(--accent-soft); outline: 1px solid var(--accent); outline-offset: -1px; }
.slide-dot.on { background: var(--accent); transform: scale(1.3); }
.slide-counter { min-width: 48px; text-align: right; }
@media (max-width: 600px) { .slide { padding: 22px 20px; min-height: 260px; } .slide-title { font-size: 1.3rem; } .slide-body { font-size: 1rem; } }

.quiz-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.quiz-q { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.quiz-right { border-color: var(--ok); }
.quiz-wrong { border-color: var(--warn); }
.quiz-text { margin: 0 0 10px; font-size: 1.05rem; }
.quiz-choices { display: grid; gap: 6px; }
.quiz-choice { display: flex; gap: 10px; align-items: baseline; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; }
.quiz-choice:hover { background: var(--surface-2); }
.quiz-choice input { accent-color: var(--accent); }
.quiz-choice.is-answer { background: var(--ok-soft); border-color: var(--ok); }
.quiz-choice.is-picked-wrong { background: var(--warn-soft); border-color: var(--warn); text-decoration: line-through; }
.quiz-tick { color: var(--ok); font-weight: 800; }
.quiz-why { margin: 10px 0 0; font-size: .92rem; }
.quiz-why.ok { color: var(--ok); }
.quiz-why.warn { color: var(--warn); }
.quiz-send { margin: 18px 0; display: flex; justify-content: flex-end; }
.quiz-result { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; padding: 18px 22px; border-radius: var(--radius); margin-bottom: 18px; border: 1px solid var(--border); background: var(--surface); }
.quiz-pass { border-color: var(--ok); background: var(--ok-soft); }
.quiz-fail { border-color: var(--warn); background: var(--warn-soft); }
.quiz-score { font-size: 2.4rem; font-weight: 800; min-width: 90px; }
.quiz-result-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }

.course-editor-bar .editor-title { gap: 4px; }
.editor-title-input { font-size: 1.4rem; font-weight: 700; border: 1px solid transparent; border-radius: var(--radius-sm); padding: 4px 10px; margin-left: -10px; background: transparent; width: 100%; box-sizing: border-box; }
.editor-desc-input { border: 1px solid transparent; border-radius: var(--radius-sm); padding: 3px 10px; margin-left: -10px; background: transparent; width: 100%; box-sizing: border-box; color: var(--muted); }
.editor-title-input:hover, .editor-desc-input:hover { border-color: var(--border); background: var(--surface); }
.editor-title-input:focus, .editor-desc-input:focus { border-color: var(--accent); background: var(--surface); outline: none; box-shadow: 0 0 0 4px var(--accent-soft); color: var(--text); }
.editor-status { min-width: 110px; text-align: right; }
.course-editor { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 18px; align-items: start; }
.slide-list { list-style: none; padding: 6px; margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); display: grid; gap: 2px; position: sticky; top: 150px; max-height: calc(100vh - 170px); overflow-y: auto; }
.slide-row { display: flex; align-items: center; gap: 4px; border-radius: 8px; }
.slide-row.on { background: var(--accent-soft); }
.slide-row:hover { background: var(--surface-2); }
.slide-row.on:hover { background: var(--accent-soft); }
.slide-pick { flex: 1; display: flex; gap: 8px; align-items: center; min-width: 0; border: 0; background: none; padding: 8px 8px; text-align: left; cursor: pointer; font: inherit; color: var(--text); }
.slide-num { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--surface-2); font-size: .75rem; font-weight: 700; display: grid; place-items: center; color: var(--muted); }
.slide-row.on .slide-num { background: var(--accent); color: #fff; }
.slide-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.slide-row-tools { display: none; flex: none; }
.slide-row:hover .slide-row-tools, .slide-row.on .slide-row-tools { display: inline-flex; }
.slide-add { padding: 6px 4px 2px; }
.slide-pane { display: grid; gap: 10px; min-width: 0; }
.slide-pane-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.slide-title-input { font-size: 1.25rem; font-weight: 700; padding: 8px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); width: 100%; box-sizing: border-box; }
.slide-notes-input { padding: 8px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); width: 100%; box-sizing: border-box; font: inherit; }
@media (max-width: 760px) { .course-editor { grid-template-columns: 1fr; } .slide-list { position: static; max-height: 220px; } }

.quiz-editor-head { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.pass-input { width: 64px; padding: 5px 8px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); }
.question-list { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 12px; }
.question-edit { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 8px; box-shadow: var(--shadow); }
.question-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.question-text, .question-why { width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font: inherit; }
.question-edit .hint { margin: 0; }
.choice-list { display: grid; gap: 6px; }
.choice-edit { display: flex; gap: 8px; align-items: center; padding: 4px 8px; border-radius: var(--radius-sm); border: 1px solid transparent; }
.choice-edit.is-answer { background: var(--ok-soft); border-color: var(--ok); }
.choice-edit input[type="radio"] { accent-color: var(--ok); }
.choice-edit input[type="text"] { flex: 1; min-width: 0; padding: 6px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font: inherit; }

.ai-tab { max-width: 760px; }
.ai-steps { display: grid; gap: 16px; padding-left: 1.2em; }
.ai-steps .deal-actions { margin-top: 8px; }
.ai-paste { width: 100%; box-sizing: border-box; margin-top: 8px; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85rem; }

/* Required training */
.badge.due-current { background: var(--ok-soft); color: var(--ok); }
.badge.due-due-soon { background: var(--highlight); color: var(--navy-deep); }
.badge.due-overdue { background: var(--danger-soft, #fde8e8); color: var(--danger); }
.badge.due-todo { background: var(--accent-soft); color: var(--accent); }
.course-standing { display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.table-scroll { overflow-x: auto; }
.report-table th { vertical-align: top; }
.report-table td .badge { white-space: normal; }
.home-training .change-dot-due { box-shadow: 0 0 0 3px rgb(217 83 79 / 20%); }

/* Question types */
.question-type { padding: 4px 8px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font: inherit; font-size: .85rem; background: var(--surface); }
.question-head { gap: 10px; }
.question-model, .quiz-written, .quiz-short { width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font: inherit; background: var(--surface); }
.quiz-short { max-width: 360px; }
.quiz-q .hint { margin: 0 0 6px; }
.quiz-model { margin: 8px 0 0; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--ok-soft); font-size: .92rem; }
.quiz-pending { border-color: var(--accent); }
.check-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.check-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; box-shadow: var(--shadow); display: grid; gap: 8px; }
.check-item blockquote { margin: 0; padding: 8px 12px; border-left: 3px solid var(--accent); background: var(--surface-2); white-space: pre-wrap; }
.check-model { margin: 0; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--ok-soft); font-size: .92rem; }
.check-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.check-actions input { flex: 1; min-width: 200px; padding: 6px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font: inherit; }
.ai-check { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 18px; margin-bottom: 16px; display: grid; gap: 8px; }
.ai-check summary { cursor: pointer; font-weight: 650; }

/* Home dashboard */
.dash { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 18px; align-items: stretch; }
.dash-cell { position: relative; display: flex; flex-direction: column; min-width: 0; }
.dash-box { position: relative; flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
.dash-box > .home-section, .dash-box > .home-guides { margin: 0; min-width: 0; flex: 1 1 auto; }
.dash-cell.fixed > .dash-box { position: absolute; inset: 0; }
.dash-cell.fixed .dash-box > .home-section, .dash-cell.fixed .dash-box > .home-guides { min-height: 0; overflow: auto; }
.dash-bar { position: sticky; top: 64px; z-index: 5; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 16px; border-radius: var(--radius); background: var(--highlight); border: 1px solid var(--yellow); box-shadow: var(--shadow-lift); }
.dash-help { margin: 0; font-size: .9rem; flex: 1 1 320px; }
.dash-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.dash-editing .dash-box { outline: 2px dashed var(--border-strong); outline-offset: 3px; border-radius: var(--radius); }
.dash-editing .dash-box > .home-section, .dash-editing .dash-box > .home-guides { pointer-events: none; user-select: none; }
.dash-tools { display: flex; gap: 6px; align-items: center; padding: 4px 6px 4px 4px; margin-bottom: 6px; border-radius: 999px; background: var(--navy-deep, #2b3a5c); color: #fff; font-size: .8rem; }
.dash-name { font-weight: 650; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-buttons { display: inline-flex; gap: 2px; }
.dash-handle, .dash-btn { border: 0; background: rgb(255 255 255 / 14%); color: #fff; border-radius: 999px; min-width: 28px; height: 26px; padding: 0 8px; font: inherit; font-weight: 700; cursor: pointer; }
.dash-handle { cursor: grab; touch-action: none; font-size: 1rem; }
.dash-btn:hover, .dash-handle:hover { background: rgb(255 255 255 / 28%); }
.dash-btn:disabled { opacity: .35; cursor: default; }
.dash-resize { position: absolute; right: -4px; bottom: -4px; width: 22px; height: 22px; cursor: nwse-resize; touch-action: none; border-radius: 6px; background: var(--accent); box-shadow: var(--shadow); }
.dash-resize::after { content: ''; position: absolute; inset: 6px; border-right: 2px solid #fff; border-bottom: 2px solid #fff; }
.dash-cell.dragging .dash-box { opacity: .55; outline-color: var(--accent); }
.dash-cell.dragging .dash-handle { cursor: grabbing; }
.dash-cell.resizing .dash-box { outline-color: var(--accent); }
.dash-empty { opacity: .8; }
.widget-pick { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.widget-pick li { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.rank-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; counter-reset: rank; }
.rank-list li { display: flex; gap: 10px; align-items: baseline; justify-content: space-between; padding: 5px 4px; border-bottom: 1px solid var(--border); }
.rank-list li:last-child { border-bottom: 0; }
.rank-list li > :first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.stat-tile { display: grid; gap: 2px; padding: 10px 12px; border-radius: var(--radius-sm); text-decoration: none; color: var(--text); background: var(--surface-2); }
.stat-n { font-size: 1.6rem; font-weight: 800; line-height: 1.1; }
.stat-label { font-size: .8rem; color: var(--muted); }
.stat-ok { background: var(--ok-soft); } .stat-ok .stat-n { color: var(--ok); }
.stat-soon { background: var(--highlight); }
.stat-bad { background: var(--danger-soft); } .stat-bad .stat-n { color: var(--danger); }
.stat-todo { background: var(--accent-soft); } .stat-todo .stat-n { color: var(--accent); }
.stat-note { margin: 10px 0 0; }
.stat-sub { font-size: .85rem; margin: 14px 0 6px; color: var(--muted); }
@media (max-width: 760px) { .dash-bar { top: 110px; } .dash-resize { display: none; } }

/* Just for fun */
.fun-fact-text { margin: 0; font-size: 1.02rem; line-height: 1.5; }
.fun-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.fun-tea-names { width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font: inherit; resize: vertical; }
.fun-tea-result { margin: 10px 0 0; font-size: 1.05rem; min-height: 1.5em; }
.fun-count { margin: 4px 0 2px; font-size: 1.7rem; font-weight: 800; color: var(--navy-deep); }
.fun-count-sub { margin: 0; }
.shelf-hint { margin: 0 0 10px; }
.shelf { display: flex; gap: 6px; align-items: flex-end; padding: 10px 12px 0; border-bottom: 10px solid #a77b52; border-radius: 4px 4px 2px 2px; background: linear-gradient(var(--surface-2), var(--surface)); min-height: 140px; overflow-x: auto; }
.spine { flex: 1 1 0; min-width: 40px; max-width: 64px; height: var(--tall); border: 0; border-radius: 4px 4px 0 0; padding: 8px 4px; background: var(--spine); box-shadow: inset -4px 0 0 rgb(0 0 0 / 14%), inset 4px 0 0 rgb(255 255 255 / 12%); cursor: pointer; display: flex; align-items: flex-end; justify-content: center; transition: transform .15s ease, box-shadow .15s ease; font: inherit; }
.spine:hover:not(:disabled) { transform: translateY(-4px); }
.spine.picked { transform: translateY(-14px); box-shadow: 0 0 0 3px var(--yellow), 0 8px 16px rgb(0 0 0 / 20%); }
.spine:disabled { cursor: default; }
.spine-label { display: grid; gap: 1px; width: 100%; padding: 3px 2px; border-radius: 3px; background: #fff; color: #222; font-size: .68rem; font-weight: 800; line-height: 1.15; text-align: center; font-variant-numeric: tabular-nums; }
.shelf-done .spine { animation: shelf-hop .5s ease both; }
.shelf-done .spine:nth-child(2) { animation-delay: .05s; } .shelf-done .spine:nth-child(3) { animation-delay: .1s; } .shelf-done .spine:nth-child(4) { animation-delay: .15s; } .shelf-done .spine:nth-child(5) { animation-delay: .2s; } .shelf-done .spine:nth-child(6) { animation-delay: .25s; }
@keyframes shelf-hop { 40% { transform: translateY(-10px); } }
@media (prefers-reduced-motion: reduce) { .spine, .shelf-done .spine { transition: none; animation: none; } }
.shelf-clock { font-size: 1.3rem; font-weight: 800; font-variant-numeric: tabular-nums; min-width: 4.5ch; }
.shelf-board li.me { font-weight: 700; }
.facts-box { width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font: inherit; line-height: 1.5; resize: vertical; }

/* ---------- polish ---------- */
.emo { display: inline-block; margin-right: .45em; line-height: 1; font-style: normal; }
.btn > .emo, .dash-btn > .emo, .chip > .emo, .badge > .emo { margin-right: 0; }
.rank-list .recent-link { padding: 0; border: 0; background: none; border-radius: 0; font-size: inherit; gap: 10px; color: var(--text); font-weight: 550; }
.rank-list .recent-link:hover { color: var(--accent); }
.rank-list li { padding: 8px 2px; }
.shelf { justify-content: center; gap: 8px; }
@media (max-width: 600px) {
  /* Hero: stars tucked in the corner, clear of the greeting; buttons in a tidy two-column grid. */
  .hello::after { width: 64px; height: 36px; right: 14px; top: 14px; }
  .hello h1 { font-size: 1.55rem; padding-right: 64px; }
  .hello .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; align-items: stretch; }
  .hello .actions .btn { padding: 9px 10px; font-size: .9rem; white-space: normal; text-align: center; }
  .hello .actions .btn-primary, .hello .actions .btn:only-child, .hello .actions .btn:last-child:nth-child(even) { grid-column: 1 / -1; }
  /* One-line lists (training to do, deals): details drop under the title instead of being cut off. */
  .deal-strip-row { flex-wrap: wrap; row-gap: 2px; }
  .deal-strip-row .change-title { white-space: normal; flex-basis: calc(100% - 24px); }
  .deal-strip-meta { flex-basis: 100%; padding-left: 20px; white-space: normal; }
  .deal-strip-row .badge { margin-left: 20px; }
  .card-meta { padding-left: 18px; }
}
.rank-list li { align-items: center; }

/* ---------- polish: forms ---------- */
.inline-form input, .filters input, .panel input[type='url'], .panel input[type='text']:not([class]) {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface);
}
.filters input:focus, .panel input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.filters select { flex: 0 0 auto; }
select { padding: 9px 12px; font-size: .95rem; }
.org-filter { border-radius: var(--radius-sm); padding: 9px 12px; }
.check-block { flex-wrap: nowrap; align-items: flex-start; }
.check-block > input { margin-top: 5px; flex: none; }
.variable-add { max-width: none; }
.deal-search { max-width: 360px; }

/* ---------- polish: tabs and chips ---------- */
button.tab { background: transparent; cursor: pointer; font: inherit; }
.tab.on { background: var(--surface); color: var(--text); border-color: var(--border); box-shadow: var(--shadow); }
.tabs { padding: 3px 0 6px; }

/* ---------- polish: layout ---------- */
.page-head { align-items: center; }
.empty-state { padding: 48px 24px; margin: 8px 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--muted); list-style: none; }
.empty-state h1 { font-size: 1.4rem; }
.panel .settings-q2 { margin-top: 28px; }
.report-wrap { margin-bottom: 18px; }
.tile, .stat-tile { align-content: start; gap: 6px; }
.tile-n { line-height: 1.1; }
.course-card .deal-actions { margin-top: auto; }
.course-standing { flex-wrap: nowrap; }
.deal-edit, .course-card .deal-edit { flex-basis: 100%; margin-left: 0; padding-top: 8px; margin-top: 4px; border-top: 1px solid var(--border); gap: 4px; }
.deal-edit > .btn:first-child { margin-left: -12px; }
.deal-edit .btn:not(.btn-danger) { color: var(--muted); font-weight: 550; }
.deal-edit .btn:not(.btn-danger):hover { color: var(--text); }
.pick-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.pick-card { align-items: flex-start; gap: 12px; }
.tabs + .table, .tabs + .table-scroll .table, .tabs + div > .table { margin-top: 0; }
.report-table th a { display: block; text-transform: none; letter-spacing: 0; font-size: .9rem; color: var(--accent); }
.audit-actions .btn { min-width: 128px; }
.shelf-board li { padding-left: 0; }
.course-editor-bar .editor-title { flex: 1 1 480px; min-width: min(100%, 480px); }
.course-editor-bar .check-line { align-items: center; row-gap: 8px; }
.table-scroll { overflow-x: auto; margin: 16px -6px 0; padding: 2px 6px 8px; }
.table-scroll > .table { margin-top: 0; }
.table-scroll > .table { min-width: 560px; }
.nowrap { white-space: nowrap; }
.slide { min-height: 320px; }
.fields-panel summary .muted { display: inline-block; margin-left: .3em; }
@container (max-width: 520px) { .rt-sep { display: none; } .rt-btn { padding: 5px 7px; } }
@container (max-width: 680px) {
  .choice-row { grid-template-columns: minmax(0, 1fr) auto; }
  .target-picker select, .target-select { width: 100%; min-width: 0; }
}

/* ---------- polish: phones ---------- */
@media (max-width: 600px) {
  .tabs { flex-wrap: wrap; overflow: visible; }
  .inline-form { flex-direction: column; align-items: stretch; }
  .inline-form input { min-width: 0; }
  .inline-form .btn { align-self: flex-start; }
  .domain { flex-wrap: wrap; }
  .domain-areas { order: 3; flex-basis: 100%; margin: 0; flex-wrap: wrap; }
  .domain-areas select { flex: 1; }
  .deal-search { max-width: none; }
  .editor-actions { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .editor-actions .btn { justify-content: center; }
  .editor-status, .save-status { grid-column: 1 / -1; text-align: left; min-width: 0; }
  .map-toolbar .btn { min-height: 40px; }
  .page-head > .actions { display: grid; grid-template-columns: 1fr 1fr; width: 100%; gap: 8px; }
  .page-head > .actions .btn { justify-content: center; white-space: normal; text-align: center; }
  .page-head > .actions .btn:only-child, .page-head > .actions .btn:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .course-card .deal-top { flex-wrap: wrap; }
  .course-standing { justify-content: flex-start; }
  .end-note { flex-direction: column; align-items: flex-start; gap: 6px; padding: 16px 18px; }
  .end-note .end-icon { font-size: 1.3rem; }
  .collection-main { flex-wrap: wrap; min-width: 0; flex-basis: 100%; }
  .collection-main .muted { white-space: nowrap; }
  .slide { min-height: 0; justify-content: flex-start; padding: 22px 18px; }
  .quiz-send .btn { width: 100%; justify-content: center; }
  .row-buttons .btn, .btn-sm.btn-ghost { min-height: 40px; min-width: 40px; }
  .panel, .home-section, .deal-card, .course-card, .fields-panel { padding: 18px; }
  .fields-panel summary .muted { display: block; margin: 4px 0 0 1.2em; }
}
.org-table th.org-col { text-align: center; }

.rt-toolbar select, .table select, .domain-areas select, .editor-title .check-line select { padding: 5px 8px; font-size: .875rem; }
.page-head:has(> div > a.small:first-child) { align-items: flex-end; }
.caret { margin-left: 4px; font-size: .8em; }
.deal-tools { align-items: center; }
.deal-tools .deal-search { height: 40px; }
.empty-state p { font-size: 1rem; margin: 0; }
.deal-tools { margin-bottom: 18px; }
.deal-tools .tabs { margin-bottom: 0; padding-bottom: 3px; }

/* Arranging the dashboard */
@media (min-width: 761px) { .dash-editing .dash-box { cursor: grab; touch-action: none; } }
.dash-editing .dash-btn { cursor: pointer; }
.dash-handle { display: inline-grid; place-items: center; }
.dash-dragging, .dash-dragging * { cursor: grabbing !important; user-select: none; }
.dash-cell.dragging .dash-box { opacity: .4; outline: 2px dashed var(--accent); }
.dash-ghost { position: fixed; z-index: 50; pointer-events: none; padding: 6px 12px; border-radius: 999px; background: var(--navy-deep); color: #fff; font-size: .85rem; font-weight: 650; box-shadow: var(--shadow-lift); white-space: nowrap; }
.dash-handle { touch-action: none; cursor: grab; }
@media (min-width: 761px) { .dash-handle { background: transparent; } }

/* Course categories */
.course-category-line { display: flex; align-items: center; gap: 10px; margin: 4px 0 8px; color: var(--muted); }
.course-category { width: 260px; max-width: 100%; padding: 6px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font: inherit; font-size: .9rem; background: var(--surface); }
.course-category:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.course-group { margin-top: 26px; }
.course-group:first-of-type { margin-top: 6px; }
.course-group-title { display: flex; align-items: baseline; gap: 10px; font-size: 1.15rem; margin: 0 0 12px; }
.course-group-title .count { font-size: .8rem; font-weight: 700; color: var(--muted); background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 1px 9px; }
.course-filter { margin-bottom: 8px; }
