/* ============================================================================
   Microsoft 365 plan finder - The Random Admin colourway
   1) tokens / theme   2) app chrome   3) blades   4) rows + chips
   5) views            6) responsive + print

   Tokens follow ../m365-licensing/DESIGN.md sections 1-2 so the two sites feel
   like one product. The content area here is a horizontal blade stack.
   ========================================================================== */

/* ---------------------------------------------------------- 1. tokens ----- */
:root {
  --font: "Segoe UI", "Segoe UI Web (West European)", -apple-system, BlinkMacSystemFont,
          system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;

  /* The Random Admin palette (therandomadmin.com/services):
     teal #14a38c, navy #142a4c, ink #0b1220, slate #33465a, mint #d2e7e2,
     page tints #fafafa -> #f3faf8, hero teal #29c4a9. */
  --tra-teal: #14a38c;
  --tra-teal-bright: #29c4a9;
  --tra-navy: #142a4c;
  --tra-ink: #0b1220;
  --tra-slate: #33465a;
  --tra-mint: #d2e7e2;

  --brand: #14a38c;
  --brand-hover: #0f8a76;
  --brand-soft: #e6f4f1;
  --bg: #f3faf8;
  --surface: #ffffff;
  --surface-2: #f3faf8;
  --surface-3: #e3f0ec;
  --text: #0b1220;
  --text-muted: #33465a;
  --text-dim: #5f7284;
  --border: #d2e7e2;
  --border-strong: #9dbfb6;

  --header-bg: linear-gradient(135deg, #14a38c, #142a4c);
  --header-bg-solid: #14a38c;
  --header-ink: #ffffff;
  --nav-bg: #fafafa;

  /* status encodings - the only colour coding in the app */
  --st-included-bg: rgba(20, 163, 140, .14);
  --st-included-ink: #0e7c69;
  --st-partial-bg: rgba(193, 156, 0, .14);
  --st-partial-ink: #7a6000;
  --st-addon-bg: rgba(20, 42, 76, .12);
  --st-addon-ink: #142a4c;
  --st-grey-bg: rgba(51, 70, 90, .12);
  --st-grey-ink: #46596b;

  --shadow-2: 0 1.6px 3.6px rgba(11,18,32,.10), 0 .3px .9px rgba(11,18,32,.08);
  --shadow-8: 0 3.2px 7.2px rgba(11,18,32,.12), 0 .6px 1.8px rgba(11,18,32,.08);
  --radius: 6px;
  --header-h: 48px;
  --nav-w: 220px;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #29c4a9;
    --brand-hover: #4fd6bf;
    --brand-soft: #123a3b;
    --bg: #0b1220;
    --surface: #14213a;
    --surface-2: #0f1a2e;
    --surface-3: #1e3350;
    --text: #f3faf8;
    --text-muted: #a9bccb;
    --text-dim: #7f93a6;
    --border: #24405c;
    --border-strong: #3f5f80;
    --header-bg: linear-gradient(135deg, #0f7a68, #0b1220);
    --header-bg-solid: #0f7a68;
    --nav-bg: #0f1a2e;
    --st-included-bg: rgba(41, 196, 169, .18);
    --st-included-ink: #6fe0c9;
    --st-partial-bg: rgba(255, 170, 68, .16);
    --st-partial-ink: #ffc169;
    --st-addon-bg: rgba(120, 160, 220, .18);
    --st-addon-ink: #a9c4f0;
    --st-grey-bg: rgba(255, 255, 255, .1);
    --st-grey-ink: #b7c3cf;
    --shadow-2: 0 1.6px 3.6px rgba(0,0,0,.4);
    --shadow-8: 0 3.2px 7.2px rgba(0,0,0,.45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --brand: #29c4a9;
  --brand-hover: #4fd6bf;
  --brand-soft: #123a3b;
  --bg: #0b1220;
  --surface: #14213a;
  --surface-2: #0f1a2e;
  --surface-3: #1e3350;
  --text: #f3faf8;
  --text-muted: #a9bccb;
  --text-dim: #7f93a6;
  --border: #24405c;
  --border-strong: #3f5f80;
  --header-bg: linear-gradient(135deg, #0f7a68, #0b1220);
  --header-bg-solid: #0f7a68;
  --nav-bg: #0f1a2e;
  --st-included-bg: rgba(41, 196, 169, .18);
  --st-included-ink: #6fe0c9;
  --st-partial-bg: rgba(255, 170, 68, .16);
  --st-partial-ink: #ffc169;
  --st-addon-bg: rgba(120, 160, 220, .18);
  --st-addon-ink: #a9c4f0;
  --st-grey-bg: rgba(255, 255, 255, .1);
  --st-grey-ink: #b7c3cf;
  --shadow-2: 0 1.6px 3.6px rgba(0,0,0,.4);
  --shadow-8: 0 3.2px 7.2px rgba(0,0,0,.45);
  color-scheme: dark;
}

/* ------------------------------------------------------------- base ------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 20px;
  -webkit-text-size-adjust: 100%;
  overflow: hidden;              /* the blade stack scrolls, not the page */
}
h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.25; }
p { margin: 0 0 10px; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; border-radius: 2px; }
.app-header :focus-visible { outline-color: #fff; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 8px; top: -60px; z-index: 100;
  background: var(--surface); color: var(--text); padding: 8px 14px;
  border: 1px solid var(--border-strong); border-radius: var(--radius);
}
.skip-link:focus { top: 8px; }
.loading { color: var(--text-muted); padding: 32px 24px; }

/* -------------------------------------------------------- 2. app chrome --- */
.app-header {
  height: var(--header-h);
  display: flex; align-items: center; gap: 8px;
  padding: 0 10px;
  background: var(--header-bg-solid); background-image: var(--header-bg); color: var(--header-ink);
  position: relative; z-index: 40;
}
.brand { display: flex; align-items: center; gap: 9px; color: var(--header-ink); flex: 0 0 auto; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 20px; height: 20px; flex: 0 0 auto; }
.brand-text { font-size: 15px; white-space: nowrap; font-weight: 400; }
.brand-text strong { font-weight: 600; }
.brand-tag {
  font-size: 11px; font-weight: 600; letter-spacing: .04em;
  border: 1px solid rgba(255,255,255,.5); border-radius: 3px;
  padding: 1px 5px; margin-left: 2px; vertical-align: 1px;
}

.header-search { position: relative; flex: 1 1 320px; max-width: 320px; margin: 0 auto; }
.header-search .search-icon {
  position: absolute; left: 8px; top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px; color: var(--header-ink); opacity: .85; pointer-events: none;
}
.header-search input {
  width: 100%; height: 30px; padding: 0 10px 0 28px;
  font: inherit; font-size: 13px; color: var(--header-ink);
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.28); border-radius: var(--radius);
}
.header-search input::placeholder { color: rgba(255,255,255,.78); }
.header-search input:focus { background: rgba(255,255,255,.26); }

.dataset-picker {
  display: flex; align-items: stretch; align-self: stretch; flex: 0 0 auto;
  gap: 2px; margin: 0 6px;
}
.dataset-picker button {
  position: relative; display: inline-flex; align-items: center;
  font: inherit; font-size: 13px; line-height: 1; padding: 0 12px;
  background: transparent; color: var(--header-ink); opacity: .82;
  border: 0; border-radius: 0; cursor: pointer; white-space: nowrap;
}
.dataset-picker button::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: 6px; height: 3px;
  border-radius: 2px; background: transparent; transition: background .15s;
}
.dataset-picker button:hover { opacity: 1; background: rgba(255,255,255,.10); }
.dataset-picker button:hover::after { background: rgba(255,255,255,.45); }
.dataset-picker button:focus-visible { outline: 2px solid #fff; outline-offset: -3px; }
.dataset-picker button[aria-pressed="true"] { opacity: 1; font-weight: 600; }
.dataset-picker button[aria-pressed="true"]::after { background: #fff; height: 3px; }
.link-btn { font: inherit; color: var(--brand); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; }
@media (max-width: 600px) {
  .dataset-picker { margin: 0 2px; gap: 0; }
  .dataset-picker button { padding: 0 7px; font-size: 12px; }
  .dataset-picker button::after { left: 6px; right: 6px; }
  .brand-text { font-size: 13px; }
}

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; flex: 0 0 auto;
  background: transparent; color: var(--header-ink);
  border: 1px solid transparent; border-radius: var(--radius); cursor: pointer;
}
.icon-btn:hover { background: rgba(255,255,255,.18); }
.icon-btn svg { width: 17px; height: 17px; }
.nav-toggle { display: none; }
.theme-toggle .i-moon { display: none; }
.theme-toggle[data-theme-state="dark"] .i-sun { display: none; }
.theme-toggle[data-theme-state="dark"] .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  .theme-toggle[data-theme-state="system"] .i-sun { display: none; }
  .theme-toggle[data-theme-state="system"] .i-moon { display: block; }
}

