/* ==========================================================================
   Vietnam Market Insights - Global Styles
   Legible design system: ink on white paper, one highlighter accent, square
   corners, ruled structure. Spec: docs/RESTYLE-LEGIBLE.md.
   ========================================================================== */

/* Tokens
   ========================================================================== */
:root {
  /* The site has one light theme; declare it so OS dark mode never restyles native controls. */
  color-scheme: light;

  /* Legible palette. The highlighter is a fill behind text, never a text colour.
     Go / caution / no-go are for state only, never decoration. */
  --paper: #ffffff;
  --paper-2: #f2f4f5;
  --ink: #101418;
  --ink-2: #4a535c;
  --ink-3: #646d76;
  --rule: #d5dadf;
  --rule-soft: #e8ebee;
  --hl: #ffe14d;
  --go: #0e7a4d;
  --go-bg: #e2f2e9;
  --caution: #9e5c00;
  --caution-bg: #fff0d6;
  --nogo: #bd3227;
  --nogo-bg: #fbe4e1;
  --ink-hover: #2a3038;
  --on-ink: #ffffff;
  --on-ink-2: #c9d0d7;

  /* Vietnamese price-board convention, used on market pages only. */
  --mk-up: #0e9f5a;
  --mk-down: #d93a30;
  --mk-ref: #b98a00;
  --mk-ceiling: #8b3fd9;
  --mk-floor: #0a8fb8;
  /* Darker shades for small text on white (WCAG AA); the base colours stay for bars and fills. */
  --mk-up-text: color-mix(in srgb, var(--mk-up) 75%, var(--ink));
  --mk-down-text: color-mix(in srgb, var(--mk-down) 75%, var(--ink));
  --mk-ref-text: color-mix(in srgb, var(--mk-ref) 75%, var(--ink));

  /* Legacy names kept so every existing rule picks up the new palette. */
  --color-bg: var(--paper);
  --color-bg-subtle: var(--paper-2);
  --color-text: var(--ink);
  --color-text-muted: var(--ink-2);
  --color-text-light: var(--ink-3);
  --color-border: var(--rule);
  --color-border-light: var(--rule-soft);
  --color-accent: var(--ink);
  --color-accent-hover: var(--ink-hover);
  --color-gold: var(--ink-2);
  --color-ink: var(--ink);
  --color-paper-edge: var(--rule);
  --color-trend: var(--hl);

  /* Square corners; only dots and filter chips are round. */
  --radius-xs: 2px;
  --radius-sm: 2px;
  --radius-md: 2px;
  --radius-lg: 2px;
  --radius-xl: 2px;
  --radius-full: 9999px;

  /* No ambient shadows. Only floating layers (search, menus) cast one. */
  --shadow-subtle: none;
  --shadow-card: none;
  --shadow-float: 0 18px 40px -16px rgba(16, 20, 24, 0.35);

  /* Type: Archivo for UI, headings and data (width axis 62-125%);
     Source Serif 4 for leads and long reads. */
  --font-sans: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, "SFMono-Regular", "Cascadia Code", Consolas, monospace;
  --stretch-display: 120%;
  --stretch-h1: 112%;
  --stretch-h2: 104%;
  --stretch-label: 88%;
  --stretch-data: 92%;

  /* Font sizes */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: clamp(2rem, 1.45rem + 2.2vw, 2.6rem);
  --text-5xl: clamp(2.4rem, 1.5rem + 3.8vw, 3.75rem);
  --text-read: 1.125rem;

  /* Line heights */
  --leading-display: 1.04;
  --leading-tight: 1.15;
  --leading-normal: 1.6;
  --leading-relaxed: 1.7;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-18: 4.5rem;

  /* Layout: a 1200px page; reading columns stay near 70 characters. */
  --page-width: 1200px;
  --reading-width: 760px;
  --max-width: var(--page-width);
  --max-width-wide: var(--page-width);
  --header-height: 60px;
  --content-padding-x: 1.5rem;
  --header-nav-gap: 1rem;
  --header-link-padding-y: 0.4rem;
}

/* Reset (replaces Tailwind's preflight, which was removed)
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border-width: 0;
  border-style: solid;
  border-color: var(--rule);
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
}

img,
svg,
video,
canvas {
  display: block;
  max-width: 100%;
}

img,
video {
  height: auto;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

button,
[type="button"],
[type="submit"],
[type="reset"] {
  background-color: transparent;
  cursor: pointer;
}

textarea {
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: var(--ink-3);
  opacity: 1;
}

table {
  border-collapse: collapse;
}

[hidden] {
  display: none !important;
}

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: var(--leading-normal);
  color: var(--ink);
  background-color: var(--paper);
  font-variant-numeric: lining-nums;
}

/* Typography
   ========================================================================== */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-sans);
  font-weight: 650;
  line-height: var(--leading-tight);
  color: var(--ink);
  text-wrap: balance;
}

h1 {
  font-size: var(--text-4xl);
  font-weight: 750;
  font-stretch: var(--stretch-h1);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-6);
}

h2 {
  font-size: clamp(1.4rem, 1.2rem + 0.8vw, 1.65rem);
  font-weight: 700;
  font-stretch: var(--stretch-h2);
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin-top: var(--space-12);
  margin-bottom: var(--space-4);
  padding-top: var(--space-3);
  border-top: 2px solid var(--ink);
}

h3 {
  font-size: 1.2rem;
  font-weight: 650;
  margin-top: var(--space-8);
  margin-bottom: var(--space-3);
}

