/* Career Compass JA — web
 * One stylesheet, two personalities: a regular website on wide screens,
 * an app shell (compact top bar + bottom tabs + bottom sheets) on phones.
 * Colours follow the Android app's theme (Theme.kt / AppColors.kt).
 */

:root {
  --brand: #007A33;
  --brand-strong: #00602A;
  --brand-tint: #E3F5E9;
  --on-brand-tint: #00522A;
  --gold: #FFC72C;
  --gold-text: #8A6300;
  --gold-tint: #FFF3D6;
  --on-gold-tint: #5C4200;
  --red: #C8102E;
  --red-tint: #FDEAEA;
  --on-red-tint: #7A0010;
  --info: #1D6FA5;
  --info-tint: #EAF4FB;
  --on-info-tint: #16577F;
  --success: #2E9E44;

  --bg: #FBFBF3;
  --surface: #FFFFFF;
  --surface-2: #F5F5E8;
  --surface-3: #EFEFE2;
  --text: #1A1C16;
  --text-2: #45483D;
  --muted: #75786C;
  --border: #E1E3D5;
  --border-strong: #C5C8B9;
  --shadow: 0 1px 2px rgba(26, 28, 22, .06), 0 4px 16px rgba(26, 28, 22, .06);
  --shadow-lg: 0 8px 32px rgba(26, 28, 22, .16);
  --hero-grad: linear-gradient(135deg, #00602A 0%, #007A33 55%, #0B8F45 100%);

  --radius: 16px;
  --radius-sm: 10px;
  --header-h: 68px;
  --tab-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #7DDA9B;
    --brand-strong: #9AE6B4;
    --brand-tint: #11331E;
    --on-brand-tint: #9AE6B4;
    --gold: #FFD873;
    --gold-text: #FFD873;
    --gold-tint: #3D2E00;
    --on-gold-tint: #FFE9B3;
    --red: #FFB3AE;
    --red-tint: #4A0E14;
    --on-red-tint: #FFDAD9;
    --info: #7FC3F2;
    --info-tint: #163449;
    --on-info-tint: #C5E4FA;
    --success: #6FDB84;
    --bg: #121410;
    --surface: #1A1C17;
    --surface-2: #22251E;
    --surface-3: #2A2D26;
    --text: #E3E4D6;
    --text-2: #C5C8B9;
    --muted: #8F9284;
    --border: #2F3229;
    --border-strong: #45483D;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, .5);
    --hero-grad: linear-gradient(135deg, #0A3D1E 0%, #0F5129 60%, #13602F 100%);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --brand: #7DDA9B;
  --brand-strong: #9AE6B4;
  --brand-tint: #11331E;
  --on-brand-tint: #9AE6B4;
  --gold: #FFD873;
  --gold-text: #FFD873;
  --gold-tint: #3D2E00;
  --on-gold-tint: #FFE9B3;
  --red: #FFB3AE;
  --red-tint: #4A0E14;
  --on-red-tint: #FFDAD9;
  --info: #7FC3F2;
  --info-tint: #163449;
  --on-info-tint: #C5E4FA;
  --success: #6FDB84;
  --bg: #121410;
  --surface: #1A1C17;
  --surface-2: #22251E;
  --surface-3: #2A2D26;
  --text: #E3E4D6;
  --text-2: #C5C8B9;
  --muted: #8F9284;
  --border: #2F3229;
  --border-strong: #45483D;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, .5);
  --hero-grad: linear-gradient(135deg, #0A3D1E 0%, #0F5129 60%, #13602F 100%);
  color-scheme: dark;
}

/* ───────────── Base ───────────── */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 12px); }
body {
  margin: 0;
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; outline: none; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .4em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.6rem, 1.1rem + 2vw, 2.4rem); font-weight: 800; }
h2 { font-size: 1.35rem; font-weight: 800; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 .8em; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 6px; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.hidden { display: none !important; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--brand); color: #fff; padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 8px; }

.ms {
  font-family: "Material Symbols Rounded";
  font-weight: normal; font-style: normal;
  font-size: 22px; line-height: 1;
  display: inline-block; white-space: nowrap; direction: ltr;
  -webkit-font-feature-settings: "liga"; font-feature-settings: "liga";
  font-variation-settings: "FILL" 0, "wght" 500;
  user-select: none; flex-shrink: 0;
  width: 1em; overflow: hidden;
}
.ms.filled { font-variation-settings: "FILL" 1, "wght" 500; }
.ms.sm { font-size: 18px; }
.ms.lg { font-size: 28px; }

/* ───────────── Header ───────────── */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
  padding-top: var(--safe-t);
}
.header-inner { height: var(--header-h); display: flex; align-items: center; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 1.12rem; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand b { color: var(--brand); font-weight: 800; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 11px;
  display: grid; place-items: center;
  background: var(--brand); color: #fff;
  box-shadow: inset 0 -3px 0 var(--gold);
}
:root[data-theme="dark"] .brand-mark, :root[data-theme="dark"] .brand-mark .ms { color: #0A2614; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .brand-mark { color: #0A2614; } }
.brand-mark.big { width: 64px; height: 64px; border-radius: 18px; }
.brand-mark.big .ms { font-size: 36px; }

.desktop-nav { display: flex; gap: 4px; }
.desktop-nav a {
  color: var(--text-2); font-weight: 600; font-size: .92rem;
  padding: 8px 12px; border-radius: 999px; white-space: nowrap;
}
.desktop-nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.desktop-nav a.active { color: var(--brand); background: var(--brand-tint); }

.header-search {
  flex: 1; max-width: 380px; margin-left: auto;
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 999px; padding: 0 14px; height: 42px;
}
.header-search:focus-within { border-color: var(--brand); background: var(--surface); }
.header-search .ms { color: var(--muted); font-size: 20px; }
.header-search input { border: 0; background: none; outline: none; width: 100%; font-size: .92rem; height: auto; padding: 0; box-shadow: none; }
.header-actions { display: flex; align-items: center; gap: 2px; }
.icon-btn {
  position: relative;
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  background: none; border: 0; color: var(--brand);
}
.icon-btn:hover { background: var(--surface-2); text-decoration: none; }
.icon-btn.active { background: var(--brand-tint); }
.icon-btn .badge {
  position: absolute; top: 4px; right: 3px;
  min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
  background: var(--red); color: #fff; font-size: 10.5px; font-weight: 800;
  display: grid; place-items: center;
}
#mobile-search-btn, .mobile-back, .mobile-title { display: none; }
.mobile-title { font-size: 1.1rem; font-weight: 800; margin: 0; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.flag-stripe { display: flex; height: 3px; }
.flag-stripe i:nth-child(1) { flex: 3; background: #007A33; }
.flag-stripe i:nth-child(2) { flex: 1; background: #FFC72C; }
.flag-stripe i:nth-child(3) { flex: 3; background: #111; }
:root[data-theme="dark"] .flag-stripe i:nth-child(3) { background: #3a3a3a; }

/* ───────────── Footer ───────────── */
.site-footer { margin-top: 64px; border-top: 1px solid var(--border); background: var(--surface); padding: 40px 0 24px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
.footer-grid h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 10px; }
.footer-grid a:not(.brand) { display: block; color: var(--text-2); padding: 3px 0; font-size: .92rem; }
.footer-grid .brand { margin-bottom: 10px; }
.footer-note { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border); }

/* ───────────── Tab bar (phones) ───────────── */
.tab-bar { display: none; }

/* ───────────── Generic building blocks ───────────── */
.page { padding-top: 32px; padding-bottom: 24px; }
.page-head { margin-bottom: 24px; }
.page-head p { color: var(--text-2); max-width: 720px; }
/* Field page header: the same photo as the home "Browse by field" tile, under a left-to-right scrim. */
.field-banner {
  position: relative; isolation: isolate; overflow: hidden; margin-bottom: 24px;
  min-height: 190px; padding: 28px; border-radius: 22px; background: #1b2b22; color: #fff;
  display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start;
}
.field-banner img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
.field-banner::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(100deg, rgba(0,0,0,.85), rgba(0,0,0,.55) 50%, rgba(0,0,0,.15)); }
.field-banner .ms-wrap {
  width: 40px; height: 40px; margin-bottom: 10px; border-radius: 12px; display: grid; place-items: center;
  background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.25); backdrop-filter: blur(6px);
}
.field-banner h1 { color: #fff; margin: 0 0 6px; }
.field-banner p { color: rgba(255,255,255,.88); max-width: 620px; margin: 0; }
@media (max-width: 760px) { .field-banner { min-height: 150px; padding: 18px; border-radius: 16px; } .field-banner p { font-size: .88rem; } }
.crumbs { display: flex; gap: 6px; align-items: center; font-size: .85rem; color: var(--muted); margin-bottom: 14px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); }
.crumbs .ms { font-size: 16px; }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow);
}
.card.flat { box-shadow: none; }
.card + .card { margin-top: 16px; }
.card-title { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-title h2, .card-title h3 { margin: 0; flex: 1; }
.card-title .ms { color: var(--brand); }

.section { margin-top: 40px; }
.section-head { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 16px; }
.section-head h2 { margin: 0; flex: 1; display: flex; align-items: center; gap: 8px; }
.section-head h2 .ms { color: var(--brand); }
.section-head a { font-weight: 700; font-size: .92rem; white-space: nowrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px; border-radius: 999px;
  font-weight: 700; font-size: .93rem; border: 1px solid transparent;
  background: var(--brand); color: #fff; white-space: nowrap;
  transition: transform .08s ease, background .15s ease, box-shadow .15s ease;
}
:root[data-theme="dark"] .btn:not(.ghost):not(.outline):not(.gold) { color: #0A2614; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn:not(.ghost):not(.outline):not(.gold) { color: #0A2614; } }
.btn:hover { text-decoration: none; background: var(--brand-strong); }
.btn:active { transform: scale(.98); }
.btn.gold { background: var(--gold); color: #241A00; }
.btn.gold:hover { filter: brightness(.96); }
.btn.outline { background: transparent; color: var(--brand); border-color: var(--border-strong); }
.btn.outline:hover { background: var(--brand-tint); }
.btn.ghost { background: transparent; color: var(--brand); padding: 0 12px; }
.btn.ghost:hover { background: var(--brand-tint); }
.btn.sm { height: 36px; padding: 0 14px; font-size: .86rem; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  background: var(--surface-2); color: var(--text-2);
  font-size: .82rem; font-weight: 600; border: 1px solid var(--border);
  white-space: nowrap;
}
.chip .ms { font-size: 17px; }
button.chip:hover, a.chip:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
:root[data-theme="dark"] .chip.on { color: #0A2614; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chip.on { color: #0A2614; } }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips.scroll::-webkit-scrollbar { display: none; }

.pill { display: inline-flex; align-items: center; gap: 4px; font-size: .74rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.pill.green { background: var(--brand-tint); color: var(--on-brand-tint); }
.pill.gold { background: var(--gold-tint); color: var(--on-gold-tint); }
.pill.red { background: var(--red-tint); color: var(--on-red-tint); }
.pill.blue { background: var(--info-tint); color: var(--on-info-tint); }
.pill .ms { font-size: 14px; }

.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.auto { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

.list-plain { list-style: none; padding: 0; margin: 0; }
.list-plain li { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.list-plain li:last-child { border-bottom: 0; }
.list-plain li .ms { color: var(--brand); font-size: 20px; margin-top: 1px; }

.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty .ms { font-size: 48px; color: var(--border-strong); margin-bottom: 8px; }
.empty h3 { color: var(--text); }

.notice { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--gold-tint); color: var(--on-gold-tint); font-size: .85rem; }
.notice .ms { font-size: 20px; }
.notice.info { background: var(--info-tint); color: var(--on-info-tint); }
.notice.red { background: var(--red-tint); color: var(--on-red-tint); }

input[type="text"], input[type="search"], input[type="number"], input[type="date"], select {
  height: 44px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface);
  width: 100%; outline: none;
}
input:focus, select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: .82rem; font-weight: 700; color: var(--text-2); }
.search-box { position: relative; }
.search-box .ms { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-box input { padding-left: 42px; }

/* ───────────── Home ───────────── */
.hero { background: var(--hero-grad); color: #fff; position: relative; overflow: hidden; }
.hero::after {
  content: ""; position: absolute; right: -120px; top: -80px; width: 460px; height: 460px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 199, 44, .28), transparent 65%);
  pointer-events: none;
}
.hero-inner { display: grid; grid-template-columns: 1.25fr 1fr; gap: 40px; padding: 56px 24px 64px; align-items: center; position: relative; z-index: 1; }
.hero h1 { color: #fff; font-size: clamp(1.8rem, 1.2rem + 2.4vw, 3rem); }
.hero h1 em { font-style: normal; color: var(--gold); }
:root[data-theme="dark"] .hero h1 em { color: #FFD873; }
.hero p.lead { font-size: 1.08rem; color: rgba(255, 255, 255, .88); max-width: 560px; }
.hero-search {
  display: flex; gap: 8px; background: #fff; border-radius: 999px; padding: 6px 6px 6px 18px;
  max-width: 560px; margin: 22px 0 16px; box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
}
.hero-search .ms { color: #75786C; align-self: center; }
.hero-search input { border: 0; outline: none; flex: 1; background: none; color: #1A1C16; height: 44px; padding: 0; box-shadow: none; }
.hero-search .btn { color: #fff; }
.hero-quick { display: flex; flex-wrap: wrap; gap: 8px; }
.hero-quick a { color: #fff; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .22); padding: 6px 12px; border-radius: 999px; font-size: .84rem; font-weight: 600; }
.hero-quick a:hover { background: rgba(255, 255, 255, .24); text-decoration: none; }
.hero-card {
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 22px; padding: 24px; backdrop-filter: blur(6px);
}
.hero-card h3 { color: #fff; display: flex; gap: 8px; align-items: center; }
.hero-card p { color: rgba(255, 255, 255, .85); font-size: .92rem; }
.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.hero-stats div { background: rgba(0, 0, 0, .14); border-radius: 14px; padding: 12px; text-align: center; }
.hero-stats b { display: block; font-size: 1.5rem; color: var(--gold); }
:root[data-theme="dark"] .hero-stats b { color: #FFD873; }
.hero-stats span { font-size: .75rem; color: rgba(255, 255, 255, .8); }

.quick-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: -32px; position: relative; z-index: 2; }
.tile {
  display: flex; gap: 14px; align-items: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow); color: var(--text);
  transition: transform .12s ease, box-shadow .12s ease;
}
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); text-decoration: none; }
.tile .tile-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; }
.tile b { display: block; font-size: .95rem; }
.tile span.sub { font-size: .8rem; color: var(--muted); }
.ti-green { background: var(--brand-tint); color: var(--brand); }
.ti-gold { background: var(--gold-tint); color: var(--gold-text); }
.ti-red { background: var(--red-tint); color: var(--red); }
.ti-blue { background: var(--info-tint); color: var(--info); }

.match-banner {
  display: flex; align-items: center; gap: 14px;
  background: var(--gold-tint); color: var(--on-gold-tint);
  border: 1px solid color-mix(in srgb, var(--gold) 50%, transparent);
  border-radius: var(--radius); padding: 14px 16px; margin-top: 24px;
}
.match-banner .ms { color: var(--gold-text); }
.match-banner a { color: inherit; font-weight: 800; }
.match-banner .grow { flex: 1; }

.trend-row { display: flex; gap: 12px; overflow-x: auto; padding: 4px 2px 10px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.trend-card {
  flex: 0 0 220px; scroll-snap-align: start;
  display: flex; flex-direction: column; gap: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px;
  color: var(--text);
}
.trend-card:hover { border-color: var(--brand); text-decoration: none; }
.trend-top { display: flex; align-items: center; justify-content: space-between; }
.rank { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .85rem; background: var(--surface-3); color: var(--text-2); }
.rank.r1 { background: #FFC107; color: #3a2a00; }
.rank.r2 { background: #B0BEC5; color: #1f2a30; }
.rank.r3 { background: #CD7F32; color: #2a1500; }
.trend-card b { font-size: .95rem; line-height: 1.3; }
.trend-card .ind { font-size: .78rem; color: var(--muted); }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 999px; font-size: .8rem; font-weight: 700; color: var(--text-2); white-space: nowrap; }
.seg button.on { background: var(--brand); color: #fff; }
:root[data-theme="dark"] .seg button.on { color: #0A2614; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .seg button.on { color: #0A2614; } }

.cat-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 12px; }
/* Photo tile: field photo behind a dark bottom gradient, label pinned bottom-left. */
.cat {
  position: relative; isolation: isolate; overflow: hidden; aspect-ratio: 4 / 3;
  display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; gap: 2px;
  background: #1b2b22; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 10px; color: #fff; font-size: .8rem; font-weight: 700; line-height: 1.2; text-align: left;
  transition: transform .15s ease;
}
.cat img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.cat::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, rgba(0,0,0,.88), rgba(0,0,0,.35) 55%, rgba(0,0,0,.05)); }
.cat:hover { transform: translateY(-3px); text-decoration: none; }
.cat:hover img { transform: scale(1.08); }
.cat .ms {
  width: 30px; height: 30px; margin-bottom: 4px; border-radius: 9px; display: grid; place-items: center; font-size: 18px;
  color: #fff; background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.25); backdrop-filter: blur(6px);
}
.cat small { color: #8ee0b0; font-size: .68rem; font-weight: 600; }

.cta-band { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 28px; position: relative; overflow: hidden; }
.cta-band::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: linear-gradient(var(--brand) 0 45%, var(--gold) 45% 55%, #111 55%); }
.cta-band h2 { margin-bottom: 4px; }

/* ───────────── Career cards ───────────── */
.career-card {
  position: relative; display: flex; flex-direction: column; gap: 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; color: var(--text); box-shadow: var(--shadow);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.career-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--brand) 40%, var(--border)); }
/* Photo strip flush with the card's top edge (cancels the card padding). */
.cc-photo { margin: -18px -18px 0; aspect-ratio: 2 / 1; overflow: hidden; border-radius: var(--radius) var(--radius) 0 0; background: var(--surface-2); }
.cc-photo img, .detail-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; display: block; transition: transform .4s ease; }
.career-card:hover .cc-photo img { transform: scale(1.04); }
.card.has-photo { overflow: hidden; }
.detail-photo { margin: -20px -20px 16px; aspect-ratio: 21 / 9; overflow: hidden; background: var(--surface-2); }
.career-card .cc-head { display: flex; gap: 12px; align-items: flex-start; }
.ind-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--brand-tint); color: var(--brand); display: grid; place-items: center; flex-shrink: 0; }
.cc-head .t { flex: 1; min-width: 0; }
.cc-head h3 { margin: 0 0 2px; font-size: 1rem; }
.cc-head h3 a { color: var(--text); }
.cc-head h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.cc-head .ind { font-size: .8rem; color: var(--muted); }
.career-card p.sum { font-size: .87rem; color: var(--text-2); margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.sal-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: auto; }
.sal { background: var(--surface-2); border-radius: 10px; padding: 8px 10px; }
.sal small { display: block; font-size: .7rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.sal b { font-size: .82rem; }
.sal.entry b { color: var(--brand); }
.sal.senior b { color: var(--gold-text); }
.bm-btn { position: relative; z-index: 2; width: 38px; height: 38px; border-radius: 50%; border: 0; background: none; color: var(--muted); display: grid; place-items: center; margin: -6px -6px 0 0; }
.bm-btn:hover { background: var(--surface-2); color: var(--brand); }
.bm-btn.on { color: var(--brand); }
.bm-btn.on .ms { font-variation-settings: "FILL" 1, "wght" 500; }
.cc-foot { display: flex; gap: 6px; flex-wrap: wrap; }
.compare-check { position: relative; z-index: 2; display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 700; color: var(--text-2); cursor: pointer; }
.compare-check input { accent-color: var(--brand); width: 16px; height: 16px; }

/* ───────────── Browse layout (sidebar filters on desktop) ───────────── */
.browse { display: grid; grid-template-columns: 260px 1fr; gap: 28px; align-items: start; }
.filters { position: sticky; top: calc(var(--header-h) + 20px); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; max-height: calc(100vh - var(--header-h) - 40px); overflow: auto; }
.filters h4 { font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 16px 0 8px; }
.filters h4:first-child { margin-top: 0; }
.check-list label { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: .88rem; cursor: pointer; }
.check-list input { accent-color: var(--brand); width: 17px; height: 17px; }
.check-list .n { margin-left: auto; color: var(--muted); font-size: .78rem; }
.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .grow { flex: 1; min-width: 200px; }
.toolbar select { width: auto; }
.result-count { font-size: .88rem; color: var(--muted); font-weight: 600; }
.filter-btn { display: none; }

/* ───────────── Detail pages ───────────── */
.detail-hero { background: var(--surface); border-bottom: 1px solid var(--border); padding: 28px 0; }
.detail-hero .row { display: flex; gap: 18px; align-items: flex-start; }
.detail-hero .ind-icon { width: 64px; height: 64px; border-radius: 18px; }
.detail-hero .ind-icon .ms { font-size: 32px; }
.detail-hero h1 { margin-bottom: 6px; }
.detail-hero .meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: .9rem; }
.detail-hero .actions { margin-left: auto; display: flex; gap: 8px; flex-shrink: 0; }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; padding-top: 24px; align-items: start; }
.detail-side { position: sticky; top: calc(var(--header-h) + 20px); display: flex; flex-direction: column; gap: 16px; }
.detail-side .card + .card { margin-top: 0; }

.tier-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.tier-tabs button { border: 1px solid var(--border); background: var(--surface-2); border-radius: 12px; padding: 10px; font-weight: 700; font-size: .85rem; color: var(--text-2); }
.tier-tabs button.on { background: var(--brand-tint); border-color: var(--brand); color: var(--on-brand-tint); }
.tier-amount { font-size: 1.4rem; font-weight: 800; color: var(--brand); }
.bar { height: 10px; background: var(--surface-3); border-radius: 999px; overflow: hidden; margin: 10px 0; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--gold)); border-radius: inherit; transition: width .4s ease; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; font-size: .9rem; }
.kv dt { color: var(--text-2); }
.kv dd { margin: 0; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.kv .neg { color: var(--red); }
.kv .total { border-top: 1px solid var(--border); padding-top: 6px; }
.net-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.net-tiles div { background: var(--brand-tint); color: var(--on-brand-tint); border-radius: 12px; padding: 12px; }
.net-tiles small { display: block; font-weight: 700; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; opacity: .8; }
.net-tiles b { font-size: 1.12rem; }
.net-tiles.three { grid-template-columns: repeat(3, 1fr); }
.net-tiles.three b { font-size: 1rem; }
@media (max-width: 480px) { .net-tiles.three { grid-template-columns: 1fr 1fr; } .net-tiles.three div:last-child { grid-column: 1 / -1; } }

.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li { position: relative; padding: 0 0 20px 44px; }
.timeline li::before { content: ""; position: absolute; left: 15px; top: 32px; bottom: 0; width: 2px; background: var(--border); }
.timeline li:last-child::before { display: none; }
.timeline .num { position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: .85rem; }
:root[data-theme="dark"] .timeline .num { color: #0A2614; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .timeline .num { color: #0A2614; } }
.timeline h4 { margin: 4px 0 4px; font-size: .97rem; }
.timeline p { font-size: .88rem; color: var(--text-2); margin-bottom: 4px; }

.subject-meter { display: flex; align-items: center; gap: 12px; }
.ring { --p: 0; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
  background: conic-gradient(var(--brand) calc(var(--p) * 1%), var(--surface-3) 0); }
.ring span { width: 44px; height: 44px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-weight: 800; font-size: .8rem; }

.inst-card { display: flex; gap: 14px; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; color: var(--text); position: relative; }
.inst-card:hover { border-color: var(--brand); text-decoration: none; }
.logo { width: 52px; height: 52px; border-radius: 12px; background: #fff; border: 1px solid var(--border); display: grid; place-items: center; overflow: hidden; flex-shrink: 0; font-weight: 800; color: #007A33; font-size: .78rem; text-align: center; }
.logo img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.inst-card .t { flex: 1; min-width: 0; }
.inst-card h3 { font-size: .97rem; margin: 0 0 2px; }
.inst-card .meta { font-size: .8rem; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.inst-card p { font-size: .84rem; color: var(--text-2); margin: 6px 0 0; }

.prog-row { display: flex; gap: 12px; align-items: center; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; color: var(--text); }
.prog-row + .prog-row { margin-top: 10px; }
.prog-row:hover { border-color: var(--brand); text-decoration: none; }
.prog-row .t { flex: 1; min-width: 0; }
.prog-row b { display: block; font-size: .93rem; }
.prog-row small { color: var(--muted); font-size: .8rem; }
.prog-row > .ms { color: var(--muted); }

.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.fact { background: var(--surface-2); border-radius: 12px; padding: 12px; }
.fact small { display: block; color: var(--muted); font-weight: 700; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; }
.fact b { font-size: .9rem; }

/* Compare tables */
.compare-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table.compare { width: 100%; border-collapse: collapse; min-width: 560px; }
table.compare th, table.compare td { padding: 14px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); font-size: .88rem; }
table.compare thead th { background: var(--surface-2); font-size: .95rem; }
table.compare tbody th { width: 160px; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
table.compare ul { margin: 0; padding-left: 18px; }

.compare-bar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 24px; z-index: 45;
  display: flex; align-items: center; gap: 12px; background: var(--text); color: var(--bg);
  border-radius: 999px; padding: 8px 8px 8px 20px; box-shadow: var(--shadow-lg); font-weight: 700; font-size: .9rem;
}
.compare-bar .btn { background: var(--gold); color: #241A00; }

/* ───────────── Quiz ───────────── */
.quiz-shell { max-width: 820px; margin: 0 auto; }
.quiz-progress { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.quiz-progress .bar { flex: 1; margin: 0; }
.opt-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.opt {
  display: flex; gap: 14px; align-items: flex-start; text-align: left;
  background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius);
  padding: 16px; transition: border-color .12s ease, background .12s ease;
}
.opt:hover { border-color: color-mix(in srgb, var(--brand) 50%, var(--border)); }
.opt.on { border-color: var(--brand); background: var(--brand-tint); }
.opt .oi { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--brand); flex-shrink: 0; }
.opt.on .oi { background: var(--brand); color: #fff; }
.opt b { display: block; font-size: .95rem; margin-bottom: 2px; }
.opt span.d { font-size: .84rem; color: var(--text-2); }
.quiz-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; }
.journey { list-style: none; padding: 0; margin: 0; counter-reset: j; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 24px; }
.journey li { counter-increment: j; display: flex; gap: 10px; align-items: baseline; font-size: .9rem; }
.journey li::before { content: counter(j); width: 24px; height: 24px; border-radius: 50%; background: var(--brand-tint); color: var(--brand); display: grid; place-items: center; font-weight: 800; font-size: .75rem; flex-shrink: 0; }
.journey small { color: var(--muted); }

.result-hero { background: var(--hero-grad); color: #fff; border-radius: 22px; padding: 28px; display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; }
.result-hero h2 { color: #fff; font-size: 1.7rem; margin-bottom: 4px; }
.result-hero p { color: rgba(255, 255, 255, .88); margin: 0; }
.big-ring { --p: 0; width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(#FFC72C calc(var(--p) * 1%), rgba(255, 255, 255, .2) 0); }
.big-ring span { width: 96px; height: 96px; border-radius: 50%; background: #0A4D25; display: grid; place-items: center; font-weight: 800; font-size: 1.6rem; color: #fff; text-align: center; line-height: 1.1; }
.big-ring small { display: block; font-size: .65rem; font-weight: 600; opacity: .8; }
.reason-list { list-style: none; padding: 0; margin: 0; }
.reason-list li { display: flex; gap: 8px; align-items: flex-start; padding: 5px 0; font-size: .9rem; }
.reason-list .ms { color: var(--success); font-size: 20px; }
.match-row { display: flex; gap: 14px; align-items: center; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; color: var(--text); }
.match-row + .match-row { margin-top: 10px; }
.match-row:hover { border-color: var(--brand); text-decoration: none; }
.match-row .t { flex: 1; min-width: 0; }
.match-row b { display: block; }
.match-row small { color: var(--muted); }
.pct { font-weight: 800; color: var(--brand); font-size: 1.05rem; }

/* ───────────── Subjects ───────────── */
.subject-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.subject { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); cursor: pointer; font-size: .9rem; }
.subject:has(input:checked) { border-color: var(--brand); background: var(--brand-tint); color: var(--on-brand-tint); font-weight: 700; }
.subject input { accent-color: var(--brand); width: 18px; height: 18px; }

/* ───────────── Roadmap ───────────── */
.rm-item { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.rm-item + .rm-item { margin-top: 10px; }
.rm-item .t { flex: 1; min-width: 0; }
.rm-item b a { color: var(--text); }
.rm-item small { display: block; color: var(--muted); }
.rm-item .rm-actions { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.rm-group { font-size: .8rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 18px 0 10px; }

/* ───────────── Sheet / toast ───────────── */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 60; opacity: 0; transition: opacity .2s ease; }
.sheet-backdrop.open { opacity: 1; }
.sheet {
  position: fixed; z-index: 61; background: var(--surface); box-shadow: var(--shadow-lg);
  left: 50%; top: 50%; transform: translate(-50%, -48%); opacity: 0;
  width: min(520px, calc(100vw - 32px)); max-height: 85vh; overflow: auto;
  border-radius: 22px; padding: 22px; transition: transform .22s ease, opacity .22s ease;
}
.sheet.open { transform: translate(-50%, -50%); opacity: 1; }
.sheet-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.sheet-head h3 { flex: 1; margin: 0; font-size: 1.15rem; }
.sheet .grabber { display: none; }

.toast-host { position: fixed; left: 50%; transform: translateX(-50%); bottom: 24px; z-index: 70; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { pointer-events: auto; background: var(--text); color: var(--bg); padding: 10px 10px 10px 18px; border-radius: 12px; font-size: .9rem; font-weight: 600; display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow-lg); animation: toast-in .2s ease; max-width: calc(100vw - 32px); }
.toast button { background: none; border: 0; color: var(--gold); font-weight: 800; padding: 6px 10px; border-radius: 8px; }
@keyframes toast-in { from { transform: translateY(10px); opacity: 0; } }

.boot { min-height: 60vh; display: grid; place-items: center; align-content: center; gap: 14px; color: var(--muted); }
.boot .brand-mark { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(.9); opacity: .7; } }

.install-card { display: none; }

/* ───────────── Tablet ───────────── */
@media (max-width: 1080px) {
  .desktop-nav a { padding: 8px 9px; }
  .header-search { max-width: 260px; }
  .cat-grid { grid-template-columns: repeat(4, 1fr); }
  .quick-tiles { grid-template-columns: repeat(2, 1fr); }
  .detail-layout { grid-template-columns: 1fr; }
  .detail-side { position: static; }
  .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 920px) {
  .desktop-nav { display: none; }
  .browse { grid-template-columns: 1fr; }
  .filters { display: none; }
  .filter-btn { display: inline-flex; }
  .grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-inner { grid-template-columns: 1fr; padding-bottom: 56px; }
}

/* ───────────── Phone: become an app ───────────── */
@media (max-width: 760px) {
  :root { --header-h: 56px; }
  body { font-size: 14.5px; padding-bottom: calc(var(--tab-h) + var(--safe-b)); }
  .container { padding: 0 16px; }
  .site-footer, .header-search, .crumbs { display: none; }
  .brand { font-size: 1.02rem; }
  .brand-mark { width: 32px; height: 32px; border-radius: 10px; }
  .header-actions { margin-left: auto; }
  #mobile-search-btn { display: grid; }
  .header-inner { gap: 6px; }
  .site-header { background: var(--surface); }
  body.has-back .mobile-back { display: grid; }
  body.has-back .brand { display: none; }
  .mobile-title { display: block; }
  .header-actions .icon-btn { width: 40px; height: 40px; }
  .roadmap-link { display: none !important; }
  .flag-stripe { height: 2px; }

  .tab-bar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    height: calc(var(--tab-h) + var(--safe-b)); padding-bottom: var(--safe-b);
    background: var(--surface); border-top: 1px solid var(--border);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, .06);
  }
  .tab-bar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); font-size: 11px; font-weight: 600; }
  .tab-bar a:hover { text-decoration: none; }
  .tab-bar a .ms { width: 56px; height: 30px; border-radius: 999px; display: grid; place-items: center; font-size: 22px; transition: background .15s ease; }
  .tab-bar a.active { color: var(--brand); font-weight: 800; }
  .tab-bar a.active .ms { background: var(--brand); color: #fff; font-variation-settings: "FILL" 1, "wght" 500; }
  :root[data-theme="dark"] .tab-bar a.active .ms { color: #0A2614; }

  .page { padding-top: 16px; padding-bottom: 24px; }
  .page-head { margin-bottom: 16px; }
  h1 { font-size: 1.45rem; }
  .section { margin-top: 28px; }
  .card { padding: 16px; border-radius: 14px; }
  .detail-photo { margin: -16px -16px 14px; aspect-ratio: 16 / 9; }

  .hero { border-radius: 0 0 26px 26px; }
  .hero-inner { padding: 22px 16px 48px; gap: 18px; }
  .hero h1 { font-size: 1.6rem; }
  .hero p.lead { font-size: .95rem; }
  .hero-search { margin: 14px 0 12px; }
  .hero-search .btn { display: none; }
  .hero-card { display: none; }
  .quick-tiles { grid-template-columns: 1fr 1fr; gap: 10px; margin-top: -28px; }
  .tile { flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px; }
  .tile span.sub { display: none; }
  .cat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .cat { font-size: .78rem; }
  .cta-band { grid-template-columns: 1fr; padding: 20px; }

  .grid.cols-2, .grid.cols-3, .grid.cols-4, .grid.auto { grid-template-columns: 1fr; gap: 12px; }
  .career-card { box-shadow: none; padding: 16px; }
  .cc-photo { margin: -16px -16px 0; aspect-ratio: 5 / 2; }
  .career-card:hover { transform: none; }

  .detail-hero { padding: 18px 0; }
  .detail-hero .row { flex-wrap: wrap; gap: 14px; }
  .detail-hero .ind-icon { width: 52px; height: 52px; }
  .detail-hero h1 { font-size: 1.35rem; }
  .detail-hero .actions { margin-left: 0; width: 100%; }
  .detail-hero .actions .btn { flex: 1; }
  .detail-layout { padding-top: 16px; gap: 16px; }
  .facts { grid-template-columns: 1fr 1fr; }

  .opt-grid { grid-template-columns: 1fr; }
  .journey { grid-template-columns: 1fr; }
  .quiz-nav { position: sticky; bottom: calc(var(--tab-h) + var(--safe-b)); background: var(--bg); padding: 12px 0; margin: 16px 0 0; }
  .quiz-nav .btn { flex: 1; }
  /* "Generate My Career Match Report" is too long for one line beside Back on a phone: let it wrap. */
  /* Both buttons size to the taller one so Back lines up when the main button wraps to two lines. */
  .quiz-nav .btn { height: auto; min-height: 44px; }
  .quiz-nav .btn.outline { flex: 0 0 auto; }
  .quiz-nav [data-act="next"] { min-width: 0; white-space: normal; padding-block: 8px; line-height: 1.25; text-align: center; }
  .result-hero { grid-template-columns: 1fr; text-align: center; justify-items: center; padding: 22px; }
  .subject-grid { grid-template-columns: 1fr 1fr; }

  .compare-bar { bottom: calc(var(--tab-h) + var(--safe-b) + 12px); width: calc(100vw - 32px); justify-content: space-between; }
  .toast-host { bottom: calc(var(--tab-h) + var(--safe-b) + 12px); }

  /* Dialogs become bottom sheets */
  .sheet { left: 0; right: 0; top: auto; bottom: 0; width: 100%; max-height: 88vh; transform: translateY(100%); opacity: 1; border-radius: 22px 22px 0 0; padding: 10px 18px calc(18px + var(--safe-b)); }
  .sheet.open { transform: translateY(0); }
  .sheet .grabber { display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--border-strong); margin: 0 auto 12px; }

  .install-card { display: flex; }
  .rm-item { flex-wrap: wrap; }
  .toolbar select { flex: 1; }
}

@media (max-width: 400px) {
  /* Four header icons + the wordmark don't fit on small phones; keep just the logo mark. */
  .brand-text { display: none; }
}

@media (max-width: 380px) {
  .subject-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

@media print {
  .site-header, .tab-bar, .site-footer, .compare-bar, .btn, .bm-btn { display: none !important; }
  body { padding: 0; }
}
