:root {
  --ink: #2c3847;
  --muted: #6d7b88;
  --line: #e6eef3;
  --bg: #f6f8fb;
  --white: #ffffff;
  --mint: #00a894;
  --mint-deep: #00977f;
  --btn: linear-gradient(135deg, #7adcb4 0%, #00d082 100%);
  --lav: #f6eefc;
  --lav-ink: #8f4ec7;
  --soft: #e8f8f4;
  --shadow: 0 16px 40px rgba(44, 56, 71, 0.06);
  --radius: 16px;
  --font: "Work Sans", "Noto Sans SC", sans-serif;
  --header: 72px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--white);
  line-height: 1.6;
}
img { max-width: 100%; display: block; }
button, input, select { font-family: inherit; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: 0; background: none; }

.wrap { width: min(1160px, calc(100% - 40px)); margin: 0 auto; }

.topbar {
  background: #f3fbf8;
  color: var(--mint-deep);
  font-size: 13px;
  text-align: center;
  padding: 8px 16px;
}
.topbar a { color: var(--mint-deep); font-weight: 600; }

.header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: auto;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(230, 238, 243, 0.9);
}
#countries-section,
#library,
#trade,
#how,
#faq-section,
#contract-panel {
  scroll-margin-top: 88px;
}
.header-inner {
  height: var(--header);
  display: flex;
  align-items: center;
  gap: 28px;
}
.brand { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.brand img { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; }
.brand-name { font-weight: 600; font-size: 18px; letter-spacing: -0.02em; color: var(--mint); }
.brand-sub { display: block; font-size: 11px; font-weight: 500; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; margin-top: -2px; }

.nav { display: flex; align-items: center; gap: 22px; margin-left: auto; }
.nav a { font-size: 15px; color: #4d5b68; font-weight: 500; }
.nav a:hover { color: var(--mint); }
.nav a.on-page { color: var(--mint); font-weight: 600; }

.subnav {
  background: #f4faf8;
  border-top: 1px solid var(--line);
}
.subnav-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0 10px;
  overflow-x: auto;
}
.subnav a {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 600;
  color: #4d5b68;
  padding: 6px 14px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
}
.subnav a:hover { color: var(--mint); border-color: var(--mint); }
.home-page #countries-section,
.home-page #library,
.home-page #trade,
.home-page #how,
.home-page #faq-section,
.home-page #contract-panel {
  scroll-margin-top: 132px;
}
.header-tools { display: flex; align-items: center; gap: 10px; }

.lang {
  display: flex;
  background: var(--bg);
  border-radius: 999px;
  padding: 3px;
}
.lang button {
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.lang button.on { background: white; color: var(--ink); box-shadow: 0 1px 4px rgba(44,56,71,.08); }
.lang-short { display: none; }
html.inapp .header { position: relative; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 10px;
  padding: 12px 22px;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.02em;
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--btn); color: white; box-shadow: 0 8px 18px rgba(0, 208, 130, 0.25); }
.btn-ghost { background: var(--lav); color: var(--lav-ink); }
.btn-line { background: white; color: var(--ink); border: 1px solid var(--line); }
.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 8px; }

.menu-btn { display: none; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); }
.menu-btn span { display: block; width: 16px; height: 1.5px; background: var(--ink); margin: 4px auto; }