h4 {
  font-size: 1.05rem;
  font-weight: 650;
  margin-top: var(--space-6);
  margin-bottom: var(--space-2);
}

/* Label above a headline. Use only when it carries information (a section, a date). */
.kicker {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 650;
  font-stretch: var(--stretch-label);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-2);
}

p {
  font-size: 1rem;
  line-height: var(--leading-normal);
  color: var(--ink);
  margin-bottom: var(--space-4);
}

/* Leads read in the serif. */
.lead,
.guide-lead,
.compare-lead,
.sell-lead {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  line-height: 1.5;
  color: var(--ink);
  margin-bottom: var(--space-5);
  max-width: 44rem;
}

/* The answer sentence on a page: the one highlighter mark. */
.mark,
mark {
  color: inherit;
  background-color: transparent;
  background-image: linear-gradient(var(--hl), var(--hl));
  background-repeat: no-repeat;
  background-size: 100% 0.62em;
  background-position: 0 88%;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* Links: ink, underlined, highlighted on hover. */
a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, var(--ink) 45%, transparent);
  transition: background-color 0.12s ease, text-decoration-color 0.12s ease;
}

a:hover {
  color: var(--ink);
  background-color: var(--hl);
  text-decoration-color: var(--ink);
}

::selection {
  background: var(--hl);
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  border-radius: 0;
}

/* Lists: content lists keep their markers; classed lists are UI and start bare. */
ul,
ol {
  margin-bottom: var(--space-4);
  padding-left: var(--space-5);
}

ul[class],
ol[class] {
  list-style: none;
  padding-left: 0;
}

li {
  font-size: 1rem;
  line-height: var(--leading-normal);
  color: var(--ink);
  margin-bottom: var(--space-2);
}

li::marker {
  color: var(--ink-3);
}

span {
  font-family: inherit;
}

section {
  margin-bottom: var(--space-8);
}

strong,
b {
  font-weight: 650;
}

small {
  font-size: 0.85em;
}

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  padding: 0.1em 0.35em;
  background-color: var(--paper-2);
  border-radius: 2px;
  color: var(--ink);
}

pre {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  padding: var(--space-4);
  background-color: var(--paper-2);
  border-radius: 2px;
  overflow-x: auto;
  margin-bottom: var(--space-4);
}

pre code {
  padding: 0;
  background: none;
}

hr {
  border: 0;
  height: 1px;
  background-color: var(--rule);
  margin: var(--space-8) 0;
}

/* Numbers that line up in columns. */
table,
.num,
.tabular {
  font-variant-numeric: tabular-nums;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}

/* Shell: header, menus, search trigger, drawer, phone bottom bar, footer
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 900;
  background: var(--paper);
  border-bottom: 1px solid var(--ink);
}

.site-header__inner {
  max-width: var(--page-width);
  height: var(--header-height);
  margin: 0 auto;
  padding: 0 var(--content-padding-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
}

.site-header__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
  font-size: 1.02rem;
  font-weight: 800;
  font-stretch: 108%;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}

.site-header__brand:hover {
  background: none;
}

.site-header__brand img {
  width: 28px;
  height: 28px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin-left: auto;
  min-width: 0;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.7rem;
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
}

.nav-link:hover {
  background: none;
  border-bottom-color: var(--ink);
}

.nav-link[aria-current="true"],
.nav-link[aria-current="page"] {
  border-bottom-color: var(--ink);
  box-shadow: inset 0 -6px 0 -2px var(--hl);
}

.dropdown-arrow {
  transition: transform 0.15s ease;
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown__menu {
  position: absolute;
  top: calc(100% + 1px);
  left: 0;
  z-index: 950;
  width: 21rem;
  padding: var(--space-3) 0;
  background: var(--paper);
  border: 1px solid var(--ink);
  box-shadow: var(--shadow-float);
  visibility: hidden;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.12s ease, transform 0.12s ease, visibility 0s linear 0.12s;
}

.nav-dropdown:nth-last-of-type(1) .nav-dropdown__menu,
.nav-dropdown:nth-last-of-type(2) .nav-dropdown__menu {
  left: auto;
  right: 0;
}

.nav-dropdown:hover .nav-dropdown__menu,
.nav-dropdown:focus-within .nav-dropdown__menu {
  visibility: visible;
  opacity: 1;
  transform: none;
  transition-delay: 0s;
}

.nav-dropdown:hover .dropdown-arrow,
.nav-dropdown:focus-within .dropdown-arrow {
  transform: rotate(180deg);
}

.nav-dropdown__blurb {
  margin: 0 var(--space-4) var(--space-2);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--rule);
  font-size: var(--text-sm);
  color: var(--ink-2);
}

.nav-dropdown__item {
  display: grid;
  gap: 0.05rem;
  padding: 0.45rem var(--space-4);
  color: var(--ink);
  text-decoration: none;
}

.nav-dropdown__item:hover,
.nav-dropdown__item:focus-visible {
  background: var(--paper-2);
}

.nav-dropdown__item:hover .nav-dropdown__label {
  background-image: linear-gradient(var(--hl), var(--hl));
  background-repeat: no-repeat;
  background-size: 100% 0.55em;
  background-position: 0 90%;
}

.nav-dropdown__label {
  justify-self: start;
  font-size: 0.92rem;
  font-weight: 600;
}

.nav-dropdown__desc {
  font-size: 0.8rem;
  color: var(--ink-2);
}

.nav-workspace {
  gap: 0.4rem;
}

.nav-workspace-badge,
.mobile-workspace-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--hl);
  color: var(--ink);
  font-size: 0.68rem;
  font-weight: 700;
  border-radius: 2px;
}

.search-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: var(--space-2);
  padding: 0.4rem 0.5rem 0.4rem 0.65rem;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 2px;
  color: var(--ink-2);
  font-size: 0.86rem;
  white-space: nowrap;
}

.search-trigger:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.search-trigger__kbd {
  font-family: inherit;
  font-size: 0.72rem;
  padding: 0 0.3rem;
  border: 1px solid var(--rule);
  color: var(--ink-2);
}

.nav-link.nav-cta {
  margin-left: var(--space-2);
  padding: 0.5rem 0.85rem;
  background: var(--ink);
  color: var(--on-ink);
  border-bottom: 0;
  border-radius: 2px;
  font-weight: 650;
}

.nav-link.nav-cta:hover {
  background: var(--ink-hover);
  color: var(--on-ink);
}

.nav-link.nav-cta[aria-current="page"] {
  box-shadow: inset 0 -4px 0 var(--hl);
}

.site-header__actions-mobile {
  display: none;
  align-items: center;
  gap: var(--space-1);
}

.mobile-search-btn,
.mobile-menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid transparent;
  color: var(--ink);
}

.mobile-search-btn:hover,
.mobile-menu-toggle:hover {
  border-color: var(--rule);
}

/* Drawer */
.mobile-drawer {
  position: fixed;
  inset: 0;
  z-index: 1000;
  visibility: hidden;
}

