/* ChinaJaunt shared styles. Round 4 tokens and patterns: STYLE_GUIDE.md. */
@font-face {
  font-family: 'Source Sans 3';
  src: url('/assets/fonts/source-sans-3-latin-wght-normal.woff2') format('woff2');
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
}

:root {
  --ink:#173d35;
  --muted:#4b625b;
  --paper:#f6f8f5;
  --white:#fff;
  --line:#cbd9d0;
  --accent:#155d49;
  --jade:#155d49;
  --light:#edf4ef;
  --note:#f3db8a;
  --control:#73847a;
  --error:#a22e32;
  --radius:12px;
  --space:24px;
}

* {
  box-sizing:border-box;
}

html {
  scroll-padding-top:24px;
}

body {
  margin:0;
  background:var(--white);
  color:var(--ink);
  font:16px/1.65 'Source Sans 3','Segoe UI',Arial,sans-serif;
}

a {
  color:var(--accent);
  text-underline-offset:4px;
}

a:hover {
  color:var(--jade);
}

a,button {
  transition:color .18s,background-color .18s;
}

:focus-visible {
  outline:3px solid var(--accent);
  outline-offset:3px;
}

.wrap {
  max-width:1280px;
  margin:auto;
  padding:0 20px;
}

.disclosure {
  font-size:14px;
  background:var(--paper);
  color:var(--muted);
  text-align:center;
  padding:10px 20px;
}

.disclosure a {
  color:var(--ink);
}

.site-header {
  background:var(--white);
  border-bottom:1px solid var(--line);
}

.header-inner {
  display:flex;
  flex-wrap:wrap;
  gap:8px 32px;
  align-items:center;
  justify-content:space-between;
  padding-top:16px;
  padding-bottom:16px;
}

nav {
  display:flex;
  flex-wrap:wrap;
  gap:8px 20px;
  font-size:15px;
}

nav a {
  display:inline-flex;
  align-items:center;
  min-height:44px;
  text-decoration:none;
  color:var(--ink);
}

nav a:hover,nav a[aria-current=page] {
  color:var(--accent);
  text-decoration:underline;
}

.skip {
  position:absolute;
  top:-100px;
}

.skip:focus {
  top:5px;
  background:var(--white);
  padding:10px;
  z-index:5;
}

.eyebrow {
  font-size:15px;
  font-weight:650;
  color:var(--jade);
  margin-bottom:12px;
}

h1,h2,h3,p {
  margin-top:0;
}

h1,h2,h3 {
  font-family:'Source Sans 3','Segoe UI',sans-serif;
  text-wrap:balance;
}

h1 {
  font-weight:700;
  letter-spacing:-1.8px;
  line-height:1.06;
  font-size:clamp(42px,5.4vw,76px);
  margin-bottom:24px;
}

h2 {
  font-size:32px;
  line-height:1.2;
  letter-spacing:-.8px;
}

h3 {
  font-size:23px;
  line-height:1.3;
  letter-spacing:-.4px;
}

p {
  margin-bottom:20px;
}

.hero {
  padding:40px 0;
  display:grid;
  gap:32px;
  align-items:center;
}

.hero p {
  max-width:520px;
  color:var(--muted);
  font-size:20px;
}

.hero .intro {
  margin-bottom:28px;
}

.hero-note {
  display:flex;
  gap:10px;
  align-items:center;
  font-size:15px!important;
  margin-top:20px;
  margin-bottom:0;
}

.hero-note svg {
  width:20px;
  height:20px;
  flex-shrink:0;
}

.button,button {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:12px;
  background:var(--accent);
  border:1px solid var(--accent);
  color:var(--white);
  border-radius:6px;
  font:650 16px/1.5 'Source Sans 3','Segoe UI',Arial,sans-serif;
  min-height:48px;
  padding:12px 22px;
  text-decoration:none;
  cursor:pointer;
}

.button svg {
  width:20px;
  height:20px;
}

.button:hover,button:hover {
  background:var(--ink);
  color:var(--white);
}

button:disabled {
  background:var(--muted);
  border-color:var(--muted);
  cursor:wait;
}

.section {
  padding:32px 0;
}

.section-heading {
  margin-bottom:24px;
}

.section-heading h2 {
  margin-bottom:8px;
}

.section-heading p {
  color:var(--muted);
  margin:0;
}

.tool-icon {
  color:var(--accent);
  margin-bottom:24px;
}

.tool-icon svg {
  width:28px;
  height:28px;
}

.travel-notes {
  display:grid;
  gap:32px;
  padding:48px 0;
}

