/* ToolNest shared stylesheet — one file for the whole site. */

/* Self-hosted font (LEGAL.md §2: no third-party font servers). Licence: assets/fonts/OFL.txt */
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-latin-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Brand */
  --navy-950: #07142b;
  --navy-900: #0b1b34;
  --navy-800: #11264a;
  --navy-700: #1a3566;
  --blue-600: #1d4ed8;
  --blue-700: #1e40af;
  --blue-50: #eef3ff;
  --blue-100: #dbe5ff;
  --green-600: #047857;
  --green-50: #ecfdf5;
  --red-600: #b91c1c;
  --amber-50: #fffbeb;
  --amber-300: #f5c451;

  /* Surfaces and text */
  --bg: #f6f7fb;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --subtle: #64748b;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;

  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 8px 24px -12px rgba(15, 23, 42, 0.12);
  --shadow-lg: 0 2px 6px rgba(15, 23, 42, 0.06), 0 24px 48px -20px rgba(15, 23, 42, 0.25);
  --max: 1160px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
svg {
  max-width: 100%;
}

a {
  color: var(--blue-600);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--blue-700);
}

:focus-visible {
  outline: 3px solid var(--blue-600);
  outline-offset: 2px;
  border-radius: 4px;
}

h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0 0 0.6em;
  letter-spacing: -0.02em;
  font-weight: 750;
}

h1 {
  font-size: clamp(2rem, 4.5vw, 2.9rem);
  letter-spacing: -0.03em;
}

h2 {
  font-size: clamp(1.4rem, 2.6vw, 1.75rem);
  margin-top: 2.2em;
}

h3 {
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}

p,
ul,
ol {
  margin: 0 0 1em;
}

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px;
}

.skip-link {
  position: absolute;
  left: -9999px;
}

.skip-link:focus {
  left: 16px;
  top: 8px;
  background: var(--surface);
  padding: 8px 12px;
  z-index: 100;
}

.icon {
  width: 20px;
  height: 20px;
  flex: none;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 68px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--navy-900);
  text-decoration: none;
  letter-spacing: -0.03em;
}

.logo:hover {
  color: var(--navy-900);
}

.logo-by {
  margin-left: 6px;
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0;
  opacity: 0.75;
  white-space: nowrap;
}

.logo-mark {
  width: 32px;
  height: 32px;
  flex: none;
}

.site-nav ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0;
}

.site-nav a {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 550;
  font-size: 0.95rem;
}

.site-nav a:hover {
  color: var(--text);
  background: var(--bg);
}

.site-nav a[aria-current="page"] {
  color: var(--navy-900);
}

.site-nav .nav-cta {
  background: var(--navy-900);
  color: #fff;
  margin-left: 6px;
}

.site-nav .nav-cta:hover {
  background: var(--navy-700);
  color: #fff;
}

/* Country menu: a <details> element, so it works without JavaScript. */
.nav-menu {
  position: relative;
}

.nav-menu-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 550;
  font-size: 0.95rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.nav-menu-button::-webkit-details-marker {
  display: none;
}

.nav-menu-button:hover,
.nav-menu[open] .nav-menu-button {
  color: var(--text);
  background: var(--bg);
}

.nav-menu-button.is-current {
  color: var(--navy-900);
}

.nav-menu-button .icon {
  width: 18px;
  height: 18px;
}

.nav-menu-button .nav-chevron {
  width: 16px;
  height: 16px;
  transition: transform 0.15s ease;
}

.nav-menu[open] .nav-chevron {
  transform: rotate(180deg);
}

.site-nav .nav-menu-list {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 60;
  display: block;
  min-width: 220px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
}

.site-nav .nav-menu-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}

.site-nav .nav-menu-list .flag,
.site-nav .nav-menu-list .code {
  width: 24px;
  height: 16px;
  border-radius: 2px;
  box-shadow: 0 0 0 1px var(--border);
}

.site-nav .nav-menu-list .code {
  display: grid;
  place-items: center;
  flex: none;
  background: var(--bg);
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--muted);
}

.site-nav .nav-menu-list a[aria-current="page"] {
  background: var(--bg);
  font-weight: 650;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-weight: 600;
  font-size: 0.97rem;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.15s;
}

.btn:hover {
  border-color: var(--navy-900);
  color: var(--navy-900);
}

.btn-primary {
  background: var(--blue-600);
  border-color: var(--blue-600);
  color: #fff;
}

.btn-primary:hover {
  background: var(--blue-700);
  border-color: var(--blue-700);
  color: #fff;
}

.btn-light {
  background: #fff;
  border-color: #fff;
  color: var(--navy-900);
}

.btn-light:hover {
  background: var(--blue-50);
  border-color: var(--blue-50);
  color: var(--navy-900);
}

.btn-ghost-dark {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}

.btn-ghost-dark:hover {
  border-color: #fff;
  color: #fff;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 0.9rem;
}

/* ---------- Homepage hero (dark) ---------- */

.hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(900px 420px at 85% -10%, rgba(59, 130, 246, 0.35), transparent 60%),
    radial-gradient(700px 380px at -10% 110%, rgba(16, 185, 129, 0.16), transparent 60%),
    linear-gradient(180deg, var(--navy-900), var(--navy-950));
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 30%, transparent 75%);
  pointer-events: none;
}

.hero .container {
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  align-items: center;
  padding-top: 72px;
  padding-bottom: 80px;
}

.hero h1 {
  color: #fff;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  margin-bottom: 0.45em;
}

.hero h1 .hl {
  background: linear-gradient(90deg, #93c5fd, #6ee7b7);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero .lead {
  font-size: 1.15rem;
  color: #cbd5e1;
  max-width: 560px;
  margin-bottom: 28px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #e2e8f0;
  font-size: 0.88rem;
  font-weight: 550;
  margin-bottom: 22px;
}

.flag {
  width: 22px;
  height: 15px;
  border-radius: 3px;
  flex: none;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.flags {
  display: inline-flex;
  gap: 4px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 32px;
}

.trust-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  padding: 0;
  margin: 0;
  color: #cbd5e1;
  font-size: 0.93rem;
}

.trust-list li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.trust-list .icon {
  width: 18px;
  height: 18px;
  color: #6ee7b7;
}

/* Hero preview card */
.preview-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
}