.mobile-drawer.is-open {
  visibility: visible;
}

.mobile-drawer__overlay {
  position: absolute;
  inset: 0;
  background: rgba(16, 20, 24, 0.45);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.mobile-drawer.is-open .mobile-drawer__overlay {
  opacity: 1;
}

.mobile-drawer__content {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(22rem, 88vw);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: var(--paper);
  border-left: 1px solid var(--ink);
  transform: translateX(100%);
  transition: transform 0.2s ease;
}

.mobile-drawer.is-open .mobile-drawer__content {
  transform: none;
}

.mobile-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--ink);
}

.mobile-drawer__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  font-stretch: 108%;
  color: var(--ink);
  text-decoration: none;
}

.mobile-drawer__close {
  width: 40px;
  height: 40px;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--ink);
}

.mobile-drawer__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  padding: var(--space-4) var(--space-4) var(--space-10);
}

.mobile-drawer__item.highlight {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: var(--space-3) var(--space-4);
  background: var(--ink);
  color: var(--on-ink);
  text-decoration: none;
}

.mobile-drawer__item.highlight strong {
  font-size: 1rem;
  font-weight: 700;
}

.mobile-drawer__item.highlight span {
  font-size: 0.82rem;
  color: var(--on-ink-2);
}

.mobile-drawer__group {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding-top: var(--space-2);
  border-top: 2px solid var(--ink);
}

.mobile-drawer__group-title {
  font-size: 1.05rem;
  font-weight: 700;
  font-stretch: var(--stretch-h2);
  color: var(--ink);
  text-decoration: none;
}

.mobile-drawer__group-blurb {
  margin-bottom: var(--space-2);
  font-size: 0.82rem;
  color: var(--ink-2);
}

.mobile-drawer__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--rule-soft);
  font-size: 0.95rem;
  color: var(--ink);
  text-decoration: none;
}

.mobile-drawer__pwa {
  padding: 0 var(--space-4) var(--space-6);
}

.pwa-install-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  border: 1px solid var(--ink);
  font-weight: 600;
}

/* Phone bottom bar */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 900;
  height: calc(60px + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--paper);
  border-top: 1px solid var(--ink);
}

.mobile-bottom-nav__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 0;
  background: none;
  color: var(--ink-2);
  font-size: 0.7rem;
  font-weight: 600;
  text-decoration: none;
}

.mobile-bottom-nav__item:hover {
  background: none;
  color: var(--ink);
}

.mobile-bottom-nav__item.is-active {
  color: var(--ink);
  box-shadow: inset 0 3px 0 var(--hl);
}

/* Footer */
.site-footer {
  margin-top: var(--space-16);
  background: var(--paper);
  border-top: 2px solid var(--ink);
}

.site-footer__signup {
  background: var(--paper-2);
  border-bottom: 1px solid var(--rule);
}

.site-footer__signup-inner,
.site-footer__inner,
.site-footer__bar {
  max-width: var(--page-width);
  margin: 0 auto;
  padding-left: var(--content-padding-x);
  padding-right: var(--content-padding-x);
}

.site-footer__signup-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: var(--space-8);
  align-items: center;
  padding-top: var(--space-10);
  padding-bottom: var(--space-10);
}

