/* ============================================================
   PassPix-style design system v1 — clean, fast, consumer-friendly
   ============================================================ */
:root {
  --bg: #f7f9fc;
  --surface: #ffffff;
  --ink: #0f172a;
  --ink-soft: #475569;
  --muted: #64748b;
  --brand: #2563eb;
  --brand-dark: #1e40af;
  --brand-light: #eff6ff;
  --ok: #16a34a;
  --ok-bg: #f0fdf4;
  --warn: #d97706;
  --warn-bg: #fffbeb;
  --bad: #dc2626;
  --bad-bg: #fef2f2;
  --border: #e2e8f0;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(15, 23, 42, .08), 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-lg: 0 10px 30px rgba(15, 23, 42, .10);
  --max: 1120px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6; font-size: 16px;
}
img { max-width: 100%; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* ---------- header ---------- */
header.site {
  background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
header.site .wrap { display: flex; align-items: center; gap: 22px; height: 60px; }
.logo { font-weight: 800; font-size: 1.2rem; color: var(--ink); letter-spacing: -.02em; display: flex; align-items: center; gap: 8px; }
.logo .dot { width: 26px; height: 26px; border-radius: 8px; background: linear-gradient(135deg, var(--brand), #06b6d4); display: inline-block; }
nav.main { display: flex; gap: 18px; font-size: .95rem; margin-left: auto; }
nav.main a { color: var(--ink-soft); font-weight: 500; }
nav.main a:hover { color: var(--brand); text-decoration: none; }
.btn {
  display: inline-block; border: 0; cursor: pointer; font: inherit; font-weight: 600;
  padding: 10px 18px; border-radius: 10px; text-align: center;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); text-decoration: none; }
.btn-big { padding: 14px 26px; font-size: 1.05rem; border-radius: 12px; }
.btn-ghost { background: var(--brand-light); color: var(--brand-dark); }
.btn-ghost:hover { background: #dbeafe; text-decoration: none; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- hero ---------- */
.hero { padding: 56px 0 40px; }
.hero .wrap { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.hero h1 { font-size: 2.4rem; line-height: 1.15; letter-spacing: -.02em; margin: 0 0 16px; }
.hero p.lead { font-size: 1.15rem; color: var(--ink-soft); margin: 0 0 26px; }
.hero .badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; font-size: .85rem; color: var(--muted); }
.hero .badges span { background: var(--surface); border: 1px solid var(--border); padding: 6px 12px; border-radius: 999px; }
.hero-visual {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 16px;
}
.hero-visual .frame { aspect-ratio: 2/3; max-width: 300px; margin: 0 auto; border-radius: 8px;
  border: 2px dashed var(--border); display: grid; place-items: center; color: var(--muted); font-size: .9rem;
  background: repeating-linear-gradient(45deg, #fafcff 0 10px, #f1f5fb 10px 20px); }

/* ---------- sections ---------- */
section.block { padding: 44px 0; }
section.block h2 { font-size: 1.6rem; letter-spacing: -.01em; margin: 0 0 8px; }
section.block p.sub { color: var(--muted); margin: 0 0 26px; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow);
}
.card h3 { margin: 0 0 6px; font-size: 1.05rem; }
.card p { margin: 0; color: var(--ink-soft); font-size: .92rem; }
.card a { font-weight: 600; }
.country-chip { display: flex; align-items: center; gap: 10px; }
.country-chip .flag { font-size: 1.4rem; }
.country-chip .spec { color: var(--muted); font-size: .82rem; }

/* ---------- tool page ---------- */
.tool-layout { display: grid; grid-template-columns: 1.35fr .85fr; gap: 26px; align-items: start; padding: 30px 0 50px; }
.tool-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.tool-side > .card { margin-bottom: 16px; }
.dropzone {
  border: 2px dashed var(--border); border-radius: var(--radius); padding: 40px 20px;
  text-align: center; color: var(--ink-soft); cursor: pointer; transition: border-color .15s, background .15s;
  background: #fbfdff;
}
.dropzone:hover, .dropzone.drag { border-color: var(--brand); background: var(--brand-light); }
.dropzone .big { font-size: 1.05rem; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.dropzone .small { font-size: .85rem; color: var(--muted); }
.workspace { display: none; }
.workspace.active { display: block; }
.canvas-area { position: relative; background: #0b1220; border-radius: 10px; overflow: hidden; margin-bottom: 14px; touch-action: none; }
.canvas-area canvas { display: block; width: 100%; height: auto; }
.canvas-area.dragging canvas { cursor: grabbing; }
.hint { font-size: .85rem; color: var(--muted); margin-top: 8px; }
.controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 12px 0; }
.ws-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 10px; }
.ws-top .hint { margin: 0; }
.checks { display: grid; gap: 8px; margin: 14px 0; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; padding: 10px 12px; border-radius: 10px; background: var(--bg); }
.check .ic { flex: 0 0 auto; font-weight: 700; }
.check.ok { background: var(--ok-bg); color: #14532d; }
.check.warn { background: var(--warn-bg); color: #78350f; }
.check.bad { background: var(--bad-bg); color: #7f1d1d; }
.spec-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.spec-table td { padding: 7px 0; border-bottom: 1px solid var(--border); vertical-align: top; }
.spec-table td:first-child { color: var(--muted); width: 45%; }
.spec-table tr:last-child td { border-bottom: 0; }
select.spec-select, .field input, .field select {
  font: inherit; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: #fff; width: 100%;
}
.results { display: none; margin-top: 16px; }
.results.active { display: block; }
.out-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.result-item { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 12px; text-align: center; }
.result-item img { border: 1px solid var(--border); border-radius: 6px; height: 150px; object-fit: contain; margin-bottom: 8px; background: #fff; }
.result-item .t { font-weight: 600; font-size: .88rem; }
.result-item .d { color: var(--muted); font-size: .78rem; margin-bottom: 8px; }
.tick { color: var(--ok); font-weight: 700; }

/* ---------- content pages ---------- */
.prose { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 34px 40px; margin: 28px 0 48px; }
.prose h1 { margin-top: 0; font-size: 1.9rem; letter-spacing: -.02em; }
.prose h2 { margin-top: 34px; font-size: 1.3rem; }
.prose h3 { margin-top: 24px; font-size: 1.08rem; }
.prose p, .prose li { color: #1e293b; }
.prose table { width: 100%; border-collapse: collapse; font-size: .9rem; margin: 16px 0; }
.prose th, .prose td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; }
.prose th { background: var(--brand-light); }
.prose blockquote { border-left: 4px solid var(--brand); margin: 16px 0; padding: 8px 16px; background: var(--bg); border-radius: 0 8px 8px 0; color: var(--ink-soft); }
.note { background: var(--warn-bg); border: 1px solid #fde68a; border-radius: 10px; padding: 12px 16px; font-size: .9rem; color: #78350f; margin: 14px 0; }
.crumbs { font-size: .85rem; color: var(--muted); padding: 18px 0 0; }
.crumbs a { color: var(--muted); }

/* ---------- faq ---------- */
details.faq { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px 18px; margin-bottom: 10px; }
details.faq summary { cursor: pointer; font-weight: 600; }
details.faq p { margin: 10px 0 0; color: var(--ink-soft); }

/* ---------- footer ---------- */
footer.site { border-top: 1px solid var(--border); background: var(--surface); margin-top: 40px; padding: 34px 0; font-size: .9rem; color: var(--muted); }
footer.site .cols { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 26px; margin-bottom: 22px; }
footer.site h4 { margin: 0 0 10px; font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); }
footer.site a { color: var(--muted); display: block; margin: 5px 0; }
footer.site a:hover { color: var(--brand); }
.disclaimer { border-top: 1px solid var(--border); padding-top: 16px; font-size: .8rem; }

/* ---------- misc ---------- */
.ad-slot { display: none; min-height: 90px; background: #f1f5f9; border-radius: 10px; margin: 20px 0; text-align: center; color: #94a3b8; font-size: .8rem; padding-top: 34px; }
.skip { position: absolute; left: -9999px; }
.center { text-align: center; }
.mt0 { margin-top: 0; }
[id] { scroll-margin-top: 84px; }
#zoomRange { width: 140px; }
.tabbar { display: none; }

/* ---------- mobile ---------- */
@media (max-width: 860px) {
  header.site .wrap { height: 54px; }
  .logo { font-size: 1.05rem; }
  .logo .dot { width: 22px; height: 22px; }
  nav.main { display: none; }
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    background: var(--surface); border-top: 1px solid var(--border);
    padding: 5px 4px calc(5px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -4px 16px rgba(15, 23, 42, .07);
  }
  .tabbar .tab {
    flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; padding: 5px 2px; min-height: 48px; border-radius: 10px;
    color: var(--muted); font-size: .66rem; font-weight: 600; text-decoration: none;
  }
  .tabbar .tab:hover, .tabbar .tab:focus { text-decoration: none; }
  .tabbar .tab svg { width: 22px; height: 22px; }
  .tabbar .tab.active { color: var(--brand); background: var(--brand-light); }
  body { padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px)); }
  .hero { padding: 28px 0 22px; }
  .hero .wrap { grid-template-columns: 1fr; gap: 22px; }
  .hero h1 { font-size: 1.62rem; }
  .hero p.lead { font-size: 1.02rem; margin-bottom: 20px; }
  .hero .controls { display: grid; gap: 10px; margin: 0; }
  .hero .controls .btn { width: 100%; }
  .hero-visual { padding: 12px; }
  .hero-visual .frame { max-width: 200px; }
  section.block { padding: 30px 0; }
  section.block h2 { font-size: 1.38rem; }
  section.block p.sub { margin-bottom: 18px; }
  .tool-layout { grid-template-columns: 1fr; gap: 18px; padding: 18px 0 32px; }
  .tool-panel { padding: 16px; }
  .dropzone { padding: 24px 14px; }
  .dropzone .big { font-size: 1rem; }
  .tool-panel .controls .btn { flex: 1 1 auto; }
  .tool-panel .controls label { flex: 1 1 100%; }
  #zoomRange { flex: 1 1 auto; width: auto; min-width: 0; }
  .prose { padding: 20px 16px; }
  .prose h1 { font-size: 1.5rem; }
  .prose h2 { font-size: 1.2rem; }
  .prose table { display: block; overflow-x: auto; max-width: 100%; }
  .spec-table tr { display: block; padding: 7px 0; border-bottom: 1px solid var(--border); }
  .spec-table tr:last-child { border-bottom: 0; }
  .spec-table td { display: block; border-bottom: 0; padding: 0; }
  .spec-table td:first-child { width: auto; font-size: .8rem; }
  footer.site .cols { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .out-grid { grid-template-columns: 1fr 1fr; }
  .hero .badges { gap: 8px; font-size: .8rem; }
  .hero .badges span { padding: 5px 10px; }
  .hero-visual { display: none; }
  .wrap { padding: 0 16px; }
  .crumbs { font-size: .8rem; }
  footer.site .cols { grid-template-columns: 1fr; gap: 16px; }
}
@media print {
  header.site, footer.site, .ad-slot, .tool-side, nav.main, .tabbar { display: none !important; }
  body { background: #fff; }
  .prose, .tool-panel { box-shadow: none; border: 0; }
}