.photo-placeholder {
  margin:0;
  background:var(--light);
  border:1px dashed var(--jade);
  border-radius:var(--radius);
  width:100%;
  max-width:340px;
  min-height:220px;
  max-height:255px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  padding:24px;
  gap:12px;
  color:var(--jade);
}

.photo-placeholder svg {
  width:40px;
  height:40px;
}

.photo-placeholder figcaption {
  max-width:260px;
  font-size:15px;
}

.topics {
  display:grid;
  gap:24px;
}

.topics article {
  border-bottom:1px solid var(--line);
  padding-bottom:16px;
}

.topics h3 {
  margin-bottom:8px;
}

.topics p {
  color:var(--muted);
  margin-bottom:8px;
}

.topics a {
  display:inline-flex;
  align-items:center;
  min-height:44px;
  font-weight:600;
}

.breadcrumbs {
  padding:20px 0;
  font-size:14px;
  color:var(--muted);
}

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

.breadcrumbs li+li:before {
  content:'/';
  margin-right:10px;
}

.breadcrumbs li {
  display:flex;
  align-items:center;
  min-width:0;
}

.page-head {
  padding:16px 0 24px;
  border-bottom:1px solid var(--line);
  margin-bottom:32px;
}

.page-head h1 {
  font-size:clamp(36px,4.1vw,56px);
  max-width:1000px;
}

.lede {
  font-size:20px;
  color:var(--muted);
  max-width:740px;
}

.verified {
  font-size:14px;
  color:var(--muted);
  max-width:80ch;
}

.tool-layout {
  display:grid;
  grid-template-columns:minmax(0,1fr);
  gap:24px;
  align-items:start;
  margin:24px 0 40px;
}

/* Allow content to shrink below a comparison table's intrinsic width. */
.tool-layout > * {
  min-width:0;
}

.panel {
  min-width:0;
  padding:24px;
  background:var(--white);
  border:1px solid var(--line);
  border-radius:var(--radius);
}

.panel h2 {
  font-size:28px;
}

.fields {
  display:grid;
  gap:20px;
}

label,legend {
  font-size:15px;
  font-weight:650;
}

label {
  display:block;
}

input,select {
  display:block;
  width:100%;
  min-width:0;
  max-width:100%;
  font:16px 'Source Sans 3','Segoe UI',Arial,sans-serif;
  padding:12px;
  border:1px solid var(--control);
  border-radius:6px;
  background:var(--white);
  color:var(--ink);
  margin-top:8px;
  min-height:48px;
}

input[type=checkbox] {
  width:20px;
  min-width:20px;
  min-height:20px;
  height:20px;
  margin:3px 12px 0 0;
  accent-color:var(--accent);
}

.check {
  display:flex;
  align-items:flex-start;
  min-height:44px;
  margin:20px 0;
  font-weight:400;
  font-size:15px;
}

.wide {
  grid-column:1/-1;
}

form button {
  margin-top:24px;
  width:100%;
}

.hint {
  font-size:15px;
  color:var(--muted);
  font-weight:400;
  margin-top:8px;
}

.result {
  background:var(--light);
  border-top:4px solid var(--jade);
  min-height:230px;
  overflow-wrap:anywhere;
}

.result h2 {
  font-size:28px;
}

.result .big {
  font:700 36px/1.2 'Source Sans 3',sans-serif;
  margin:20px 0;
}

.result dl {
  display:grid;
  grid-template-columns:1fr auto;
  gap:8px;
}

.result dd {
  margin:0;
  font-weight:700;
}

.result ul {
  padding-left:20px;
}

.notice {
  border-left:4px solid var(--ink);
  border-radius:0 8px 8px 0;
  padding:20px 24px;
  background:var(--note);
  font-size:15px;
  margin:24px 0;
}

.notice a {
  color:var(--ink);
  font-weight:650;
}

.error {
  color:var(--error);
}

.prose {
  max-width:68ch;
  padding-bottom:48px;
  overflow-wrap:anywhere;
}

.prose h2 {
  margin-top:40px;
}

.sources {
  font-size:15px;
  padding-left:20px;
}

.sources li {
  margin-bottom:12px;
  overflow-wrap:anywhere;
}

details {
  margin:20px 0;
  border-bottom:1px solid var(--line);
}

summary {
  cursor:pointer;
  font-weight:650;
  padding:12px 0;
  min-height:48px;
}

table {
  border-collapse:collapse;
  width:100%;
  font-size:15px;
}

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

th {
  background:var(--paper);
}

.table-scroll {
  overflow-x:auto;
  max-width:100%;
}

fieldset {
  border:1px solid var(--line);
  border-radius:8px;
  margin:20px 0;
  padding:16px;
  min-width:0;
}