.site-footer__signup-kicker {
  margin: 0;
  font-size: var(--text-xs);
  font-weight: 650;
  font-stretch: var(--stretch-label);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.site-footer__signup-title {
  margin: 0.35rem 0 0.5rem;
  padding: 0;
  border: 0;
  font-size: clamp(1.3rem, 1.1rem + 0.8vw, 1.6rem);
  font-stretch: var(--stretch-h2);
}

.site-footer__signup-copy p {
  margin: 0;
  max-width: 34rem;
  color: var(--ink-2);
}

.site-footer__signup-copy .site-footer__signup-kicker {
  color: var(--ink-2);
}

.site-footer__signup-row {
  display: flex;
  gap: var(--space-2);
}

.site-footer__signup-row input {
  flex: 1;
  min-width: 0;
  padding: 0.7rem 0.8rem;
  background: var(--paper);
  border: 1px solid var(--ink-2);
  border-radius: 2px;
}

.site-footer__signup-row input:focus {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
  border-color: var(--ink);
}

.site-footer__signup-row button {
  padding: 0.7rem 1.1rem;
  background: var(--ink);
  color: var(--on-ink);
  font-weight: 650;
  border-radius: 2px;
  white-space: nowrap;
}

.site-footer__signup-row button:hover {
  background: var(--ink-hover);
}

.site-footer__signup-row button[disabled] {
  opacity: 0.6;
  cursor: wait;
}

.site-footer__signup-status {
  display: block;
  min-height: 1.2em;
  margin-top: 0.5rem;
  font-size: 0.85rem;
}

.site-footer__signup-status.is-success {
  color: var(--go);
}

.site-footer__signup-status.is-error {
  color: var(--nogo);
}

.site-footer__signup-note {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  color: var(--ink-2);
}

.site-footer__inner {
  display: grid;
  grid-template-columns: minmax(0, 15rem) minmax(0, 1fr);
  gap: var(--space-10);
  padding-top: var(--space-10);
  padding-bottom: var(--space-10);
}

.site-footer__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 800;
  font-stretch: 108%;
  color: var(--ink);
  text-decoration: none;
}

.site-footer__tagline {
  margin: 0.75rem 0 1rem;
  font-size: 0.88rem;
  color: var(--ink-2);
}

.site-footer__contact {
  margin: -0.25rem 0 1rem;
  font-size: 0.88rem;
  color: var(--ink-2);
}

.site-footer__contact a {
  font-weight: 600;
  color: var(--ink);
}

.site-footer__follow {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.footer-social-link {
  font-size: 0.86rem;
  font-weight: 600;
}

.site-footer__cols {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--space-6);
}

.site-footer__col {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 0;
}

.site-footer__heading {
  margin: 0 0 0.35rem;
  padding: 0;
  border: 0;
  font-size: var(--text-xs);
  font-weight: 650;
  font-stretch: var(--stretch-label);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.site-footer__heading a {
  color: inherit;
  text-decoration: none;
}

.site-footer__col > a {
  font-size: 0.88rem;
  color: var(--ink);
  text-decoration: none;
}

.site-footer__col > a:hover {
  text-decoration: underline;
}

.site-footer__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding-top: var(--space-4);
  padding-bottom: var(--space-6);
  border-top: 1px solid var(--rule);
}

.footer-bar__copy {
  margin: 0;
  font-size: 0.8rem;
  color: var(--ink-2);
}

/* In-page utility row (copy, CSV, print) on reference pages. */
.utility-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0 0 var(--space-6);
}

.utility-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: var(--paper);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 600;
}

.utility-btn:hover {
  border-color: var(--ink);
}

.utility-btn svg {
  width: 16px;
  height: 16px;
}

/* Shell breakpoints */
@media (max-width: 1279px) {
  .search-trigger {
    padding: 0.45rem;
  }

  .search-trigger__text,
  .search-trigger__kbd {
    display: none;
  }
}

@media (max-width: 1023px) {
  .site-nav {
    display: none;
  }

  .site-header__actions-mobile {
    display: flex;
  }

  .site-footer__inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .site-footer__cols {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  :root {
    --content-padding-x: 1rem;
  }

  .mobile-bottom-nav {
    display: flex;
  }

  body {
    padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px));
  }

  .site-footer__signup-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-5);
  }

  .site-footer__cols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .site-footer__signup-row {
    flex-direction: column;
  }
}

@media print {
  .site-header,
  .mobile-bottom-nav,
  .mobile-drawer,
  .site-footer__signup,
  .utility-bar {
    display: none !important;
  }
}

/* Legible components (Verdict, RatingMeter, SourcedFigure, NextSteps, labels, buttons)
   ========================================================================== */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.05rem;
  border: 1px solid var(--ink);
  border-radius: 2px;
  font-size: 0.92rem;
  font-weight: 650;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.btn--primary {
  background: var(--ink);
  color: var(--on-ink);
}

.btn--primary:hover {
  background: var(--ink-hover);
  color: var(--on-ink);
}

.btn--secondary {
  background: var(--paper);
  color: var(--ink);
}

.btn--secondary:hover {
  background: var(--paper-2);
}

.btn--hl {
  background: var(--hl);
  border-color: var(--hl);
  color: var(--ink);
}

.btn--hl:hover {
  background: var(--hl);
  border-color: var(--ink);
}

/* Verdict */
.verdict {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-3) var(--space-5);
  align-items: start;
  margin: var(--space-6) 0 var(--space-8);
  padding: var(--space-5);
  background: var(--paper);
  border: 1px solid var(--ink);
}

.verdict__word {
  margin: 0;
  padding: 0.45rem 0.7rem;
  font-size: 1.4rem;
  font-weight: 800;
  font-stretch: 125%;
  letter-spacing: 0.02em;
  line-height: 1;
  text-transform: uppercase;
}

.verdict--go .verdict__word { color: var(--go); background: var(--go-bg); }
.verdict--caution .verdict__word { color: var(--caution); background: var(--caution-bg); }
.verdict--nogo .verdict__word { color: var(--nogo); background: var(--nogo-bg); }

.verdict__body {
  display: grid;
  gap: var(--space-2);
  min-width: 0;
}

.verdict__qualifier {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  font-stretch: var(--stretch-h2);
}

.verdict__text {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.08rem;
  line-height: 1.55;
}

/* Rating meter */
.meter {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  font-weight: 650;
  white-space: nowrap;
}