.app-shell { display: flex; height: calc(100% - var(--header-h)); align-items: stretch; }
.sidenav {
  flex: 0 0 var(--nav-w); width: var(--nav-w);
  overflow-y: auto; padding: 10px 0 20px;
  background: var(--nav-bg);
  border-right: 1px solid var(--border);
}
.nav-list { list-style: none; margin: 0; padding: 0; }
.nav-list a {
  display: flex; align-items: center; gap: 10px;
  min-height: 36px; padding: 6px 10px 6px 9px;
  color: var(--text); font-size: 14px;
  border-left: 3px solid transparent;
}
.nav-list a:hover { background: rgba(0,0,0,.05); text-decoration: none; }
:root[data-theme="dark"] .nav-list a:hover { background: rgba(255,255,255,.06); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .nav-list a:hover { background: rgba(255,255,255,.06); }
}
.nav-list a svg { width: 20px; height: 20px; flex: 0 0 auto; color: var(--text-muted); }
.nav-list a[aria-current="page"] { background: var(--surface); font-weight: 600; border-left-color: var(--brand); }
.nav-list a[aria-current="page"] svg { color: var(--brand); }
.nav-note { margin: 18px 12px 0; font-size: 12px; color: var(--text-dim); line-height: 16px; }
.nav-scrim { position: fixed; inset: var(--header-h) 0 0; background: rgba(0,0,0,.4); z-index: 29; }