.preview-card .label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #93c5fd;
  font-weight: 650;
}

.preview-card .big {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 6px 0 4px;
  font-variant-numeric: tabular-nums;
}

.preview-card .big small {
  font-size: 1rem;
  font-weight: 500;
  color: #94a3b8;
  letter-spacing: 0;
}

.preview-card dl {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px 16px;
  margin: 18px 0 0;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.93rem;
}

.preview-card dt {
  color: #94a3b8;
}

.preview-card dd {
  margin: 0;
  text-align: right;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.preview-card .caption {
  margin: 16px 0 0;
  font-size: 0.82rem;
  color: #94a3b8;
}

/* ---------- Light page header band (inner pages) ---------- */

.page-hero {
  background:
    radial-gradient(800px 300px at 90% -40%, rgba(29, 78, 216, 0.1), transparent 70%),
    linear-gradient(180deg, #fff, var(--bg));
  border-bottom: 1px solid var(--border);
  padding: 28px 0 36px;
}

.page-hero h1 {
  margin-bottom: 0.35em;
}

.intro {
  font-size: 1.13rem;
  color: var(--muted);
  max-width: 720px;
  margin: 0;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  font-weight: 550;
  color: var(--muted);
}

.chip .icon {
  width: 16px;
  height: 16px;
  color: var(--green-600);
}

.chip .flag {
  width: 18px;
  height: 12px;
  border-radius: 2px;
  box-shadow: 0 0 0 1px var(--border);
}

/* ---------- Main ---------- */

main {
  padding: 0 0 72px;
}

.section {
  padding-top: 56px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.section-head h2 {
  margin: 0;
}

.section-head p {
  margin: 6px 0 0;
  color: var(--muted);
}

.kicker {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue-600);
  margin-bottom: 8px;
}

.breadcrumb {
  font-size: 0.88rem;
  color: var(--subtle);
  margin-bottom: 14px;
}

.breadcrumb ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0;
  margin: 0;
}

.breadcrumb li + li::before {
  content: "/";
  margin-right: 6px;
  color: var(--border-strong);
}

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

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

.content {
  max-width: 760px;
}

.content > h2:first-child {
  margin-top: 1.4em;
}

/* ---------- Tool cards ---------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 16px;
  margin: 0 0 8px;
  padding: 0;
  list-style: none;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: var(--text);
  height: 100%;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

a.card:hover {
  border-color: var(--blue-100);
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
  color: var(--text);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.card-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--blue-50);
  color: var(--blue-600);
}

.card-icon .icon {
  width: 22px;
  height: 22px;
}

.card h3 {
  margin: 0;
}

.card p {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0;
}

.card .go {
  margin-top: auto;
  padding-top: 14px;
  font-weight: 650;
  font-size: 0.92rem;
  color: var(--blue-600);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

a.card:hover .go .icon {
  transform: translateX(3px);
}

.card .go .icon {
  width: 16px;
  height: 16px;
  transition: transform 0.2s;
}

.card.soon {
  background: transparent;
  border-style: dashed;
  border-color: var(--border-strong);
  box-shadow: none;
}

.card.soon .card-icon {
  background: var(--surface);
  color: var(--subtle);
  border: 1px solid var(--border);
}

.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 650;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--green-50);
  color: var(--green-600);
  white-space: nowrap;
}

.badge.muted {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
}

/* ---------- Feature row ---------- */

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.feature .card-icon {
  margin-bottom: 14px;
  background: var(--navy-900);
  color: #fff;
}

.feature h3 {
  margin-bottom: 6px;
}

.feature p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

/* ---------- Country strip ---------- */

.country-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.country {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}

a.country {
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

a.country:hover {
  color: var(--text);
  border-color: var(--blue-100);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

a.country .status {
  color: var(--blue-600);
  font-weight: 600;
}

.card-icon .code-badge {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.card-icon .flag {
  width: 26px;
  height: 18px;
  border-radius: 3px;
  box-shadow: 0 0 0 1px var(--border);
}

.country .flag {
  width: 30px;
  height: 20px;
  box-shadow: 0 0 0 1px var(--border);
}

.country .code {
  display: grid;
  place-items: center;
  width: 30px;
  height: 20px;
  border-radius: 3px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--muted);
}

.country strong {
  display: block;
  font-size: 0.97rem;
}

.country span.status {
  font-size: 0.85rem;
  color: var(--muted);
}

/* ---------- Calculator ---------- */

.calculator {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.9fr);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  margin: 32px 0 8px;
  overflow: hidden;
}

.content.legal {
  padding-top: 32px;
}

.calc-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 20px;
  padding: 28px;
  align-content: start;
}

.calc-form .span-2 {
  grid-column: 1 / -1;
}

.form-intro {
  margin: 0;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--muted);
  font-size: 0.9rem;
}

.field label {
  display: block;
  font-weight: 600;
  font-size: 0.93rem;
  margin-bottom: 6px;
}

.field .hint {
  display: block;
  font-size: 0.82rem;
  color: var(--subtle);
  font-weight: 400;
  margin-top: 1px;
}

.input-wrap {
  display: flex;
  align-items: stretch;
  height: 50px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input-wrap:hover {
  border-color: var(--subtle);
}

.input-wrap:focus-within {
  border-color: var(--blue-600);
  box-shadow: 0 0 0 4px rgba(29, 78, 216, 0.14);
}

.input-wrap .affix {
  display: flex;
  align-items: center;
  padding: 0 14px;
  background: var(--bg);
  color: var(--muted);
  font-size: 0.93rem;
  font-weight: 550;
  white-space: nowrap;
}

.input-wrap input {
  flex: 1;
  width: 100%;
  min-width: 0;
  border: 0;
  padding: 0 14px;
  font: inherit;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  background: transparent;
}

.input-wrap input:focus {
  outline: none;
}

.select-wrap {
  position: relative;
}

.select-wrap select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 50px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 0 44px 0 14px;
  font: inherit;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}

.select-wrap select:hover {
  border-color: var(--subtle);
}

.select-wrap select:focus {
  outline: none;
  border-color: var(--blue-600);
  box-shadow: 0 0 0 4px rgba(29, 78, 216, 0.14);
}