.meter__bars {
  display: inline-grid;
  grid-template-columns: repeat(3, 0.45rem);
  gap: 2px;
}

.meter__bars i {
  display: block;
  height: 0.8rem;
  background: var(--rule);
}

.meter--favourable { color: var(--go); }
.meter--mixed { color: var(--caution); }
.meter--challenging { color: var(--nogo); }
.meter .meter__bars i.is-on { background: currentColor; }

/* Sourced figures */
.figs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: var(--space-5);
  margin: var(--space-6) 0;
}

.fig {
  display: grid;
  align-content: start;
  gap: 0.15rem;
  min-width: 0;
  padding-top: 0.55rem;
  border-top: 1px solid var(--ink);
}

.fig__value {
  font-size: 1.85rem;
  font-weight: 700;
  font-stretch: var(--stretch-data);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.fig__label {
  font-size: 0.9rem;
}

.fig__source {
  font-size: 0.78rem;
  color: var(--ink-2);
}

/* Document number, as-of stamp, status */
.docno {
  display: inline-block;
  padding: 0.05rem 0.4rem;
  border: 1px solid var(--ink);
  font-size: 0.76rem;
  font-weight: 650;
  font-stretch: 80%;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.asof {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--ink-2);
}

.asof::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  background: var(--go);
}

.status {
  display: inline-block;
  padding: 0.12rem 0.45rem;
  font-size: 0.7rem;
  font-weight: 700;
  font-stretch: var(--stretch-label);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.status--upcoming { color: var(--caution); background: var(--caution-bg); }
.status--in-effect { color: var(--go); background: var(--go-bg); }
.status--suspended,
.status--repealed { color: var(--ink-2); background: var(--paper-2); }
.status--proposed,
.status--pending-guidance { color: var(--ink); background: var(--paper); box-shadow: inset 0 0 0 1px var(--ink-2); }

/* Next decisions */
.next-steps {
  display: grid;
  margin: var(--space-12) 0 var(--space-8);
  border-top: 2px solid var(--ink);
}

.next-steps__title {
  margin: var(--space-3) 0 var(--space-2);
  font-size: var(--text-xs);
  font-weight: 650;
  font-stretch: var(--stretch-label);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.next-steps__item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.1rem var(--space-4);
  align-items: center;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--rule);
  color: var(--ink);
  text-decoration: none;
}

.next-steps__item:hover {
  background: var(--paper-2);
}

.next-steps__label {
  font-size: 1.05rem;
  font-weight: 650;
}

.next-steps__note {
  grid-column: 1;
  font-size: 0.85rem;
  color: var(--ink-2);
}

.next-steps__arrow {
  grid-column: 2;
  grid-row: 1 / span 2;
  font-size: 1.15rem;
  font-weight: 700;
}

@media (max-width: 560px) {
  .verdict {
    grid-template-columns: minmax(0, 1fr);
  }

  .verdict__word {
    justify-self: start;
  }
}

/* Page furniture shared by every template: breadcrumb, stat figures, tables, callouts
   ========================================================================== */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem 0.5rem;
  margin: 0 0 var(--space-5);
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--ink-2);
}

.breadcrumb a {
  color: var(--ink-2);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.breadcrumb [aria-hidden="true"] {
  color: var(--ink-3);
}

.breadcrumb > span:last-child {
  color: var(--ink);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
  gap: var(--space-6) var(--space-5);
}

.stat-card {
  display: grid;
  align-content: start;
  gap: 0.2rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--ink);
}

.stat-value {
  font-size: 1.85rem;
  font-weight: 700;
  font-stretch: var(--stretch-data);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.stat-label {
  font-weight: 650;
  line-height: 1.35;
}

.stat-note {
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--ink-2);
}

.stat-source {
  margin-top: 0.2rem;
  font-size: 0.78rem;
  color: var(--ink-2);
}

.stat-source a {
  color: inherit;
}

/* Tables: ruled, no fills. Header row sits on an ink rule. */
main table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

main th,
main td {
  padding: 0.6rem 0.75rem 0.6rem 0;
  text-align: left;
  vertical-align: top;
  border: 0;
  border-bottom: 1px solid var(--rule);
  background: none;
}

main thead th {
  font-size: var(--text-xs);
  font-weight: 650;
  font-stretch: var(--stretch-label);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
  border-bottom: 1px solid var(--ink);
}

main tbody th {
  font-weight: 650;
}

main tbody tr:hover td,
main tbody tr:hover th {
  background: var(--paper-2);
}

main caption {
  caption-side: bottom;
  padding-top: var(--space-2);
  font-size: 0.82rem;
  color: var(--ink-2);
  text-align: left;
}

/* Tool pages: rules shared by every calculator (landed cost, channel, PSP, entry, hiring).
   Page-specific variations stay in each page's own style block.
   ========================================================================== */
.lc-page > :global(*) { max-width: var(--reading-width)
}

.lc-page > .lc-tool { max-width: none
}

.lc-page > section { margin-bottom: var(--space-12)
}

.lc-header { margin-bottom: var(--space-8)
}

.lc-header h1 { margin-bottom: var(--space-3)
}

.lc-tool { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-8); align-items: start; margin-bottom: var(--space-12)
}

.lc-field { display: grid; gap: 0.35rem; align-content: start; min-width: 0
}

.lc-field label { font-size: 0.875rem; font-weight: 650; line-height: 1.3; color: var(--ink)
}

.lc-results h2 { margin: 0; padding: 0; border: 0; font-size: var(--text-xs); font-weight: 650; font-stretch: var(--stretch-label); letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink-2)
}

