/* ==========================================================================
   Korea Paperwork — design system
   Single stylesheet, no build step, no external fonts.
   ========================================================================== */

:root {
  /* Light only — declared so form controls and scrollbars are not rendered
     dark by a browser following the OS preference. */
  color-scheme: light;

  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
    "Apple SD Gothic Neo", "Malgun Gothic", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --bg: #ffffff;
  --bg-soft: #f6f8fb;
  --bg-sunken: #eef2f7;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --border: #dfe5ee;
  --border-strong: #c3cddd;

  /* Contrast against every surface token below, not just white: --text-faint
     lands on --bg-sunken in places, which is the darkest background the muted
     greys ever sit on. Both clear 4.5:1 there, so no small text on this site
     falls under the AA floor. */
  --text: #101828;
  --text-muted: #45536a;
  --text-faint: #606f86;

  --brand: #0f5bd6;
  --brand-strong: #0b47a8;
  --brand-soft: #e8f0fe;
  --accent: #c8102e; /* taegeuk red */
  --accent-soft: #fdecef;
  --ok: #0f7a4d;
  --ok-soft: #e6f5ee;
  --warn: #a35a00;
  --warn-soft: #fdf1e0;
  --danger: #b3261e;
  --danger-soft: #fdeceb;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.05);
  --shadow: 0 4px 12px rgba(16, 24, 40, 0.07), 0 2px 4px rgba(16, 24, 40, 0.04);
  --shadow-lg: 0 18px 40px rgba(16, 24, 40, 0.12);

  --wrap: 1120px;
  --wrap-prose: 760px;
  --header-h: 64px;
}

/* ------------------------------------------------------------------ reset */

*,
*::before,
*::after {
  box-sizing: border-box;
}
* {
  margin: 0;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
body {
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img,
svg,
video {
  display: block;
  max-width: 100%;
  height: auto;
}
a {
  color: var(--brand);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}
a:hover {
  color: var(--brand-strong);
}
h1,
h2,
h3,
h4 {
  line-height: 1.22;
  letter-spacing: -0.015em;
  font-weight: 700;
  text-wrap: balance;
}
h1 {
  font-size: clamp(1.9rem, 1.35rem + 2.2vw, 2.85rem);
}
h2 {
  font-size: clamp(1.45rem, 1.2rem + 1.1vw, 1.95rem);
}
h3 {
  font-size: clamp(1.15rem, 1.05rem + 0.5vw, 1.35rem);
}
h4 {
  font-size: 1.05rem;
}
code,
kbd,
samp,
pre {
  font-family: var(--font-mono);
  font-size: 0.9em;
}
code {
  background: var(--bg-sunken);
  padding: 0.12em 0.38em;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
/* The offset gap shows whatever is behind the element, so on a brand-coloured
   surface a brand-coloured ring disappears into it. Filling the gap with the
   page background keeps the ring readable everywhere. */
:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--bg);
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--brand);
  color: #fff;
  padding: 0.7rem 1.1rem;
  border-radius: 0 0 var(--radius) 0;
  font-weight: 600;
}
.skip-link:focus {
  left: 0;
}

.wrap {
  width: min(100% - 2rem, var(--wrap));
  margin-inline: auto;
}
/* Guide shell: one prose column with its contents list alongside. Below the
   breakpoint the list stacks above the article as a boxed summary. */
.wrap--guide {
  width: min(100% - 2rem, var(--wrap));
  margin-inline: auto;
  display: grid;
  gap: 2rem;
  grid-template-columns: minmax(0, 1fr);
  padding-top: 2.4rem;
}
@media (min-width: 1080px) {
  /* Only pages long enough to earn a contents list get the second column —
     otherwise the article would sit off-centre beside an empty rail. */
  .wrap--guide.has-toc {
    grid-template-columns: 232px minmax(0, var(--wrap-prose));
    column-gap: 3.5rem;
    row-gap: 2.2rem;
    justify-content: center;
    align-items: start;
  }
  /* The contents rail spans both rows so it can stick alongside the whole
     article, while the heading stays in the article column. */
  .guide-toc {
    grid-column: 1;
    grid-row: 1 / span 2;
  }
  .has-toc .guide-head,
  .has-toc .guide-body {
    grid-column: 2;
  }
}
.wrap--guide:not(.has-toc) {
  max-width: var(--wrap-prose);
}
.guide-body {
  min-width: 0;
  max-width: var(--wrap-prose);
}

/* ------------------------------------------------------------- checklists */

/* A checklist without a documents panel is just a prose column; one with a panel
   widens to make room for it rather than pushing the text off-centre. */
.wrap--checklist {
  width: min(100% - 2rem, var(--wrap-prose));
  margin-inline: auto;
  padding-top: 2.4rem;
}
@media (min-width: 1080px) {
  .wrap--checklist:has(.docpanel) {
    width: min(100% - 2rem, var(--wrap));
  }
  .checklist-body:has(> .docpanel) {
    display: grid;
    grid-template-columns: minmax(0, var(--wrap-prose)) minmax(0, 330px);
    column-gap: 2.5rem;
    align-items: start;
  }
  .checklist-body:has(> .docpanel) > * {
    grid-column: 1;
  }
  .checklist-body > .docpanel {
    grid-column: 2;
    grid-row: 1 / span 200;
    position: sticky;
    top: calc(var(--header-h) + 24px);
  }
}
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ----------------------------------------------------------------- header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.15s;
}
/* Set once the page has scrolled: the border alone reads as a seam, not as a
   bar sitting over content. */
.site-header.is-stuck {
  box-shadow: var(--shadow);
}
.site-header__inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: var(--header-h);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 1.02rem;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
}
.brand__mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(140deg, var(--brand) 0%, var(--accent) 130%);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.brand__text strong {
  font-weight: 800;
}
.brand--footer {
  margin-bottom: 0.75rem;
}

