/* ============================================================
   签证照片检查台 — 样式表
   顺序：1 tokens / 2 reset / 3 layout / 4 控制面板 / 5 预览面板
        6 排版面板 / 7 响应式
   同一选择器只在本文件出现一次（响应式段落除外），不使用 !important。
   ============================================================ */

/* ---------- 1. tokens ---------- */
:root {
  --ink: #20252b;
  --muted: #798089;
  --paper: #f4f1ea;
  --panel: #fffdfa;
  --panel-soft: #f8f6f0;
  --card: #faf8f3;
  --line: #dedbd2;
  --line-soft: #eeeae3;
  --accent: #e56f4c;
  --accent-dark: #ba4c31;
  --accent-soft: #fff1eb;
  --ok: #2d8064;
  --warn: #c7832f;
  --shadow: 0 24px 70px rgba(42, 34, 24, .08);
  /* 字号阶梯。原本散着 12 档，其中 10 / 11 / 12px 三档挤在一起用了 36 次 ——
     肉眼分不出差别，改版时却要记三个数。收敛成 6 档，语义命名而不是尺寸命名。
     国旗 emoji、关闭 ×、＋ 号这类是字形尺寸不是文字层级，不进阶梯，保持字面值；
     国家搜索框的 16px 是 iOS 防聚焦缩放的下限，同样不能进阶梯。 */
  --fs-hero: clamp(35px, 5vw, 60px);
  --fs-title: 18px;
  --fs-body: 13px;
  --fs-label: 12px;
  --fs-meta: 11px;
  --fs-micro: 10px;
  /* PC 模拟器注入 --safe-area-inset-*，真机走 env()；两端都能取到值。 */
  --safe-bottom: var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px));
  --safe-left: var(--safe-area-inset-left, env(safe-area-inset-left, 0px));
  --safe-right: var(--safe-area-inset-right, env(safe-area-inset-right, 0px));
}

/* ---------- 2. reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; } /* 唯一保留的 !important：压过组件自身的 display */

html {
  min-height: 100%;
  touch-action: manipulation;
}

body {
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
  /* 与 OG 封面同一套字体：中西文都交给 PingFang SC，数字和 mm / KB 这些单位
     不再由 Avenir Next 单独承担，整页字形保持一致。Microsoft YaHei 留作 Windows 兜底。 */
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

button, input { font: inherit; color: inherit; }
ul { padding-left: 16px; }

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

/* ---------- 3. layout ---------- */
.app-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding:
    clamp(8px, 1.2vw, 14px)
    calc(clamp(18px, 4vw, 56px) + var(--safe-right))
    calc(34px + var(--safe-bottom))
    calc(clamp(18px, 4vw, 56px) + var(--safe-left));
}

.hero {
  max-width: 780px;
  padding: clamp(8px, 1.8vw, 18px) 0 28px;
}
.hero h1 {
  font-family: Georgia, "Songti SC", serif;
  font-weight: 400;
  font-size: var(--fs-hero);
  line-height: 1.06;
  letter-spacing: -.055em;
}
.hero h1 em { color: var(--accent); font-style: normal; }