.lc-says { margin: 0; font-family: var(--font-serif); font-size: 1.05rem; line-height: 1.5
}

.lc-disclaimer { margin: 0; font-size: 0.8rem; line-height: 1.5; color: var(--ink-2)
}

.lc-results :global(.tool-share) { margin-top: 0
}

.related-list { margin: var(--space-4) 0 0; padding: 0; list-style: none; border-top: 1px solid var(--ink)
}

.related-list li { margin: 0; padding: 0.6rem 0; border-bottom: 1px solid var(--rule); line-height: 1.5
}

/* Container - same width for all pages */
.container,
.page-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-left: var(--content-padding-x);
  padding-right: var(--content-padding-x);
}

.container-wide {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  padding-left: var(--content-padding-x);
  padding-right: var(--content-padding-x);
}

/* One left edge: every top-level page wrapper starts where the breadcrumb and
   the header content start, whether or not the page has a right-hand table of
   contents. Narrow wrappers used to centre themselves, so pages without a TOC
   (guides, articles, comparisons, company and about pages) sat ~190px further
   in than pages with one (2026-11-10). Full-width wrappers are unaffected. A
   page that genuinely needs a centred block can set `margin-inline: auto`. */
.main-content>* {
  margin-inline: 0 auto;
}

/* Content column + right-hand rail (BaseLayout `rail`), the same two-column layout as the hubs
   and go/no-go pages. The rail stacks under the content below 960px. */
.with-rail {
  display: grid;
  grid-template-columns: minmax(0, var(--reading-width)) 17.5rem;
  justify-content: space-between;
  align-items: start;
  gap: var(--space-12);
}

.with-rail__main { min-width: 0; }

@media (max-width: 959px) {
  .with-rail { grid-template-columns: minmax(0, 1fr); gap: var(--space-8); }
}

/* Header Dropdown & Mega-Menu Architecture */

@keyframes navDropdownFade {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Smart Search nav link */

/* Main Content */
.main-content {
  min-height: calc(100vh - var(--header-height) - 80px);
  padding-top: var(--space-10);
  padding-bottom: var(--space-16);
}

/* Topic List (Homepage)
   ========================================================================== */

/* Topic Grid (New Grid-based layout for better space utilization) */
.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--space-6);
  margin: var(--space-8) 0;
}

.topic-card {
  display: flex;
  flex-direction: column;
  padding: var(--space-6);
  background: var(--paper);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-subtle);
  text-decoration: none;
  transition: all 0.2s ease;
  height: 100%;
}

.topic-card:hover {
  border-color: var(--color-accent);
  text-decoration: none;
}

.topic-card__title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topic-card__title::after {
  content: "→";
  font-weight: 400;
  opacity: 0.5;
  transition: transform 0.2s ease;
}

.topic-card:hover .topic-card__title::after {
  transform: translateX(4px);
  opacity: 1;
  color: var(--color-accent);
}

.topic-card__desc {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}

/* Topic Page Components
   ========================================================================== */

/* Topic headline sits right under the dateline rule, broadsheet-style. */
.topic-article>h1 {
  margin-bottom: var(--space-4);
}

.data-vintage {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-style: italic;
  margin-bottom: var(--space-8);
  padding-bottom: var(--space-5);
  border-bottom: 1px solid var(--color-border);
}

/* Key characteristics list styling */
.characteristics-list {
  list-style: none;
  padding: 0;
}

.characteristics-list li {
  position: relative;
  padding-left: 1.6rem;
  margin-bottom: var(--space-3);
}

.characteristics-list li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--color-text-light);
}

/* Utility Classes
   ========================================================================== */

/* Was an h3; kept visually identical. Two classes so it beats ".growth-modal__container p". */

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Hero Section */
.hero {
  text-align: center;
  padding: var(--space-12) 0;
  margin-bottom: var(--space-8);
  border-bottom: 1px solid var(--color-border-light);
}

/* Stats Section */
.stats-section {
  margin-bottom: var(--space-12);
}

/* What's New Section */

/* Methodology Section */
.methodology {
  padding: var(--space-8) 0;
  border-top: 1px solid var(--color-border);
  max-width: 680px;
}

.methodology h2 {
  font-size: var(--text-xl);
  margin-top: 0;
  border-bottom: none;
  padding-bottom: 0;
}

.methodology p {
  color: var(--color-text-muted);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
}

.methodology a {
  color: var(--color-accent);
  text-decoration: none;
}

.methodology a:hover {
  text-decoration: underline;
}

/* Mission Quote */
.mission {
  text-align: center;
  padding: var(--space-8) 0;
  border-top: 1px solid var(--color-border);
}

/* Page Actions (Share & Cite) */
.page-actions {
  margin-top: var(--space-12);
  padding: var(--space-8);
  background: var(--color-bg-subtle);
  border-radius: 2px;
}

.page-actions h2 {
  margin-top: 0;
  border-bottom: none;
  padding-bottom: 0;
}

/* Share Buttons */
.share-buttons {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.share-buttons__label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  margin-right: var(--space-2);
}

.share-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 2px;
  color: var(--color-text-muted);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  transition: all 0.15s ease;
}

.share-button:hover {
  color: var(--color-accent);
  border-color: var(--color-accent);
  text-decoration: none;
}

.share-button.is-copied {
  color: var(--go);
  border-color: var(--go);
}

/* Cite Section */
.cite-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.cite-button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 2px;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  align-self: flex-start;
}

.cite-button:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.cite-button.is-copied {
  color: var(--go);
  border-color: var(--go);
}

