/* Business system prototype: the shell (sidebar, header, panels, front door). */

.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); height: 100vh; height: 100dvh; transition: grid-template-columns .22s var(--ease); }
html.nav-mini .app { grid-template-columns: var(--side-mini-w) minmax(0, 1fr); }

.side-veil { display: none; }

/* ---------- Sidebar ---------- */
.side { position: relative; z-index: 30; display: flex; flex-direction: column; min-height: 0; background: var(--side-bg); color: var(--side-ink); border-right: 1px solid var(--side-line); }
.brand { flex: none; display: flex; align-items: center; gap: 10px; height: var(--head-h); padding: 0 16px; border-bottom: 1px solid var(--side-line); overflow: hidden; }
.brand__mark { width: 34px; height: 34px; flex: none; border-radius: var(--r-surface); display: grid; place-items: center; background: var(--accent); color: var(--on-accent); font: 800 13px var(--font-head); letter-spacing: .02em; }
.brand__name { min-width: 0; white-space: nowrap; }
.brand__name b { display: block; font: 700 15px/1.15 var(--font-head); color: var(--side-ink); }
.brand__name small { display: block; font-size: 11px; color: var(--side-muted); }
.nav { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 10px 10px 16px; scrollbar-width: thin; }
.nav__label { padding: 14px 10px 6px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--side-muted); white-space: nowrap; }
.ng { margin-bottom: 2px; }
.ng__head, .nav-link {
  position: relative; width: 100%; display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 7px 10px;
  border: 0; border-radius: var(--r-control); background: transparent; color: var(--side-ink); font-weight: 500; font-size: var(--fs-sm);
  text-align: left; text-decoration: none; line-height: 1.3;
}
.ng__head:hover, .nav-link:hover { background: color-mix(in srgb, var(--side-ink) 7%, transparent); }
.ng__head svg, .nav-link svg { width: 18px; height: 18px; flex: none; }
/* Long names wrap onto a second line rather than being cut off (Lee, 2026-11-13). */
.ng__head .lbl, .nav-link .lbl { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ng__chev { width: 15px !important; height: 15px !important; color: var(--side-muted); transition: transform .2s var(--ease); }
.ng.open .ng__chev { transform: rotate(90deg); }
.ng.current > .ng__head { color: var(--side-active-ink); font-weight: 600; }
.ng__pages { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .22s var(--ease); }
.ng.open .ng__pages { grid-template-rows: 1fr; }
.ng__pages > div { overflow: hidden; }
.ng__pages a {
  position: relative; display: flex; align-items: center; gap: 8px; min-height: 32px; margin: 1px 0; padding: 6px 10px 6px 38px; border-radius: var(--r-control);
  color: var(--side-ink); text-decoration: none; font-size: var(--fs-sm); line-height: 1.3;
}
.ng__pages a::before { content: ""; position: absolute; left: 19px; top: 0; bottom: 0; width: 1px; background: var(--side-line); }
.ng__pages a:hover { background: color-mix(in srgb, var(--side-ink) 7%, transparent); }
.ng__pages a[aria-current="page"] { background: var(--side-active-bg); color: var(--side-active-ink); font-weight: 600; }
.ng__pages a[aria-current="page"]::before { background: var(--side-active-ink); width: 2px; left: 18px; }
.ng__pages a .soon { margin-left: auto; font-size: 11px; font-weight: 600; color: var(--side-muted); }
.nav-link[aria-current="page"] { background: var(--side-active-bg); color: var(--side-active-ink); font-weight: 600; }
.side__foot { flex: none; padding: 10px; border-top: 1px solid var(--side-line); display: flex; gap: 6px; }
.side__foot .nav-link { flex: 1; }
.collapse-btn svg { transition: transform .22s var(--ease); }
html.nav-mini .collapse-btn svg { transform: rotate(180deg); }

/* Icons-only sidebar: labels hide, a group's pages fly out beside it */
html.nav-mini .brand__name, html.nav-mini .nav__label, html.nav-mini .ng__head .lbl, html.nav-mini .ng__chev,
html.nav-mini .nav-link .lbl, html.nav-mini .side__foot .nav-link:not(.collapse-btn) { display: none; }
html.nav-mini .brand { padding: 0 17px; }
html.nav-mini .ng__head, html.nav-mini .nav-link { justify-content: center; padding: 0; height: 36px; }
html.nav-mini .ng__pages { display: none; }
html.nav-mini .nav { overflow: visible; }
html.nav-mini .side { overflow: visible; }
.fly {
  position: fixed; z-index: 40; min-width: 210px; padding: 8px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-surface); box-shadow: var(--shadow-2); display: none;
}
.fly.on { display: block; animation: rise .16s var(--ease); }
.fly h4 { padding: 6px 10px 8px; font-size: var(--fs-sm); }
.fly a { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 10px; border-radius: var(--r-control); color: var(--ink-2); text-decoration: none; font-size: var(--fs-sm); }
.fly a:hover { background: var(--surface-2); color: var(--ink); }
.fly a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.fly a .soon { margin-left: auto; font-size: 10px; color: var(--muted); }

