/* Dahua at CNW: phone first, light and modern. One centred column on bigger screens. */
@font-face { font-family: "Montserrat"; src: url("../fonts/Montserrat-variable-latin.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }

:root {
  color-scheme: light;
  --bg: #f4f6fb;
  --card: #ffffff;
  --ink: #0f172a;
  --muted: #5b6478;
  --line: #e2e7f2;
  --tint: #eaf0fb;
  --blue: #2a4a9f;
  --blue-ink: #ffffff;
  --red: #d7141a;
  --red-ink: #ffffff;
  --navy: #0f1f4d;
  --focus: #f5a400;
  --ph: #fff3a3;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 31, 77, .06), 0 6px 18px rgba(15, 31, 77, .06);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0b1020; --card: #141b2e; --ink: #eef2fb; --muted: #a3aec6; --line: #25304b; --tint: #1c2744;
    --blue: #4a6fe8; --red: #ef4452; --navy: #1c2a55; --ph: #5a4d00;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 18px rgba(0, 0, 0, .25);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1020; --card: #141b2e; --ink: #eef2fb; --muted: #a3aec6; --line: #25304b; --tint: #1c2744;
  --blue: #4a6fe8; --red: #ef4452; --navy: #1c2a55; --ph: #5a4d00;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 18px rgba(0, 0, 0, .25);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 500 1rem/1.5 Montserrat, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: inherit; }
[hidden] { display: none !important; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap {
  max-width: 640px; margin: 0 auto; padding: 14px 16px 40px;
  padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right));
}
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

h1 { font-size: 1.5rem; line-height: 1.2; font-weight: 800; letter-spacing: -.01em; margin: 14px 0 10px; }
h2 { font-size: 1.05rem; line-height: 1.3; font-weight: 800; margin: 26px 0 10px; }
h3 { font-size: .95rem; font-weight: 700; margin: 16px 0 4px; }
.lead { color: var(--muted); margin: 0 0 16px; }

/* ---------- top bar on inner pages ---------- */
.topbar { display: flex; gap: 8px; align-items: center; }
.back {
  display: inline-flex; align-items: center; gap: 4px; min-height: 40px; padding: 0 14px 0 10px;
  border-radius: 999px; background: var(--card); border: 1px solid var(--line);
  font-weight: 700; font-size: .85rem; text-decoration: none; box-shadow: var(--shadow);
}
.back svg { width: 16px; height: 16px; stroke-width: 2.2; }
.topbar .back + .back { margin-left: auto; padding-left: 14px; }

/* ---------- home ---------- */
.hero {
  position: relative; overflow: hidden; border-radius: 22px; padding: 18px 18px 22px;
  background: radial-gradient(120% 90% at 100% 0%, #3a5cc2 0%, rgba(58, 92, 194, 0) 55%), linear-gradient(160deg, #14286a 0%, var(--navy) 70%);
  color: #fff; box-shadow: 0 10px 30px rgba(15, 31, 77, .25);
}
.hero::before, .hero::after { content: ""; position: absolute; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .12); pointer-events: none; }
.hero::before { width: 220px; height: 220px; right: -70px; bottom: -110px; }
.hero::after { width: 340px; height: 340px; right: -130px; bottom: -190px; border-color: rgba(255, 255, 255, .07); }
.hero .logos { display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%; background: #fff; border-radius: 12px; padding: 10px 16px; }
.hero .logos img { height: auto; display: block; max-width: none; }
.hero .logos img:first-child { width: 58%; }
.hero .logos img:last-child { width: 34%; }
.hero h1 { font-size: clamp(1.15rem, 5.4vw, 2.1rem); margin: 18px 0 8px; font-weight: 800; line-height: 1.12; position: relative; white-space: nowrap; }
.tags { margin: 0; display: flex; flex-wrap: nowrap; align-items: center; gap: 4px 8px; font-size: clamp(.5rem, 2.5vw, .72rem); font-weight: 700; letter-spacing: .1em; white-space: nowrap; text-transform: uppercase; color: #b9c7f5; position: relative; }
.tags i { width: 4px; height: 4px; border-radius: 50%; background: #ff6b78; }

.actions { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.act {
  display: flex; align-items: center; gap: 11px; min-height: 62px; padding: 10px 12px;
  border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow);
  text-decoration: none; line-height: 1.2;
}
.act:active { transform: translateY(1px); }
.act .ic { flex: none; width: 36px; height: 36px; padding: 8px; border-radius: 10px; background: var(--tint); color: var(--blue); }
.act .tx { display: flex; flex-direction: column; justify-content: center; gap: 2px; min-width: 0; text-align: left; }
.act b { font-size: .88rem; font-weight: 700; }
.act small { color: var(--muted); font-size: .72rem; font-weight: 600; }
.act.primary { min-height: 68px; padding: 12px 14px 12px 12px; background: var(--blue); border-color: var(--blue); color: var(--blue-ink); }
.act.primary .ic { width: 40px; height: 40px; padding: 9px; background: rgba(255, 255, 255, .16); color: #fff; }
.act.primary .tx { flex: 1; }
.act.primary b { font-size: 1rem; font-weight: 800; }
.act.primary small { color: rgba(255, 255, 255, .82); font-size: .75rem; }
.act .go { flex: none; width: 20px; height: 20px; stroke-width: 2.2; opacity: .9; }
.foot { color: var(--muted); font-size: .78rem; margin: 22px 4px 0; text-align: center; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-align: center;
  min-height: 46px; padding: 0 18px; border-radius: 12px; border: 0; cursor: pointer; font-family: inherit;
  background: var(--blue); color: var(--blue-ink); font-weight: 700; font-size: .9rem; text-decoration: none;
}
.btn.red { background: var(--red); color: var(--red-ink); }
.btn.light { background: var(--card); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow); }
.btn.sm { min-height: 42px; padding: 0 16px; font-size: .85rem; border-radius: 11px; }
.btn[aria-disabled="true"] { opacity: .65; cursor: not-allowed; }
.btn .ext, .ext { width: 14px; height: 14px; stroke-width: 2.2; flex: none; }
body[data-page="help"] #call, body[data-page="feedback"] form .btn { width: 100%; }

/* ---------- product list ---------- */
.tools { position: sticky; top: 0; z-index: 5; margin: 0 -16px; padding: 8px 16px 6px; background: color-mix(in srgb, var(--bg) 88%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.searchbox { position: relative; }
.searchbox svg { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; margin-top: -9px; color: var(--muted); pointer-events: none; }
.search {
  width: 100%; min-height: 46px; font: inherit; font-size: .95rem; padding: 0 14px 0 42px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--ink); box-shadow: var(--shadow);
}
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 10px 0 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); font: 700 .8rem/1 Montserrat, system-ui, sans-serif; cursor: pointer; white-space: nowrap;
}
.chip span { color: var(--muted); font-weight: 600; margin-left: 4px; }
.chip[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); color: #fff; }
.chip[aria-pressed="true"] span { color: rgba(255, 255, 255, .7); }
.count { color: var(--muted); font-size: .8rem; font-weight: 600; margin: 8px 2px 0; min-height: 1.4em; }
.group-title { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 20px 4px 8px; }
.row {
  display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 9px 12px 9px 9px; margin-bottom: 8px; text-decoration: none; box-shadow: var(--shadow);
}
.row:active { border-color: var(--blue); }
.row img { width: 64px; height: 64px; flex: none; border-radius: 10px; background: #fff; border: 1px solid var(--line); object-fit: contain; }
.rt { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.row .code { font-weight: 800; font-size: .92rem; overflow-wrap: anywhere; }
.row .name { color: var(--muted); font-size: .8rem; line-height: 1.35; font-weight: 500; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row .chev { margin-left: auto; width: 18px; height: 18px; color: var(--muted); flex: none; stroke-width: 2.2; }
.empty, .more-box { background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); padding: 20px; text-align: center; font-size: .88rem; }
.more-box { margin-top: 18px; color: var(--muted); }
.more-box p { margin: 0 0 12px; }

/* ---------- product page ---------- */
.stage { display: block; width: 100%; padding: 0; border: 1px solid var(--line); border-radius: 18px; background: #fff; cursor: zoom-in; position: relative; overflow: hidden; margin-top: 12px; box-shadow: var(--shadow); }
.stage img { display: block; width: 100%; max-height: 420px; object-fit: contain; aspect-ratio: 1 / 1; }
.stage .hint { position: absolute; right: 10px; bottom: 10px; background: rgba(15, 31, 77, .82); color: #fff; font-size: .72rem; font-weight: 600; padding: 5px 11px; border-radius: 999px; }
.thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; padding-bottom: 4px; }
.thumbs button { flex: none; width: 60px; height: 60px; padding: 0; border: 2px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; }
.thumbs button[aria-current="true"] { border-color: var(--blue); }
.thumbs img { width: 100%; height: 100%; object-fit: contain; border-radius: 8px; display: block; }
.variant { display: inline-flex; align-items: center; gap: 8px; margin: 14px 0 0; padding: 5px 12px 5px 8px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: .75rem; font-weight: 700; color: var(--muted); }
.variant i { width: 14px; height: 14px; border-radius: 50%; background: linear-gradient(90deg, #fff 50%, #111 50%); border: 1px solid #9aa4b8; }
.badge { display: inline-block; background: var(--tint); color: var(--blue); font-weight: 800; font-size: .8rem; padding: 5px 12px; border-radius: 999px; overflow-wrap: anywhere; letter-spacing: .02em; }
.links, .docs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.links { margin-top: 12px; }
.points { padding-left: 1.1em; margin: 8px 0 0; font-size: .9rem; }
.points li { margin-bottom: 7px; }
dl.specs { margin: 0; font-size: .88rem; }
dl.specs div { display: grid; grid-template-columns: minmax(110px, 38%) 1fr; gap: 6px 14px; padding: 9px 0; border-bottom: 1px solid var(--line); }
dl.specs dt { color: var(--muted); font-weight: 600; }
dl.specs dd { margin: 0; overflow-wrap: anywhere; }
details.more, details.faq { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 2px 16px; margin-top: 12px; box-shadow: var(--shadow); }
details.more > summary, details.faq summary, details.morepts summary { cursor: pointer; font-weight: 700; font-size: .92rem; min-height: 48px; display: flex; align-items: center; }
details.faq { margin: 0 0 8px; }
details.faq p { margin: 0 0 14px; font-size: .9rem; color: var(--muted); }

dialog.zoom { border: 0; padding: 0; width: 100%; height: 100%; max-width: 100%; max-height: 100%; background: rgba(0, 0, 0, .92); }
dialog.zoom::backdrop { background: rgba(0, 0, 0, .92); }
dialog.zoom .inner { height: 100%; display: flex; flex-direction: column; }
dialog.zoom .close { align-self: flex-end; margin: 12px; min-height: 44px; padding: 0 20px; border-radius: 999px; border: 0; background: #fff; color: #111; font: 700 .9rem Montserrat, system-ui, sans-serif; cursor: pointer; }
dialog.zoom .view { flex: 1; min-height: 0; overflow: auto; display: flex; align-items: center; justify-content: center; }
dialog.zoom img { background: #fff; max-width: 100%; max-height: 100%; object-fit: contain; }

/* ---------- help + feedback ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-top: 12px; box-shadow: var(--shadow); font-size: .9rem; }
.card p { margin: 0 0 6px; }
.phone-big { font-size: clamp(1.4rem, 6vw, 1.9rem); font-weight: 800; overflow-wrap: anywhere; }
label { display: block; font-weight: 700; font-size: .88rem; margin: 18px 0 6px; }
.hint-text { color: var(--muted); font-weight: 500; }
input[type="text"], textarea {
  width: 100%; font: inherit; font-size: .95rem; padding: 12px 14px; min-height: 46px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink); box-shadow: var(--shadow);
}
textarea { min-height: 150px; resize: vertical; }
.notice { border-radius: var(--radius); padding: 14px 16px; margin-top: 16px; font-weight: 600; font-size: .9rem; background: var(--card); color: var(--ink); }
.notice.ok { border: 2px solid #2e8b57; }
.notice.bad { border: 2px solid var(--red); }
.ph { background: var(--ph); padding: 0 4px; border-radius: 4px; }

@media (min-width: 760px) {
  .wrap { padding-top: 28px; }
  .hero { padding: 26px 28px 30px; }
  .hero .logos img { height: auto; }
  .row img { width: 72px; height: 72px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }

/* neat line breaks: balance short texts so a single word is never left on its own line */
h1, h2, h3, .lead, .foot, .more-box p, .empty p, .card p, .points li, .act small, .name, details.faq p, .notice { text-wrap: balance; }
.points li, details.faq p, .card p { text-wrap: pretty; }
.row .code, .badge, .chip, .btn, .act b { white-space: nowrap; }
.row .code { white-space: normal; }
.btn { flex-wrap: nowrap; }

body[data-page="product"] h1 { font-size: 1.2rem; line-height: 1.3; }

/* ---------- DMSS page ---------- */
.qrcard { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 20px 16px; box-shadow: var(--shadow); font-size: .9rem; }
.qrcard p { margin: 0; text-wrap: balance; }
.qrbox { width: min(78vw, 300px); aspect-ratio: 1 / 1; background: #fff; border-radius: 12px; border: 1px solid var(--line); overflow: hidden; }
.qrbox svg { display: block; width: 100%; height: 100%; stroke: none; }
.storebtns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.storebtns .btn { padding: 0 10px; font-size: .82rem; }

/* ---------- installer tip (laptop) ---------- */
.tip { display: flex; gap: 12px; align-items: center; margin-top: 14px; padding: 12px 14px; border-radius: var(--radius); background: var(--tint); border: 1px solid var(--line); font-size: .82rem; line-height: 1.45; }
.tip svg { flex: none; width: 30px; height: 30px; padding: 5px; border-radius: 9px; background: var(--card); color: var(--blue); }
.tip p { margin: 0; text-wrap: pretty; }
.tip b { display: block; font-size: .9rem; margin-bottom: 2px; }
.tip.big { margin-top: 16px; }

/* ---------- alignment polish ---------- */
.docs { flex-direction: column; align-items: stretch; gap: 8px; }
.docs .btn { justify-content: space-between; width: 100%; min-height: 48px; padding: 8px 14px; white-space: normal; text-align: left; line-height: 1.3; }
.links .btn { white-space: nowrap; }
.tip.big { align-items: flex-start; }
.tip.big svg { margin-top: 1px; }
.chips { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); padding-right: 24px; }
.btn svg.ext { margin-left: 2px; }
.back { line-height: 1; }

/* feedback form: spam-robot trap (kept off screen, not display:none) and privacy line */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.privacy { color: var(--muted); font-size: .75rem; margin: 10px 2px 0; text-align: center; }

/* footer link, feedback product note */
.sitefoot { text-align: center; margin: 26px 0 0; font-size: .75rem; }
.sitefoot a { color: var(--muted); text-underline-offset: 3px; }
.about { margin: 0 0 10px; padding: 8px 12px; border-radius: 10px; background: var(--tint); font-size: .85rem; font-weight: 700; color: var(--blue); }
body[data-page="privacy"] p { font-size: .92rem; }
.qlinks { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