.nav {
  margin-left: auto;
}
.nav__list {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  list-style: none;
  padding: 0;
}
.nav__link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.5rem 0.7rem;
  border-radius: var(--radius-sm);
  font-size: 0.94rem;
  font-weight: 550;
  color: var(--text-muted);
  text-decoration: none;
  background: none;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
.nav__link:hover {
  color: var(--text);
  background: var(--bg-soft);
}
.nav__link.is-active {
  color: var(--brand);
}
/* Desktop only: colour alone is a weak signal for "you are here". In the drawer
   every row already carries a rule line, so an underline would read as a border. */
@media (min-width: 941px) {
  .nav__link.is-active {
    box-shadow: inset 0 -2px 0 0 var(--brand);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  }
}
.nav__chev {
  width: 0;
  height: 0;
  border: 4px solid transparent;
  border-top-color: currentColor;
  margin-top: 3px;
  transition: transform 0.15s;
}
.nav__group {
  position: relative;
}
.nav__menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 250px;
  list-style: none;
  padding: 0.4rem;
  margin: 0;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: none;
}
.nav__group[data-open='true'] .nav__menu {
  display: block;
}
.nav__group[data-open='true'] .nav__chev {
  transform: rotate(180deg);
}
.nav__menu a {
  display: block;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  color: var(--text-muted);
  text-decoration: none;
}
.nav__menu a:hover {
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.nav-burger {
  display: none;
  flex-direction: column;
  place-items: center;
  gap: 4px;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-muted);
}
.nav-burger:hover {
  border-color: var(--border-strong);
  color: var(--text);
}
.nav-burger span {
  display: block;
  width: 17px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
}

@media (max-width: 940px) {
  .nav-burger {
    display: flex;
  }
  .nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    max-height: calc(100dvh - var(--header-h));
    overflow-y: auto;
    padding: 0.6rem 1rem 1.2rem;
    display: none;
    box-shadow: var(--shadow-lg);
  }
  .nav.is-open {
    display: block;
  }
  .nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  .nav__link {
    width: 100%;
    justify-content: space-between;
    padding: 0.75rem 0.5rem;
    font-size: 1rem;
    border-bottom: 1px solid var(--border);
  }
  .nav__menu {
    position: static;
    box-shadow: none;
    border: 0;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    background: var(--bg-soft);
    min-width: 0;
  }
}

/* ------------------------------------------------------------ breadcrumbs */

.breadcrumbs {
  border-bottom: 1px solid var(--border);
  background: var(--bg-soft);
  font-size: 0.86rem;
}
.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  padding: 0.6rem 0;
  margin: 0;
  color: var(--text-faint);
}
.breadcrumbs li + li::before {
  content: '\203A';
  margin-right: 0.4rem;
  color: var(--text-faint);
  font-weight: 400;
}
.breadcrumbs [aria-current='page'] {
  color: var(--text);
  font-weight: 550;
}
.breadcrumbs a {
  color: var(--text-muted);
  text-decoration: none;
}
.breadcrumbs a:hover {
  color: var(--brand);
  text-decoration: underline;
}

/* -------------------------------------------------------------- page head */

.page-head {
  padding: 2.6rem 0 1.6rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, var(--bg-soft), var(--bg));
  margin-bottom: 2.2rem;
}
.page-head .wrap {
  max-width: var(--wrap-prose);
}
.layout-default .page-head .wrap {
  max-width: var(--wrap);
}
.lede {
  margin-top: 0.8rem;
  font-size: 1.12rem;
  color: var(--text-muted);
  max-width: 62ch;
  text-wrap: pretty;
}
.page-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.4rem;
  margin-top: 0.9rem;
  font-size: 0.84rem;
  color: var(--text-faint);
}
.page-meta__item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.page-meta svg {
  flex: none;
}

/* ------------------------------------------------------------------ prose */

main {
  padding-bottom: 4rem;
}
.layout-guide main p,
.layout-guide main ul,
.layout-guide main ol,
.layout-guide main blockquote,
.layout-checklist main p,
.layout-checklist main ul,
.layout-checklist main ol,
.layout-page main p {
  margin-block: 1rem;
  text-wrap: pretty;
}
main h2 {
  margin-top: 2.6rem;
  margin-bottom: 0.7rem;
  scroll-margin-top: calc(var(--header-h) + 12px);
}
main h3 {
  margin-top: 1.9rem;
  margin-bottom: 0.5rem;
  scroll-margin-top: calc(var(--header-h) + 12px);
}
main ul,
main ol {
  padding-left: 1.35rem;
}
main li {
  margin-block: 0.35rem;
}
main li::marker {
  color: var(--text-faint);
}
blockquote {
  border-left: 3px solid var(--brand);
  padding: 0.2rem 0 0.2rem 1.1rem;
  color: var(--text-muted);
  font-style: italic;
}
hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2.4rem 0;
}
.small {
  font-size: 0.88rem;
  color: var(--text-muted);
}
.muted {
  color: var(--text-muted);
}

/* ------------------------------------------------------------------ table */