.cite-format {
  font-size: var(--text-sm);
}

.cite-format summary {
  cursor: pointer;
  color: var(--color-accent);
}

.cite-formats {
  margin-top: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.cite-format__item {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.cite-format__label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.cite-format__code {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  background: var(--color-bg);
  padding: var(--space-3);
  border-radius: 2px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Category Filters */

.filter-tag {
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-sm);
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  border-radius: 2px;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-tag:hover,
.filter-tag.is-active {
  background: var(--color-accent);
  color: white;
  border-color: var(--color-accent);
}

/* ==========================================================================
   CHANGELOG PAGE STYLES
   ========================================================================== */

.legend-label {
  font-weight: 500;
  color: var(--color-text-muted);
}

/* Anchor Links - Pilcrow visibility on hover */

h2:hover .anchor-link,
h3:hover .anchor-link {
  opacity: 1;
}

/* Print Styles for Canonical Pages */
@media print {

  .mobile-section-nav {
    display: none !important;
  }

  .canonical-page {
    grid-template-columns: 1fr !important;
    padding: 0 !important;
    max-width: none !important;
  }

  .page-content {
    order: 1 !important;
  }

  .reference-article {
    max-width: none !important;
  }
}

/* Content Sections */
.content-section {
  scroll-margin-top: 80px;
}

/* Sources Section */

.source-item {
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--color-border-light);
}

.source-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.source-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 500;
}

.source-link:hover {
  text-decoration: underline;
}

.source-description {
  margin: 0.25rem 0 0;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.limitations-list {
  list-style: disc;
  padding-left: 1.25rem;
  margin: 0;
}

.limitations-list li {
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.methodology-link {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border-light);
}

.methodology-link a {
  color: var(--color-accent);
  font-size: 0.875rem;
}

.last-reviewed {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
  font-size: 0.8125rem;
  color: var(--color-text-light);
}

.last-reviewed .separator {
  margin: 0 0.5rem;
  color: var(--color-border);
}

.last-reviewed a {
  color: var(--color-text-muted);
}

.last-reviewed a:hover {
  color: var(--color-accent);
}

@media (min-width: 1280px) {
  :root {
    --max-width: 1120px;
    --max-width-wide: 1280px;
    --content-padding-x: 2rem;
    --header-nav-gap: 0.75rem;
    --header-link-padding-y: 0.3rem;
  }
}

@media (min-width: 1536px) {
  :root {
    --max-width: 1180px;
    --max-width-wide: 1360px;
  }
}

/* The Custom Research button needs the room: keep search icon-only until the header widens. */

@media (max-width: 768px) {

  .mobile-section-nav {
    display: block;
    margin-bottom: 2rem;
  }

  .section-dropdown {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    border: 1px solid var(--color-border);
    border-radius: 2px;
    background: var(--color-bg);
    color: var(--color-text);
    cursor: pointer;
  }
}


/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */
@media (max-width: 640px) {
  :root {
    --text-3xl: 1.5rem;
    --text-2xl: 1.375rem;
  }

  /* Keep search reachable on mobile (no ⌘K keyboard) — icon only. */

  .main-content {
    padding-top: var(--space-6);
  }

  /* Mobile Page Actions */

  /* Mobile Share Buttons */
  .share-buttons {
    flex-wrap: wrap;
  }

  /* Mobile Update List */
}

/* Topic page definitional paragraph — sits above the first H2 and gives
   Google a clean answer-engine-ready definition + key stat in one block. */
.topic-definition {
  font-size: 1.0625rem;
  line-height: 1.7;
  margin: 1rem 0 2.5rem;
  padding: 1rem 1.25rem;
  border-radius: 0 2px 2px 0;
  color: var(--color-text);
  border-top: 2px solid var(--ink);
}

/* Comparison tables: accent-tinted row hover for readability. */
.compare-table tbody tr {
  transition: background-color 0.15s ease;
}

.compare-table tbody tr:hover td {
  background: var(--paper-2);
}

.compare-table tbody tr:hover th {
  background: var(--paper-2);
}

/* ==========================================================================
   Editorial & guide component polish (FAQ accordions, keyfacts, notes).
   Elevates callouts and accordions across all guides, comparisons, and tools.
   ========================================================================== */

.keyfacts {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--paper);
  box-shadow: var(--shadow-subtle);
  border-top: 2px solid var(--ink);
}

.lawnote,
.disclaimer {
  border-radius: var(--radius-sm);
}

.info-card,
.sector-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--paper);
  box-shadow: var(--shadow-subtle);
}

/* 1. Report Executive Summary Card */

@keyframes pulse-dot {
  0% {
    opacity: 0.4;
  }

  50% {
    opacity: 1;
  }

  100% {
    opacity: 0.4;
  }
}

.meta-sep {
  color: var(--color-border);
}

/* 2. Report Key Metrics KPI Grid */

.delta-positive {
  color: var(--go);
  background: var(--go-bg);
}

.delta-neutral {
  color: var(--color-text-muted);
  background: var(--color-bg-subtle);
}

.delta-negative {
  color: var(--nogo);
  background: var(--nogo-bg);
}

/* 3. Donut Chart Component */

.legend-swatch-cell {
  width: 16px;
}

.legend-swatch {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.legend-label-cell strong {
  color: var(--color-text);
}

.legend-note {
  display: block;
  font-size: 0.68rem;
  color: var(--color-text-muted);
}

.legend-value-cell {
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--color-ink);
}

/* 4. Report Data Table Component */