.stepper {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 18px;
  color: #aaa49a;
  font-size: var(--fs-label);
}
.stepper span { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.stepper b {
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  border-radius: 50%;
  background: #e7e2d9;
  font-size: var(--fs-meta);
  color: #8b867c;
}
.stepper i { width: 34px; height: 1px; background: var(--line); }
.stepper .active { color: var(--ink); font-weight: 700; }
.stepper .active b { background: var(--accent); color: #fff; }

.workspace {
  display: grid;
  grid-template-columns: minmax(360px, .78fr) minmax(0, 1.22fr);
  gap: 18px;
  align-items: stretch;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 26px;
  min-width: 0;
}
.panel-heading { display: flex; gap: 13px; align-items: flex-start; }
.panel-heading h2 { font-size: var(--fs-title); font-weight: 700; letter-spacing: -.02em; }
.panel-heading p { margin-top: 5px; font-size: var(--fs-label); color: var(--muted); }
/* 全站只用两个字族：正文黑体 + hero 衬线。步骤号原本为「01 / 02」这 4 个字符
   单开一个 Arial Narrow，而 Android 上根本没有这个字体、回落后窄体效果本就不生效。
   改回正文字族，靠等宽数字和字距还原原来那种编号的节奏。 */
.step {
  padding-top: 4px;
  font-size: var(--fs-meta);
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  letter-spacing: .12em;
}

.footer-note {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  color: #98958d;
  font-size: var(--fs-meta);
  text-align: center;
}

.footer-privacy { margin: -4px 0 0; color: #aaa59b; }
.footer-credits {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: -3px;
  color: #aaa59b;
  font-size: var(--fs-micro);
}
.powered-by { margin-right: 2px; }
.credit-icon {
  position: relative;
  display: inline-flex;
  width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: #ebe8e1;
  box-shadow: 0 0 0 1px rgba(50, 45, 38, .08);
  transition: transform .16s ease, box-shadow .16s ease;
}
.credit-icon img { display: block; width: 16px; height: 16px; border-radius: 4px; }
.credit-icon::after {
  position: absolute;
  bottom: calc(100% + 7px);
  left: 50%;
  width: max-content;
  max-width: 180px;
  padding: 5px 8px;
  border-radius: 5px;
  background: var(--ink);
  color: var(--panel);
  content: attr(data-label);
  font-size: var(--fs-micro);
  line-height: 1.2;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 3px);
  transition: opacity .16s ease, transform .16s ease;
  white-space: nowrap;
}
.credit-icon:hover,
.credit-icon:focus-visible { box-shadow: 0 0 0 2px rgba(229, 111, 76, .28); transform: translateY(-1px); }
.credit-icon:hover::after,
.credit-icon:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 4. 控制面板 ---------- */
.field-label {
  display: block;
  margin: 31px 0 9px;
  font-size: var(--fs-meta);
  color: var(--muted);
  letter-spacing: .06em;
}

.selection-tabs {
  display: flex;
  gap: 6px;
  margin-top: 14px;
  margin-bottom: 10px;
  padding: 3px;
  background: #f1eee7;
  border-radius: 7px;
}
.selection-tab {
  flex: 1;
  border: 0;
  border-radius: 5px;
  background: transparent;
  padding: 8px 10px;
  color: var(--muted);
  font-size: var(--fs-meta);
  font-weight: 600;
  cursor: pointer;
}
.selection-tab.active {
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(42, 34, 24, .09);
}

.preset-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(108px, 1fr)); gap: 8px; }
.preset-card {
  position: relative;
  border: 1px solid var(--line);
  background: var(--card);
  padding: 12px 42px 12px 10px;
  text-align: left;
  cursor: pointer;
  transition: border-color .2s, background .2s, transform .2s;
}
.preset-card strong { display: block; font-size: var(--fs-body); }
.preset-card small { display: block; margin-top: 5px; color: var(--muted); font-size: var(--fs-micro); }
.preset-card:hover { border-color: #cbb8ab; }
.preset-card:active { transform: translateY(1px); }
.preset-card.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 -2px 0 var(--accent);
}
.size-shape {
  position: absolute;
  top: 12px;
  right: 10px;
  display: block;
  width: calc(28px * var(--ratio));
  height: 28px;
  border: 2px solid #d7a18f;
  background: var(--panel);
  opacity: .9;
}
.preset-card.selected .size-shape { border-color: var(--accent); background: #ffe2d8; }

.country-search {
  display: block;
  width: 100%;
  margin-bottom: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 9px 10px;
  /* 16px 是 iOS 不触发聚焦自动放大的下限，缩回视觉尺寸靠 transform 之外的方式不可靠，
     所以这里直接用 16px 而不是版面上的 11px。 */
  font-size: 16px;
  outline: none;
}
.country-search:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(229, 111, 76, .12); }

.country-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 390px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-right: 4px;
  scrollbar-gutter: stable;
}
.country-card {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--card);
  padding: 10px;
  text-align: left;
  cursor: pointer;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.country-card:hover { border-color: #cbb8ab; background: var(--panel); }
.country-card.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 -2px 0 var(--accent);
}
.country-flag { font-size: 22px; line-height: 1; }
.country-card-copy { min-width: 0; }
.country-card-copy strong,
.country-card-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.country-card-copy strong { font-size: var(--fs-meta); }
.country-card-copy small { margin-top: 4px; color: var(--muted); font-size: var(--fs-micro); }
.country-empty { padding: 18px 0; color: var(--muted); font-size: var(--fs-meta); text-align: center; }

