:root {
  --navy: #071833;
  --navy-2: #0c2d5c;
  --blue: #1d4e89;
  --bright: #2f6fe4;
  --ice: #e7eef8;
  --bg: #f3f6fb;
  --card: #fff;
  --ink: #102033;
  --muted: #5c6d82;
  --line: #d5deea;
  --ok: #0f7a43;
  --warn: #8a5b00;
  --bad: #9d2230;
  --shadow: 0 8px 24px rgba(7, 24, 51, .08);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", "Yu Gothic", Meiryo, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.4;
}
a { color: var(--blue); }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; background: #fff; z-index: 9; padding: 6px; }
.topbar {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 8px 12px;
  background: linear-gradient(90deg, var(--navy), var(--navy-2));
  color: #fff;
}
.brand { display: flex; gap: 8px; align-items: center; color: #fff; text-decoration: none; min-width: 140px; }
.brand strong { display: block; font-size: 18px; letter-spacing: .02em; }
.brand small { display: block; color: #c9d7ee; font-size: 11px; }
.top-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; align-items: center; margin-left: auto; }
.langs { display: flex; gap: 4px; align-items: center; }
.lang-btn, .btn, .cart-link {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px; text-decoration: none; border: 1px solid transparent;
  min-height: 36px; padding: 0 10px; cursor: pointer;
}
.lang-btn { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); font-size: 13px; }
.lang-btn.is-on { background: #fff; color: var(--navy); }
.lang-pick select { min-height: 36px; border-radius: 8px; border: 0; padding: 0 6px; max-width: 118px; }
.login-mini { display: flex; gap: 6px; align-items: end; }
.login-mini label { display: grid; gap: 2px; font-size: 11px; color: #d5e3f8; }
.login-mini input { width: 128px; min-height: 36px; border: 0; border-radius: 8px; padding: 0 8px; }
.btn { background: var(--bright); color: #fff; font-weight: 650; }
.btn-ghost { background: #fff; color: var(--navy); border-color: var(--line); }
.topbar .btn-ghost { border-color: transparent; }
.cart-link { background: #fff; color: var(--navy); font-weight: 700; }
.who { font-size: 13px; color: #d5e3f8; }
.mainnav {
  display: flex; flex-wrap: wrap; gap: 4px;
  padding: 6px 10px; background: #fff; border-bottom: 1px solid var(--line);
}
.mainnav a {
  text-decoration: none; color: var(--navy); padding: 6px 8px; border-radius: 7px; font-size: 13px; font-weight: 650;
}
.mainnav a.is-on, .mainnav a:hover { background: var(--ice); }
.banner { margin: 8px 12px; padding: 8px 10px; border-radius: 8px; background: #e8f6ee; color: var(--ok); }
.banner.bad { background: #fdecef; color: var(--bad); }
.banner.warn { background: #fff6df; color: var(--warn); }
main { padding: 10px 12px 18px; max-width: 1180px; margin: 0 auto; }
.site-foot { padding: 8px 12px 16px; color: var(--muted); text-align: center; }
.card, .panel {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 10px;
}
h1 { font-size: 28px; line-height: 1.15; margin: 0 0 6px; color: var(--navy); }
h2 { font-size: 16px; margin: 0 0 8px; color: var(--navy); }
.muted, .help { color: var(--muted); font-size: 13px; }
.funnel { display: grid; grid-template-columns: minmax(280px, .9fr) minmax(320px, 1.1fr); gap: 10px; }
.right-stack { display: grid; grid-template-rows: minmax(180px, .9fr) minmax(200px, 1.1fr); gap: 10px; min-height: 0; }
.lead-grid, .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.span-2 { grid-column: 1 / -1; }
label { display: grid; gap: 3px; font-size: 12px; font-weight: 650; color: var(--navy); }
input, select, textarea {
  width: 100%; min-height: 38px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; background: #fff;
}
textarea { min-height: 90px; resize: vertical; }
.checks { display: flex; gap: 8px; align-items: flex-start; font-weight: 500; font-size: 13px; }
.checks input { width: auto; min-height: 0; margin-top: 2px; }
.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }
.steps { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.steps span { background: var(--ice); color: var(--navy); border-radius: 999px; padding: 3px 8px; font-size: 12px; font-weight: 650; }
.trust { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; }
.trust b { display: block; background: var(--navy); color: #fff; border-radius: 8px; padding: 6px 8px; font-size: 12px; font-weight: 650; }
.reel { display: flex; flex-direction: column; min-height: 0; height: 100%; }
.reel-frame { position: relative; flex: 1; min-height: 160px; background: var(--navy); border-radius: 10px; overflow: hidden; }
.slide { display: none; position: absolute; inset: 0; margin: 0; }
.slide.is-on { display: block; }
.slide img { width: 100%; height: 100%; object-fit: cover; }
.slide figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; gap: 8px;
  padding: 8px 10px; color: #fff; background: linear-gradient(transparent, rgba(7,24,51,.85));
}
.reel-bar { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.reel-play { width: 36px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: #fff; cursor: pointer; }
.reel-progress { flex: 1; height: 4px; background: var(--ice); border-radius: 99px; overflow: hidden; }
.reel-progress span { display: block; height: 100%; width: 0; background: var(--bright); }
.inv-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-bottom: 8px; }
.filters .filter-actions { display: flex; gap: 6px; align-items: end; }
.inv-scroll { overflow: auto; min-height: 0; flex: 1; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.inv-row, .product-link {
  display: grid; grid-template-columns: 56px 1fr auto; gap: 8px; align-items: center;
  padding: 6px 8px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit;
}
.inv-row:hover { background: var(--ice); }
.inv-row img, .thumb { width: 56px; height: 42px; object-fit: cover; border-radius: 6px; background: var(--ice); }
.inv-row strong, .product-link strong { display: block; color: var(--navy); }
.inv-row em, .product-link em { font-style: normal; color: var(--muted); font-size: 12px; }
.price { font-weight: 750; color: var(--navy); white-space: nowrap; }
.was { color: var(--muted); text-decoration: line-through; font-weight: 500; font-size: 12px; margin-right: 4px; }
.badge { display: inline-block; background: #e5f6ec; color: var(--ok); border-radius: 99px; padding: 2px 6px; font-size: 11px; font-weight: 700; }
.modal[hidden] { display: none; }
.modal { position: fixed; inset: 0; background: rgba(7,24,51,.55); display: grid; place-items: center; padding: 16px; z-index: 20; }
.modal-card { width: min(420px, 100%); }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.stat b { display: block; font-size: 26px; color: var(--navy); }
.stat span { color: var(--muted); font-size: 12px; }
.bars { display: grid; gap: 5px; }
.bar-row { display: grid; grid-template-columns: 52px 1fr 24px; gap: 6px; align-items: center; font-size: 12px; }
.bar { height: 10px; background: var(--ice); border-radius: 99px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--bright); }
.sheet { overflow: auto; max-height: 560px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; white-space: nowrap; }
th { position: sticky; top: 0; background: var(--navy); color: #fff; font-weight: 650; }
td.wrap, th.wrap { white-space: normal; }
.gallery { display: grid; grid-template-columns: 88px 1fr; gap: 8px; }
.gallery-main { width: 100%; height: 280px; object-fit: cover; border-radius: 12px; background: var(--navy); }
.thumbs { display: grid; gap: 6px; align-content: start; }
.thumbs img { width: 88px; height: 64px; object-fit: cover; border-radius: 8px; cursor: pointer; }
.split { display: grid; grid-template-columns: 1.2fr .8fr; gap: 10px; }
.totals { display: grid; gap: 4px; }
.totals div { display: flex; justify-content: space-between; gap: 12px; }
.totals .grand { font-size: 18px; color: var(--navy); border-top: 1px solid var(--line); padding-top: 6px; }
.row-actions, .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@media (min-width: 980px) and (min-height: 740px) {
  body.home { height: 100dvh; overflow: hidden; display: flex; flex-direction: column; }
  body.home main { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  body.home .funnel, body.home .right-stack, body.home .panel { min-height: 0; }
  body.home .funnel { flex: 1; }
  body.home .site-foot { padding-top: 0; }
}
@media (max-width: 860px) {
  .funnel, .split, .stats { grid-template-columns: 1fr; }
  .right-stack { grid-template-rows: 220px 280px; }
  .filters { grid-template-columns: 1fr 1fr; }
  .login-mini { width: 100%; }
  .login-mini input { width: 100%; }
  .topbar { align-items: flex-start; }
  .gallery { grid-template-columns: 1fr; }
  .thumbs { grid-auto-flow: column; overflow: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .reel-progress span { transition: none !important; }
}