/* ----------------------------------------------------------- 3. blades ---- */
.blade-stack {
  flex: 1 1 auto; min-width: 0;
  display: flex; align-items: stretch;
  overflow-x: auto; overflow-y: hidden;
  background: var(--bg);
}
.blade {
  display: flex; flex-direction: column;
  height: 100%; min-width: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  box-shadow: var(--shadow-2);
}
.blade-1 { flex: 0 0 360px; width: 360px; }
.blade-main { flex: 1 1 auto; min-width: 480px; }
.blade-detail { flex: 0 0 420px; width: 420px; }
.blade-wide { flex: 1 1 auto; min-width: 0; }

.blade-head {
  flex: 0 0 auto; min-height: 44px;
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px 6px 16px;
  border-bottom: 1px solid var(--border);
}
.blade-head-text { min-width: 0; flex: 1 1 auto; }
.blade-title { font-size: 16px; font-weight: 600; }
.blade-sub { margin: 1px 0 0; font-size: 12px; color: var(--text-muted); line-height: 16px; }
.blade-close, .blade-back {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 28px; min-width: 28px; padding: 0 6px;
  background: transparent; color: var(--text-muted);
  border: 1px solid transparent; border-radius: var(--radius); cursor: pointer;
}
.blade-close:hover, .blade-back:hover { background: var(--surface-2); color: var(--text); }
.blade-close svg, .blade-back svg { width: 15px; height: 15px; }
.blade-back { display: none; font-size: 13px; padding: 0 8px; }

.blade-toolbar {
  flex: 0 0 auto;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.blade-body { flex: 1 1 auto; overflow-y: auto; padding: 0 0 32px; }
.blade-body-pad { padding: 16px 16px 40px; }

/* filter box + select + toggles inside a toolbar */
.filter-box { position: relative; flex: 1 1 180px; max-width: 280px; }
.filter-box svg {
  position: absolute; left: 7px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px; color: var(--text-muted); pointer-events: none;
}
.filter-box input, .tool-select {
  width: 100%; height: 28px; padding: 0 8px 0 26px;
  font: inherit; font-size: 13px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius);
}
.tool-select { width: auto; padding: 0 6px; max-width: 240px; }
.tool-label { font-size: 12px; color: var(--text-muted); }
.toggle {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text); cursor: pointer; white-space: nowrap;
}
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 12px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--radius); cursor: pointer;
}
.btn:hover { background: var(--surface-2); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }

/* ------------------------------------------------- 4. list rows + chips --- */
.list { list-style: none; margin: 0; padding: 0; }
.row {
  display: block; width: 100%; text-align: left;
  padding: 9px 16px; border: 0; border-bottom: 1px solid var(--border);
  border-left: 3px solid transparent;
  background: transparent; color: var(--text); cursor: pointer;
}
.row:hover { background: var(--surface-2); }
.row[aria-current="true"] { background: var(--brand-soft); border-left-color: var(--brand); }
.row-title { display: flex; align-items: baseline; gap: 6px; font-size: 14px; font-weight: 600; }
.row-title-text { min-width: 0; }
.row-sub { margin: 2px 0 0; font-size: 12px; color: var(--text-muted); line-height: 16px; }
.row-count {
  margin-left: auto; flex: 0 0 auto;
  font-size: 11.5px; font-weight: 400; color: var(--text-dim);
  background: var(--surface-2); border-radius: 10px; padding: 1px 8px;
}
.row-empty .row-title { font-weight: 400; color: var(--text-muted); }
.row-chevron { margin-left: auto; color: var(--text-dim); width: 14px; height: 14px; flex: 0 0 auto; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }

.chip {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 7px;
  font-size: 11.5px; line-height: 1; font-weight: 600; white-space: nowrap;
  border-radius: 11px; border: 1px solid transparent;
}
.chip svg { width: 11px; height: 11px; flex: 0 0 auto; }
.chip-included { background: var(--st-included-bg); color: var(--st-included-ink); }
.chip-partial  { background: var(--st-partial-bg);  color: var(--st-partial-ink); }
.chip-addon    { background: var(--st-addon-bg);    color: var(--st-addon-ink); }
.chip-readonly { background: var(--st-grey-bg);     color: var(--st-grey-ink); }
.chip-text     { background: var(--st-grey-bg);     color: var(--st-grey-ink); font-weight: 400; }
.chip-na       { background: var(--st-grey-bg);     color: var(--st-grey-ink); text-decoration: line-through; }
.chip-none     { background: var(--st-grey-bg);     color: var(--st-grey-ink); }
.chip-plain    { background: var(--surface-2); color: var(--text-muted); font-weight: 400; }

.note-dot {
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; flex: 0 0 auto;
  border-radius: 50%; background: var(--surface-3); color: var(--text-muted);
  font-size: 10px; font-weight: 700; cursor: help; vertical-align: 1px;
}
mark { background: rgba(255, 185, 0, .45); color: inherit; border-radius: 2px; padding: 0 1px; }
:root[data-theme="dark"] mark { background: rgba(255, 185, 0, .3); color: #fff; }
.empty { padding: 24px 16px; color: var(--text-muted); max-width: 46ch; }
.group-head {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px 4px;
  font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-muted);
  background: var(--surface);
}
.group-head-sticky { position: sticky; top: 0; z-index: 2; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.nav-divider { margin: 10px 16px 2px; border-top: 1px solid var(--border); padding-top: 8px; }

/* collapsible section header used on the Plans blade */
.acc-head {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 8px 16px; border: 0; border-bottom: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); cursor: pointer;
  font-size: 13px; font-weight: 600; text-align: left;
  position: sticky; top: 0; z-index: 1;
}
.acc-head:hover { background: var(--surface-3); }
.acc-head svg { width: 12px; height: 12px; color: var(--text-muted); transition: transform .15s ease; }
.acc-head[aria-expanded="false"] svg { transform: rotate(-90deg); }
.acc-count { margin-left: auto; font-size: 11.5px; font-weight: 400; color: var(--text-dim); }