legend {
  padding:0 8px;
}

.day {
  border-bottom:1px solid var(--line);
  padding:20px 0;
}

.day h3 {
  margin-bottom:8px;
}

.day p {
  font-size:15px;
  margin-bottom:8px;
}

.affiliate-box {
  padding:24px;
  border:1px dashed var(--control);
  font-size:15px;
  color:var(--muted);
  border-radius:8px;
  margin:32px 0;
}

.site-footer {
  background:var(--paper);
  border-top:1px solid var(--line);
  padding:40px 0;
  margin-top:48px;
}

.footer-top {
  display:flex;
  flex-direction:column;
  gap:24px;
}

.site-footer p {
  font-size:15px;
  max-width:400px;
  color:var(--muted);
  margin-top:16px;
}

.footer-links {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px 24px;
  max-width:500px;
  font-size:15px;
}

.footer-bottom {
  font-size:14px;
  color:var(--muted);
  margin-top:32px;
  border-top:1px solid var(--line);
  padding-top:24px;
  overflow-wrap:anywhere;
}

svg {
  fill:none;
  stroke:currentColor;
  stroke-width:2;
  stroke-linecap:round;
  stroke-linejoin:round;
  vertical-align:middle;
}

@media(min-width:600px) {
  .fields {
    grid-template-columns:1fr 1fr;
  }

  .wrap {
    padding:0 32px;
  }

  .section-heading {
    display:flex;
    justify-content:space-between;
    align-items:baseline;
    gap:24px;
  }

}

@media(min-width:900px) {
  .wrap {
    padding:0 40px;
  }

  .header-inner {
    min-height:96px;
  }

  .hero {
    grid-template-columns:1.25fr 1fr;
    gap:64px;
    padding:64px 0 48px;
  }

  .section {
    padding:40px 0;
  }

  .travel-notes {
    grid-template-columns:340px 1fr;
    gap:64px;
    padding:48px 0;
  }

  .tool-layout {
    grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);
    gap:32px;
  }

  .panel {
    padding:32px;
  }

  .footer-top {
    flex-direction:row;
    justify-content:space-between;
  }

  .footer-links {
    min-width:380px;
  }

  .page-head {
    padding:24px 0 32px;
  }

}

@media(prefers-reduced-motion:reduce) {
  html {
    scroll-behavior:auto;
  }

  *,*::before,*::after {
    transition:none!important;
    animation:none!important;
  }

}

[hidden] {
  display:none!important;
}

.brand {
  display:inline-flex;
  align-items:center;
  gap:10px;
  min-height:44px;
  font-size:28px;
  line-height:1;
  letter-spacing:-1px;
  text-decoration:none;
  color:var(--ink);
}

.brand span {
  font-weight:450;
}

.brand b {
  font-weight:800;
  color:var(--jade);
}

.brand-mark {
  width:32px;
  height:32px;
  flex-shrink:0;
  color:var(--jade);
}

.brand:focus-visible {
  outline-offset:6px;
}

.route-map {
  min-width:0;
  background:var(--light);
  border-radius:24px 24px 64px 24px;
  padding:28px;
  color:var(--ink);
}

.route-map h2 {
  font-size:30px;
  margin-bottom:8px;
}

.route-map p {
  font-size:16px;
  margin-bottom:0;
  color:var(--muted);
}

.arrival-map {
  width:100%;
  height:auto;
  display:block;
  margin:12px 0;
}

.map-track {
  stroke:var(--jade);
  stroke-width:5;
  fill:none;
}

.map-stops circle {
  fill:var(--white);
  stroke:var(--ink);
  stroke-width:4;
}

.map-labels {
  fill:var(--ink);
  stroke:none;
  font:650 21px 'Source Sans 3',sans-serif;
}

.map-directions {
  stroke:var(--jade);
  stroke-width:3;
}

.route-map .map-caption {
  font-size:15px;
}

.toolkit-grid {
  display:grid;
  gap:24px;
}

.primary-tool {
  background:var(--jade);
  color:var(--white);
  padding:32px;
  border-radius:12px;
}

.primary-tool h3 {
  font-size:32px;
  max-width:20ch;
}

.primary-tool p {
  max-width:48ch;
}

.primary-tool .tool-icon {
  color:var(--white);
  margin-bottom:20px;
}

.primary-tool .button {
  background:var(--white);
  color:var(--jade);
  border-color:var(--white);
}

.primary-tool .button:hover {
  background:var(--light);
}

.primary-tool :focus-visible {
  outline-color:var(--white);
}