.table-source {
  font-style: italic;
}

/* 5. Print & PDF Export Rules (@media print) */
@media print {
  body {
    background: var(--paper) !important;
    color: #000000 !important;
    font-size: 11pt !important;
  }

  /* Hide navigation, header, search trigger, status tickers, and footer buttons */
  .more-list {
    display: none !important;
  }

  .main-content {
    padding-top: 0 !important;
  }
}

/* Replace harsh black <hr> site-wide with subtle, spacious dividers */
hr {
  border: none !important;
  height: 1px !important;
  background: var(--color-border-light) !important;
  margin: var(--space-8) 0 !important;
  clear: both;
}

/* Callout Box / Formula Container */

/* Comparison Entity Card Grid */
.compare-cards-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  margin: var(--space-6) 0;
}

.compare-entity-card {
  background: var(--paper);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-card);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.compare-entity-card:hover {
  border-color: var(--color-accent);
}

.compare-entity-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-border-light);
}

.compare-entity-card__title {
  font-size: var(--text-xl);
  font-weight: 700;
  margin: 0;
  border: none;
  color: var(--color-text);
}

.compare-entity-badge {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: color-mix(in srgb, var(--color-accent) 10%, transparent);
  color: var(--color-accent);
  padding: 0.2rem 0.5rem;
  border-radius: 2px;
}

.compare-entity-card__body {
  font-size: var(--text-sm);
  line-height: 1.65;
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
}

.compare-entity-card__acceptance {
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-xs);
  line-height: 1.6;
  color: var(--color-text);
}

/* Related Links Visual Cards */
.related-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-4);
  margin: var(--space-4) 0 var(--space-8);
}

.related-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: var(--paper);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  text-decoration: none !important;
  color: var(--color-text) !important;
  font-size: var(--text-sm);
  font-weight: 600;
  box-shadow: none;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.related-card:hover {
  border-color: var(--color-accent);
  color: var(--color-accent) !important;
  box-shadow: var(--shadow-card);
}

.related-card:hover .related-card__arrow {
  transform: translateX(4px);
}

/* Responsive Breakpoints & Viewport Adjustments */
@media (max-width: 768px) {

  /* Table Horizontal Scrolling on Mobile */
  main table:not([data-reflow]):not([class*="legend"]):not([class*="donut"]) {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Grid Layouts Stacked on Mobile */
}

/* Responsive Breakpoints & Viewport Adjustments */
@media (max-width: 768px) {

  /* Compact Mobile Typography Scaling */
  :root {
    --text-4xl: 1.6rem;
    --text-5xl: 2rem;
    --text-3xl: 1.35rem;
    --text-2xl: 1.2rem;
    --text-xl: 1.05rem;
    --text-lg: 0.975rem;
    --text-base: 0.9rem;
    --text-sm: 0.8rem;
    --text-xs: 0.725rem;
  }

  html {
    font-size: 15px;
    /* Baseline scaling for mobile */
  }

  h4,
  h5,
  h6 {
    font-size: 0.95rem !important;
  }

  p,
  li {
    line-height: 1.55 !important;
  }

  .stat-label {
    font-size: 0.8rem !important;
  }

  /* Compact container paddings */
  .main-content,
  .page-content,
  .hero {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  /* Table Horizontal Scrolling on Mobile */
  main table:not([data-reflow]):not([class*="legend"]):not([class*="donut"]) {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    font-size: 0.825rem;
  }

  /* Phase 5 & 6: Reading & Workspace Mobile Optimization */
  .pay-spine {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding-bottom: var(--space-2) !important;
  }

  .pay-cta__btn {
    width: 100% !important;
    justify-content: center !important;
  }

  .workspace-actions__grid {
    grid-template-columns: 1fr !important;
  }

  .goal-form {
    flex-direction: column !important;
  }

  .goal-form input,
  #goal-date-input,
  .goal-form button {
    flex: none !important;
    height: auto !important;
    width: 100% !important;
    font-size: 16px !important;
    /* Prevents auto-zoom on iOS Safari */
  }

  .workspace-item-link {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.25rem !important;
  }

}

@media (max-width: 480px) {
  html {
    font-size: 14.5px;
  }
}

/* Content columns must be able to shrink inside their grid/flex parent so a wide
   child (table, blockquote, chart) wraps or scrolls-internally instead of forcing
   the whole column — and the page — wider than the viewport. */
.page-content,
.reference-article,
.main-content {
  min-width: 0;
}

@media (max-width: 768px) {
  /* Hard-clamp table scroll containers (and raw tables) to the viewport so a
     wide, nowrap table scrolls INSIDE itself instead of stretching the column
     and the whole page. calc(100vw - 2rem) accounts for the 1rem page padding
     each side. This sidesteps brittle grid min-content behaviour entirely. */
  .table-scroll,
  .compare-table-wrap,
  table {
    max-width: calc(100vw - 2rem);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 768px) {
  /* Trim the tiny residual overflow of the CanonicalLayout content column.
     Safe here: the only sticky element inside (.page-sidebar) is display:none on
     mobile, so clip can't break sticky. The data table already scrolls inside
     its own wrapper, so nothing useful is clipped. */
  .canonical-page {
    overflow-x: clip;
  }
}

/* Tablet widths: the expanded desktop menu no longer fits between 769px and 1100px,
   so use the drawer there (the bottom tab bar stays phone-only). */

.lead-capture__note { margin: 0.5rem 0 0; font-size: 0.8rem; color: var(--ink-2); }
.lead-capture__note a { color: inherit; text-decoration: underline; }