.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(900px 420px at 8% 0%, rgba(122, 220, 180, 0.18), transparent 60%),
    linear-gradient(#fff, #f8fbfc);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: 24px;
  padding: 36px 0 28px;
}
.kicker {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.04em;
}
.hero h1 {
  font-size: clamp(36px, 4.4vw, 52px);
  line-height: 1.15;
  font-weight: 500;
  letter-spacing: -0.03em;
  margin: 10px 0 14px;
  color: #243140;
}
.hero h1 em { font-style: normal; color: var(--mint); }
.lede { font-size: 17px; color: #5c6b78; max-width: 520px; }
.hero-actions { display: flex; gap: 12px; margin-top: 26px; flex-wrap: wrap; }
.hero-art { position: relative; min-height: 320px; }
.hero-art img { width: 100%; height: 420px; object-fit: contain; object-position: center; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  background: white;
}
.stat { padding: 18px 8px; text-align: center; }
.stat strong { display: block; font-size: 22px; font-weight: 600; color: var(--ink); }
.stat span { font-size: 13px; color: var(--muted); }

.section { padding: 72px 0; }
.section.alt { background: var(--bg); }
.section-head { text-align: center; margin-bottom: 32px; }
.section-head h2 {
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 500;
  letter-spacing: -0.03em;
  margin-top: 6px;
}
.section-head p { color: var(--muted); margin-top: 8px; }

.finder {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1.4fr auto;
  gap: 10px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 10px;
  box-shadow: var(--shadow);
  margin: 22px auto 0;
  position: relative;
  z-index: 2;
}
.field { display: flex; flex-direction: column; gap: 4px; padding: 6px 12px; }
.field label { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.field select, .field input {
  border: 0;
  outline: none;
  font-size: 15px;
  color: var(--ink);
  background: transparent;
  width: 100%;
}
.finder .btn { align-self: center; margin-right: 4px; }

.country-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}
.country {
  text-align: left;
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 14px 12px;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.country:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.country.on {
  border-color: #7adcb4;
  background: #f4fbf8;
  box-shadow: 0 0 0 3px rgba(0, 208, 130, 0.12);
}
.flag { font-size: 26px; line-height: 1; }
.country .name { display: block; margin-top: 8px; font-weight: 600; font-size: 15px; }
.country .sys { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }

.library {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 18px;
  align-items: start;
}
.industries {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px;
  position: sticky;
  top: calc(var(--header) + 16px);
}
.industries button {
  width: 100%;
  text-align: left;
  padding: 11px 12px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #415060;
  font-weight: 500;
  font-size: 14px;
}
.industries button.on { background: var(--soft); color: var(--mint-deep); }
.industries button span { color: var(--muted); font-size: 12px; font-weight: 600; }

.panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  min-height: 420px;
}
.panel-top { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 18px; }
.panel-top h3 { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.panel-top p { color: var(--muted); font-size: 14px; margin-top: 4px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  font-size: 12px;
  font-weight: 600;
  color: var(--mint-deep);
  background: var(--soft);
  border-radius: 999px;
  padding: 4px 10px;
}
.ready {
  display: inline-block;
  margin-left: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--mint-deep);
  background: var(--soft);
  border-radius: 999px;
  padding: 2px 8px;
  vertical-align: 2px;
}
.ready.tag-sample { color: #3d5a80; background: #e8eef6; }
.ready.tag-popular { color: #9a3412; background: #ffedd5; }
.ready.tag-official { color: #1e3a5f; background: #e0e7ff; }
.ready.tag-featured { color: #854d0e; background: #fef9c3; }
.ready.tag-new { color: #9f1239; background: #ffe4e6; }
.ready.tag-bilingual { color: #134e4a; background: #ccfbf1; }
.ready.tag-fillin { color: #167a58; background: var(--soft); }

.templates { display: flex; flex-direction: column; gap: 10px; }
.template {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 14px;
}
.template h4 { font-size: 16px; font-weight: 600; }
.template p { font-size: 13px; color: var(--muted); margin-top: 2px; }
.template-actions { display: flex; gap: 8px; }

.trade-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.trade {
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 210px;
}
.trade .badge {
  align-self: flex-start;
  font-size: 12px;
  font-weight: 600;
  color: var(--lav-ink);
  background: var(--lav);
  border-radius: 999px;
  padding: 4px 10px;
}
.trade h3 { font-size: 18px; font-weight: 600; letter-spacing: -0.02em; }
.trade p { color: var(--muted); font-size: 14px; flex: 1; }
.trade .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.step {
  background: white;
  border-radius: 16px;
  padding: 20px;
  border: 1px solid var(--line);
}
.step i {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--soft);
  color: var(--mint-deep);
  font-style: normal;
  font-weight: 700;
}
.step h3 { margin: 14px 0 6px; font-size: 17px; font-weight: 600; }
.step p { color: var(--muted); font-size: 14px; }

.cta {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 24px;
  align-items: center;
  background:
    radial-gradient(500px 180px at 90% 0%, rgba(143, 78, 199, 0.12), transparent 60%),
    linear-gradient(135deg, #f3fbf8, #ffffff);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 36px;
}
.cta h2 { font-size: 32px; font-weight: 500; letter-spacing: -0.03em; }
.cta p { color: #5c6b78; margin: 8px 0 18px; }
.note { font-size: 13px; color: var(--muted); }
#modal-hint:empty { display: none; }
body, body * {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
input, textarea {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

.faq { max-width: 760px; margin: 0 auto; }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item button {
  width: 100%;
  text-align: left;
  padding: 18px 0;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}
.faq-item .a { display: none; color: var(--muted); padding: 0 0 16px; font-size: 15px; }
.faq-item.open .a { display: block; }
.faq-item .mark { color: var(--mint); font-weight: 500; }

.footer { background: #1e2a36; color: #d5dee6; padding: 48px 0 24px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 24px; }
.footer h3 { color: white; font-size: 14px; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 12px; font-weight: 600; }
.footer a, .footer p { display: block; color: #b7c3ce; font-size: 14px; margin: 8px 0; }
.footer a:hover { color: white; }
.footer-brand { display: flex; gap: 10px; align-items: center; color: white; font-weight: 600; margin-bottom: 10px; }
.footer-brand img { width: 32px; height: 32px; border-radius: 8px; }
.legal { margin-top: 28px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.08); font-size: 12px; color: #8ea0b0; }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(30, 42, 54, 0.45);
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .22s ease, visibility .22s ease;
}
.modal.open { opacity: 1; visibility: visible; pointer-events: auto; }
.sheet {
  width: min(640px, 100%);
  background: white;
  border-radius: 18px;
  padding: 24px;
  max-height: min(84vh, 760px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,.18);
  transform: translateY(14px);
  transition: transform .22s ease;
}
.modal.open .sheet { transform: none; }
.preview-wait {
  min-height: 220px;
  display: grid;
  place-items: center;
}
.preview-wait-in {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-family: "Work Sans", "Noto Sans SC", sans-serif;
}
.preview-wait-in i {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid #e6eef3;
  border-top-color: #00a894;
  animation: btn-spin .8s linear infinite;
}
.preview-wait-in p { margin: 0; font-size: 14px; }
.sheet-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.sheet h3 { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.sheet .meta { color: var(--muted); font-size: 13px; margin: 6px 0 14px; }
.outline { background: var(--bg); border-radius: 12px; padding: 14px 16px; }
.outline li { margin: 6px 0 6px 18px; font-size: 14px; }
.doc-view {
  max-height: none;
  overflow: auto;
  background: #fff;
  border-radius: 12px;
  padding: 22px 28px 32px;
  font-family: "Times New Roman", Times, serif;
  font-size: 15px;
  line-height: 1.55;
}
.doc-view h1 { font-size: 22px; text-align: center; font-weight: 600; }
.doc-view h2 { font-size: 17px; margin-top: 1.1em; }
.doc-view h3 { font-size: 15px; margin: 0.8em 0 0.15em; }
.doc-view p { margin: 0.35em 0; }
.doc-view .blank { display: inline-block; min-width: 160px; border-bottom: 1px solid #1c2430; }
.doc-view table { width: 100%; border-collapse: collapse; margin: 12px 0 20px; }
.doc-view td, .doc-view th { border: 1px solid #c5d0d8; padding: 8px; text-align: left; vertical-align: bottom; }
.doc-view td.blank { height: 32px; }
.preview-lock { max-height: 460px; overflow: auto; position: relative; }
.preview-gate {
  position: sticky;
  bottom: 0;
  z-index: 1;
  margin: 10px -28px -32px;
  padding: 42px 16px 14px;
  text-align: center;
  background: linear-gradient(to bottom, rgba(255,255,255,0), #fff 46%);
  font-family: "Segoe UI", sans-serif;
}
.outline.preview-lock .preview-gate {
  margin: 10px -16px -14px;
  background: linear-gradient(to bottom, rgba(255,255,255,0), var(--bg) 46%);
}
.preview-gate p { margin: 0 0 10px; font-size: 14px; line-height: 1.45; }
#file-load {
  display: none;
}
#file-load.on {
  display: flex;
  position: fixed;
  inset: 0;
  z-index: 120;
  background: #fff;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 14px;
  color: #2c3847;
  font-size: 15px;
}
#file-load i {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid #e6eef3;
  border-top-color: #00a894;
  animation: btn-spin .8s linear infinite;
}
#download-note {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 70;
  max-width: min(440px, calc(100% - 32px));
  background: #1c2430;
  color: white;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.45;
}
#profile-verify { margin: -6px 0 12px; color: var(--muted); font-size: 13px; }
.words { font-variant-numeric: tabular-nums; }
.sheet-top, .sheet .meta, .sheet .note { flex: 0 0 auto; }
#modal-outline,
#modal-outline.doc-view,
#modal-outline.preview-lock {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow: auto;
}
.sheet-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; justify-content: flex-end; flex: 0 0 auto; }
.close-x { width: 36px; height: 36px; border-radius: 10px; background: var(--bg); font-size: 18px; }

.empty { padding: 40px 10px; text-align: center; color: var(--muted); }

#login-btn {
  max-width: 148px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#login-btn.user-name {
  background: var(--soft);
  color: var(--mint-deep);
  border-color: transparent;
}
html.sheet-open body {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
  top: calc(-1 * var(--scroll-y, 0px));
  overflow: hidden;
}
.login-mask {
  position: fixed;
  inset: 0;
  background: rgba(30, 42, 54, 0.45);
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overscroll-behavior: none;
}
.login-mask.open { display: flex; }
.login-sheet {
  width: min(440px, 100%);
  max-height: min(88vh, 760px);
  overflow: auto;
  overscroll-behavior: contain;
  background: white;
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 24px 80px rgba(0,0,0,.18);
}
.login-or { margin: 14px 0 2px; text-align: center; color: var(--muted); font-size: 12px; }
#login-app { width: 100%; text-decoration: none; }
#login-app.pending, .btn.busy { pointer-events: none; }
.btn-spin {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.45);
  border-top-color: #fff;
  animation: btn-spin .7s linear infinite;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }
.login-status.busy {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.login-status.busy::before {
  content: "";
  width: 14px;
  height: 14px;
  margin-top: 2px;
  flex: 0 0 14px;
  border-radius: 50%;
  border: 2px solid #d7efe9;
  border-top-color: #00a894;
  animation: btn-spin .7s linear infinite;
}
#login-getapp { display: none; width: 100%; margin-top: 10px; }
#login-getapp.show { display: inline-flex; }
#pay-mask { z-index: 90; }
.pay-kicker { margin: 14px 0 6px; font-size: 13px; color: var(--muted); }
.pay-row { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.pay-row span { color: var(--muted); }
.pay-method {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 14px;
  padding: 12px 14px;
  border: 1px solid #00a894;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
}
.pay-method .dot {
  margin-left: auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #00a894;
  box-shadow: inset 0 0 0 4px white;
  border: 2px solid #00a894;
}
.pay-short { color: #d14343; font-size: 13px; min-height: 18px; margin: 0 0 8px; }
#pay-ok { flex: 1; }
html.no-app-login #login-app,
html.no-app-login #login-status,
html.no-app-login .login-or { display: none; }
.profile-sheet .coupon-card { margin-top: 12px; }
.profile-sheet h4 { margin: 18px 0 6px; font-size: 16px; }
.profile-list { margin-top: 8px; }
#profile-logout { width: 100%; margin-top: 16px; }
.login-sheet h3 { font-size: 22px; font-weight: 600; }
.login-sheet .lead { color: var(--muted); font-size: 14px; margin: 8px 0 16px; }
.login-sheet label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 6px; }
.login-sheet input {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 12px;
  font-size: 15px;
}
.login-actions { display: flex; gap: 10px; margin-top: 16px; }
.login-actions .btn { flex: 1; }
.login-status { min-height: 22px; margin-top: 10px; font-size: 13px; color: var(--mint-deep); }
.login-error { color: #d14343; font-size: 13px; min-height: 20px; margin-top: 8px; }
.login-note { margin-top: 14px; font-size: 13px; color: var(--muted); }
.login-note a { color: var(--mint-deep); font-weight: 600; }
.account-page { background: var(--bg); min-height: 100vh; }
.account-main { padding: 28px 0 48px; }
.profile-card, .coupon-card, .contract-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.profile-card { display: flex; gap: 16px; align-items: center; padding: 20px; }
.profile-card img { width: 64px; height: 64px; border-radius: 16px; object-fit: cover; background: var(--soft); }
.profile-card h1 { font-size: 24px; font-weight: 600; }
.profile-card p { color: var(--muted); font-size: 14px; }
.coupon-card { margin-top: 16px; padding: 18px 20px; display: flex; justify-content: space-between; align-items: center; }
.coupon-card strong { font-size: 28px; color: var(--mint-deep); }
.contract-head { margin: 28px 0 12px; }
.contract-card { padding: 16px 18px; margin-bottom: 12px; }
.contract-card h3 { font-size: 16px; font-weight: 600; }
.contract-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.status-pill { font-size: 12px; font-weight: 700; }
.party { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: #4d5b68; margin-top: 8px; }
.party .signed { color: #009933; }
.contract-meta { margin-top: 8px; color: var(--muted); font-size: 12px; }
.account-empty, .account-gate { padding: 28px 8px; color: var(--muted); }

@media (max-width: 980px) {
  html, body {
    overflow-x: clip;
    max-width: 100%;
    overscroll-behavior-x: none;
  }
  body { width: 100%; position: relative; }
  .header, .topbar, .subnav, .wrap, main, footer { max-width: 100%; min-width: 0; }
  .topbar { overflow-wrap: anywhere; }
  .header-inner { gap: 8px; min-width: 0; }
  .brand { flex: 0 1 auto; min-width: 0; max-width: 46%; gap: 8px; }
  .brand > span { min-width: 0; display: block; }
  .brand-name, .brand-sub {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .lang-full { display: none; }
  .lang-short { display: inline; }
  .header-tools {
    flex: 1 1 auto;
    min-width: 0;
    justify-content: flex-end;
    gap: 6px;
  }
  #login-btn {
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
    max-width: 12em;
  }
  .header-tools #app-link {
    min-width: 0;
    max-width: 28vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .subnav { overflow: hidden; }
  .subnav-inner { overscroll-behavior-x: contain; }
  .hero-grid, .library, .trade-grid, .steps, .cta, .footer-grid, .stats { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .country-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .finder { grid-template-columns: 1fr 1fr; }
  .industries { position: static; }
  .hero-art { display: none; }
  .nav { display: none; }
  .nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 50;
    background: white;
    border-bottom: 1px solid var(--line);
    padding: 8px 20px 16px;
    align-items: stretch;
    gap: 0;
  }
  .nav.open a {
    display: block;
    padding: 12px 0;
    border-top: 1px solid var(--line);
  }
  .menu-btn { display: inline-block; }
  .header { position: sticky; }
  .header-inner { position: static; }
}
@media (max-width: 720px) {
  .hero h1 { font-size: 30px; }
  .hero-grid {
    grid-template-columns: 1fr;
    padding: 20px 0 16px;
    gap: 12px;
  }
  .hero-art {
    display: block;
    min-height: 0;
    order: -1;
  }
  .hero-art img {
    height: auto;
    max-height: 220px;
    object-fit: contain;
  }
  .stats, .trade-grid, .steps, .cta, .footer-grid, .library, .country-grid { grid-template-columns: minmax(0, 1fr); }
  .finder { grid-template-columns: 1fr; }
  .template { grid-template-columns: 1fr; }
  .wrap { width: min(1160px, calc(100% - 28px)); }
  .section { padding: 52px 0; }
  .header-tools #app-link { display: none; }
  #login-btn { display: inline-flex; }
  .login-mask { align-items: flex-end; padding: 0; }
  .login-sheet { width: 100%; border-radius: 18px 18px 0 0; max-height: 92vh; }
  .modal { align-items: flex-end; padding: 0; overflow: hidden; touch-action: pan-y; }
  .sheet {
    width: 100%;
    max-height: 92vh;
    border-radius: 18px 18px 0 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 16px 16px 18px;
  }
  .sheet-top, .sheet .meta, .sheet .note { flex: 0 0 auto; max-width: 100%; }
  #modal-outline,
  #modal-outline.doc-view,
  #modal-outline.preview-lock {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    max-width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    touch-action: pan-y;
  }
  .doc-view { padding: 16px 14px 20px; }
  .doc-view table { width: 100%; table-layout: fixed; }
  .doc-view .blank { min-width: 0; max-width: 100%; }
  .doc-view td, .doc-view th, .doc-view p { overflow-wrap: anywhere; }
  .preview-gate { margin-left: 0; margin-right: 0; }
  .sheet-actions { flex: 0 0 auto; justify-content: flex-end; margin-top: 12px; }
  #contract-panel { scroll-margin-top: 88px; }
}

.hub-page { background: #eef2f4; }
.ex-hero { padding: 22px 0 0; background: #eef2f4; }
.ex-hero .hub-search { margin: 12px 0 0; max-width: none; }
.ex-crumb { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.ex-crumb a { color: var(--mint-deep); font-weight: 600; }
.ex-crumb i { margin: 0 8px; font-style: normal; color: #b7c2c8; }
.ex-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px 32px 40px;
  box-shadow: 0 8px 24px rgba(44, 56, 71, 0.04);
}
.ex-panel h1 { font-size: 32px; letter-spacing: -0.03em; margin: 0 0 10px; }
.ex-panel .lede { max-width: 46em; margin: 0 0 28px; color: var(--muted); }
.ex-panel h2 { font-size: 22px; margin: 28px 0 12px; color: var(--mint-deep); }
.ex-panel h3 { font-size: 18px; margin: 22px 0 10px; }
.ex-panel h3 a { color: var(--ink); }
.ex-panel h3 a:hover { color: var(--mint); }
.ex-panel h3 small { color: var(--muted); font-size: 13px; font-weight: 500; }
.ex-cat { padding-bottom: 8px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.ex-cat:last-child { border-bottom: 0; }
.ex-cols {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 32px;
  margin: 0 0 8px;
}
.ex-cols a { color: #1a6bb8; font-weight: 500; }
.ex-cols a:hover { text-decoration: underline; color: var(--mint-deep); }
.ex-table { width: 100%; border-collapse: collapse; margin-top: 18px; font-size: 14px; }
.ex-table th, .ex-table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.ex-table th { color: var(--muted); font-size: 12px; }
.ex-place {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 12px 0 4px;
}
.ex-place label span { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.ex-place select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
}
.ex-az { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
.ex-az a { min-width: 28px; text-align: center; font-weight: 600; color: var(--mint-deep); }
.ex-read { margin-top: 16px; line-height: 1.65; }
.ex-frame { width: 100%; height: 78vh; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.ex-read h1 { font-size: 22px; }
.ex-src { font-size: 12px; color: var(--muted); margin-bottom: 12px; }
@media (max-width: 720px) {
  .ex-place { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .ex-panel { padding: 20px 16px 28px; }
  .ex-panel h1 { font-size: 26px; }
  .ex-cols { grid-template-columns: 1fr; }
}
.hub-hero { padding: 48px 0 28px; background: linear-gradient(180deg, #f3fbf8 0%, #fff 100%); }
.hub-hero h1 { font-size: 36px; letter-spacing: -0.03em; max-width: 18em; margin: 8px 0 12px; }
.hub-search { display: grid; grid-template-columns: 1fr auto; gap: 10px; max-width: 720px; margin-top: 22px; }
.hub-search input {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 15px;
  background: #fff;
}
.hub-featured { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.hub-card, .hub-block, .hub-sector {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
}
.hub-card h3 { font-size: 16px; margin-bottom: 6px; }
.hub-card p { color: var(--muted); font-size: 13px; min-height: 2.6em; }
.hub-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.hub-links a {
  font-size: 12px;
  font-weight: 600;
  color: var(--mint-deep);
  background: var(--soft);
  border-radius: 999px;
  padding: 4px 10px;
}
.hub-cats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.hub-cats button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 600;
  color: #4d5b68;
}
.hub-cats button span { margin-left: 6px; color: var(--muted); font-weight: 500; }
.hub-cats button.on { background: var(--mint); border-color: var(--mint); color: #fff; }
.hub-cats button.on span { color: rgba(255,255,255,.85); }
.hub-block { margin-bottom: 14px; }
.hub-block header { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.hub-block header span { color: var(--muted); font-size: 13px; }
.hub-block ul { list-style: none; }
.hub-block li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.hub-block em { display: block; font-style: normal; color: var(--muted); font-size: 12px; }
.hub-sectors { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.hub-sector { display: block; }
.hub-sector strong { display: block; }
.hub-sector span { color: var(--muted); font-size: 12px; }
@media (max-width: 980px) {
  .hub-featured { grid-template-columns: 1fr 1fr; }
  .hub-sectors { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .hub-hero h1 { font-size: 28px; }
  .hub-search, .hub-featured, .hub-sectors, .hub-block li { grid-template-columns: 1fr; }
}

.page-curtain {
  position: fixed;
  inset: 0;
  z-index: 180;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  background: #f6f8fb;
  color: var(--ink);
  font-family: var(--font);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.page-curtain img {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 8px 24px rgba(44, 56, 71, 0.08);
}
.page-curtain strong {
  color: var(--mint);
  font-size: 18px;
  letter-spacing: -0.02em;
}
.page-curtain p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}
.page-curtain-bar {
  width: 148px;
  height: 3px;
  border-radius: 99px;
  background: #e6eef3;
  overflow: hidden;
}
.page-curtain-bar i {
  display: block;
  height: 100%;
  width: 42%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7adcb4, #00a894);
  animation: page-bar 1s ease-in-out infinite;
}
html.page-entering .page-curtain {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
html.page-ready .page-curtain {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .42s ease, visibility .42s ease;
}
html.page-leaving .page-curtain {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity .28s ease, visibility .28s ease;
}
html.signing-in .page-curtain { display: none; }
.nav-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 190;
  height: 3px;
  width: 0;
  border-radius: 0 99px 99px 0;
  background: linear-gradient(90deg, #7adcb4, #00a894);
  opacity: 0;
  pointer-events: none;
}
.nav-progress.run { animation: nav-run .72s ease; }
#ex-root.view-in { animation: view-in .42s ease; }
.ex-stage {
  position: relative;
  margin-top: 12px;
  min-height: 78vh;
  border-radius: 8px;
  background: #f6f8fb;
  overflow: hidden;
}
.ex-stage::before,
.ex-stage::after {
  content: "";
  position: absolute;
  top: 46%;
  height: 3px;
  border-radius: 99px;
}
.ex-stage::before {
  left: 22%;
  right: 22%;
  background: #e6eef3;
}
.ex-stage::after {
  left: 22%;
  width: 22%;
  background: #00a894;
  animation: page-bar 1s ease-in-out infinite;
}
.ex-stage .ex-frame {
  position: relative;
  z-index: 1;
  opacity: 0;
  transition: opacity .4s ease;
}
.ex-stage .ex-frame.ex-in { opacity: 1; }
.ex-stage:has(.ex-in)::before,
.ex-stage:has(.ex-in)::after { opacity: 0; transition: opacity .3s ease; }
@keyframes page-bar {
  0% { transform: translateX(-130%); }
  100% { transform: translateX(340%); }
}
@keyframes nav-run {
  0% { width: 0; opacity: 1; }
  65% { width: 72%; opacity: 1; }
  100% { width: 100%; opacity: 0; }
}
@keyframes view-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .page-curtain,
  .nav-progress,
  #ex-root.view-in,
  .ex-stage .ex-frame,
  .ex-stage::after,
  .page-curtain-bar i {
    animation: none !important;
    transition: none !important;
  }
}