.table-scroll {
  overflow-x: auto;
  margin-block: 1.4rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.94rem;
  min-width: 460px;
}
th,
td {
  text-align: left;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
thead th {
  background: var(--bg-soft);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  white-space: nowrap;
}
tbody tr:last-child td {
  border-bottom: 0;
}
tbody tr:hover {
  background: var(--bg-soft);
}
td.num,
th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------- components */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  box-shadow: var(--shadow-sm);
}
.card--pad {
  padding: 1.7rem;
}
.grid {
  display: grid;
  gap: 1.1rem;
}
.grid--2 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.grid--3 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}
.grid--4 {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.tile {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 1.35rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.tile:hover {
  border-color: var(--brand);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  color: inherit;
}
.tile__icon {
  font-size: 1.5rem;
  line-height: 1;
}
.tile h3 {
  margin: 0;
  font-size: 1.06rem;
}
.tile p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-muted);
}
.tile__cta {
  margin-top: auto;
  padding-top: 0.5rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--brand);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.68rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  background: var(--brand);
  color: #fff;
  transition: background 0.15s, border-color 0.15s;
}
.btn:hover {
  background: var(--brand-strong);
  color: #fff;
}
.btn--ghost {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
}
.btn--ghost:hover {
  background: var(--bg-soft);
  color: var(--text);
  border-color: var(--brand);
}
.btn--sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
}
.btn--block {
  width: 100%;
}
.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.2rem;
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  background: var(--bg-sunken);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.badge--brand {
  background: var(--brand-soft);
  color: var(--brand-strong);
  border-color: transparent;
}
.badge--ok {
  background: var(--ok-soft);
  color: var(--ok);
  border-color: transparent;
}
.badge--warn {
  background: var(--warn-soft);
  color: var(--warn);
  border-color: transparent;
}
.badge--danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: transparent;
}

.callout {
  display: flex;
  gap: 0.85rem;
  padding: 1rem 1.15rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-soft);
  margin-block: 1.6rem;
  font-size: 0.95rem;
}
.callout__icon {
  flex-shrink: 0;
  font-size: 1.1rem;
  line-height: 1.5;
}
.callout p {
  margin-block: 0.35rem !important;
}
.callout p:first-child {
  margin-top: 0 !important;
}
.callout p:last-child {
  margin-bottom: 0 !important;
}
.callout--warn {
  background: var(--warn-soft);
  border-color: color-mix(in srgb, var(--warn) 30%, transparent);
  border-left: 4px solid var(--warn);
}
.callout--info {
  background: var(--brand-soft);
  border-color: color-mix(in srgb, var(--brand) 25%, transparent);
}
.callout--ok {
  background: var(--ok-soft);
  border-color: color-mix(in srgb, var(--ok) 30%, transparent);
}