.spec-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px;
  margin-top: 12px;
  padding: 15px 16px;
  background: var(--panel-soft);
}
.spec-item small { display: block; margin-bottom: 4px; color: var(--muted); font-size: var(--fs-micro); letter-spacing: .07em; }
.spec-item strong { font-size: var(--fs-body); }
.bg-value { display: flex; align-items: center; gap: 6px; }
.bg-swatch {
  display: inline-block;
  flex: none;
  width: 16px;
  height: 16px;
  border: 1px solid #c8c4bc;
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .45);
}

.requirements {
  margin-top: 12px;
  padding: 13px 15px;
  background: var(--panel-soft);
  color: #686f76;
  font-size: var(--fs-meta);
  line-height: 1.7;
}
.requirements-details > summary { display: none; }
.requirements > p { margin-bottom: 3px; color: var(--ink); font-weight: 700; }
.applicable-destinations {
  display: grid;
  gap: 2px;
  margin: 7px 0 6px;
  padding: 7px 9px;
  background: var(--panel);
  border-left: 2px solid var(--accent);
}
.applicable-destinations small { color: var(--muted); font-size: var(--fs-micro); }
.applicable-destinations strong { color: var(--ink); font-size: var(--fs-meta); font-weight: 600; line-height: 1.5; }

/* ---------- 5. 预览面板 ---------- */
.preview-panel { display: flex; flex-direction: column; min-height: 560px; }
.preview-heading { align-items: flex-start; }
.preview-heading > div { flex: 1; }

.status-pill { border-radius: 20px; padding: 7px 10px; background: #eeeae2; color: var(--muted); font-size: var(--fs-meta); }
.status-pill.good { background: #e7f2ed; color: var(--ok); }
.status-pill.warn { background: #fbefdf; color: var(--warn); }

.frame-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  min-height: 20px;
  color: var(--muted);
  font-size: var(--fs-micro);
  line-height: 1.3;
}
.frame-meta strong { color: var(--muted); font-size: var(--fs-meta); font-weight: 600; }
.frame-meta-bg { display: inline-flex; align-items: center; gap: 5px; }
.frame-meta .bg-swatch { width: 13px; height: 13px; }

/* 取代 alert 的内联报错。位于舞台上方，出现时把舞台往下推，不遮挡预览。 */
.stage-error {
  margin-top: 14px;
  padding: 10px 12px;
  border-left: 3px solid var(--warn);
  background: #fdf5e7;
  color: #8a5b16;
  font-size: var(--fs-label);
  line-height: 1.6;
}

/* 舞台高度固定，构图缩放只改变画面内容，不推动周围布局。 */
.preview-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex: none;
  height: 420px;
  margin: 25px 0 17px;
  background: #ebe8e1;
  overflow: hidden;
}
/* 拖拽悬停：内描边而不是 border，免得舞台尺寸变化把画面挤动一像素。 */
.preview-stage.drop-target {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 2px var(--accent);
}
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  color: #9c9a94;
  font-size: var(--fs-label);
}
.empty-grid {
  width: calc(150px * var(--frame-ratio, .7143));
  height: 150px;
  border: 1px solid #c4c0b7;
  background:
    repeating-linear-gradient(0deg, transparent 0 24px, rgba(130, 125, 115, .15) 25px),
    repeating-linear-gradient(90deg, transparent 0 24px, rgba(130, 125, 115, .15) 25px);
}
.preview-upload-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--accent);
  background: var(--panel);
  padding: 8px 12px;
  color: var(--accent-dark);
  font-size: var(--fs-meta);
  font-weight: 600;
  cursor: pointer;
}
.preview-upload-button span { font-size: 16px; font-weight: 400; line-height: 1; }
/* 拖拽和粘贴在触屏上没有对应操作，只在有精确指针的设备上提。 */
.empty-drop-hint { display: none; font-size: var(--fs-micro); color: #a8a59e; }
@media (hover: hover) and (pointer: fine) {
  .empty-drop-hint { display: block; }
}
.preview-upload-button:hover { background: var(--accent-soft); }

.canvas-wrap {
  position: relative;
  flex: none;
  max-width: calc(100% - 76px);
  max-height: 378px;
  box-shadow: 0 8px 25px rgba(40, 30, 20, .16);
  overflow: hidden;
}
.canvas-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
  background: #fff;
  touch-action: none;
  cursor: grab;
}
.canvas-wrap canvas.dragging { cursor: grabbing; }

