/* HCI Hero by Niyyasoft - one stylesheet, light and dark. */

:root {
  --blue: #0B3C8C;
  --blue-2: #14498F;
  --blue-3: #1F5FBF;
  --light: #8FB2DD;
  --pale: #EAF1FA;
  --ink: #0F1B2D;
  --muted: #5B6B80;
  --line: #DCE4EF;
  --bg: #F4F7FB;
  --card: #FFFFFF;
  --field: #FFFFFF;
  --shadow: 0 1px 2px rgba(15, 27, 45, .06), 0 6px 24px rgba(15, 27, 45, .06);
  --sc0: #F9E1E1; --sc0-ink: #9B2C2C;
  --sc1: #FCEFD6; --sc1-ink: #8A5A00;
  --sc2: #E3EEFA; --sc2-ink: #1F5FBF;
  --sc3: #DDF1E6; --sc3-ink: #1F7A55;
  --warn: #A05A00;
  --radius: 14px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --blue: #6E9BE0;
  --blue-2: #8FB2DD;
  --blue-3: #9CC0F2;
  --light: #3D5E8F;
  --pale: #16243F;
  --ink: #E6EDF7;
  --muted: #9FB0C8;
  --line: #243451;
  --bg: #0A1120;
  --card: #101A2E;
  --field: #0C1526;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 30px rgba(0, 0, 0, .25);
  --sc0: #3A1F26; --sc0-ink: #F2A5A5;
  --sc1: #3A2F18; --sc1-ink: #F0C57A;
  --sc2: #16294A; --sc2-ink: #9CC0F2;
  --sc3: #123626; --sc3-ink: #8FD8B2;
  --warn: #F0C57A;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 130px; }
body { margin: 0; font: 15px/1.55 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--blue-3); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(28px, 4vw, 42px); font-weight: 800; }
h2 { font-size: 21px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 700; margin-top: 1.4em; }
p { margin: 0 0 .8em; }
small { font-size: 12px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: 99; background: var(--card); padding: 8px 12px; border-radius: 8px; }
.wrap { width: min(1320px, 100% - 32px); margin-inline: auto; }
.wrap.narrow { width: min(640px, 100% - 32px); }
.muted { color: var(--muted); }
.warn { color: var(--warn); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
:focus-visible { outline: 3px solid var(--light); outline-offset: 2px; border-radius: 6px; }

/* ---------------------------------------------------------------- topbar */
.topbar { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; gap: 20px; min-height: 66px; }
.brand { display: flex; align-items: center; }
.logo { height: 42px; width: auto; display: block; }
.logo-dark { display: none; }
[data-theme="dark"] .logo-light { display: none; }
[data-theme="dark"] .logo-dark { display: block; }
.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.nav > a { padding: 8px 12px; border-radius: 9px; color: var(--ink); font-weight: 600; font-size: 14px; }
.nav > a:hover { background: var(--pale); text-decoration: none; }
.nav > a.on { background: var(--pale); color: var(--blue); }
.auth { display: flex; align-items: center; gap: 8px; margin-left: 10px; padding-left: 14px; border-left: 1px solid var(--line); }
.who { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; color: var(--ink); }
.who.guest { color: var(--muted); }
.avatar { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--blue); color: #fff; font-size: 13px; font-weight: 700; }
.who.guest .avatar { background: var(--line); color: var(--muted); }
.theme-toggle { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--muted); cursor: pointer; }
.theme-toggle .i-sun { display: none; }
[data-theme="dark"] .theme-toggle .i-sun { display: block; }
[data-theme="dark"] .theme-toggle .i-moon { display: none; }
.nav-toggle { display: none; margin-left: auto; width: 42px; height: 38px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); cursor: pointer; padding: 9px 10px; }
.nav-toggle span:not(.sr) { display: block; height: 2px; background: var(--ink); margin: 4px 0; border-radius: 2px; }