.secondary-tools {
  display:grid;
  gap:24px;
}

.secondary-tools article {
  border-bottom:1px solid var(--line);
  padding:8px 0 24px;
}

.secondary-tools h3 {
  margin-bottom:12px;
}

.secondary-tools p {
  color:var(--muted);
  margin-bottom:8px;
  max-width:52ch;
}

.secondary-tools a {
  display:inline-flex;
  align-items:center;
  min-height:44px;
  font-weight:650;
}

.guide-list {
  list-style:none;
  padding:0;
  margin:0;
  display:grid;
  gap:24px;
}

.guide-list li {
  border-top:1px solid var(--line);
  padding-top:20px;
}

.guide-list h3 {
  font-size:23px;
  margin-bottom:8px;
}

.guide-list span,.coming-soon {
  font-size:15px;
  color:var(--muted);
}

.editorial-note {
  padding:24px;
  background:var(--paper);
  border-left:3px solid var(--jade);
  max-width:80ch;
}

.editorial-note p {
  margin:8px 0 0;
}

.result-column {
  min-width:0;
}

.tool-notes {
  max-width:none;
  padding-bottom:0;
}

.tool-notes h2 {
  font-size:26px;
}

.tool-notes .notice {
  margin-top:24px;
}

.result dd {
  text-align:right;
}

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

.secondary-button {
  background:var(--white);
  color:var(--jade);
}

.secondary-button:hover {
  background:var(--light);
  color:var(--ink);
}

a:hover {
  text-decoration-thickness:2px;
}

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

@media(min-width:900px) {
  .toolkit-grid {
    grid-template-columns:1.1fr 1fr;
    gap:40px;
  }

  .guide-list {
    grid-template-columns:repeat(3,1fr);
  }

  .primary-tool {
    padding:40px;
  }

  .tool-layout {
    grid-template-columns:1fr 1.1fr;
  }

  .travel-notes {
    align-items:start;
  }

}

@media(max-width:599px) {
  .header-inner {
    gap:8px;
  }

  .header-inner nav {
    width:100%;
    gap:4px 14px;
  }

  .hero h1 {
    font-size:48px;
  }

  .hero {
    padding-top:32px;
  }

  .route-map {
    padding:24px 20px;
    border-radius:16px 16px 44px 16px;
  }

  .map-labels {
    font-size:25px;
  }

  .page-head h1 {
    font-size:36px;
    overflow-wrap:anywhere;
  }

  .page-head .lede {
    font-size:18px;
  }

  .panel {
    padding:20px;
  }

  .panel h2 {
    font-size:25px;
  }

  .result dl {
    font-size:15px;
    gap:12px;
  }

  .prose h2 {
    font-size:28px;
  }

  .photo-placeholder {
    max-width:300px;
    min-height:200px;
  }

  .disclosure {
    line-height:1.5;
  }

  .primary-tool {
    padding:28px;
  }

  .primary-tool .button {
    width:100%;
  }

}


/* Guides: quiet section rail and a readable long-form column, Round 4 tokens. */
.guide-layout {
  display:grid;
  gap:24px 64px;
  padding-bottom:64px;
  align-items:start;
}
.guide-contents {
  border-top:3px solid var(--jade);
  border-bottom:1px solid var(--line);
  padding:20px 0;
}
.guide-contents nav,.guide-related {
  display:flex;
  flex-direction:column;
  gap:4px;
  align-items:flex-start;
}
.guide-contents h2,.guide-related h2 {
  font-size:23px;
  margin:0 0 12px;
}
.guide-contents a,.guide-related a {
  min-height:44px;
  align-items:center;
}
.guide-article {
  min-width:0;
  max-width:72ch;
  overflow-wrap:anywhere;
}
.guide-article section {
  margin-top:48px;
  scroll-margin-top:24px;
}
.guide-article h2 {
  line-height:1.2;
  text-wrap:balance;
}
.guide-date {
  margin:0 0 24px;
  color:var(--muted);
  font-size:15px;
}
.guide-article p,.exemption-list li {
  line-height:1.75;
}
.guide-article .notice {
  margin-top:0;
  font-size:16px;
}
.guide-article .notice h2 {
  font-size:26px;
  margin-top:0;
}
.citation {
  font-size:15px;
  white-space:normal;
}
.exemption-list {
  padding-left:24px;
}
.exemption-list li {
  margin:16px 0;
}
.guide-cta {
  background:var(--light);
  border-top:4px solid var(--jade);
  padding:24px;
}
.guide-cta h2 {
  margin-top:0;
}
.guide-related {
  border-top:1px solid var(--line);
  margin-top:48px;
  padding-top:24px;
}
.esim-comparison {
  min-width:540px;
}
.esim-comparison th:first-child {
  width:22%;
}
.esim-comparison caption {
  text-align:left;
  font-weight:650;
  padding-bottom:12px;
}
.partner-placeholders {
  display:grid;
  gap:16px;
}
.partner-placeholder {
  padding:24px;
  background:var(--paper);
  border:1px dashed var(--control);
  border-radius:8px;
  font-weight:650;
}
@media(min-width:900px) {
  .guide-layout {
    grid-template-columns:240px minmax(0,1fr);
  }
  .guide-contents {
    margin-top:0;
  }
  .guide-article {
    font-size:18px;
  }
  .partner-placeholders {
    grid-template-columns:1fr 1fr;
  }
}