.disclaimer {
  margin-top: 3rem;
  padding: 1.15rem 1.3rem;
  border: 1px solid var(--border);
  border-left: 4px solid var(--warn);
  border-radius: var(--radius);
  background: var(--bg-soft);
  font-size: 0.89rem;
  color: var(--text-muted);
}
.disclaimer h2 {
  font-size: 0.95rem;
  margin: 0 0 0.4rem;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.disclaimer ul {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
}

details.faq {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 0 1.1rem;
  margin-block: 0.65rem;
}
details.faq > summary {
  cursor: pointer;
  font-weight: 620;
  padding: 0.9rem 0;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}
details.faq > summary::-webkit-details-marker {
  display: none;
}
details.faq > summary::after {
  content: '+';
  font-size: 1.25rem;
  color: var(--text-faint);
  line-height: 1;
  flex-shrink: 0;
}
details.faq[open] > summary::after {
  content: '\2212';
}
details.faq > *:not(summary) {
  margin-bottom: 1rem !important;
}

/* -------------------------------------------------------------- form bits */

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1.05rem;
}
.field > label,
.fieldset__legend {
  font-size: 0.88rem;
  font-weight: 620;
  color: var(--text);
}
.field__help {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}
input[type='text'],
input[type='number'],
input[type='email'],
input[type='search'],
select,
textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  font: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent);
}
select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 17px) 55%, calc(100% - 12px) 55%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 2.2rem;
}
.input-suffix {
  position: relative;
}
.input-suffix input {
  padding-right: 3.4rem;
}
.input-suffix__unit {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85rem;
  color: var(--text-faint);
  pointer-events: none;
}
fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 1.05rem;
}
.form-grid {
  display: grid;
  gap: 0 1.1rem;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

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

.tool {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: minmax(0, 1fr);
  margin-bottom: 3rem;
}
@media (min-width: 900px) {
  .tool--split {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    align-items: start;
  }
  .tool--split .tool__output {
    position: sticky;
    top: calc(var(--header-h) + 16px);
  }
}
.tool__panel,
.tool__output {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.tool__panel h2,
.tool__output h2 {
  margin-top: 0;
  font-size: 1.15rem;
}
.tool__section + .tool__section {
  margin-top: 1.6rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--border);
}
.tool__section h3 {
  margin-top: 0;
  font-size: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
}
.tool__section h3 .badge {
  font-variant-numeric: tabular-nums;
}

.score {
  text-align: center;
  padding: 1.4rem 1rem 1.2rem;
  border-radius: var(--radius);
  background: var(--bg-soft);
  border: 1px solid var(--border);
}
.score__value {
  font-size: clamp(2.6rem, 2rem + 3vw, 3.6rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.score__label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}
.score.is-pass {
  background: var(--ok-soft);
  border-color: color-mix(in srgb, var(--ok) 35%, transparent);
}
.score.is-pass .score__value {
  color: var(--ok);
}
.score.is-close {
  background: var(--warn-soft);
  border-color: color-mix(in srgb, var(--warn) 35%, transparent);
}
.score.is-close .score__value {
  color: var(--warn);
}
.score.is-fail .score__value {
  color: var(--text-muted);
}

.meter {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: var(--bg-sunken);
  overflow: hidden;
  margin-top: 1rem;
  border: 1px solid var(--border);
}
.meter__fill {
  height: 100%;
  background: var(--brand);
  border-radius: 999px;
  transition: width 0.35s ease;
}
.meter__fill.is-pass {
  background: var(--ok);
}
.meter__fill.is-close {
  background: var(--warn);
}
.meter__mark {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 2px;
  background: var(--text);
  opacity: 0.55;
}

/* ----------------------------------------------- F-2-7 points calculator */

/* Korean term of art beside its English label. Same weight as the English —
   synthetic bolding on Hangul reads as a different typeface. */
.term {
  display: inline-block;
  padding: 0.05em 0.4em;
  border-radius: var(--radius-sm);
  background: var(--bg-sunken);
  color: var(--text-muted);
  font-size: 0.92em;
  font-weight: inherit;
  word-break: keep-all;
}

.source-line {
  margin: 0.9rem 0 0 !important;
  font-size: 0.78rem;
  color: var(--text-faint);
}
.source-line a {
  color: inherit;
  text-decoration-color: var(--border-strong);
}
.source-line a:hover {
  color: var(--brand);
}
.source-line--article {
  margin-top: 2.2rem !important;
}

.f27-block + .f27-block,
.f27-block + .f27-fold,
.f27-fold + .f27-fold,
.f27-fold + .btn-row {
  margin-top: 1.4rem;
}
.f27-block__title {
  margin: 0 0 1.1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
  font-size: 1rem;
}
.f27-block--lead {
  padding: 1.3rem;
  border-radius: var(--radius);
  background: var(--brand-soft);
  border: 1px solid color-mix(in srgb, var(--brand) 25%, transparent);
}
.f27-block__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 0.9rem;
}
.f27-block__head h3 {
  margin: 0;
  font-size: 1.05rem;
}
.f27-block__note {
  margin: 0.6rem 0 1.1rem !important;
  font-size: 0.87rem;
  color: var(--text-muted);
}

.optioncards {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.optioncard {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 0.92rem;
  cursor: pointer;
}
.optioncard input {
  flex: none;
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--brand);
  cursor: pointer;
}
.optioncard__label {
  flex: 1 1 auto;
  min-width: 0;
}
.optioncard__points {
  flex: none;
  font-weight: 700;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
}
.optioncard:hover {
  border-color: var(--brand);
}
.optioncard:has(input:checked) {
  border-color: var(--brand);
  box-shadow: inset 0 0 0 1px var(--brand);
}
.optioncard:has(input:focus-visible) {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.f27-fold {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.f27-fold > summary {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.85rem 1rem;
  cursor: pointer;
  font-weight: 620;
  font-size: 0.95rem;
  list-style: none;
}
.f27-fold > summary::-webkit-details-marker {
  display: none;
}
.f27-fold > summary::after {
  content: '';
  flex: none;
  width: 0;
  height: 0;
  border: 5px solid transparent;
  border-top-color: var(--text-faint);
  transform-origin: 50% 25%;
  transition: transform 0.15s;
}
.f27-fold[open] > summary::after {
  transform: rotate(180deg);
}
.f27-fold__label {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.f27-fold__label svg {
  flex: none;
  color: var(--brand);
}
.f27-fold--danger .f27-fold__label svg {
  color: var(--danger);
}
.f27-fold[open] > summary {
  border-bottom: 1px solid var(--border);
}
.f27-fold > div {
  padding: 1.1rem 1rem 0.1rem;
}

.scorecard {
  padding: 1.2rem 1.25rem 1.35rem;
  border-radius: var(--radius);
  background: var(--bg-soft);
  border: 1px solid var(--border);
}
.scorecard__eyebrow {
  margin: 0 0 0.6rem !important;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.scorecard__value {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  margin: 0 !important;
}
.scorecard__value strong {
  font-size: clamp(2.6rem, 2rem + 3vw, 3.4rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--brand);
}
.scorecard__value span {
  font-size: 1.25rem;
  color: var(--text-faint);
}
.scorecard.is-pass .scorecard__value strong {
  color: var(--ok);
}
.scorecard.is-close .scorecard__value strong {
  color: var(--warn);
}
.scorecard.is-fail .scorecard__value strong {
  color: var(--text-muted);
}

.meter__scale {
  position: relative;
  display: flex;
  justify-content: space-between;
  margin-top: 0.5rem;
  font-size: 0.72rem;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}
.meter__scale-mark {
  position: absolute;
  transform: translateX(-50%);
  white-space: nowrap;
  font-weight: 700;
  color: var(--text-muted);
}

.status {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-soft);
}
.status__icon {
  flex: none;
  display: flex;
  color: var(--text-muted);
}
.status__title {
  margin: 0 !important;
  font-size: 0.95rem;
  font-weight: 700;
}
.status__note {
  margin: 0.2rem 0 0 !important;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.status--pass {
  background: var(--ok-soft);
  border-color: color-mix(in srgb, var(--ok) 35%, transparent);
}
.status--pass .status__icon,
.status--pass .status__title {
  color: var(--ok);
}
.status--close {
  background: var(--warn-soft);
  border-color: color-mix(in srgb, var(--warn) 35%, transparent);
}
.status--close .status__icon,
.status--close .status__title {
  color: var(--warn);
}

.f27-result h3 {
  margin: 1.7rem 0 0.5rem;
  font-size: 0.95rem;
}
.f27-result .callout {
  margin-top: 1.5rem;
}
.f27-result .btn--block {
  margin-top: 1.2rem;
}

.breakdown {
  margin: 0;
}

.suggestions {
  list-style: none;
  counter-reset: suggestion;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.suggestions li {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--brand-soft);
  font-size: 0.88rem;
}
.suggestions li::before {
  counter-increment: suggestion;
  content: counter(suggestion) '.';
  flex: none;
  font-weight: 700;
  color: var(--brand);
}
.suggestions p {
  margin: 0 !important;
  flex: 1 1 auto;
}
.suggestions__gain {
  flex: none;
  font-weight: 700;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
}

.kv {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px dashed var(--border);
  font-size: 0.93rem;
}
.kv:last-child {
  border-bottom: 0;
}
.kv dt {
  color: var(--text-muted);
}
.kv dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  white-space: nowrap;
}
.kv.is-negative dd {
  color: var(--danger);
}
.kv--total {
  border-top: 2px solid var(--border-strong);
  border-bottom: 0;
  margin-top: 0.4rem;
  padding-top: 0.75rem;
  font-size: 1.05rem;
}

.compare {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-bottom: 1.2rem;
}
.compare__card {
  padding: 1.15rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
  position: relative;
}
.compare__card.is-winner {
  border-color: var(--ok);
  background: var(--ok-soft);
}
.compare__card h3 {
  margin: 0 0 0.15rem;
  font-size: 0.92rem;
  color: var(--text-muted);
  font-weight: 600;
}
.compare__amount {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.compare__sub {
  font-size: 0.83rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}
.compare__flag {
  position: absolute;
  top: -11px;
  right: 12px;
}

.copy-box {
  position: relative;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  margin-block: 0.65rem;
}
.copy-row {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}
.copy-row .copy-box {
  flex: 1;
  margin: 0;
}

.output-empty {
  color: var(--text-faint);
  font-size: 0.92rem;
  text-align: center;
  padding: 2rem 1rem;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.6rem;
}
/* Scoped: the flat `.chip` further down is a static label, and without this the
   clickable example chips on the tool pages inherit it and lose their affordance. */
.chip-row .chip {
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  font-size: 0.83rem;
  cursor: pointer;
  color: var(--text-muted);
  font-family: inherit;
}
.chip-row .chip:hover {
  border-color: var(--brand);
  color: var(--brand);
}

/* ------------------------------------------------------------ visa detail */

.factgrid {
  display: grid;
  gap: 0.8rem;
  /* Narrow enough that all four answers sit on one line in the article column. */
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  margin-bottom: 1.6rem;
}
.fact {
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
}
.fact__label {
  margin: 0 0 0.5rem !important;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.fact__value {
  margin: 0 !important;
  font-size: 0.95rem;
  font-weight: 650;
  line-height: 1.4;
  text-wrap: pretty;
}
.fact__note {
  margin: 0.4rem 0 0 !important;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
}
/* The money figure is what people came for, so it gets the one filled card. */
.fact--accent {
  background: var(--brand-strong);
  border-color: var(--brand-strong);
}
.fact--accent .fact__value {
  font-size: 1.3rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.fact--accent .fact__label,
.fact--accent .fact__value,
.fact--accent .fact__note {
  color: #fff;
}
.fact--accent .fact__label,
.fact--accent .fact__note {
  opacity: 0.82;
}

.pathway {
  margin-bottom: 2.2rem;
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.pathway__title {
  margin: 0 0 0.9rem !important;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.pathway ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 0.5rem;
  list-style: none;
  margin: 0 !important;
  padding: 0 !important;
}
.pathway__step {
  margin: 0 !important;
}
.pathway__step + .pathway__step::before {
  content: '→';
  margin-right: 0.5rem;
  color: var(--text-faint);
}
.pathway__step > *,
.pathway__step {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
}
.pathway__step a {
  text-decoration: none;
  color: inherit;
}
.pathway__code {
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  font-weight: 700;
  font-size: 0.85rem;
}
.pathway__name {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.pathway__step a:hover .pathway__code {
  border-color: var(--brand);
  color: var(--brand);
}
.pathway__step.is-current .pathway__code {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

/* Requirements the reader can tick off, each with the rule behind it. */
.reqlist {
  list-style: none;
  padding: 0 !important;
  margin-block: 1.2rem !important;
}
.reqlist li {
  position: relative;
  margin-block: 0.6rem;
  padding: 0.75rem 1rem 0.75rem 2.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.reqlist li::before {
  content: '';
  position: absolute;
  left: 1rem;
  top: 1.05em;
  width: 15px;
  height: 15px;
  border: 2px solid var(--border-strong);
  border-radius: 3px;
}
.reqlist li.is-key {
  border-color: color-mix(in srgb, var(--brand) 40%, transparent);
  background: var(--brand-soft);
}
.reqlist li.is-key::before {
  border-color: var(--brand);
}
.reqlist__note {
  margin: 0.3rem 0 0 !important;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Required documents: name, Korean term, and the condition attached to it. */
.doclist {
  list-style: none;
  padding: 0 !important;
  margin-block: 1.2rem !important;
}
.doclist li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.2rem 1rem;
  margin-block: 0.5rem;
  padding: 0.7rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 0.93rem;
}
.doclist__note {
  flex: none;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ------------------------------------------------------- corrections log */

.correction {
  margin-block: 1.4rem;
  padding: 1.4rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.correction__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.correction h3 {
  margin: 0.5rem 0 1rem !important;
  font-size: 1.15rem;
}
.correction > p:last-child {
  margin-bottom: 0 !important;
}

/* The was / is-now pair is the whole point of the page: the old figure has to be
   legible enough to recognise, and unmistakably not the current one. */
.wasnow {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: minmax(0, 1fr);
  margin-block: 1rem;
}
@media (min-width: 620px) {
  .wasnow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.wasnow > div {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-soft);
}
.wasnow__label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 0.4rem !important;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.wasnow__value {
  margin: 0 !important;
  font-size: 0.98rem;
  line-height: 1.45;
}
.wasnow__was .wasnow__value {
  color: var(--text-muted);
  text-decoration: line-through;
  text-decoration-color: var(--danger);
}
.wasnow__now {
  background: var(--ok-soft) !important;
  border-color: color-mix(in srgb, var(--ok) 32%, transparent) !important;
}
.wasnow__now .wasnow__label {
  color: var(--ok);
}
.wasnow__now .wasnow__value {
  font-weight: 650;
}

/* Passes where nothing changed are deliberately quieter than corrections. */
.verif {
  list-style: none;
  padding: 0 !important;
  margin-block: 1.2rem !important;
}
.verif li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 1rem;
  margin-block: 0.6rem;
  padding: 0.7rem 1rem;
  border-left: 3px solid var(--brand);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--brand-soft);
  font-size: 0.92rem;
}
.verif__date {
  flex: none;
  font-weight: 650;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.verif p {
  margin: 0 !important;
  flex: 1 1 260px;
}

/* --------------------------------------------------------------- verdicts */

.verdict {
  padding: 1.15rem 1.3rem;
  border-radius: var(--radius);
  margin-bottom: 1.2rem;
  border: 1px solid var(--border);
  background: var(--bg-soft);
}
.verdict h3 {
  margin: 0 0 0.3rem;
  font-size: 1.05rem;
}
.verdict p {
  margin: 0;
  font-size: 0.93rem;
  color: var(--text-muted);
}
.verdict--ok {
  background: var(--ok-soft);
  border-color: color-mix(in srgb, var(--ok) 35%, transparent);
}
.verdict--warn {
  background: var(--warn-soft);
  border-color: color-mix(in srgb, var(--warn) 35%, transparent);
}

.visa-match {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  padding: 0.95rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  margin-bottom: 0.7rem;
}
.visa-match__code {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  min-width: 58px;
  padding: 0.3rem 0.5rem;
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-weight: 800;
  font-size: 0.88rem;
}
.visa-match__body {
  min-width: 0;
}
.visa-match__body h4 {
  margin: 0 0 0.15rem;
  font-size: 0.98rem;
}
.visa-match__body p {
  margin: 0 !important;
  font-size: 0.88rem;
  color: var(--text-muted);
}
.visa-match--partial .visa-match__code {
  background: var(--warn-soft);
  color: var(--warn);
}
.visa-match__reasons {
  margin: 0.45rem 0 0 !important;
  padding-left: 1.1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ------------------------------------------------------------- checklists */

.checklist {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
  counter-reset: step;
}
.checklist__item {
  position: relative;
  padding: 1.15rem 1.2rem 1.15rem 3.4rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  margin-bottom: 0.75rem;
}
.checklist__item::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 1rem;
  top: 1.15rem;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--bg-sunken);
  border: 1px solid var(--border-strong);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
}
.checklist__item.is-done {
  background: var(--ok-soft);
  border-color: color-mix(in srgb, var(--ok) 30%, transparent);
}
.checklist__item.is-done::before {
  content: '\2713';
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
}
.checklist__head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}
.checklist__item h3 {
  margin: 0;
  font-size: 1.02rem;
}
.checklist__item p {
  margin: 0.4rem 0 0 !important;
  font-size: 0.92rem;
  color: var(--text-muted);
}
.checklist__item ul {
  margin: 0.6rem 0 0;
  font-size: 0.9rem;
}
.checklist__toggle {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.83rem;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}
.checklist__toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--ok);
  cursor: pointer;
}
/* The documents summary is the one thing a reader photographs before going to
   the bank, so it inverts against the page rather than tracking the surface
   tokens. */
.docpanel {
  padding: 1.35rem 1.4rem;
  border-radius: var(--radius-lg);
  background: #16233b;
  border: 1px solid rgba(233, 238, 247, 0.12);
  color: #e9eef7;
}
.docpanel__title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 1.1rem !important;
  font-size: 1rem;
  color: #fff;
}
.docpanel__title svg {
  flex: none;
}
.docpanel h4 {
  margin: 1.1rem 0 0.45rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #9fb3d4;
}
.docpanel h4:first-of-type {
  margin-top: 0;
}
.docpanel ul {
  list-style: none;
  margin: 0 !important;
  padding: 0 !important;
  font-size: 0.9rem;
}
.docpanel li {
  margin: 0;
  padding: 0.4rem 0;
  border-bottom: 1px solid rgba(233, 238, 247, 0.12);
}
.docpanel li:last-child {
  border-bottom: 0;
}
.docpanel li small {
  display: block;
  color: #9fb3d4;
  font-size: 0.82em;
}
.docpanel__tip {
  margin: 1.2rem 0 0 !important;
  padding: 0.8rem 0.9rem;
  border-radius: var(--radius-sm);
  background: rgba(233, 238, 247, 0.07);
  font-size: 0.85rem;
  font-style: italic;
  color: #c8d6ec;
}
.docpanel .btn {
  width: 100%;
  margin-top: 1.2rem;
}

/* What to bring — the packing list for one step. */
.bring {
  margin-block: 0.9rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
}
.bring__title {
  margin: 0 0 0.4rem !important;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.bring ul {
  margin: 0 !important;
  padding-left: 1.15rem;
  font-size: 0.9rem;
}
.bring li {
  margin-block: 0.25rem;
}

/* The mistake that sends people back for a second visit. */
.pitfall {
  display: flex;
  gap: 0.6rem;
  margin-block: 0.9rem;
  padding: 0.75rem 0.95rem;
  border-radius: var(--radius-sm);
  border: 1px solid color-mix(in srgb, var(--danger) 28%, transparent);
  background: var(--danger-soft);
  font-size: 0.88rem;
}
.pitfall::before {
  content: '⚠';
  flex: none;
  color: var(--danger);
  line-height: 1.5;
}
.pitfall p {
  margin: 0 !important;
}
/* Several pitfalls in one box, as on the visa detail pages. */
.pitfall--block {
  padding: 1.1rem 1.2rem;
}
.pitfall--block p + p {
  margin-top: 0.6rem !important;
}
.pitfall strong {
  color: var(--danger);
}

/* Counter phrases, printed so they can be pointed at. */
.phrasebook td:last-child {
  font-weight: 620;
  word-break: keep-all;
}

.progress-bar {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  position: sticky;
  top: calc(var(--header-h) + 8px);
  z-index: 20;
  font-size: 0.9rem;
}
.progress-bar .meter {
  flex: 1;
  margin: 0;
}

/* ----------------------------------------------------------------- lists  */

.post-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
  display: grid;
  gap: 0.85rem;
}
.post-list li {
  margin: 0;
}
.post-card {
  display: block;
  padding: 1.15rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.post-card:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-sm);
  color: inherit;
}
.post-card h3 {
  margin: 0.3rem 0 0.25rem;
  font-size: 1.08rem;
}
.post-card p {
  margin: 0 !important;
  font-size: 0.92rem;
  color: var(--text-muted);
}
.post-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text-faint);
}

.guide-toc {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
  padding: 1rem 1.2rem;
}
.guide-toc__title {
  margin: 0 0 0.5rem !important;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-muted);
}
.guide-toc ol {
  margin: 0 !important;
  padding-left: 1.3rem;
  font-size: 0.9rem;
}
.guide-toc li {
  margin-block: 0.35rem;
}
.guide-toc a {
  color: var(--text-muted);
  text-decoration: none;
}
.guide-toc a:hover {
  color: var(--brand);
  text-decoration: underline;
}
@media (min-width: 1080px) {
  /* On the wide layout the list is a rail, not a box: a hairline and the
     numbers carry it, which is quieter beside a long article. */
  .guide-toc {
    position: sticky;
    top: calc(var(--header-h) + 24px);
    max-height: calc(100vh - var(--header-h) - 48px);
    overflow-y: auto;
    border: 0;
    border-left: 1px solid var(--border);
    border-radius: 0;
    background: none;
    padding: 0.1rem 0 0.1rem 1.2rem;
  }
}

.guide-head {
  padding-bottom: 1.6rem;
  border-bottom: 1px solid var(--border);
}
.guide-head h1 {
  margin: 0;
}
.guide-body > h2:first-of-type {
  margin-top: 0;
}

.statbox {
  margin-block: 1.8rem;
  padding: 1.5rem 1.2rem;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg-soft);
  text-align: center;
}
.statbox__label {
  margin: 0 0 0.5rem !important;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-muted);
}
.statbox__value {
  margin: 0 !important;
  font-size: clamp(1.7rem, 1.3rem + 1.6vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.statbox__value small {
  font-size: 0.5em;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0;
}
.statbox__source {
  margin: 0.6rem 0 0 !important;
  font-size: 0.78rem;
  color: var(--text-faint);
}

.checks {
  list-style: none;
  padding: 0 !important;
  margin-block: 1.2rem !important;
}
.checks li {
  position: relative;
  padding-left: 2rem;
  margin-block: 0.75rem;
}
/* Check-circle drawn from a ring and a rotated corner border, so the list needs
   no icon font and no extra markup in 22 guide bodies. */
.checks li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.25em;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  border: 2px solid var(--brand);
}
.checks li::after {
  content: '';
  position: absolute;
  left: 6.5px;
  top: 0.5em;
  width: 4px;
  height: 8px;
  border: solid var(--brand);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.refpanel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-block: 2rem;
  padding: 1.2rem 1.35rem;
  border-radius: var(--radius);
  background: var(--brand-soft);
  border: 1px solid color-mix(in srgb, var(--brand) 22%, transparent);
}
.refpanel > div {
  flex: 1 1 260px;
}
.refpanel .btn {
  flex: none;
}
.refpanel h2,
.refpanel h3 {
  margin: 0 0 0.25rem !important;
  font-size: 0.95rem;
}
.refpanel p {
  margin: 0 !important;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.related {
  margin-top: 3rem;
  padding-top: 1.8rem;
  border-top: 1px solid var(--border);
}
.related h2 {
  margin-top: 0;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-muted);
}
.related ul {
  list-style: none;
  padding: 0 !important;
  margin: 0 !important;
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.related li {
  margin: 0;
}
.related li a {
  display: block;
  height: 100%;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-weight: 620;
  font-size: 0.95rem;
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.related li a:hover {
  border-color: var(--brand);
  color: var(--brand);
  box-shadow: var(--shadow-sm);
}

/* ------------------------------------------------------------------- home */

.section {
  padding: clamp(2.5rem, 2rem + 2.5vw, 4rem) 0;
}
.section--soft {
  background: var(--bg-soft);
  border-block: 1px solid var(--border);
}
.section__head {
  max-width: 62ch;
  margin-bottom: 1.8rem;
}
.section__head h2 {
  margin-top: 0;
}
.section__head p {
  margin: 0.55rem 0 0;
  color: var(--text-muted);
}
/* ----------------------------------------------------------------- footer */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
  padding: 3rem 0 1.5rem;
  font-size: 0.9rem;
}
.footer__grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: minmax(240px, 1.4fr) repeat(auto-fit, minmax(150px, 1fr));
}
.footer__title {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-faint);
  margin-bottom: 0.7rem;
  font-weight: 700;
}
.footer__col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.42rem;
}
.footer__col a {
  color: var(--text-muted);
  text-decoration: none;
}
.footer__col a:hover {
  color: var(--brand);
  text-decoration: underline;
}
.footer__about p {
  color: var(--text-muted);
  margin-bottom: 0.7rem;
  max-width: 42ch;
}
.footer__note {
  font-size: 0.82rem;
  color: var(--text-faint);
}
.footer__bar {
  margin-top: 2.5rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.6rem;
  color: var(--text-faint);
  font-size: 0.83rem;
}