/* ---------- Main column ---------- */
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.head {
  position: relative; z-index: 20; flex: none; display: flex; align-items: center; gap: 10px; height: var(--head-h);
  padding: 0 var(--pad); background: var(--head-bg); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.head__menu { display: none; }
.head__gap { flex: 1 1 0; min-width: 0; }
.crumbs { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--muted); white-space: nowrap; overflow: hidden; }
.crumbs b { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.crumbs svg { width: 14px; height: 14px; flex: none; }
.head__search {
  display: flex; align-items: center; gap: 8px; width: 280px; height: 36px; padding: 0 10px; border: 1px solid var(--line-strong);
  border-radius: var(--r-control); background: color-mix(in srgb, var(--accent-soft) 60%, var(--surface)); color: var(--accent-ink); font-size: var(--fs-sm); font-weight: 500;
  border-color: color-mix(in srgb, var(--accent) 30%, var(--line));
}
.head__search:hover { border-color: var(--accent); background: var(--accent-soft); }
.head__search svg { width: 16px; height: 16px; flex: none; }
.head__search span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; }
.head__search kbd { white-space: nowrap; }
.head__search kbd { margin-left: auto; font: 600 11px var(--font-body); padding: 2px 6px; border-radius: var(--r-small); background: var(--surface-3); color: var(--ink-2); }
.mysys { position: relative; }
.mysys__n { min-width: 22px; height: 22px; padding: 0 6px; border-radius: var(--r-pill); background: var(--surface); color: var(--spark-strong); font-size: 12px; font-weight: 700; display: inline-grid; place-items: center; }
.mysys.bump { animation: bump .4s var(--ease); }
@keyframes bump { 40% { transform: scale(1.08); } }
.bell-dot { position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; border-radius: var(--r-dot); background: var(--spark); border: 2px solid var(--surface); }
.userbtn { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 10px 0 4px; border: 0; border-radius: var(--r-pill); background: var(--accent-soft); }
.userbtn:hover { background: color-mix(in srgb, var(--accent-soft) 70%, var(--accent) 30%); }
.userbtn span { text-align: left; line-height: 1.2; }
.userbtn b { display: block; font-size: var(--fs-sm); color: var(--ink); }
.userbtn small { display: block; font-size: 11px; color: var(--muted); }

.content { flex: 1; min-height: 0; overflow: auto; }
.page { display: flex; flex-direction: column; gap: 14px; min-height: 100%; padding: 20px var(--pad) var(--pad); }
.page__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page__title { display: grid; gap: 4px; min-width: 0; }
.page__title h1 { font-size: var(--fs-2xl); }
.page__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.panel { display: none; }
.panel.on { display: block; animation: rise .25s var(--ease); }