.crop-guides {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255, 255, 255, .72);
  box-shadow: inset 0 0 0 1px rgba(32, 37, 43, .12);
  pointer-events: none;
}
.crop-guides::before,
.crop-guides::after,
.guide-v,
.guide-h {
  content: "";
  position: absolute;
  background: rgba(255, 255, 255, .48);
  box-shadow: 0 0 0 .5px rgba(32, 37, 43, .1);
}
.crop-guides::before, .crop-guides::after { top: 0; bottom: 0; width: 1px; }
.crop-guides::before { left: 33.333%; }
.crop-guides::after { left: 66.666%; }
.guide-v { top: 0; bottom: 0; left: 50%; width: 1px; background: rgba(229, 111, 76, .62); }
.guide-h { left: 0; right: 0; height: 1px; }
.guide-h-one { top: 33.333%; }
.guide-h-two { top: 66.666%; }
.face-guide {
  position: absolute;
  left: 23%;
  top: 16%;
  width: 54%;
  height: 58%;
  border: 1px dashed rgba(255, 255, 255, .82);
  border-radius: 50% 50% 46% 46%;
}
.crop-guides small {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  background: rgba(32, 37, 43, .66);
  padding: 4px 7px;
  color: #fff;
  font-size: var(--fs-micro);
  letter-spacing: .04em;
  white-space: nowrap;
}

/* 头部测量线：两条可拖动的横线，中间高亮出头部区间。 */
.head-guides { position: absolute; inset: 0; pointer-events: none; }
.head-band {
  position: absolute;
  left: 0;
  right: 0;
  background: rgba(229, 111, 76, .16);
  border-top: 1px solid rgba(229, 111, 76, .35);
  border-bottom: 1px solid rgba(229, 111, 76, .35);
}
.head-line {
  position: absolute;
  left: 0;
  right: 0;
  /* 线只有 1px，但热区要够手指按：用 20px 高的透明容器包住。 */
  height: 20px;
  margin-top: -10px;
  display: flex;
  align-items: center;
  pointer-events: auto;
  cursor: ns-resize;
  touch-action: none;
}
.head-line::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  box-shadow: 0 0 0 .5px rgba(255, 255, 255, .7);
}
.head-line-label {
  position: relative;
  margin-left: 6px;
  border-radius: 3px;
  background: var(--accent);
  padding: 2px 6px;
  color: #fff;
  font-size: var(--fs-micro);
  letter-spacing: .04em;
}
.head-line-chin .head-line-label { margin-left: auto; margin-right: 6px; }
.head-line.dragging::before, .head-line:focus-visible::before { background: var(--accent-dark); }

.zoom-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: var(--fs-meta);
}
.zoom-row input { flex: 1; accent-color: var(--accent); }

.measure-box { margin-bottom: 12px; padding: 12px 15px; background: var(--panel-soft); }
.measure-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.measure-toggle { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: var(--fs-label); cursor: pointer; }
.measure-toggle input { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }
.measure-head strong { font-size: var(--fs-label); }
.measure-head strong.good { color: var(--ok); }
.measure-head strong.warn { color: var(--warn); }
.measure-hint { margin-top: 7px; color: var(--muted); font-size: var(--fs-micro); line-height: 1.6; }