/* ------------------------------------------------- home entry + tool cards */
/* Layout follows the Stitch "Administrative Clarity" home comp. Colours come
   from the tokens above rather than the comp's own palette, so the contrast
   floor holds without a second set of values to maintain. */

.entry {
  padding: clamp(2.5rem, 2rem + 4vw, 4.5rem) 0 clamp(2rem, 1.5rem + 2vw, 3rem);
  border-bottom: 1px solid var(--border);
}
.entry__inner {
  max-width: var(--wrap-prose);
}
.entry h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.6rem, 1.35rem + 1.1vw, 2.1rem);
  letter-spacing: -0.02em;
}
.entry__lede {
  margin: 0 0 1.6rem;
  font-size: clamp(1.02rem, 0.98rem + 0.25vw, 1.13rem);
  color: var(--text-muted);
}

.searchbox {
  position: relative;
}
.searchbox__icon {
  position: absolute;
  left: 1rem;
  top: 1.05rem;
  color: var(--text-faint);
  pointer-events: none;
}
.searchbox input {
  width: 100%;
  padding: 0.95rem 1rem 0.95rem 2.9rem;
  font: inherit;
  font-size: 1.05rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.searchbox input::placeholder {
  color: var(--text-faint);
}
.searchbox input:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
  border-color: var(--brand);
}
.searchbox__results {
  position: absolute;
  z-index: 30;
  inset-inline: 0;
  top: calc(100% + 0.4rem);
  margin: 0;
  padding: 0.3rem;
  list-style: none;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-height: 22rem;
  overflow-y: auto;
}
.searchbox__results:empty {
  display: none;
}
.searchbox__results a {
  display: block;
  padding: 0.55rem 0.7rem;
  border-radius: var(--radius-sm);
  color: var(--text);
  text-decoration: none;
}
.searchbox__results a:hover,
.searchbox__results a:focus-visible,
.searchbox__results [aria-selected='true'] a {
  background: var(--brand-soft);
}
.searchbox__cat {
  display: block;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-faint);
}
.searchbox__none {
  padding: 0.7rem;
  color: var(--text-muted);
  font-size: 0.92rem;
}
.entry__popular {
  margin-top: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.6rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.trust-strip {
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 0;
}
.trust-strip ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.7rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.trust-strip li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.trust-strip svg {
  color: var(--brand);
  flex: none;
}

.toolgrid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}
.toolcard {
  display: block;
  padding: 1.4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.toolcard:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow);
}
.toolcard__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  margin-bottom: 1rem;
  border-radius: var(--radius);
  background: var(--brand-soft);
  color: var(--brand);
}
.toolcard h3 {
  margin: 0 0 0.4rem;
  font-size: 1.12rem;
}
.toolcard p {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.chip {
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  background: var(--bg-sunken);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 500;
}

.situations {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.situation {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.4rem 1.5rem;
  border-radius: var(--radius-lg);
  background: var(--brand-soft);
  border: 1px solid transparent;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s;
}
.situation:hover {
  border-color: var(--brand);
}
.situation h3 {
  margin: 0 0 0.3rem;
  font-size: 1.2rem;
}
.situation p {
  margin: 0;
  font-size: 0.93rem;
  color: var(--text-muted);
}
.situation svg {
  flex: none;
  color: var(--brand);
}
.situation--primary {
  background: var(--brand-strong);
}
.situation--primary h3,
.situation--primary p,
.situation--primary svg {
  color: #fff;
}

.adslot {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 90px;
  margin: clamp(2rem, 1.5rem + 2vw, 3rem) 0;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  color: var(--text-faint);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}

/* ------------------------------------------------------------------ print */

@media print {
  .site-header,
  .site-footer,
  .breadcrumbs,
  .nav,
  .nav-burger,
  .btn,
  .progress-bar,
  .checklist__toggle,
  .no-print {
    display: none !important;
  }
  body {
    font-size: 11pt;
    color: #000;
    background: #fff;
  }
  .page-head {
    background: none;
    border: 0;
    padding-top: 0;
    margin-bottom: 1rem;
  }
  /* A checklist is printed to be carried to a counter: masthead, rule, then the
     document list first, because that is what gets checked at the desk. */
  .wrap--checklist,
  .wrap--guide {
    padding-top: 0;
  }
  .guide-head {
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid #000;
  }
  .guide-head .lede,
  .guide-head .page-meta {
    font-size: 9.5pt;
    color: #333;
  }
  .print-doc__eyebrow {
    margin: 0 0 0.2rem;
    font-size: 8pt;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #444;
  }
  .print-doc__foot {
    margin-top: 1.4rem;
    padding-top: 0.6rem;
    border-top: 1px solid #999;
    font-size: 8.5pt;
    color: #444;
  }
  .docpanel {
    background: none !important;
    color: #000 !important;
    border: 1px solid #999;
    border-radius: 0;
    break-inside: avoid;
  }
  .docpanel__title,
  .docpanel h4,
  .docpanel li small,
  .docpanel__tip {
    color: #000 !important;
  }
  .docpanel li {
    border-bottom-color: #ccc;
  }
  /* Every document in the summary gets a box to tick at the counter. */
  .docpanel li::before {
    content: '\2610';
    margin-right: 0.4rem;
  }
  .docpanel__tip {
    background: none !important;
    border: 1px dashed #999;
  }
  /* Browsers drop background fills from print by default, so every tinted block
     needs a border to survive as a block, and muted body text needs darkening. */
  .bring,
  .pitfall,
  .callout {
    background: none !important;
    border: 1px solid #999;
    break-inside: avoid;
  }
  .checklist__item p,
  .small,
  .muted,
  .lede,
  .field__help {
    color: #333 !important;
  }
  /* The open/closed affordance means nothing on paper (site.js opens them). */
  details.faq > summary::after {
    display: none;
  }
  /* The document footer already carries the source, so the in-page line would
     only repeat it. */
  .wrap--checklist .source-line--article {
    display: none;
  }
  .wrap,
  .wrap--guide {
    width: 100%;
    display: block;
  }
  .guide-toc {
    display: none;
  }
  .checklist__item,
  .card,
  .tool__panel {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #999;
  }
  .checklist__item::before {
    content: '\2610';
    border: 0;
    background: none;
    font-size: 1.1rem;
  }
  a[href^='http']::after {
    content: ' (' attr(href) ')';
    font-size: 0.85em;
    color: #444;
    word-break: break-all;
  }
  .print-only {
    display: block !important;
  }
}
.print-only {
  display: none;
}