.select-wrap::after {
  content: "";
  position: absolute;
  right: 18px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.input-wrap input[type="date"] {
  color-scheme: light;
  -webkit-appearance: none;
  appearance: none;
  min-height: 48px;
}

.check-field {
  display: flex;
  align-items: flex-end;
}

.field label.check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  min-height: 50px;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.field label.check input {
  flex: none;
  width: 18px;
  height: 18px;
  margin: 3px 0 0;
  accent-color: var(--blue-600);
}

.field.invalid .input-wrap {
  border-color: var(--red-600);
  box-shadow: 0 0 0 4px rgba(185, 28, 28, 0.1);
}

.field .error-msg {
  display: none;
  color: var(--red-600);
  font-size: 0.83rem;
  margin-top: 5px;
}

.field.invalid .error-msg {
  display: block;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.form-actions .privacy-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.83rem;
  color: var(--subtle);
}

.form-actions .privacy-note .icon {
  width: 16px;
  height: 16px;
  color: var(--green-600);
}

/* Results panel (dark) */
.calc-results {
  position: relative;
  color: #fff;
  background:
    radial-gradient(500px 260px at 100% 0%, rgba(59, 130, 246, 0.35), transparent 65%),
    linear-gradient(180deg, var(--navy-800), var(--navy-900));
  padding: 32px 28px;
}

.calc-results h2 {
  font-size: 0.8rem;
  margin: 0 0 10px;
  color: #93c5fd;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
}

.result-main {
  font-size: clamp(2.6rem, 6vw, 3.4rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
  color: #fff;
}

.result-main small {
  font-size: 1rem;
  font-weight: 500;
  color: #94a3b8;
  letter-spacing: 0;
}

.result-list {
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
}

.result-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.95rem;
  color: #cbd5e1;
}

.result-list li span:last-child {
  font-weight: 650;
  color: #fff;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.result-list li.key span:last-child {
  color: #6ee7b7;
}

.result-note {
  font-size: 0.85rem;
  color: #94a3b8;
  margin: 18px 0 0;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Phone-only result bar (added by common.js). */
.result-bar {
  display: none;
}

@media (max-width: 960px) {
  .result-bar {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-radius: var(--radius);
    background: var(--navy-900);
    color: #fff;
    text-decoration: none;
    box-shadow: 0 12px 32px -8px rgba(7, 20, 43, 0.5);
    transform: translateY(160%);
    transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1);
  }

  .result-bar.show {
    transform: none;
  }

  .result-bar:hover {
    color: #fff;
  }

  .result-bar-label {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #93c5fd;
  }

  .result-bar strong {
    font-size: 1.2rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
  }
}

/* ---------- Article parts ---------- */

.steps {
  list-style: none;
  counter-reset: step;
  padding: 0;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 48px;
  margin-bottom: 16px;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--navy-900);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
}

.formula {
  background: var(--navy-900);
  color: #e2e8f0;
  border-radius: var(--radius);
  padding: 20px 24px;
  font-family: var(--mono);
  font-size: 0.9rem;
  overflow-x: auto;
  white-space: pre;
  line-height: 1.9;
  margin-bottom: 1em;
  box-shadow: var(--shadow);
}

.table-wrap {
  overflow-x: auto;
  margin-bottom: 1em;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th,
td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

tbody tr:last-child td {
  border-bottom: 0;
}

th {
  background: var(--bg);
  font-weight: 650;
  font-size: 0.85rem;
  color: var(--muted);
}

td.num,
th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

tr.is-yours td {
  background: var(--blue-50);
  font-weight: 700;
}

.tip {
  display: flex;
  gap: 14px;
  background: var(--green-50);
  border: 1px solid #a7f3d0;
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 1.2em 0;
}

.tip p:last-child {
  margin-bottom: 0;
}

.tip strong {
  color: var(--green-600);
}

.faq details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  transition: box-shadow 0.2s;
}

.faq details[open] {
  box-shadow: var(--shadow);
}

.faq summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  font-weight: 650;
  cursor: pointer;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "";
  flex: none;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.2s;
  margin-top: -4px;
}

.faq details[open] summary::after {
  transform: rotate(-135deg);
  margin-top: 4px;
}

.faq details > p {
  padding: 0 20px;
  color: var(--muted);
}

.faq details > p:last-child {
  padding-bottom: 18px;
  margin-bottom: 0;
}

.disclaimer {
  background: var(--amber-50);
  border: 1px solid var(--amber-300);
  border-radius: var(--radius);
  padding: 16px 20px;
  font-size: 0.92rem;
  margin-top: 2.5em;
}

.disclaimer p:last-child {
  margin-bottom: 0;
}

/* Required next to every affiliate link (FTC / UK ASA): e.g. <span class="affiliate-label">(affiliate link)</span> */
.affiliate-label {
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
}

.sources {
  margin-top: 2em;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 0.88rem;
  color: var(--muted);
}

.updated {
  color: var(--subtle);
  font-size: 0.88rem;
}

/* ---------- PDF tools ---------- */

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* A hidden file input's focus shows on the label that looks like its button. */
.visually-hidden:focus-visible + label {
  outline: 3px solid var(--blue-600);
  outline-offset: 2px;
}

.pdf-tool {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  margin: 32px 0 8px;
  padding: 28px;
}

.pdf-tool [hidden] {
  display: none !important;
}

.dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 52px 24px;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg);
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
}

.dropzone.is-over {
  border-color: var(--blue-600);
  background: var(--blue-50);
}

.pdf-work.is-over {
  outline: 2px dashed var(--blue-600);
  outline-offset: 8px;
  border-radius: var(--radius-sm);
}

.dropzone-icon {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border-radius: 18px;
  background: var(--blue-100);
  color: var(--blue-600);
}

.dropzone-icon .icon {
  width: 30px;
  height: 30px;
}

.dropzone .btn {
  font-size: 1.05rem;
  padding: 14px 30px;
}

.dropzone-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.93rem;
}

.btn:disabled,
.btn:disabled:hover {
  opacity: 0.5;
  cursor: not-allowed;
  border-color: var(--border-strong);
  color: var(--text);
}

.btn-primary:disabled,
.btn-primary:disabled:hover {
  background: var(--blue-600);
  border-color: var(--blue-600);
  color: #fff;
}

.btn-quiet {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.btn-quiet:hover {
  border-color: var(--border);
  color: var(--text);
}

.file-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}