/* Pop-overs from the header */
.pop {
  position: fixed; z-index: 45; width: 380px; max-width: calc(100vw - 24px); background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-surface); box-shadow: var(--shadow-2); display: none; overflow: hidden;
}
.pop.on { display: block; animation: rise .16s var(--ease); }
.pop__head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 10px; }
.pop__body { max-height: 60vh; overflow: auto; padding: 0 8px 8px; }
.note { display: flex; gap: 10px; padding: 10px 8px; border-radius: var(--r-control); align-items: flex-start; }
.note:hover { background: var(--surface-2); }
.note b { display: block; color: var(--ink); font-size: var(--fs-sm); font-weight: 600; }
.note small { display: block; color: var(--muted); font-size: var(--fs-xs); }
.note.unread b::after { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: var(--r-dot); background: var(--spark); margin-left: 6px; vertical-align: middle; }

/* Search palette */
.palette-veil { position: fixed; inset: 0; z-index: 80; background: rgba(15, 26, 36, .3); display: none; padding: 10vh 16px 16px; }
.palette-veil.on { display: block; }
.palette { width: 620px; max-width: 100%; margin: 0 auto; background: var(--surface); border-radius: var(--r-surface); box-shadow: var(--shadow-2); overflow: hidden; animation: rise .16s var(--ease); }
.palette__in { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.palette__in svg { width: 18px; height: 18px; color: var(--muted); }
.palette__in input { flex: 1; height: 54px; border: 0; outline: none; background: transparent; font-size: var(--fs-lg); color: var(--ink); }
.palette__res { max-height: 56vh; overflow: auto; padding: 8px; }
.palette__grp { padding: 8px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.palette__item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; border-radius: var(--r-control); background: transparent; text-align: left; }
.palette__item[aria-selected="true"] { background: var(--accent-soft); }
.palette__item b { color: var(--ink); font-weight: 600; font-size: var(--fs-sm); }
.palette__item small { color: var(--muted); font-size: var(--fs-xs); margin-left: auto; }
.palette__item svg { width: 16px; height: 16px; color: var(--muted); }

/* ---------- Assistant (AI guide) ---------- */
.ask {
  position: fixed; z-index: 50; top: calc(var(--head-h) + 10px); right: 12px; bottom: 12px; width: 400px; max-width: calc(100vw - 24px);
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-surface);
  box-shadow: var(--shadow-2); transform: translateX(calc(100% + 24px)); transition: transform .26s var(--ease); visibility: hidden;
}
.ask.on { transform: none; visibility: visible; }
.ask__head { flex: none; display: flex; align-items: center; gap: 10px; padding: 14px 14px 12px; border-bottom: 1px solid var(--line); }
.ask__head .who { flex: 1; min-width: 0; }
.ask__head b { display: block; color: var(--ink); font-size: var(--fs-md); }
.ask__head small { display: flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--muted); }
.ask__orb { width: 36px; height: 36px; border-radius: var(--r-surface); display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 50%, var(--spark))); color: #fff; }
.ask__orb svg { width: 18px; height: 18px; }
.ask__msgs { flex: 1; min-height: 0; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 88%; padding: 10px 12px; border-radius: var(--r-surface); font-size: var(--fs-sm); line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg--b { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); border-bottom-left-radius: 4px; }
.msg--v { align-self: flex-end; background: var(--accent); color: var(--on-accent); border-bottom-right-radius: 4px; }
.msg--a { align-self: flex-start; background: var(--accent-soft); color: var(--ink); border-bottom-left-radius: 4px; }
.msg b { color: var(--ink); }
.msg__go { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; white-space: normal; }
.msg__who { font-size: 11px; color: var(--muted); margin: 0 4px -6px; }
.msg--note { align-self: center; max-width: 100%; font-size: var(--fs-xs); color: var(--muted); background: transparent; padding: 0; text-align: center; }
.typing { align-self: flex-start; display: flex; gap: 4px; padding: 12px 14px; border-radius: var(--r-surface); background: var(--surface-2); }
.typing i { width: 6px; height: 6px; border-radius: var(--r-dot); background: var(--muted); animation: typ 1s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes typ { 50% { transform: translateY(-4px); opacity: .5; } }
.ask__starts { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 10px; }
.ask__form { flex: none; display: flex; gap: 8px; align-items: flex-end; padding: 12px 14px 14px; border-top: 1px solid var(--line); }
.ask__form textarea { flex: 1; min-height: 40px; max-height: 140px; resize: none; }
.ask__err { padding: 0 14px 8px; font-size: var(--fs-xs); color: var(--bad-ink); }

/* ---------- Front door ---------- */
.door { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(380px, 5fr) 7fr; background: var(--surface); }
.door__form { display: flex; flex-direction: column; justify-content: center; gap: 28px; padding: 48px clamp(24px, 6vw, 88px); }
.door__form .brand { border: 0; height: auto; padding: 0; }
.door__form h1 { font-size: clamp(28px, 3vw, 38px); line-height: 1.12; }
.door__form p.lead { font-size: var(--fs-lg); color: var(--ink-2); }
.door__card { display: grid; gap: 14px; }
.door__small { font-size: var(--fs-xs); color: var(--muted); display: flex; gap: 8px; align-items: flex-start; }
.door__small svg { width: 15px; height: 15px; flex: none; margin-top: 1px; }
.door__show {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: center; gap: 18px; padding: 48px clamp(24px, 4vw, 64px);
  background:
    radial-gradient(1200px 500px at 110% -10%, color-mix(in srgb, var(--spark) 34%, transparent), transparent 60%),
    radial-gradient(900px 600px at -20% 120%, color-mix(in srgb, var(--c1) 30%, transparent), transparent 60%),
    var(--accent);
  color: color-mix(in srgb, #fff 80%, transparent);
}
.door__show h2 { color: #fff; font-size: clamp(22px, 2.2vw, 30px); max-width: 26ch; }
.door__tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.door__tile { grid-column: span 2; padding: 14px; border-radius: var(--r-surface); background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16); backdrop-filter: blur(6px); color: #fff; display: grid; gap: 6px; animation: rise .5s var(--ease) both; }
.door__tile.wide { grid-column: span 4; }
.door__tile.full { grid-column: span 6; }
.door__tile small { font-size: 11px; color: rgba(255, 255, 255, .75); }
.door__tile b { font: 700 22px var(--font-head); }
.door__tile .chart { height: 90px; }
.door__tile.wide .chart { height: 120px; }
.door__ticks { display: flex; flex-wrap: wrap; gap: 8px; }
.door__ticks span { display: inline-flex; gap: 6px; align-items: center; padding: 6px 10px; border-radius: var(--r-pill); background: rgba(255, 255, 255, .12); font-size: var(--fs-xs); color: #fff; }
.door__ticks svg { width: 14px; height: 14px; }

/* ---------- Phones ---------- */
@media (max-width: 900px) {
  .app, html.nav-mini .app { grid-template-columns: minmax(0, 1fr); }
  /* The phone menu opens under the header, so the menu button stays in reach to close it. */
  .side { position: fixed; top: var(--head-h); bottom: 0; left: 0; width: min(300px, 86vw); transform: translateX(-102%); transition: transform .24s var(--ease); box-shadow: var(--shadow-2); }
  .side .brand { display: none; }
  .head { z-index: 40; }
  .side-veil { top: var(--head-h); }
  .tab { height: 44px; }
  .btn--sm { height: 44px; }
  .btn--icon.btn--sm { width: 44px; }
  html.nav-open .side { transform: none; }
  html.nav-mini .brand__name, html.nav-mini .nav__label, html.nav-mini .ng__head .lbl, html.nav-mini .ng__chev, html.nav-mini .nav-link .lbl { display: revert; }
  html.nav-mini .ng__pages { display: grid; }
  html.nav-mini .ng__head, html.nav-mini .nav-link { justify-content: flex-start; padding: 7px 10px; height: auto; }
  .collapse-btn { display: none !important; }
  .ng__head, .nav-link, .ng__pages a { min-height: 44px; }
  .head .btn, .head__search, .userbtn { height: 44px; }
  .head .btn--icon, .head__search { width: 44px; }
  .side-veil { position: fixed; inset: 0; z-index: 25; background: rgba(15, 26, 36, .3); display: none; }
  html.nav-open .side-veil { display: block; }
  .head { padding: 0 12px; gap: 6px; }
  .head__menu { display: inline-flex; }
  .head__search { width: 44px; padding: 0; justify-content: center; }
  .head > * { flex: none; }
  .head > .head__gap { flex: 1 1 0; min-width: 0; }
  .head [data-ask] { width: 44px; padding: 0; }
  .head [data-ask] .lbl { display: none !important; }
  .head__search span, .head__search kbd { display: none; }
  .userbtn > span:not(.av), .mysys .lbl { display: none; }
  .page { padding: 14px 12px; }
  .door { grid-template-columns: 1fr; }
  .door__show { padding: 32px 20px; }
  .ask { top: 8px; right: 8px; left: 8px; bottom: 8px; width: auto; }
}
@media (max-width: 1180px) and (min-width: 901px) { .head__search { width: 200px; } }

/* ---------- The context bar under the header (Lee, 2026-11-12) ----------
   Where you are and what this page replaces on the left; Take the tour,
   Customise this and + Add on the right, in the same place on every page. */
.ctx {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  min-height: 60px; padding: 10px var(--pad); background: var(--surface); border-bottom: 1px solid var(--line);
}
.ctx__where { flex: 1 1 420px; display: flex; align-items: center; gap: 14px; min-width: 0; }
.ctx__acts { flex: none; }
.ctx .crumbs { flex: none; font-size: var(--fs-sm); }
.ctx__acts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.replaces-chip {
  display: inline-flex; align-items: center; gap: 10px; min-height: 36px; padding: 4px 14px 4px 5px;
  border-radius: var(--r-pill); background: var(--spark-soft); border: 1px solid color-mix(in srgb, var(--spark) 30%, transparent);
  color: var(--ink); font-size: var(--fs-sm); font-weight: 600; line-height: 1.25; flex: 0 1 auto; min-width: 0;
}
.replaces-chip b { font-weight: 800; color: color-mix(in srgb, var(--spark-strong) 78%, black); }
.replaces-chip__logos { display: flex; }
.tl-logo {
  width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: var(--r-dot);
  background: var(--surface); border: 2px solid var(--spark-soft); margin-left: -7px; box-shadow: var(--shadow-1);
}
.replaces-chip__logos .tl-logo:first-child { margin-left: 0; }
.tl-logo img { width: 16px; height: 16px; display: block; }
.tl-logo--ini { background: var(--hex); color: #fff; font: 800 10px var(--font-head); letter-spacing: -.02em; }
/* Customise this pulses once every five seconds so nobody misses it. */
.ctx__custom { position: relative; animation: ctx-pulse 5s ease-out infinite; }
.ctx__custom::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; animation: ctx-ring 5s ease-out infinite; }
@keyframes ctx-pulse { 0%, 82%, 100% { transform: none; } 87% { transform: scale(1.06); } 92% { transform: scale(.99); } }
@keyframes ctx-ring {
  0%, 80% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--spark) 55%, transparent); }
  100% { box-shadow: 0 0 0 14px color-mix(in srgb, var(--spark) 0%, transparent); }
}
@media (prefers-reduced-motion: reduce) { .ctx__custom, .ctx__custom::after { animation: none; } }
@media (max-width: 900px) {
  .ctx { padding: 8px 12px; gap: 8px; min-height: 0; }
  .ctx .crumbs { display: none; }
  .replaces-chip { font-size: var(--fs-xs); }
  .ctx__acts { width: 100%; }
  .ctx__acts .btn { height: 44px; flex: 1; }
  .ctx__acts [data-tour-btn] span { display: none; }
  .ctx__acts [data-tour-btn] { flex: none; width: 44px; padding: 0; }
}

/* ---------- Take the tour and Customise this in the top bar (Lee, 2026-11-13) ---------- */
.head__page { display: flex; align-items: center; gap: 8px; }
.head__page:empty { display: none; }
.ctx__pagebtns { display: none; }
.ctx__pagebtns:empty { display: none !important; }
@media (max-width: 1180px) and (min-width: 901px) { .head__page [data-tour-btn] span { display: none; } .head__page [data-tour-btn] { width: 36px; padding: 0; } }
@media (max-width: 900px) {
  .head__page { display: none; }
  .ctx__pagebtns { display: contents; }
}

/* ---------- Home at the top of the menu, with the section count ---------- */
.nav-home { margin-bottom: 6px; font-weight: 600; }
.nav-home__n { min-width: 26px; height: 22px; padding: 0 7px; border-radius: var(--r-pill); display: inline-grid; place-items: center; background: var(--spark-strong); color: #fff; font-size: 11px; font-weight: 700; }
html.nav-mini .nav-home__n { display: none; }
@media (max-width: 900px) { html.nav-mini .nav-home__n { display: inline-grid; } }

/* ---------- The S logo in place of initials (a placeholder, Lee 2026-11-13) ---------- */
.brand__logo { width: auto; height: 34px; flex: none; }

/* ---------- Menu text size from Appearance ---------- */
.ng__head, .nav-link, .ng__pages a { font-size: var(--fs-nav); }
.ng__head .bi, .nav-link .bi { width: 20px; height: 20px; }

/* ---------- The page title lives in the top bar (Lee, 2026-11-13) ---------- */
.head__title {
  flex: 0 1 auto; min-width: 0; margin: 0 6px 0 0; font: var(--fw-head) var(--fs-title)/1.15 var(--font-head);
  color: var(--ink); letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.head__title:empty { display: none; }
.head__search { width: auto; flex: none; }
.head__search span { flex: none; }
.ctx__title { display: none; }
@media (max-width: 1500px) { .userbtn > span:not(.av) { display: none; } .userbtn { padding: 0 4px; } }
@media (max-width: 1400px) and (min-width: 901px) {
  .head [data-ask] .lbl, .head__page [data-tour-btn] span { display: none !important; }
  .head [data-ask], .head__page [data-tour-btn] { width: 36px; padding: 0; }
}
@media (max-width: 1180px) and (min-width: 901px) { .head__search kbd { display: none; } }
@media (max-width: 900px) {
  .head__title { display: none; }
  .ctx__title { display: block; width: 100%; font: var(--fw-head) var(--fs-title)/1.15 var(--font-head); color: var(--ink); }
}

/* ---------- Tabs and page buttons in the breadcrumb bar ---------- */
.ctx { flex-wrap: wrap; row-gap: 8px; }
.ctx__where { flex: 0 1 auto; }
.ctx__tabs { flex: 0 1 auto; min-width: 0; margin-left: auto; }
.ctx__tabs .tabs { padding: 0; }
.ctx__tabs .tab { height: 36px; padding: 0 14px; }
.ctx__acts { margin-left: auto; }
.ctx__tabs + .ctx__acts:empty { display: none; }
.ctx__acts:empty { display: none; }
@media (max-width: 900px) {
  .ctx__tabs { width: 100%; margin-left: 0; }
  .ctx__tabs .tab { height: 44px; }
}
@media (max-width: 900px) {
  /* One swipeable row of buttons on a phone, not a stack (Lee, 2026-11-13). */
  .ctx__acts { width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: 0; }
  .ctx__acts::-webkit-scrollbar { display: none; }
  .ctx__acts .btn { flex: none; }
  .replaces-chip { padding: 3px 12px 3px 4px; }
  .replaces-chip > span:last-child { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .ctx__where { width: 100%; flex-wrap: wrap; gap: 8px; }
}
@media (max-width: 900px) { .head__search { width: 44px; flex: none; } }
@media (max-width: 900px) { .userbtn { min-width: 44px; justify-content: center; } }
@media (max-width: 900px) { .head [data-appearance] { display: none; } }