/* ------------------------------------------------------------ 5. views ---- */
/* Home */
.home { max-width: 860px; }
.home-h1 { font-size: 24px; margin-bottom: 6px; }
.home-lede { color: var(--text-muted); max-width: 60ch; }
.big-search { position: relative; margin: 16px 0 6px; }
.big-search svg {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--text-muted); pointer-events: none;
}
.big-search input {
  width: 100%; height: 42px; padding: 0 12px 0 38px;
  font: inherit; font-size: 15px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius);
}
.big-search input:focus { border-color: var(--brand); outline-offset: 2px; }
.cards { display: flex; flex-wrap: wrap; gap: 12px; margin: 16px 0 4px; }
.card {
  flex: 1 1 210px; min-width: 200px; text-align: left;
  padding: 14px; background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-2);
  cursor: pointer;
}
.card:hover { border-color: var(--brand); box-shadow: var(--shadow-8); text-decoration: none; }
.card svg { width: 20px; height: 20px; color: var(--brand); }
.card h3 { font-size: 15px; margin: 6px 0 4px; }
.card p { font-size: 13px; color: var(--text-muted); margin: 0; }
.pop { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pop button {
  height: 26px; padding: 0 10px; font-size: 12.5px;
  background: var(--surface); color: var(--brand);
  border: 1px solid var(--border-strong); border-radius: 13px; cursor: pointer;
}
.pop button:hover { background: var(--brand-soft); border-color: var(--brand); }
.subhead { font-size: 13px; font-weight: 600; margin: 20px 0 2px; }
.results { margin-top: 10px; border-top: 1px solid var(--border); }
.results .group-head { padding-left: 0; }
.results .row { padding-left: 0; padding-right: 0; border-left: 0; }
.results .row:hover { background: transparent; }
.results .row:hover .row-title-text { text-decoration: underline; }

/* Feature / plan detail */
.callout {
  display: flex; gap: 8px; padding: 10px 12px; margin: 0 0 14px;
  background: var(--brand-soft); border-left: 3px solid var(--brand); border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 13px; line-height: 18px;
}
.callout svg { width: 15px; height: 15px; flex: 0 0 auto; color: var(--brand); margin-top: 2px; }
.callout-plain { background: var(--surface-2); border-left-color: var(--border-strong); }
.callout-plain svg { color: var(--text-muted); }
.breadcrumb { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
.detail-h { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin: 18px 0 6px; }
.plan-rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border); }
.plan-rows li { border-bottom: 1px solid var(--border); }
.plan-row {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 4px; border: 0; background: transparent; color: var(--text);
  text-align: left; cursor: pointer;
}
.plan-row:hover { background: var(--surface-2); }
.plan-row-name { flex: 1 1 auto; min-width: 0; }
.plan-row-note { font-size: 12px; color: var(--text-muted); margin: 1px 0 0; line-height: 16px; }
.muted-list { list-style: none; margin: 0; padding: 0; color: var(--text-muted); font-size: 13px; }
.muted-list li { padding: 3px 0; }
.sku-block { margin-top: 4px; }
.sku-product { margin: 0 0 6px; font-size: 13px; }
.sku-alt { margin: 10px 0 2px; font-size: 12px; color: var(--text-muted); }
.sku-line { display: flex; align-items: center; gap: 8px; margin: 3px 0; min-width: 0; }
.sku-label { flex: 0 0 110px; font-size: 12px; color: var(--text-muted); }
.sku-code, .sku-inline {
  font-family: Consolas, "Cascadia Mono", "Segoe UI Mono", Menlo, monospace; font-size: 12px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 3px; padding: 2px 6px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
.sku-inline { padding: 0 5px; }
.sku-copy {
  flex: 0 0 auto; width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid transparent; border-radius: var(--radius); color: var(--text-muted); cursor: pointer;
}
.sku-copy svg { width: 15px; height: 15px; }
.sku-copy:hover { background: var(--surface-2); color: var(--brand); border-color: var(--border); }
.sku-copy.is-done { color: var(--brand); }
.sku-copy.is-done::after { content: "Copied"; font-size: 11px; margin-left: 4px; }

.sku-compact { padding: 10px 16px 4px; border-bottom: 1px solid var(--border); }
.sku-compact .detail-h { margin-top: 0; }

.stat-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.stat {
  flex: 1 1 110px; padding: 10px 12px;
  background: var(--surface-2); border-radius: var(--radius);
}
.stat b { display: block; font-size: 20px; font-weight: 600; }
.stat span { font-size: 12px; color: var(--text-muted); }

/* Compare */
.picker { display: flex; flex-wrap: wrap; gap: 4px; }
.picker button {
  height: 24px; padding: 0 9px; font-size: 12px;
  background: var(--surface); color: var(--text-muted);
  border: 1px solid var(--border-strong); border-radius: 12px; cursor: pointer; white-space: nowrap;
}
.picker button:hover { border-color: var(--brand); color: var(--text); }
.picker button[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.picker button[disabled] { opacity: .45; cursor: not-allowed; }
.cmp-wrap { overflow-x: auto; }
table.cmp { border-collapse: collapse; width: 100%; font-size: 13px; }
table.cmp th, table.cmp td { border-bottom: 1px solid var(--border); padding: 7px 10px; text-align: left; vertical-align: top; }
table.cmp thead th {
  position: sticky; top: 0; z-index: 3;
  background: var(--surface); border-bottom: 1px solid var(--border-strong);
  font-size: 12px; font-weight: 600;
}
table.cmp thead th.cmp-plan { text-align: center; width: 120px; }
table.cmp tbody th {
  font-weight: 400; min-width: 240px;
}
table.cmp td.cmp-cell { text-align: center; }
table.cmp tr.cmp-section th {
  background: var(--surface-2); font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted);
}
table.cmp tbody tr:hover td, table.cmp tbody tr:hover th { background: var(--surface-2); }
.cmp-mark { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; }
.cmp-mark svg { width: 13px; height: 13px; }
.cmp-included { background: var(--st-included-bg); color: var(--st-included-ink); }
.cmp-partial { background: var(--st-partial-bg); color: var(--st-partial-ink); }
.cmp-addon { background: var(--st-addon-bg); color: var(--st-addon-ink); }
.cmp-readonly, .cmp-text { background: var(--st-grey-bg); color: var(--st-grey-ink); }
.cmp-na, .cmp-none { color: var(--text-dim); }
.cmp-row-btn { background: transparent; border: 0; padding: 0; text-align: left; color: var(--text); cursor: pointer; font: inherit; }
.cmp-row-btn:hover { text-decoration: underline; }
.legend { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 12px; font-size: 12px; color: var(--text-muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }

/* Change log */
table.log { border-collapse: collapse; width: 100%; font-size: 13px; }
table.log th, table.log td { border-bottom: 1px solid var(--border); padding: 8px 10px; text-align: left; vertical-align: top; }
table.log thead th { font-size: 12px; font-weight: 600; color: var(--text-muted); background: var(--surface-2); }
table.log td.log-date { white-space: nowrap; color: var(--text-muted); }

/* --------------------------------------------------- 6. responsive/print -- */
/* Keep blade 1 + blade 2 (min 480) + a detail blade inside a 1440 laptop. */
@media (max-width: 1500px) {
  .blade-1 { flex-basis: 320px; width: 320px; }
  .blade-detail { flex-basis: 380px; width: 380px; }
}
@media (max-width: 1200px) {
  .blade-1 { flex-basis: 290px; width: 290px; }
  .blade-detail { flex-basis: 340px; width: 340px; }
}
@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .brand-text { display: none; }
  .header-search { max-width: none; }
  .sidenav {
    position: fixed; z-index: 30; top: var(--header-h); bottom: 0; left: 0;
    width: 260px; flex-basis: 260px;
    transform: translateX(-100%); transition: transform .18s ease;
    box-shadow: var(--shadow-8);
  }
  body.nav-open .sidenav { transform: none; }
  /* one blade at a time: only the rightmost is shown, with a Back button */
  .blade-stack { overflow-x: hidden; }
  .blade { display: none; flex: 1 1 100%; width: 100%; min-width: 0; border-right: 0; }
  .blade.is-top { display: flex; }
  .blade-back { display: inline-flex; }
  .blade-close { display: none; }
  .home { max-width: none; }
  table.cmp thead th.cmp-plan { width: auto; }
  table.cmp tbody th { min-width: 160px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

@media print {
  body { overflow: visible; }
  .app-header, .sidenav, .blade-toolbar, .blade-close, .blade-back,
  .nav-scrim, .skip-link, .blade-1, .blade-detail { display: none !important; }
  .app-shell, .blade-stack, .blade, .blade-body { display: block; height: auto; overflow: visible; }
  .blade { border: 0; box-shadow: none; }
  .blade-body { padding: 0; }
  .row { break-inside: avoid; border-left: 0; padding-left: 0; }
  .chip { border: 1px solid #999 !important; background: none !important; color: #000 !important; text-decoration: none !important; }
  .chip svg { display: none; }
  .chip::after { content: " - " attr(data-status-label); font-weight: 400; }
  mark { background: none; font-weight: 700; }
}