.file-card-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: #fee2e2;
  color: var(--red-600);
}

.file-card strong {
  display: block;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.file-card .file-card-meta {
  display: block;
  color: var(--muted);
  font-size: 0.88rem;
}

.work-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
  margin-bottom: 14px;
}

.work-title {
  font-size: 1.1rem;
  margin: 0;
}

.work-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.pdf-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 20px;
  margin-top: 22px;
}

.pdf-options .span-2 {
  grid-column: 1 / -1;
}

.choice-group {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.choice-group legend {
  padding: 0;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 0.93rem;
}

.choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.choice label {
  display: block;
  height: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-weight: 600;
  font-size: 0.93rem;
  line-height: 1.3;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.choice label:hover {
  border-color: var(--subtle);
}

.choice label small {
  display: block;
  margin-top: 2px;
  font-weight: 400;
  font-size: 0.8rem;
  color: var(--subtle);
}

.choice input:checked + label {
  border-color: var(--blue-600);
  background: var(--blue-50);
  color: var(--navy-900);
  box-shadow: inset 0 0 0 1px var(--blue-600);
}

.choice input:focus-visible + label {
  outline: 3px solid var(--blue-600);
  outline-offset: 2px;
}

.select-wrap select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.tool-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
}

.tool-actions .btn-primary {
  min-width: 190px;
}

.pdf-status {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.93rem;
}

/* Kept in the page when empty (margin only removed) so screen readers keep announcing it. */
.pdf-status:empty {
  margin: 0;
}

.pdf-status.is-error {
  padding: 12px 14px;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  background: #fef2f2;
  color: var(--red-600);
}

.pdf-status.is-busy::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 10px;
  vertical-align: -2px;
  border: 2px solid var(--blue-100);
  border-top-color: var(--blue-600);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.pdf-privacy {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 20px 0 0;
  color: var(--subtle);
  font-size: 0.85rem;
  text-align: center;
}

.pdf-privacy .icon {
  width: 16px;
  height: 16px;
  color: var(--green-600);
}

/* Lists of files (merge, pictures to PDF) */
.file-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: file;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  counter-increment: file;
}

.file-thumb {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 52px;
  height: 64px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
}

.file-thumb canvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
}

.file-thumb:not(.is-drawn) canvas {
  display: none;
}

.file-thumb::after {
  content: counter(file);
  position: absolute;
  top: 3px;
  left: 3px;
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--navy-900);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
}

.file-info {
  flex: 1;
  min-width: 0;
}

.file-name {
  display: block;
  overflow: hidden;
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.file-meta {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
}

.file-actions {
  flex: none;
  display: flex;
  gap: 4px;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.icon-btn:hover:not(:disabled) {
  border-color: var(--navy-900);
  color: var(--navy-900);
}

.icon-btn.danger:hover:not(:disabled) {
  border-color: var(--red-600);
  color: var(--red-600);
}

.icon-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.icon-btn .icon {
  width: 18px;
  height: 18px;
}

[draggable="true"] {
  cursor: grab;
}

.is-dragging {
  opacity: 0.45;
}

.file-item.drop-before {
  box-shadow: inset 0 3px 0 var(--blue-600);
}

.file-item.drop-after {
  box-shadow: inset 0 -3px 0 var(--blue-600);
}

/* Page previews (rotate, delete, extract, rearrange) */
.page-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 18px 0 14px;
}

.page-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 16px 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.page-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.page-tile.drop-before::before,
.page-tile.drop-after::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 44px;
  width: 3px;
  border-radius: 2px;
  background: var(--blue-600);
}

.page-tile.drop-before::before {
  left: -8px;
}

.page-tile.drop-after::after {
  right: -8px;
}

.thumb {
  --pad: 10px;
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  padding: var(--pad);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  transition: border-color 0.15s, box-shadow 0.15s;
}

/* Pinned inside the square so it always fits, turned or not (a square holds any page turned 90°). */
.thumb canvas {
  position: absolute;
  inset: var(--pad);
  display: block;
  max-width: calc(100% - 2 * var(--pad));
  max-height: calc(100% - 2 * var(--pad));
  margin: auto;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.2);
  transition: transform 0.25s ease, opacity 0.15s;
}

.thumb:not(.is-drawn) canvas {
  display: none;
}

/* Blank page shape while the preview is drawn (or if it can't be). */
.thumb:not(.is-drawn)::before {
  content: "";
  width: 62%;
  aspect-ratio: 1 / 1.41;
  border-radius: 2px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.15);
}

.thumb canvas.rot-90 {
  transform: rotate(90deg);
}

.thumb canvas.rot-180 {
  transform: rotate(180deg);
}

.thumb canvas.rot-270 {
  transform: rotate(270deg);
}

.page-tile.is-changed .thumb {
  border-color: var(--blue-600);
}

.page-label {
  display: block;
  white-space: nowrap;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.tile-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.tile-row .icon-btn {
  width: 36px;
  height: 36px;
}

.page-pick {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.page-pick:hover .thumb {
  border-color: var(--subtle);
}

.pick-mark {
  position: absolute;
  top: 7px;
  right: 7px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 2px solid var(--border-strong);
  border-radius: 50%;
  background: #fff;
  color: transparent;
}

.pick-mark .icon {
  width: 15px;
  height: 15px;
}

.page-pick[aria-pressed="true"] .thumb {
  border-color: var(--blue-600);
  box-shadow: inset 0 0 0 2px var(--blue-600);
  background: var(--blue-50);
}

.page-pick[aria-pressed="true"] .pick-mark {
  border-color: var(--blue-600);
  background: var(--blue-600);
  color: #fff;
}

.pick-delete .page-pick[aria-pressed="true"] .thumb {
  border-color: var(--red-600);
  box-shadow: inset 0 0 0 2px var(--red-600);
  background: #fef2f2;
}

.pick-delete .page-pick[aria-pressed="true"] .pick-mark {
  border-color: var(--red-600);
  background: var(--red-600);
}

.pick-delete .page-pick[aria-pressed="true"] canvas {
  opacity: 0.35;
}

/* Results panel (dark, like the calculators) */
.pdf-result {
  margin-top: 22px;
  padding: 28px;
  border-radius: var(--radius);
  color: #fff;
  background:
    radial-gradient(500px 260px at 100% 0%, rgba(59, 130, 246, 0.35), transparent 65%),
    linear-gradient(180deg, var(--navy-800), var(--navy-900));
}

.result-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 20px;
}

.result-badge {
  flex: none;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(110, 231, 183, 0.15);
  color: #6ee7b7;
}

.pdf-result h2 {
  margin: 2px 0 4px;
  color: #fff;
  font-size: 1.3rem;
  letter-spacing: -0.01em;
}

.pdf-result h2:focus {
  outline: none;
}

.result-head p {
  margin: 0;
  color: #cbd5e1;
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

.btn-download {
  font-size: 1.02rem;
  padding: 14px 26px;
}

.result-file {
  margin: 10px 0 0;
  color: #94a3b8;
  font-size: 0.85rem;
  overflow-wrap: anywhere;
}

.result-files {
  max-height: 340px;
  margin: 18px 0 0;
  padding: 0;
  overflow: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  list-style: none;
}

.result-files li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 4px 14px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.92rem;
}

.result-file-name {
  color: #fff;
  overflow-wrap: anywhere;
}

.result-file-meta {
  color: #94a3b8;
  font-size: 0.85rem;
  white-space: nowrap;
}

.result-file-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #93c5fd;
  font-weight: 600;
  text-decoration: none;
}