.compression-box { margin-bottom: 2px; padding: 14px 15px; background: var(--panel-soft); }
.compression-head { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: var(--fs-label); }
.compression-head strong { color: var(--ink); font-size: var(--fs-label); }
.compression-box input { display: block; width: 100%; margin: 13px 0 7px; accent-color: var(--accent); }
.compression-scale { display: flex; justify-content: space-between; color: #aaa49a; font-size: var(--fs-micro); }
/* 编码是异步的，期间下载不可用；让体积读数轻微呼吸，说明它在算而不是卡死了。 */
.compression-box.busy .compression-head strong { color: var(--muted); animation: pulse 1.1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) {
  .compression-box.busy .compression-head strong { animation: none; }
}

.checks { border-top: 1px solid var(--line); }
.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: var(--fs-body);
}
.check-row small { margin-left: auto; color: var(--muted); font-size: var(--fs-meta); }
.check-dot {
  display: grid;
  place-items: center;
  flex: none;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: #eeeae2;
  color: #9d9a92;
  font-size: var(--fs-meta);
}
.check-row.good .check-dot { background: #d8eee4; color: var(--ok); }
.check-row.warn .check-dot { background: #f9e7cd; color: var(--warn); }
.check-row.muted { color: var(--muted); }

.actions { margin-top: 17px; }
.download-button {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  background: var(--accent);
  color: #fff;
  font-size: var(--fs-body);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background .2s, transform .2s;
}
.download-button:hover { background: var(--accent-dark); }
.download-button:active { transform: translateY(1px); }
.download-button[aria-disabled="true"] { background: #ddd8ce; color: #9b968c; pointer-events: none; }

.print-button, .reset-button {
  width: 100%;
  margin-top: 10px;
  border: 1px solid var(--line);
  background: transparent;
  padding: 11px;
  font-size: var(--fs-label);
  font-weight: 600;
  cursor: pointer;
}
.print-button { border-color: var(--accent); color: var(--accent-dark); }
.print-button:hover { background: var(--accent-soft); }
.reset-button:hover { background: var(--panel-soft); }

/* ---------- 6. 排版弹窗 ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 4vw, 40px);
  padding-bottom: calc(clamp(12px, 4vw, 40px) + var(--safe-bottom));
  background: rgba(32, 28, 22, .52);
  animation: modal-fade .16s ease-out;
}
@keyframes modal-fade { from { opacity: 0; } to { opacity: 1; } }

.modal {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 660px;
  /* 内容高度不确定，弹窗整体不超过视口，超出的部分在 body 内滚动。 */
  max-height: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 30px 80px rgba(30, 22, 14, .3);
}
.modal-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: none;
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--line-soft);
}
.modal-head h2 { font-size: var(--fs-title); font-weight: 700; letter-spacing: -.02em; }
.modal-head p { margin-top: 5px; color: var(--muted); font-size: var(--fs-meta); line-height: 1.6; }
.modal-head > div { flex: 1; min-width: 0; }
.modal-close {
  flex: none;
  border: 0;
  background: transparent;
  padding: 0 4px;
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.modal-close:hover { color: var(--ink); }

.modal-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 20px 24px;
}
.modal-foot { flex: none; padding: 0 24px 22px; }

.print-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: #ebe8e1;
}
.print-stage canvas {
  display: block;
  max-width: 100%;
  height: auto;
  background: #fff;
  box-shadow: 0 8px 25px rgba(40, 30, 20, .16);
}

/* 弹窗打开时锁住背景滚动，否则移动端滚弹窗会带着页面一起动。 */
body.modal-open { overflow: hidden; }

/* ---------- 7. 响应式 ---------- */
@media (max-width: 980px) {
  .workspace { grid-template-columns: 1fr; }
  .preset-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .hero { padding-top: 12px; }
  .stepper { gap: 6px; font-size: var(--fs-meta); }
  .stepper i { width: 16px; }
  .preset-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .country-cards { max-height: 300px; }
  .preview-panel { min-height: 500px; }
  .preview-stage { height: 320px; }
  .canvas-wrap { max-height: 278px; }
  .footer-note { padding-bottom: 20px; }
  .requirements-details > summary {
    display: block;
    margin-top: 12px;
    padding: 9px 12px;
    background: var(--panel-soft);
    color: var(--muted);
    font-size: var(--fs-meta);
    cursor: pointer;
  }
  .requirements-details > summary::marker { color: var(--accent); }
  .requirements-details[open] > summary { color: var(--ink); }
  .requirements-details .requirements { margin-top: 4px; }
}

@media (min-width: 981px) {
  .app-shell { padding-bottom: calc(18px + var(--safe-bottom)); }
  .hero { padding-bottom: 20px; }
  .footer-note { margin-top: 12px; }
  .preview-stage { margin-top: 20px; margin-bottom: 12px; }
}

@media (max-width: 520px) {
  .panel { padding: 20px; }
  .spec-card { grid-template-columns: 1fr; }
  .modal-head { padding: 18px 18px 14px; }
  .modal-body { padding: 16px 18px; }
  .modal-foot { padding: 0 18px 18px; }
  .print-stage { padding: 12px; }
}