/* Keep the article close on small screens; section links remain one tap away. */
.guide-contents .desktop-contents {
  display:none;
}
.guide-contents .mobile-contents {
  margin:0;
  border:0;
}
.mobile-contents summary {
  padding:0;
  display:list-item;
  min-height:44px;
  align-content:center;
  font-size:18px;
}
@media(min-width:900px) {
  .guide-contents .desktop-contents {
    display:flex;
  }
  .guide-contents .mobile-contents {
    display:none;
  }
}

/* Comparison cells retain whole words; narrow screens scroll within the region.
   border-collapse:separate is required so sticky first-column cells actually cover scrolling cells. */
.table-scroll table {
  min-width:520px;
  overflow-wrap:normal;
  word-break:normal;
  border-collapse:separate;
  border-spacing:0;
}

/* Keep the first column visible while the remaining columns scroll. */
.table-scroll th:first-child,
.table-scroll td:first-child {
  position:sticky;
  left:0;
  z-index:1;
  background:var(--white);
  box-shadow:1px 0 0 var(--line);
}
.table-scroll thead th:first-child {
  background:var(--paper);
  z-index:2;
}

@media (max-width:599px) {
  .table-scroll th,
  .table-scroll td {
    padding:10px 8px;
  }
}

.table-scroll table.plan-compare {
  min-width:0;
}
.plan-compare td {
  text-align:right;
  white-space:nowrap;
  font-variant-numeric:tabular-nums;
}

.related-guides {
  border-top:1px solid var(--line);
  padding:24px 0 40px;
}

.related-guides li {
  margin:12px 0;
}

@media(min-width:900px) {
  .tool-notes {
    grid-column:1 / -1;
  }

  .tool-notes > p,
  .tool-notes > ul {
    max-width:80ch;
  }
}

/* Plain-text itinerary follows the existing form scale. */
#plan-text {
  box-sizing: border-box;
  width: 100%;
  min-height: 240px;
  font: inherit;
  color: inherit;
  padding: 12px;
  border: 1px solid #73847A;
  border-radius: 8px;
  resize: vertical;
}
#plan-text:focus-visible {
  outline: 3px solid #155D49;
  outline-offset: 3px;
}

/* Queue 5–8: preserve normal-flow results and contain the wide comparison. */
[data-queue-tool] .check {
 display: flex;
 align-items: center;
 gap: 12px;
 min-height: 48px;
}
[data-queue-tool] input[type="checkbox"] {
 width: 24px;
 height: 24px;
 flex-shrink: 0;
}
[data-queue-tool] ~ noscript {
 display: block;
 margin-top: 16px;
}
.result .table-scroll {
 max-width: 100%;
 overflow-x: auto;
}
[data-queue-tool="wall"] .result table {
 min-width: 820px;
}
[data-queue-tool="wall"] .result table td {
 min-width: 180px;
 vertical-align: top;
}

/* Text-heavy 2–3 column tables should wrap, not force a 520–820px min-width. */
.table-scroll table.wrap-table {
  min-width: 0;
  width: 100%;
  overflow-wrap: break-word;
  word-break: normal;
  border-collapse: collapse;
}
.table-scroll table.wrap-table th:first-child,
.table-scroll table.wrap-table td:first-child {
  position: static;
  box-shadow: none;
}
.table-scroll table.wrap-table th,
.table-scroll table.wrap-table td {
  white-space: normal;
  vertical-align: top;
}
#plan-text {
 width: 100%;
 max-width: 100%;
}

[data-queue-tool="budget"] fieldset {
  grid-column: 1 / -1;
}

[data-queue-tool="budget"] fieldset > label:not(.check) + label,
[data-queue-tool="budget"] fieldset > small + label {
  margin-top: 12px;
}

[data-queue-tool="budget"] fieldset > small {
  display: block;
  font-size: 15px;
}