.result-file-link:hover {
  color: #fff;
}

.result-file-link .icon {
  width: 16px;
  height: 16px;
}

.pdf-result .btn-ghost-dark {
  margin-top: 18px;
}

@media (max-width: 600px) {
  .pdf-tool {
    padding: 18px;
  }

  .dropzone {
    padding: 36px 16px;
  }

  .pdf-options {
    grid-template-columns: 1fr;
  }

  .tool-actions .btn-primary {
    flex: 1 1 100%;
  }

  .page-grid {
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 14px 10px;
  }

  .thumb {
    --pad: 7px;
  }

  /* Tiles with buttons under them need room for "Page 10" between two buttons. */
  .page-grid.wide-tiles {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }

  .file-item {
    gap: 10px;
    padding: 8px 10px;
  }

  .file-actions .icon-btn {
    width: 36px;
    height: 36px;
  }

  .pdf-result {
    padding: 22px 18px;
  }

  .result-files li {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .result-file-name {
    grid-column: 1 / -1;
  }
}

/* ---------- Resume maker ---------- */

/* The form (left) and the live preview (right). Built by assets/js/resume.js. */
.resume-app {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  margin: 32px 0 8px;
  min-height: 640px;
}

.rf-noscript {
  grid-column: 1 / -1;
  padding: 20px;
  border-radius: var(--radius);
  background: var(--amber-50);
  border: 1px solid var(--amber-300);
}

.resume-form {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.rf-bar {
  display: grid;
  gap: 10px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.rf-bar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rf-privacy {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.rf-privacy .icon {
  width: 16px;
  height: 16px;
  margin-top: 3px;
  color: var(--green-600);
}

/* The file picker is hidden; its label is styled as the "Open draft" button. */
.rf-file {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}

.rf-file:focus-visible + label {
  outline: 3px solid var(--blue-600);
  outline-offset: 2px;
}

.rf-offscreen {
  position: fixed;
  left: -9999px;
  top: 0;
}

.rf-group {
  min-width: 0;
  margin: 0;
  padding: 20px 22px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.rf-group > legend {
  float: left;
  width: 100%;
  padding: 0;
  margin: 0 0 12px;
  font-weight: 750;
  font-size: 1.08rem;
  letter-spacing: -0.01em;
}

.rf-help {
  clear: both;
  margin: -4px 0 14px;
  font-size: 0.88rem;
  color: var(--muted);
}

.rf-grid {
  clear: both;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
}

.rf-grid .span-2 {
  grid-column: 1 / -1;
}

.input-wrap.is-text input {
  font-weight: 450;
  font-variant-numeric: normal;
}

.rf-textarea {
  display: block;
  width: 100%;
  min-height: 72px;
  resize: vertical;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 12px 14px;
  font: inherit;
  font-size: 0.97rem;
  line-height: 1.5;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.rf-textarea:hover {
  border-color: var(--subtle);
}

.rf-textarea:focus {
  outline: none;
  border-color: var(--blue-600);
  box-shadow: 0 0 0 4px rgba(29, 78, 216, 0.14);
}

.resume-form ::placeholder {
  color: var(--subtle);
  opacity: 1;
}

.rf-entries {
  display: grid;
  gap: 12px;
}

.rf-entries:not(:empty) {
  margin-bottom: 12px;
}

.rf-entry {
  padding: 14px 16px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}

.rf-entry-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.rf-entry-title {
  min-width: 0;
  margin: 0;
  font-size: 0.95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rf-entry-tools {
  display: flex;
  flex: none;
  gap: 6px;
}

.rf-icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.rf-icon-btn:hover:not(:disabled) {
  border-color: var(--navy-900);
  color: var(--navy-900);
}

.rf-icon-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.rf-choices {
  display: grid;
  gap: 8px;
}

.rf-radio {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  cursor: pointer;
}

.rf-radio input {
  flex: none;
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--blue-600);
}

.rf-radio:has(input:checked) {
  border-color: var(--blue-600);
  background: var(--blue-50);
}

/* Preview panel (dark, like the calculator results), with white pages inside. */
.rp-panel {
  position: sticky;
  top: 84px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: calc(100vh - 100px);
  min-width: 0;
  padding: 20px;
  border-radius: var(--radius-lg);
  color: #fff;
  background:
    radial-gradient(500px 260px at 100% 0%, rgba(59, 130, 246, 0.35), transparent 65%),
    linear-gradient(180deg, var(--navy-800), var(--navy-900));
  box-shadow: var(--shadow-lg);
}

.rp-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
}

.rp-title {
  margin: 0;
  font-size: 0.8rem;
  color: #93c5fd;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
}

.rp-meta {
  margin: 0;
  font-size: 0.85rem;
  color: #cbd5e1;
}

.rp-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.rp-options label {
  color: #cbd5e1;
  font-size: 0.85rem;
  margin-bottom: 4px;
}

.rp-options .select-wrap select {
  height: 44px;
  font-size: 0.93rem;
}

.rp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rp-actions .btn {
  flex: 1 1 auto;
}

.rp-status {
  margin: 0;
  font-size: 0.88rem;
  color: #cbd5e1;
}

.rp-status:empty {
  display: none;
}

.rp-status.is-error {
  color: #fca5a5;
}

.rp-warnings {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rp-warnings:empty {
  display: none;
}

.rp-warnings li {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: rgba(245, 196, 81, 0.12);
  border: 1px solid rgba(245, 196, 81, 0.4);
  color: #fde68a;
  font-size: 0.85rem;
  line-height: 1.5;
}

.rp-pages {
  display: grid;
  gap: 14px;
  min-height: 0;
  overflow: auto;
  border-radius: var(--radius-sm);
}

.rp-sheet {
  position: relative;
  overflow: hidden;
  background: #fff;
  border-radius: 3px;
  box-shadow: 0 10px 28px -10px rgba(0, 0, 0, 0.55);
  aspect-ratio: 612 / 792;
}

.rp-a4 .rp-sheet {
  aspect-ratio: 595.28 / 841.89;
}

/* Until the visitor types, the preview shows the example, faded and labelled. */
.rp-panel.is-example .rp-page {
  opacity: 0.55;
}

.rp-panel.is-example .rp-sheet:first-child::after {
  content: "Example";
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--navy-900);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.rp-page {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  color: #111827;
}

.rp-page span {
  position: absolute;
  white-space: pre;
  line-height: 1;
}

/* Metric-compatible with the Helvetica and Times fonts used in the PDF. */
.rp-sans {
  font-family: Helvetica, Arial, "Liberation Sans", "Nimbus Sans", sans-serif;
}

.rp-serif {
  font-family: "Times New Roman", Times, "Liberation Serif", "Nimbus Roman", serif;
}

.rp-page .rp-bold {
  font-weight: 700;
}

.rp-page .rp-italic {
  font-style: italic;
}

.rp-page .rp-soft {
  color: #4b5563;
}

.rp-rule {
  position: absolute;
  height: 0;
  border-top: 0.75px solid #9ca3af;
}

/* Phones and tablets: a bar pinned to the bottom with Preview and Download. */
.resume-bar {
  display: none;
}

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

  .rp-panel {
    position: static;
    max-height: none;
  }

  .rp-pages {
    overflow: visible;
  }

  .resume-bar {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    z-index: 40;
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    border-radius: var(--radius);
    background: var(--navy-900);
    box-shadow: 0 12px 32px -8px rgba(7, 20, 43, 0.5);
    transform: translateY(160%);
    transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1);
  }

  .resume-bar.show {
    transform: none;
  }

  .resume-bar .btn {
    flex: 1 1 0;
  }
}

@media (max-width: 600px) {
  .rf-group {
    padding: 16px;
  }

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

  .rf-bar {
    padding: 14px;
  }

  .rp-panel {
    padding: 16px;
  }
}

/* Search box on hub pages (assets/js/tool-search.js) */
.hub-search {
  position: relative;
  max-width: 560px;
  margin-top: 22px;
}

.hub-search-icon {
  position: absolute;
  top: 50%;
  left: 16px;
  display: flex;
  color: var(--subtle);
  transform: translateY(-50%);
  pointer-events: none;
}

.hub-search input {
  width: 100%;
  height: 54px;
  padding: 0 16px 0 48px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  font: inherit;
  font-size: 1rem; /* 16px or more stops phones zooming in on tap */
  transition: border-color 0.15s, box-shadow 0.15s;
}

.hub-search input::placeholder {
  color: var(--subtle);
}

.hub-search input:hover {
  border-color: var(--subtle);
}

.hub-search input:focus {
  outline: none;
  border-color: var(--blue-600);
  box-shadow: 0 0 0 4px rgba(29, 78, 216, 0.14);
}

.search-status {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.search-status:empty {
  margin: 0;
}

main .section[hidden],
.card-grid > li[hidden] {
  display: none;
}

.tool-bars-wrap {
  max-width: 560px;
  margin-top: 14px;
}

.tool-bars-label {
  margin: 0 0 4px 6px;
  color: var(--blue-600);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Wide screens: the list sits beside the title instead of under the search box. */
@media (min-width: 961px) {
  .hub-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 440px);
    align-items: start;
    gap: 48px;
  }

  .hub-hero .tool-bars-wrap {
    max-width: none;
    margin-top: 0;
    animation-delay: 0.12s;
  }

  .hub-hero .tool-bars,
  .hub-hero .tool-deck.is-deck {
    max-height: 372px;
  }

  .hub-hero .tool-deck.is-deck {
    height: 372px;
  }
}

/* List of tool bars beside (or under) the hub search box. Without JavaScript it's a plain
   scrolling list. tool-search.js adds .is-deck to #tool-deck and turns it into a 3D deck: the
   box scrolls over an empty track while the bars stay pinned (sticky) and are placed one by one
   (transform, z-index, opacity): one faces you in the middle, the rest stack above and below. */
.tool-bars {
  --fade-bottom: 0px;
  display: grid;
  grid-template-columns: minmax(0, 1fr); /* long descriptions shorten with "…" instead of widening the list */
  gap: 8px;
  max-height: 322px;
  margin: 0;
  padding: 6px;
  overflow-x: hidden;
  overflow-y: auto;
  list-style: none;
}

.tool-bars > li {
  min-width: 0;
}

/* The framed panel around the list, with the Animation switch in its top-right corner. */
.tool-deck-frame {
  padding: 6px 8px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.6);
  box-shadow: var(--shadow-sm), inset 0 1px 0 #fff;
}

.tool-deck-bar {
  display: flex;
  justify-content: flex-end;
  min-height: 32px;
}

.deck-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px 4px 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.deck-switch:hover {
  color: var(--text);
}

.deck-switch-track {
  position: relative;
  width: 34px;
  height: 20px;
  border-radius: 10px;
  background: var(--border-strong);
  transition: background 0.2s;
}

.deck-switch-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.3);
  transition: transform 0.2s;
}

.deck-switch[aria-checked="true"] .deck-switch-track {
  background: var(--blue-600);
}

.deck-switch[aria-checked="true"] .deck-switch-track::after {
  transform: translateX(14px);
}

.tool-deck.is-deck {
  position: relative;
  height: 322px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none; /* the stacks above and below show there's more */
}

.tool-deck.is-deck::-webkit-scrollbar {
  display: none;
}

.tool-deck.is-deck .tool-bars {
  position: sticky;
  top: 0;
  display: block;
  height: 100%;
  max-height: none;
  padding: 0;
  overflow: visible;
  perspective: 900px;
}

.tool-deck.is-deck .tool-bars > li {
  position: absolute;
  top: 0;
  right: 6px;
  left: 6px;
  transform-origin: 50% 50%;
  backface-visibility: hidden;
  will-change: transform, opacity;
}

.tool-deck.is-deck .tool-bars > li.is-centre .tool-bar {
  border-color: var(--blue-600);
  box-shadow: var(--shadow-lg);
}

.tool-deck.is-deck .tool-bars > li.is-centre .tool-bar-go {
  color: var(--blue-600);
}

.tool-deck-track {
  pointer-events: none;
}

.tool-bars > li[hidden] {
  display: none;
}

.tool-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 64px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.tool-bar:hover,
.tool-bar:focus-visible {
  border-color: var(--blue-600);
  background: #fff;
  box-shadow: var(--shadow);
  color: var(--text);
}

.tool-bar:focus-visible {
  outline-offset: 1px;
}

.tool-bar-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--blue-50);
  color: var(--blue-600);
}