.guestbar { background: var(--blue); color: #fff; }
[data-theme="dark"] .guestbar { background: #0E2C63; }
.guestbar .wrap { display: flex; align-items: center; gap: 12px; padding: 9px 0; flex-wrap: wrap; }
.guestbar p { margin: 0; flex: 1 1 420px; font-size: 14px; }
.gb-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: rgba(255, 255, 255, .15); }
.gb-actions { display: flex; gap: 8px; }
.devbar { background: #FFF4DA; color: #6B4A00; font-size: 13px; padding: 6px 0; }

/* --------------------------------------------------------------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 10px; border: 1px solid transparent;
  font: 600 14px/1.2 var(--font); cursor: pointer; text-decoration: none !important; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s; }
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 9px; }
.btn-lg { padding: 13px 26px; font-size: 16px; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-2); }
[data-theme="dark"] .btn-primary { background: #2F63B8; }
.btn-quiet { background: var(--card); color: var(--ink); border-color: var(--line); }
.btn-quiet:hover { border-color: var(--light); background: var(--pale); }
.btn-light { background: #fff; color: var(--blue); }
.btn-ghost-light { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .5); }
.btn-danger { background: transparent; color: #B42318; border-color: #F1C0BA; }
.btn-danger:hover { background: #FDECEA; }
.btn-export { background: var(--card); color: var(--ink); border-color: var(--line); padding: 8px 12px; }
.btn-export:hover { border-color: var(--blue); }
.fi { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 5px; color: #fff; font-size: 11px; font-weight: 800; }
.fi-docx { background: #2B579A; } .fi-pptx { background: #C43E1C; } .fi-xlsx { background: #217346; }
.locked { opacity: .85; }
.btn.locked { border-style: dashed; }
.lock { margin-left: 2px; color: var(--muted); }
.link-btn { background: none; border: 0; color: var(--blue-3); font: 600 13px var(--font); cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.link-btn:hover { background: var(--pale); }
.link-btn.muted { color: var(--muted); }
form.inline { display: inline-flex; gap: 6px; }

/* ----------------------------------------------------------------- flash */
.flash { margin: 16px 0 0; padding: 12px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); }
.flash-ok { border-color: #A6D9BF; background: var(--sc3); }
.flash-warn { border-color: #EDC98A; background: var(--sc1); }
.flash-info { border-color: var(--light); background: var(--pale); }
.flash-error { border-color: #F1B4B4; background: var(--sc0); }

/* ------------------------------------------------------------------ hero */
.hero { background: linear-gradient(135deg, #0B3C8C 0%, #14498F 60%, #1D5AAE 100%); color: #fff; padding: 44px 0 52px; }
.hero-grid { display: grid; grid-template-columns: 1fr auto; gap: 40px; align-items: center; }
.hero h1 { color: #fff; max-width: 17ch; }
.hero .lead { color: #D6E4F7; font-size: 17px; max-width: 64ch; }
.hero-mark { width: 200px; height: auto; filter: drop-shadow(0 12px 30px rgba(0, 0, 0, .25)); background: #fff; border-radius: 28px; padding: 18px; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: 12px; font-weight: 700; color: var(--light); margin-bottom: 8px; }
.stats { display: flex; gap: 12px; list-style: none; padding: 0; margin: 22px 0 0; flex-wrap: wrap; }
.stats li { background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18); border-radius: 12px; padding: 10px 16px; min-width: 110px; }
.stats strong { display: block; font-size: 24px; }
.stats span { font-size: 12px; color: #D6E4F7; }
.page-head { padding: 34px 0 10px; }
.page-head .lead { color: var(--muted); font-size: 17px; max-width: 80ch; }
.page-head .eyebrow { color: var(--blue); }
.ph-grid { display: grid; grid-template-columns: 1fr 340px; gap: 30px; align-items: start; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ----------------------------------------------------------------- cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; margin: 20px 0; }
.builder { padding-bottom: 110px; }
.step { margin-top: -26px; position: relative; }
.step + .step { margin-top: 20px; }
.step-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 18px; }
.step-head p { color: var(--muted); margin: 0; }
.step-head h2 { margin-bottom: 4px; }
.step-no { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--blue); color: #fff; font-weight: 800; }
[data-theme="dark"] .step-no { background: #2F63B8; }
.counter { margin-left: auto; flex: none; padding: 4px 12px; border-radius: 99px; background: var(--pale); color: var(--blue); font-weight: 700; font-size: 13px; }
.sec-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: space-between; margin-bottom: 12px; }
.sec-head h2 { margin: 0; }

/* ---------------------------------------------------------------- fields */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.field em { font-weight: 400; font-style: normal; }
.field input, .field select, .search { font: 500 14px var(--font); color: var(--ink); background: var(--field); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; }
.field input:focus, .field select:focus, .search:focus { border-color: var(--blue-3); outline: 3px solid color-mix(in srgb, var(--light) 45%, transparent); }
.field.check { flex-direction: row; align-items: center; gap: 10px; padding-top: 24px; color: var(--ink); }
.field.check input { width: 18px; height: 18px; }
.with-unit { position: relative; display: block; }
.with-unit i { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-style: normal; color: var(--muted); font-size: 12px; pointer-events: none; }
.with-unit input { padding-right: 52px; }
fieldset { border: 0; padding: 0; margin: 18px 0 0; min-width: 0; }
legend { font-weight: 700; font-size: 14px; margin-bottom: 10px; padding: 0; }
legend em { font-weight: 400; color: var(--muted); font-style: normal; }
.search { max-width: 340px; }

.lens-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.lens-card { position: relative; cursor: pointer; }
.lens-card input { position: absolute; opacity: 0; }
.lc-body { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; padding: 14px 16px; border: 2px solid var(--line); border-radius: 12px; height: 100%; transition: border-color .15s, background .15s; }
.lc-icon { grid-row: span 2; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--pale); color: var(--blue); font-size: 18px; }
.lc-body small { color: var(--muted); }
.lens-card input:checked + .lc-body { border-color: var(--blue); background: var(--pale); }
.lens-card input:focus-visible + .lc-body { outline: 3px solid var(--light); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; }
.chip > span { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 99px; font-size: 14px; font-weight: 500; background: var(--card); transition: all .15s; }
.chip input:checked + span { background: var(--blue); border-color: var(--blue); color: #fff; }
.chip input:checked + span .tag { background: rgba(255, 255, 255, .2); color: #fff; }
.chip input:focus-visible + span { outline: 3px solid var(--light); }
.tag { display: inline-block; font-style: normal; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--pale); color: var(--blue); }
.tag-tech { background: #E8EEFD; color: #2B4FB5; }
.tag-biz { background: #FDF0E1; color: #9A5B00; }
.tag-both { background: #E9F6EF; color: #1F7A55; }
[data-theme="dark"] .tag-tech { background: #1A2A52; color: #A8C2F5; }
[data-theme="dark"] .tag-biz { background: #3A2D17; color: #F0C57A; }
[data-theme="dark"] .tag-both { background: #13342A; color: #8FD8B2; }
.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--pale); color: var(--blue); margin-left: 6px; font-style: normal; }
.badge-warn { background: var(--sc1); color: var(--warn); }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--card); }
.seg button { border: 0; background: none; padding: 8px 12px; font: 600 13px var(--font); color: var(--muted); cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--pale); color: var(--blue); }
.quick { font-size: 13px; color: var(--muted); margin: -4px 0 14px; }

.plat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.plat { position: relative; display: block; cursor: pointer; }
.plat > input { position: absolute; top: 14px; right: 14px; width: 18px; height: 18px; accent-color: var(--blue); }
.plat-body { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px 30px; border: 2px solid var(--line); border-radius: 12px; height: 100%; border-left: 5px solid var(--pc); transition: all .15s; background: var(--card); }
.plat:hover .plat-body { border-color: var(--light); border-left-color: var(--pc); }
.plat > input:checked ~ .plat-body { border-color: var(--blue); border-left-color: var(--pc); background: var(--pale); }
.plat-top { display: flex; align-items: center; padding-right: 26px; }
.plat-top strong { font-size: 15px; }
.plat-vendor { font-size: 12px; color: var(--muted); font-weight: 600; }
.plat-tag { font-size: 13px; }
.plat-hv { font-size: 12px; color: var(--muted); }
.plat-more { position: absolute; bottom: 8px; right: 12px; font-size: 12px; font-weight: 600; }
.plat[hidden], .pcard[hidden] { display: none; }
.plat.disabled .plat-body { opacity: .5; }

.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.cat { margin: 0; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--card); }
.cat legend { display: flex; align-items: center; gap: 8px; width: 100%; margin: 0 0 6px; float: left; }
.cat legend + * { clear: both; }
.cat-toggle { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.cat-toggle input, .pt input { width: 16px; height: 16px; accent-color: var(--blue); flex: none; }
.cat-n { margin-left: auto; font-size: 12px; color: var(--muted); font-weight: 600; }
.pt { display: flex; align-items: center; gap: 8px; padding: 4px 2px; font-size: 13.5px; cursor: pointer; border-radius: 6px; clear: both; }
.pt:hover { background: var(--pale); }
.pt span { flex: 1; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot-tech { background: #2B4FB5; } .dot-biz { background: #D98A12; } .dot-both { background: #1F7A55; }
.legend { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.legend .dot { margin-left: 8px; }

.est-grid { display: grid; gap: 4px; }
.est-grid fieldset { border-top: 1px solid var(--line); padding-top: 14px; }

.submit-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: color-mix(in srgb, var(--card) 94%, transparent); backdrop-filter: blur(10px); border-top: 1px solid var(--line); }
.wrap-inner { width: min(1320px, 100% - 32px); margin-inline: auto; display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.wrap-inner p { margin: 0 auto 0 0; color: var(--muted); font-size: 14px; }

/* --------------------------------------------------------------- results */
.res-head { background: var(--card); border-bottom: 1px solid var(--line); padding: 28px 0 22px; }
.res-head-grid { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: end; }
.res-head h1 { font-size: clamp(26px, 3.2vw, 36px); margin-bottom: 6px; }
.res-head .sub { font-size: 16px; font-weight: 600; color: var(--blue); margin-bottom: 8px; }
.res-head .eyebrow { color: var(--blue); }
.res-head .meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; }
.res-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.res-actions > form, .res-actions > a { align-self: flex-end; }
.export-row { display: flex; gap: 8px; flex-wrap: wrap; }
.lock-note { font-size: 12px; color: var(--muted); margin: 0; }
.tabs { position: sticky; top: 66px; z-index: 30; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.tabs .wrap { display: flex; gap: 4px; overflow-x: auto; }
.tabs a { padding: 12px 14px; font-weight: 600; font-size: 14px; color: var(--muted); border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.on { color: var(--blue); border-bottom-color: var(--blue); }
.results { padding-bottom: 40px; }
.summary-list { margin: 0 0 18px; padding-left: 20px; }
.summary-list li { margin-bottom: 6px; }

.rank-list { display: grid; gap: 10px; }
.rank { display: grid; grid-template-columns: 44px minmax(220px, 1.1fr) 2fr; gap: 16px; align-items: center; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; border-left: 5px solid var(--pc); }
.rank.legacy { opacity: .75; }
.rank-no { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--pale); color: var(--blue); font-weight: 800; font-size: 16px; }
.rank:first-child .rank-no { background: var(--blue); color: #fff; }
.rank-name small { display: block; color: var(--muted); }
.meter { position: relative; height: 14px; border-radius: 99px; background: var(--pale); overflow: hidden; }
.meter.big { height: 22px; }
.meter span { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, var(--blue), var(--blue-3)); border-radius: 99px; }
.rank .meter span { background: var(--pc); }
.meter em { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-style: normal; font-weight: 800; font-size: 12px; color: var(--ink); }
.meter-mini { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.meter-mini b { color: var(--ink); }

table { border-collapse: collapse; width: 100%; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.heat th, .heat td, .fit th, .fit td, .plain th, .plain td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; font-size: 13.5px; }
.heat thead th, .fit thead th, .plain thead th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--pale); }
.heat td { text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.h0 { background: var(--sc0); color: var(--sc0-ink); } .h1 { background: var(--sc1); color: var(--sc1-ink); }
.h2 { background: #EEF3FA; } .h3 { background: var(--sc2); color: var(--sc2-ink); } .h4 { background: var(--sc3); color: var(--sc3-ink); }
[data-theme="dark"] .h2 { background: #16213A; }
.fit td p { margin: 4px 0 0; font-size: 12.5px; }
.plain tr.used td { background: var(--pale); }
.plain .num { text-align: right; }

/* --------------------------------------------------------------- matrix */
.matrix-wrap { max-height: 78vh; overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.matrix { border-collapse: separate; border-spacing: 0; min-width: 760px; }
.matrix th, .matrix td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: 10px 12px; vertical-align: top; text-align: left; font-size: 13.5px; background: var(--card); }
.matrix thead th { position: sticky; top: 0; z-index: 3; background: var(--card); border-bottom: 3px solid var(--pc, var(--blue)); min-width: 190px; }
.matrix thead th a { color: var(--ink); font-weight: 800; font-size: 14.5px; }
.matrix thead th small { display: block; color: var(--muted); font-weight: 500; }
.matrix .mx-point { position: sticky; left: 0; z-index: 2; width: 250px; min-width: 210px; background: var(--card); }
.matrix thead .mx-point { z-index: 4; }
.matrix .mx-point span { font-weight: 700; }
.matrix .mx-point .dot { margin-left: 6px; vertical-align: middle; }
.matrix .mx-point small { display: block; color: var(--muted); font-weight: 400; margin-top: 3px; line-height: 1.4; }
.matrix .mx-cat th { position: sticky; left: 0; background: var(--pale); color: var(--blue); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; padding: 8px 12px; }
.matrix td p { margin: 4px 0 6px; }
.matrix td p.strong { font-weight: 700; }
.matrix td.sc0 { background: color-mix(in srgb, var(--sc0) 55%, var(--card)); }
.matrix td.sc1 { background: color-mix(in srgb, var(--sc1) 55%, var(--card)); }
.matrix td.sc2 { background: color-mix(in srgb, var(--sc2) 45%, var(--card)); }
.matrix td.sc3 { background: color-mix(in srgb, var(--sc3) 55%, var(--card)); }
.matrix.single td { min-width: 420px; }
.matrix.compact .mx-point small, .matrix.compact td p { display: none; }
.matrix tr[hidden] { display: none; }
.src { display: inline-block; font-size: 11.5px; font-weight: 600; color: var(--blue-3); word-break: break-all; }

.score { display: inline-flex; gap: 3px; vertical-align: middle; }
.score i { width: 9px; height: 9px; border-radius: 50%; background: var(--line); display: block; }
.score.s3 i.on { background: var(--sc3-ink); }
.score.s2 i.on { background: var(--sc2-ink); }
.score.s1 i.on { background: var(--sc1-ink); }
.score.s0 i { background: transparent; border: 1.5px solid var(--sc0-ink); width: 9px; height: 9px; }

/* ------------------------------------------------------------ editions */
.ed-pick { background: var(--pale); border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; }
.ed-pick p { margin: 0 0 8px; font-weight: 600; }
.ed-pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin-bottom: 10px; }
.basis { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; cursor: help; }
.basis-published { background: var(--sc3); color: var(--sc3-ink); }
.basis-estimate { background: var(--sc1); color: var(--sc1-ink); }
.basis-quote { background: var(--line); color: var(--muted); }
.ed-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.ed-plat { margin: 0; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.ed-plat legend { float: left; width: 100%; display: flex; align-items: baseline; gap: 6px; margin-bottom: 4px; }
.ed-plat legend small { color: var(--muted); font-weight: 500; }
.ed-plat legend .link-btn { margin-left: auto; }
.ed-plat .pt small { margin-left: auto; }
.ed-plat[hidden] { display: none; }
.editions-matrix thead th { min-width: 170px; }

.change-eds summary { cursor: pointer; font-weight: 700; color: var(--blue); }
.change-eds[open] summary { margin-bottom: 14px; }

/* ----------------------------------------------------------------- cost */
.stack-chart { display: grid; gap: 10px; margin: 8px 0 18px; }
.sc-row { display: grid; grid-template-columns: 220px 1fr 150px; gap: 14px; align-items: center; }
.sc-name small, .sc-total small { display: block; color: var(--muted); font-size: 12px; }
.sc-bar { display: flex; height: 26px; border-radius: 8px; overflow: hidden; background: var(--pale); }
.sc-bar i { display: block; height: 100%; }
.seg-sw_term { background: #0B3C8C; } .seg-hw { background: #8FB2DD; } .seg-hw_support { background: #B9CCE4; }
.seg-windows { background: #C07A12; } .seg-services { background: #5B6B80; }
[data-theme="dark"] .seg-sw_term { background: #4F82D6; }
.chart-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); align-items: center; }
.chart-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.sc-total strong { font-size: 16px; color: var(--blue); }
.notes { font-size: 13.5px; padding-left: 18px; }
.disclaimer { font-size: 12.5px; color: var(--muted); background: var(--pale); border-radius: 10px; padding: 10px 14px; }
.recalc { border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin: 16px 0; }
.recalc summary { cursor: pointer; font-weight: 700; color: var(--blue); }
.recalc form { margin-top: 12px; }
.recalc .btn { margin-top: 14px; }

/* ------------------------------------------------------------- diagrams */
.dtabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.dtabs button { border: 1px solid var(--line); background: var(--card); color: var(--ink); padding: 8px 14px; border-radius: 99px; font: 600 13px var(--font); cursor: pointer; }
.dtabs button[aria-selected="true"] { background: var(--blue); border-color: var(--blue); color: #fff; }
.diagram { margin: 0 0 22px; }
.diagram figcaption { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.diagram .dl { display: flex; gap: 8px; }
.diagram .dl a { font-size: 13px; font-weight: 700; padding: 4px 10px; border: 1px solid var(--line); border-radius: 8px; }
.svg-box { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px; overflow-x: auto; }
.svg-box svg { display: block; min-width: 900px; height: auto; }

/* ----------------------------------------------------------- references */
.ref-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.ref-col h3 { margin-top: 0; }
.ref-col ul, .ref-list { list-style: none; padding: 0; margin: 0; }
.ref-col li, .ref-list li { display: grid; grid-template-columns: 100px 1fr; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.ref-col li span, .ref-list li span { color: var(--muted); font-weight: 600; }
.ref-col li a, .ref-list li a { word-break: break-word; }

/* ------------------------------------------------------ catalogue cards */
.sticky-tools { position: sticky; top: 76px; z-index: 20; padding: 12px 16px; }
.cat-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.pcard { background: var(--card); border: 1px solid var(--line); border-top: 5px solid var(--pc); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow); }
.pcard header { display: flex; gap: 12px; align-items: flex-start; }
.pcard h2 { font-size: 17px; margin: 0; }
.pcard h2 a { color: var(--ink); }
.pcard p { margin: 0; font-size: 14px; }
.pcard footer { margin-top: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding-top: 8px; }
.pcard footer .src { margin-left: auto; }
.pick input { width: 20px; height: 20px; accent-color: var(--blue); margin-top: 2px; }
.facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 14px; margin: 6px 0; font-size: 13px; }
.facts div { min-width: 0; }
.facts dt { color: var(--muted); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.facts dd { margin: 0; font-weight: 600; }
.facts-box { grid-template-columns: 1fr; background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--pc); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.ticks, .cautions { padding-left: 0; list-style: none; margin: 0; }
.ticks li, .cautions li { position: relative; padding-left: 26px; margin-bottom: 8px; }
.ticks li::before { content: "\2713"; position: absolute; left: 0; color: var(--sc3-ink); font-weight: 800; }
.cautions li::before { content: "!"; position: absolute; left: 4px; color: var(--warn); font-weight: 800; }
.fit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.fit-item { border-radius: 12px; padding: 12px 14px; border: 1px solid var(--line); }
.fit-item.sc0 { background: color-mix(in srgb, var(--sc0) 60%, var(--card)); }
.fit-item.sc1 { background: color-mix(in srgb, var(--sc1) 60%, var(--card)); }
.fit-item.sc2 { background: color-mix(in srgb, var(--sc2) 55%, var(--card)); }
.fit-item.sc3 { background: color-mix(in srgb, var(--sc3) 60%, var(--card)); }
.fit-item strong { display: block; margin: 6px 0 2px; }
.fit-item p { margin: 0; font-size: 13px; color: var(--muted); }
.plain-list { list-style: none; padding: 0; margin: 0 0 18px; }
.plain-list li { padding: 8px 0; border-bottom: 1px dashed var(--line); }
.empty { text-align: center; padding: 40px 24px; }
.saved td { vertical-align: middle; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.prose p, .prose li { max-width: 90ch; }
.legend-list { list-style: none; padding: 0; }
.legend-list li { margin-bottom: 6px; }

/* ----------------------------------------------------------------- footer */
.foot { border-top: 1px solid var(--line); background: var(--card); padding: 28px 0; margin-top: 40px; font-size: 13px; color: var(--muted); }
.foot-grid { display: grid; grid-template-columns: minmax(260px, 1fr) 2fr; gap: 24px; }
.foot-grid > div { display: flex; gap: 12px; align-items: flex-start; }
.foot strong { color: var(--ink); }
.foot .fine { font-size: 12px; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1080px) {
  .nav-toggle { display: block; }
  .nav { display: none; position: absolute; top: 66px; left: 0; right: 0; flex-direction: column; align-items: stretch; background: var(--card); border-bottom: 1px solid var(--line); padding: 10px 16px 16px; box-shadow: var(--shadow); }
  .nav.open { display: flex; }
  .auth { margin: 8px 0 0; padding: 10px 0 0; border-left: 0; border-top: 1px solid var(--line); }
  .res-head-grid, .ph-grid, .hero-grid { grid-template-columns: 1fr; }
  .res-actions { align-items: flex-start; }
  .res-actions > form, .res-actions > a { align-self: flex-start; }
  .hero-mark { display: none; }
}
@media (max-width: 760px) {
  body { font-size: 14.5px; }
  .card { padding: 18px 16px; }
  .grid-2, .lens-grid, .two-col { grid-template-columns: 1fr; }
  .rank { grid-template-columns: 40px 1fr; }
  .rank-bars { grid-column: 1 / -1; }
  .sc-row { grid-template-columns: 1fr; gap: 6px; }
  .foot-grid { grid-template-columns: 1fr; }
  .wrap-inner p { display: none; }
  .matrix .mx-point { width: 160px; min-width: 150px; }
  .step-head { flex-wrap: wrap; }
  .counter { margin-left: 48px; }
  .logo { height: 36px; }
  .tabs { top: 66px; }
}

@media print {
  .topbar, .guestbar, .tabs, .res-actions, .submit-bar, .foot, .recalc, .dtabs, .toolbar { display: none !important; }
  .card { box-shadow: none; break-inside: avoid-page; }
  .matrix-wrap { max-height: none; overflow: visible; }
  .dpanel[hidden] { display: block !important; }
}