.tool-bar-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  line-height: 1.3;
}

.tool-bar-text strong {
  font-size: 0.98rem;
  font-weight: 650;
}

.tool-bar-text span {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.84rem;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.tool-bar-go {
  flex: none;
  display: flex;
  color: var(--subtle);
  transition: transform 0.2s, color 0.2s;
}

.tool-bar:hover .tool-bar-go,
.tool-bar:focus-visible .tool-bar-go {
  color: var(--blue-600);
  transform: translateX(4px);
}

/* ---------- Footer (dark) ---------- */

.site-footer {
  background: var(--navy-950);
  color: #94a3b8;
  font-size: 0.93rem;
  padding: 56px 0 28px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(6, 1fr);
  gap: 24px;
  padding-bottom: 36px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.site-footer .logo {
  color: #fff;
  margin-bottom: 12px;
}

.site-footer .about-text {
  max-width: 320px;
  margin: 0;
}

.site-footer h2 {
  font-size: 0.8rem;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 4px 0 14px;
}

.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.site-footer a {
  color: #cbd5e1;
  text-decoration: none;
}

.site-footer a:hover {
  color: #fff;
  text-decoration: underline;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 24px;
  font-size: 0.85rem;
}

.footer-bottom p {
  margin: 0;
}

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
  .hero .container {
    grid-template-columns: 1fr;
    gap: 36px;
    padding-top: 48px;
    padding-bottom: 56px;
  }

  .preview-card {
    max-width: 460px;
  }

  .calculator {
    grid-template-columns: 1fr;
  }

  .features {
    grid-template-columns: 1fr;
  }

  .country-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .site-nav .hide-md {
    display: none;
  }

  .footer-grid > :first-child {
    grid-column: 1 / -1;
  }
}

/* Wide tables marked .stack turn into labelled blocks on phones. */
@media (max-width: 600px) {
  table.stack thead {
    display: none;
  }

  table.stack tr,
  table.stack td {
    display: block;
  }

  table.stack tr {
    border-bottom: 2px solid var(--border);
    padding: 8px 0;
  }

  table.stack td {
    border-bottom: 0;
    padding: 6px 16px;
  }

  table.stack td::before {
    content: attr(data-label);
    display: block;
    font-size: 0.75rem;
    font-weight: 650;
    color: var(--subtle);
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }

  .calc-form {
    grid-template-columns: 1fr;
    padding: 20px;
  }

  .calc-results {
    padding: 24px 20px;
  }

  .hero-actions .btn {
    flex: 1 1 auto;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 16px;
  }

  .container {
    padding: 0 16px;
  }

  .site-nav .hide-sm {
    display: none;
  }

  .site-nav .hide-sm-inline {
    display: none;
  }

  /* Phones: the Country menu shows just its globe ("Country" is still read out by screen readers). */
  .site-nav .nav-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .nav-menu-button {
    padding: 8px;
  }

  .nav-menu-button .nav-chevron {
    display: none;
  }

  .site-header .container {
    gap: 10px;
  }

  .site-nav ul {
    gap: 2px;
  }

  .site-nav a {
    padding: 8px 10px;
  }

  .country-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Minimal animation ---------- */

/* Hero content rises in once on load. */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.hero-copy > *,
.preview-wrap,
.page-hero .container > * {
  animation: rise 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.hero-copy > :nth-child(2),
.page-hero .container > :nth-child(2) {
  animation-delay: 0.06s;
}

.hero-copy > :nth-child(3),
.page-hero .container > :nth-child(3) {
  animation-delay: 0.12s;
}

.hero-copy > :nth-child(4),
.page-hero .container > :nth-child(4) {
  animation-delay: 0.18s;
}

.hero-copy > :nth-child(5) {
  animation-delay: 0.24s;
}

.preview-wrap {
  animation-delay: 0.2s;
  perspective: 900px;
}

/* 3D tilt: the side under the cursor sinks back into the screen (driven by common.js). */
.tilt {
  position: relative;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) scale(var(--tilt-scale, 1));
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.6s ease;
  will-change: transform;
}

.tilt.is-tilting {
  --tilt-scale: 1.02;
  transition: transform 0.12s ease-out, box-shadow 0.3s ease;
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.75);
}

/* Soft light that follows the cursor. */
.tilt::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.13), transparent 45%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.tilt.is-tilting::after {
  opacity: 1;
}

/* Below-the-fold content fades up as it scrolls in (added by common.js). */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.reveal.revealed {
  opacity: 1;
  transform: none;
}

/* Main result glows briefly when it changes. */
@keyframes pulse {
  0% {
    transform: scale(1);
    text-shadow: 0 0 0 rgba(147, 197, 253, 0);
  }
  35% {
    transform: scale(1.025);
    text-shadow: 0 0 24px rgba(147, 197, 253, 0.55);
  }
  100% {
    transform: scale(1);
    text-shadow: 0 0 0 rgba(147, 197, 253, 0);
  }
}

.result-main {
  transform-origin: left center;
}

.result-main.pulse {
  animation: pulse 0.45s ease-out;
}

/* Live dot on the hero preview card. */
@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6ee7b7;
  margin-right: 8px;
  animation: blink 2s ease-in-out infinite;
}

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

  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* Phones and small tablets: drop "by Vintayz" next to the logo so the menu fits (it stays in the footer). */
@media (max-width: 700px) {
  .site-header .logo-by {
    display: none;
  }
}

/* The smallest phones: tighten the menu so all four items fit inside the 16px gutter. */
@media (max-width: 400px) {
  .site-header .container {
    gap: 8px;
  }

  .site-nav ul {
    gap: 0;
  }

  .site-nav a {
    padding: 8px 7px;
  }

  .nav-menu-button {
    padding: 8px 6px;
  }
}

/* ---------- Light/dark switch (header) ----------
   A sliding switch: sun on the left, moon on the right; the knob sits under the one in use. */

.theme-switch {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: none;
  cursor: pointer;
}

.theme-switch[hidden] {
  display: none;
}

.theme-switch-track {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 58px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--bg);
  color: var(--subtle);
  transition: background 0.2s, border-color 0.2s;
}

.theme-switch:hover .theme-switch-track {
  border-color: var(--subtle);
}

.theme-switch-track .icon {
  position: relative;
  z-index: 1;
  width: 14px;
  height: 14px;
  transition: color 0.2s;
}

.theme-switch-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.3);
  transition: transform 0.2s ease;
}

.theme-switch[aria-checked="false"] .icon-sun {
  color: #b45309;
}

.theme-switch[aria-checked="true"] .icon-moon {
  color: #fcd34d;
}

.theme-switch[aria-checked="true"] .theme-switch-knob {
  transform: translateX(28px);
}

@media (max-width: 560px) {
  .theme-switch {
    margin-left: 2px;
  }

  .theme-switch-track {
    width: 48px;
    height: 26px;
    padding: 0 6px;
  }

  .theme-switch-track .icon {
    width: 12px;
    height: 12px;
  }

  .theme-switch-knob {
    width: 20px;
    height: 20px;
  }

  .theme-switch[aria-checked="true"] .theme-switch-knob {
    transform: translateX(22px);
  }
}

/* ---------- Dark mode ----------
   theme.js sets data-theme="dark" on <html> when the device is set to dark, and the header
   switch flips it. Most colours come from the variables below; the rules after them fix the
   places that use a fixed light colour or navy as text. Things that stand for paper (PDF page
   previews, the resume preview) stay white on purpose. */

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a1120;
  --surface: #111b2e;
  --text: #e5eaf3;
  --muted: #a6b2c6;
  --subtle: #8a96ab;
  --border: #223049;
  --border-strong: #34445f;
  --blue-600: #7aa2ff; /* links, icons and outlines: light enough to read on dark */
  --blue-700: #a3bfff;
  --blue-50: #15233f;
  --blue-100: #1c3160;
  --green-600: #34d399;
  --green-50: #0f2a22;
  --red-600: #f87171;
  --amber-50: #2a2210;
  --amber-300: #7a6120;
  --btn-blue: #3667eb; /* button background: dark enough for white text */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.4), 0 24px 48px -20px rgba(0, 0, 0, 0.7);
}

[data-theme="dark"] .site-header {
  background: rgba(10, 17, 32, 0.86);
}

[data-theme="dark"] .logo,
[data-theme="dark"] .logo:hover,
[data-theme="dark"] .site-nav a[aria-current="page"],
[data-theme="dark"] .nav-menu-button.is-current,
[data-theme="dark"] .choice input:checked + label {
  color: var(--text);
}

[data-theme="dark"] .btn:hover,
[data-theme="dark"] .icon-btn:hover:not(:disabled),
[data-theme="dark"] .rf-icon-btn:hover:not(:disabled) {
  border-color: var(--text);
  color: var(--text);
}

[data-theme="dark"] .site-nav .nav-cta,
[data-theme="dark"] .btn-primary,
[data-theme="dark"] .btn-primary:disabled,
[data-theme="dark"] .btn-primary:disabled:hover {
  background: var(--btn-blue);
  border-color: var(--btn-blue);
  color: #fff;
}

[data-theme="dark"] .site-nav .nav-cta:hover,
[data-theme="dark"] .btn-primary:hover {
  background: #2f5bd6;
  border-color: #2f5bd6;
  color: #fff;
}

[data-theme="dark"] .page-pick[aria-pressed="true"] .pick-mark,
[data-theme="dark"] .deck-switch[aria-checked="true"] .deck-switch-track {
  border-color: var(--btn-blue);
  background: var(--btn-blue);
}

[data-theme="dark"] .page-hero {
  background:
    radial-gradient(800px 300px at 90% -40%, rgba(122, 162, 255, 0.12), transparent 70%),
    linear-gradient(180deg, var(--surface), var(--bg));
}

[data-theme="dark"] .input-wrap input[type="date"] {
  color-scheme: dark;
}

/* Navy blocks sit on a near-navy page, so give them an edge. */
[data-theme="dark"] .formula,
[data-theme="dark"] .pdf-result {
  border: 1px solid var(--border);
}

[data-theme="dark"] .site-footer {
  border-top: 1px solid var(--border);
}

[data-theme="dark"] .steps li::before {
  background: var(--blue-100);
  color: var(--text);
}

[data-theme="dark"] .tip {
  border-color: #1f5c46;
}

[data-theme="dark"] .file-card-icon {
  background: #3a1616;
}

[data-theme="dark"] .pdf-status.is-error {
  border-color: #5c1f1f;
  background: #2a1212;
}

[data-theme="dark"] .pick-delete .page-pick[aria-pressed="true"] .thumb {
  background: #2a1212;
}

[data-theme="dark"] .pick-mark,
[data-theme="dark"] .tool-bar:hover,
[data-theme="dark"] .tool-bar:focus-visible {
  background: var(--surface);
}

[data-theme="dark"] .tool-deck-frame {
  background: rgba(17, 27, 46, 0.6);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .theme-switch-knob {
  background: #2a3a58;
}

/* Small phones: slightly tighter menu links so the light/dark switch keeps a margin from the edge. */
@media (max-width: 420px) {
  .site-nav a {
    padding-right: 6px;
    padding-left: 6px;
  }
}
