/* ===== Hệ thiết kế: Roboto Flex, chữ xám than, nút xanh lá bo 4px, ô nhập bo tròn, khối tạo mã màu tối ===== */
:root {
  --text: #313231;
  --muted: #595959;
  --muted-2: #8a8a8a;
  --line: #e6e8e4;
  --bg: #f7f8f6;
  --white: #ffffff;
  --tint: #f3f8f3;
  --gray: #f9f9f9;
  --primary: #4e8126;
  --primary-dark: #3e6b1c;
  --primary-soft: #eef5e7;
  --lime: #a8d672;
  --dark: #1e1e1e;
  --dark-2: #262626;
  --dark-3: #333333;
  --ok: #2f7d32;
  --ok-soft: #eaf5ea;
  --warn: #a45a06;
  --warn-soft: #fff4e5;
  --bad: #b3261e;
  --bad-soft: #fdecea;
  --hero: linear-gradient(108deg, #d6eeec 5.34%, #cedcc0 94.28%);
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 24, 18, .04), 0 6px 20px rgba(20, 24, 18, .06);
  --font: "Roboto Flex", Roboto, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 var(--font); }
img { max-width: 100%; }
a { color: var(--primary); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; color: var(--text); }
h1 { font-size: clamp(1.6rem, 3.6vw, 2rem); font-weight: 600; }
h2 { font-size: 1.125rem; font-weight: 600; }
h3 { font-size: 1rem; font-weight: 600; }
p { margin: 0 0 .8em; }
input[type=checkbox], input[type=radio] { accent-color: var(--primary); }
.wrap { max-width: 1232px; margin: 0 auto; padding: 0 16px; }
.main { padding-top: 28px; padding-bottom: 56px; min-height: 60vh; }
.main-bare { min-height: 60vh; }
.narrow { max-width: 800px; margin-left: auto; margin-right: auto; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.warn-text { color: var(--warn); }
.pre { white-space: pre-line; }
[hidden] { display: none !important; }

/* ===== Đầu trang, chân trang ===== */
.topbar { background: var(--white); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1000; }
.topbar-in { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.125rem; color: var(--text); text-decoration: none; letter-spacing: -.01em; white-space: nowrap; }
.nav .btn { white-space: nowrap; gap: 0; }
.brand-logo { display: block; width: 44px; height: 44px; flex: none; }
.nav { display: flex; align-items: center; gap: 22px; }
.nav a:not(.btn) { color: var(--text); text-decoration: none; font-weight: 500; font-size: .95rem; }
.nav a:not(.btn):hover { color: var(--primary); }
.page-hero { background: var(--hero); padding: 36px 0 40px; text-align: center; }
.page-hero h1 { font-size: clamp(1.6rem, 3.6vw, 2.25rem); font-weight: 500; margin: 0; }
.page-hero p { font-size: 1.125rem; margin: 10px auto 0; max-width: 760px; }
.footer { background: var(--white); border-top: 1px solid var(--line); padding: 32px 0; font-size: .9rem; color: var(--muted); }
.footer-in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px 40px; }
.footer-brand { max-width: 420px; }
.footer-brand p { margin: 10px 0 0; }
.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-links a { color: var(--text); text-decoration: none; }
.footer-links a:hover { color: var(--primary); }

/* ===== Nút ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px;
  padding: 8px 16px; border-radius: 4px; border: 1px solid transparent; background: #e5e7eb; color: var(--text);
  font: inherit; font-weight: 600; font-size: 1rem; line-height: 1.25; text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { background: #d9dce1; }
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-dark { background: var(--dark); color: #fff; }
.btn-dark:hover { background: #000; }
.btn-light { background: #fff; color: var(--text); }
.btn-light:hover { background: #eef0ec; }
.btn-ghost { background: transparent; border-color: #555; color: #e5e5e5; }
.btn-ghost:hover { background: #2c2c2c; }
.btn-sm { min-height: 32px; padding: 5px 12px; font-size: .875rem; }
.btn-lg { min-height: 48px; padding: 12px 22px; font-size: 1.0625rem; }
.btn-xl { min-height: 52px; padding: 14px 22px; font-size: 1.0625rem; font-weight: 700; }
.btn-block { width: 100%; }
.btn-call { background: var(--dark); color: #fff; }
.btn-call:hover { background: #000; }
.btn-zalo { background: #0068ff; color: #fff; }
.btn-zalo:hover { background: #0057d6; }
.btn-outline { background: #fff; border-color: var(--line); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.link-btn { background: none; border: 0; padding: 0; color: var(--primary); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; }
.danger, .link-btn.danger { color: var(--bad); }

/* ===== Thẻ, thông báo, nhãn ===== */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
.alert { border-radius: 10px; padding: 14px 16px; margin-bottom: 16px; border: 1px solid; }
.alert ul { margin: 6px 0 0; padding-left: 20px; }
.alert-error { background: var(--bad-soft); border-color: #f3c3bf; color: #7a1a14; }
.alert-info { background: var(--primary-soft); border-color: #cfe3bd; color: #2d4d15; }
.alert-warn { background: var(--warn-soft); border-color: #f3d6a6; color: #6b3a03; }
.alert-success { background: var(--ok-soft); border-color: #bfe0c0; color: #1f4f21; }
.created h2 { font-size: 1.25rem; }
.message { text-align: center; padding: 36px 24px; }
.message .btn-row { justify-content: center; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; background: var(--primary-soft); color: var(--primary-dark); font-size: .8125rem; font-weight: 600; }
.tag-ok { background: var(--ok-soft); color: var(--ok); }

/* ===== Ô nhập (nền sáng) ===== */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-weight: 500; font-size: .9rem; margin-bottom: 6px; }
.field small { font-weight: 400; color: var(--muted-2); }
.req { color: var(--bad); font-style: normal; }
input:not([type=checkbox]):not([type=radio]):not([type=file]), select {
  width: 100%; height: 44px; padding: 10px 18px; border: 1px solid #d5d9d2; border-radius: 9999px; background: #fff; font: inherit; color: #111;
}
textarea { width: 100%; padding: 12px 18px; border: 1px solid #d5d9d2; border-radius: 16px; background: #fff; font: inherit; color: #111; resize: vertical; }
select { appearance: none; -webkit-appearance: none; padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%23595959' stroke-width='1.6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(78, 129, 38, .28); outline-offset: 0; border-color: var(--primary); }
.row-2 { display: flex; gap: 12px; flex-wrap: wrap; }
.row-2 > .field { flex: 1 1 150px; }
.row-2 > .grow { flex: 3 1 220px; }
.row-center { align-items: center; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 6px 0; cursor: pointer; }
.check input { margin-top: 3px; width: 18px; height: 18px; flex: none; }
.hint { color: var(--muted); font-size: .9375rem; }
.chip-group { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip-opt input { position: absolute; opacity: 0; pointer-events: none; }
.chip-opt span { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border: 1px solid #d5d9d2; border-radius: 999px; background: #fff; cursor: pointer; font-weight: 500; font-size: .9375rem; }
.chip-opt input:checked + span { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-dark); font-weight: 600; box-shadow: 0 0 0 1px var(--primary) inset; }
.chip-opt input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.swatch { width: 16px; height: 16px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .25); display: inline-block; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; user-select: none; }
.switch input { appearance: none; -webkit-appearance: none; width: 40px; height: 22px; border-radius: 999px; background: #5b5b5b; position: relative; flex: none; margin: 0; cursor: pointer; transition: background .2s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch input:checked { background: var(--primary); }
.switch input:checked::after { transform: translateX(18px); }
.switch input:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }

/* ===== Trang chủ ===== */
.hero { background: var(--hero); padding: 36px 0 64px; }
.hero-title { text-wrap: balance; text-align: center; font-size: clamp(1.75rem, 4vw, 2.25rem); font-weight: 500; line-height: 1.12; margin: 0 0 10px; }
.hero-sub { text-wrap: balance; text-align: center; font-size: clamp(1rem, 2.2vw, 1.25rem); line-height: 1.4; max-width: 760px; margin: 0 auto 28px; }
.anchor { position: relative; top: -80px; }
.owned-bar { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; background: rgba(255, 255, 255, .72); border-radius: 10px; padding: 10px 16px; margin: 0 auto 14px; font-size: .9375rem; }
.owned-list { display: flex; flex-wrap: wrap; gap: 4px 14px; list-style: none; margin: 0; padding: 0; }
.trust-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; background: var(--white); border-radius: 12px; box-shadow: var(--shadow); padding: 16px 24px; margin-top: 20px; }
.trust-items { flex: 1 1 420px; display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: .9375rem; }
.trust-items span:first-letter { color: var(--primary); font-weight: 700; }
.trust-bar .lookup { flex: 0 1 auto; display: flex; align-items: center; gap: 10px; }
.trust-bar .lookup label { font-weight: 500; font-size: .9375rem; white-space: nowrap; }
.trust-bar .lookup input { width: 170px; height: 40px; text-transform: uppercase; letter-spacing: .08em; }
.sec { background: var(--white); padding: 96px 0; }
.sec-tint { background: var(--tint); }
.sec-gray { background: var(--gray); }
.sec-title { text-align: center; font-size: clamp(1.6rem, 3.6vw, 2.25rem); font-weight: 600; line-height: 1.2; margin: 0 0 16px; }
.sec-sub { text-align: center; color: var(--muted); font-size: 1.125rem; margin: -4px auto 40px; }
.sec .sec-title + .split-card, .sec .sec-title + .steps3, .sec .sec-title + .faq { margin-top: 40px; }
.split-card { display: grid; grid-template-columns: 1fr 1fr; background: var(--white); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); }
.split-text { padding: 36px; display: flex; flex-direction: column; justify-content: center; font-size: 1.0625rem; color: var(--muted); }
.split-text .btn { align-self: flex-start; margin-top: 12px; }
.split-art { background: var(--hero); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 36px; }
.stats-band { padding: 64px 0; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; text-align: center; }
.stats-grid b { display: block; font-size: 3rem; font-weight: 600; line-height: 1.1; }
.stats-grid span { color: var(--muted); }
.steps3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.step3 { border: 1px solid var(--line); border-radius: 16px; padding: 28px; background: var(--white); }
.step3-n { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--dark); color: var(--lime); font-weight: 700; margin-bottom: 16px; }
.step3 h3 { font-size: 1.125rem; margin-bottom: 8px; }
.step3 p { color: var(--muted); margin: 0; }
.feat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.feat { background: var(--white); border-radius: 16px; padding: 24px; border: 1px solid var(--line); }
.feat-i { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; background: var(--primary-soft); font-size: 1.5rem; margin-bottom: 16px; }
.feat h3 { font-size: 1.25rem; font-weight: 500; margin-bottom: 8px; }
.feat p { color: var(--muted); font-size: .9375rem; margin: 0; }
.faq details { border-bottom: 1px solid var(--line); padding: 18px 4px; }
.faq summary { cursor: pointer; font-weight: 500; font-size: 1.0625rem; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.5rem; line-height: 1; color: var(--primary); }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 10px 0 0; color: var(--muted); }
.faq-more { margin-top: 24px; }
.mock-plate {
  display: flex; gap: 16px; align-items: center; background: #0b4ea2; color: #fff; border-radius: 16px; padding: 18px;
  box-shadow: 0 0 0 4px #fff inset, 0 0 0 6px #0b4ea2 inset, 0 18px 40px rgba(11, 78, 162, .28); width: min(100%, 420px); aspect-ratio: 3 / 2;
}
.mock-left { flex: 1; display: flex; flex-direction: column; padding-left: 10px; min-width: 0; }
.mock-left small { opacity: .8; font-weight: 700; letter-spacing: .1em; font-size: .75rem; }
.mock-left b { font-size: clamp(3rem, 8vw, 4.6rem); line-height: 1; font-weight: 800; }
.mock-left span { font-weight: 600; margin-top: 6px; }
.mock-left em { font-style: normal; opacity: .8; font-size: .85rem; }
.mock-qr { background: #fff; border-radius: 10px; padding: 10px; width: 46%; aspect-ratio: 1; }
.mock-qr svg { display: block; width: 100%; height: 100%; }
.checks { list-style: none; padding: 0; margin: 0; }
.checks li { position: relative; padding: 6px 0 6px 28px; }
.checks li::before { content: "✓"; position: absolute; left: 0; top: 6px; width: 20px; height: 20px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-size: .8rem; font-weight: 800; display: grid; place-items: center; }

/* ===== Khối tạo mã (form tạo / sửa) — nền tối ===== */
.gen-card { display: grid; grid-template-columns: minmax(0, 1fr) 380px; background: var(--dark); color: #e8e8e8; border-radius: 20px; box-shadow: 0 20px 50px rgba(20, 30, 10, .18); max-width: 1200px; margin: 0 auto; }
.gen-main { padding: 28px 32px 32px; min-width: 0; }
.gen-side { border-left: 1px solid #2e2e2e; padding: 28px 24px; }
.gen-side-in { position: sticky; top: 88px; }
.kind-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.kind-tab input { position: absolute; opacity: 0; pointer-events: none; }
.kind-tab span { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 76px; padding: 10px 8px 8px; border-radius: 8px; color: var(--lime); cursor: pointer; transition: background .15s; }
.kind-tab em { font-style: normal; font-size: .75rem; color: #cfcfcf; white-space: nowrap; }
.kind-tab span:hover { background: #2a2a2a; }
.kind-tab input:checked + span { background: var(--dark-3); color: #fff; }
.kind-tab input:checked + span em { color: #fff; font-weight: 600; }
.kind-tab input:focus-visible + span { outline: 2px solid var(--lime); outline-offset: 1px; }
.gen-sec { border-top: 1px solid #2e2e2e; padding-top: 24px; margin-top: 20px; }
.gen-title { color: #fff; font-size: 1.25rem; font-weight: 600; margin: 0 0 16px; }
.gen-title small { color: var(--muted-2); font-size: .8125rem; font-weight: 400; margin-left: 8px; }
.gen-card .field > span { color: #d6d6d6; }
.gen-card .field small { color: #9a9a9a; }
.gen-card .req { color: #ff8a80; }
.gen-card input:not([type=checkbox]):not([type=radio]):not([type=file]), .gen-card select, .gen-card textarea { border-color: transparent; }
.gen-card input:focus, .gen-card select:focus, .gen-card textarea:focus { outline-color: rgba(168, 214, 114, .55); }
.gen-card .hint, .gen-card .field-note { color: #a3a3a3; }
.gen-card .hint b { color: #fff; }
.gen-card a:not(.btn), .gen-card .link-btn { color: var(--lime); }
.gen-card .muted { color: #a3a3a3; }
.field-note { display: block; font-size: .8125rem; margin-top: 6px; color: var(--muted-2); }
.gen-card .switch { color: #e8e8e8; }
.gen-opts .field-note { margin: 8px 0 0 50px; }
.pin-ways { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr); gap: 12px; margin-bottom: 8px; }
.pin-way { background: var(--dark-2); border: 1px solid var(--dark-3); border-radius: 12px; padding: 14px; min-width: 0; }
.pin-way-title { font-size: .875rem; color: #d6d6d6; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.pin-way-title b { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--lime); color: var(--dark); font-size: .75rem; }
.pin-search-title { margin: 16px 0 10px; }
.search-row { display: flex; gap: 8px; }
.search-row input { flex: 1; min-width: 0; }
.search-row .btn { border-radius: 9999px; min-height: 44px; }
.pin-status { font-size: .875rem; margin-top: 8px; }
.pin-status:empty { display: none; }
.pin-status.ok { color: #9fe0a2; }
.pin-status.warn { color: #ffcf8a; }
.pin-status.bad { color: #ff9e97; }
.how { margin: 4px 0 0; font-size: .875rem; color: #bdbdbd; }
.how summary { cursor: pointer; color: var(--lime); font-weight: 500; }
.how ul { margin: 8px 0 0; padding-left: 20px; }
.how li { margin-bottom: 4px; }
.geo-results { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; }
.geo-results button { text-align: left; background: var(--dark-2); color: #e8e8e8; border: 1px solid var(--dark-3); border-radius: 10px; padding: 9px 12px; font: inherit; font-size: .875rem; cursor: pointer; }
.geo-results button:hover { background: #303030; }
.geo-results .muted { color: #a3a3a3; }
.coords-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; margin-top: 10px; font-size: .875rem; }
.gen-card .coords-row { color: #cfcfcf; }
.gen-card .coords-row b { color: #fff; }
.photo-slots { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.photo-slot { background: var(--dark-2); border: 1px dashed #454545; border-radius: 12px; padding: 14px; min-width: 0; }
.photo-slot-title { font-weight: 500; font-size: .875rem; color: #d6d6d6; margin-bottom: 10px; }
.file-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 8px 16px; border-radius: 9999px; background: #fff; color: var(--text); font-weight: 600; font-size: .9375rem; cursor: pointer; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo-current { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.photo-current img { width: 110px; height: 82px; object-fit: cover; border-radius: 8px; }
.photo-new { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.photo-new img { max-height: 150px; border-radius: 10px; }
.gen-card .check { color: #d6d6d6; font-size: .875rem; }
.gen-card .dup-box { color: #6b3a03; }
.gen-card .dup-box a { color: #7a4a0c; }
.gen-card .dup-confirm { color: var(--text); }
.gen-card .alert { margin-bottom: 20px; }
/* Cột xem trước biển */
.preview-stage { background: #fff; border-radius: 12px; padding: 16px; display: flex; justify-content: center; align-items: center; min-height: 220px; }
.preview-stage canvas { display: block; max-width: 100%; max-height: 360px; width: auto; height: auto; border-radius: 10px; box-shadow: 0 6px 18px rgba(0, 0, 0, .18); }
.preview-opts { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.preview-tpls { display: flex; gap: 6px; flex-wrap: wrap; }
.preview-colors { display: flex; gap: 8px; flex-wrap: wrap; }
.tpl-opt span { white-space: nowrap; }
.tpl-opt input, .color-opt input { position: absolute; opacity: 0; pointer-events: none; }
.tpl-opt span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 8px; border: 1px solid #3c3c3c; color: #cfcfcf; font-size: .8125rem; cursor: pointer; }
.tpl-opt input:checked + span { border-color: var(--lime); color: #fff; background: #2c2c2c; }
.tpl-shape { display: inline-block; border: 1.5px solid currentColor; border-radius: 2px; }
.tpl-ngang { width: 15px; height: 10px; }
.tpl-doc { width: 10px; height: 15px; }
.tpl-vuong { width: 12px; height: 12px; }
.color-opt i { display: block; width: 24px; height: 24px; border-radius: 50%; border: 2px solid #3c3c3c; cursor: pointer; }
.color-opt input:checked + i { border-color: var(--lime); box-shadow: 0 0 0 2px var(--dark), 0 0 0 4px var(--lime); }
.tpl-opt input:focus-visible + span, .color-opt input:focus-visible + i { outline: 2px solid var(--lime); outline-offset: 2px; }
.preview-note { font-size: .8125rem; color: #a3a3a3; margin: 12px 0 14px; }
.gen-side .agree { margin: 0 0 14px; }
.gen-side .btn-block + .btn-block { margin-top: 10px; }
.gen-legal { font-size: .75rem; color: #8a8a8a; margin: 12px 0 0; }

/* ===== Bản đồ ===== */
.map { position: relative; height: 300px; border-radius: 12px; border: 1px solid var(--line); overflow: hidden; z-index: 0; }
.gen-card .map { border: 0; }
.map-pick { height: 400px; cursor: crosshair; margin-top: 14px; }
.map-notice { position: absolute; left: 10px; right: 10px; bottom: 28px; z-index: 1000; background: rgba(255, 255, 255, .96); border: 1px solid #f3d6a6; color: #6b3a03; border-radius: 10px; padding: 10px 12px; font-size: .875rem; box-shadow: var(--shadow); }
.sea-label { color: #fff; text-align: center; font-size: 11px; line-height: 1.15; font-weight: 700; background: rgba(11, 78, 162, .78); border-radius: 6px; padding: 3px 6px; white-space: nowrap; text-shadow: 0 1px 2px rgba(0, 0, 0, .5); pointer-events: none; }
.sea-label small { font-weight: 500; opacity: .95; }
.pin-icon { background: none; border: 0; }
.me-dot { width: 18px; height: 18px; border-radius: 50%; background: #1a73e8; border: 3px solid #fff; box-shadow: 0 0 0 2px rgba(26, 115, 232, .35); }
.map-links { margin-top: 8px; font-size: .875rem; color: var(--muted); }

/* ===== Trang công khai của địa điểm ===== */
.place { max-width: 680px; margin: 0 auto; }
.place-head { margin-bottom: 16px; }
.place-head h1 { margin-bottom: 10px; }
.code-badge { display: inline-block; font-size: .875rem; padding: 4px 12px; border-radius: 999px; background: #fff; border: 1px dashed #9aa39a; }
.code-badge b { letter-spacing: .08em; }
.addr-card .label { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.addr-main { font-size: 1.5rem; font-weight: 700; line-height: 1.25; margin: 6px 0; }
.addr-sub { font-size: 1.0625rem; color: var(--muted); margin-bottom: 10px; }
.addr-old { font-size: .9375rem; color: var(--muted); margin-bottom: 12px; }
.addr-old span { font-weight: 600; }
.action-grid { display: grid; grid-template-columns: 1fr; gap: 10px; margin-bottom: 16px; }
.action-grid .btn { min-height: 52px; font-size: 1.0625rem; }
.action-grid .btn-primary { font-size: 1.125rem; min-height: 56px; }
.action-grid .btn:not(.btn-primary):not(.btn-call):not(.btn-zalo) { background: #fff; border-color: var(--line); }
@media (min-width: 520px) { .action-grid { grid-template-columns: 1fr 1fr; } .action-grid .btn-primary { grid-column: 1 / -1; } }
.photo { width: 100%; border-radius: 10px; display: block; }
.btn-check { margin-top: 12px; background: #fff; border-color: var(--primary); color: var(--primary); }
.btn-check:hover { background: var(--primary-soft); }
.check-result { margin-top: 10px; padding: 12px 14px; border-radius: 10px; border: 1px solid; }
.check-result.ok { background: var(--ok-soft); border-color: #bfe0c0; color: #1f4f21; }
.check-result.warn { background: var(--warn-soft); border-color: #f3d6a6; color: #6b3a03; }
.check-result.bad { background: var(--bad-soft); border-color: #f3c3bf; color: #7a1a14; }
.check-result small { display: block; margin-top: 4px; opacity: .85; }
.place-meta { font-size: .875rem; color: var(--muted); padding: 4px 4px 0; }
.flag summary { cursor: pointer; color: var(--muted); text-decoration: underline; }
.flag-form { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.flag-form select, .flag-form input { flex: 1 1 180px; }
.plus-row { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); display: flex; flex-direction: column; gap: 2px; }
.plus-row .label { display: inline; margin-right: 6px; }
.plus { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .04em; font-size: 1.05rem; }
.plus-actions { font-size: .9375rem; }
.gallery { display: grid; gap: 10px; }
.gallery-2 { grid-template-columns: 1fr 1fr; }
.gallery .photo { aspect-ratio: 4 / 3; object-fit: cover; }
.gallery-1 .photo { aspect-ratio: auto; }
.cta-card { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; justify-content: space-between; background: var(--hero); border-radius: var(--radius); padding: 20px 22px; margin: 20px 0; }
.cta-card p { margin: 2px 0 0; color: var(--muted); font-size: .9375rem; }
.more-link { text-align: center; font-weight: 600; margin: 4px 0 0; }

/* ===== Trang quét trên điện thoại (redesign: ảnh nền, tương phản cao, hiện đại) ===== */
.scan { padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
.scan-hero {
  position: relative; min-height: 44vh; padding: 76px 0 26px;
  display: flex; align-items: flex-end;
  background-color: #16231b; background-size: cover; background-position: center;
}
.scan-hero--plain { background-image: linear-gradient(145deg, #17492b 0%, #0f3350 100%); }
.scan-hero-veil { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(9,15,11,.12) 0%, rgba(9,15,11,.34) 42%, rgba(9,15,11,.88) 100%); }
.scan-hero-in { position: relative; z-index: 1; width: 100%; max-width: 712px; margin: 0 auto; padding: 0 16px; color: #fff; }
.scan-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.scan-tag { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: rgba(255, 255, 255, .16); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); border: 1px solid rgba(255, 255, 255, .3); color: #fff; font-size: .8125rem; font-weight: 600; }
.scan-tag svg { width: 16px; height: 16px; }
.scan-tag--ok { background: rgba(47, 125, 50, .72); }
.scan-title { color: #fff; font-size: clamp(1.75rem, 6.4vw, 2.6rem); font-weight: 700; line-height: 1.12; margin: 0 0 12px; letter-spacing: -.015em; text-shadow: 0 2px 18px rgba(0, 0, 0, .45); text-wrap: balance; }
.scan-code { display: inline-flex; align-items: center; gap: 8px; font-size: .875rem; color: rgba(255, 255, 255, .82); }
.scan-code b { letter-spacing: .1em; color: #fff; padding: 3px 10px; border: 1px dashed rgba(255, 255, 255, .5); border-radius: 8px; }

.scan-sheet { position: relative; z-index: 2; margin-top: -22px; background: var(--bg); border-radius: 24px 24px 0 0; box-shadow: 0 -12px 30px rgba(0, 0, 0, .14); padding: 24px 0 8px; }
.scan-wrap { max-width: 680px; }
.scan-card { background: var(--white); border: 1px solid var(--line); border-radius: 16px; padding: 20px; box-shadow: var(--shadow); margin-bottom: 14px; }
.scan-card h2 { font-size: 1.0625rem; margin: 0 0 12px; }
.scan-eyebrow { font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; }
.scan-addr { border-left: 4px solid var(--primary); }
.scan-addr-main { font-size: clamp(1.4rem, 5.5vw, 1.75rem); font-weight: 700; line-height: 1.2; margin: 8px 0 4px; letter-spacing: -.01em; }
.scan-addr-sub { font-size: 1.0625rem; color: var(--muted); }
.scan-addr-old { font-size: .9375rem; color: var(--muted); margin-top: 8px; }
.scan-addr-old b { color: var(--text); font-weight: 600; }
.scan-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.scan-chip { display: inline-flex; align-items: center; gap: 6px; padding: 9px 15px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--text); font: inherit; font-weight: 600; font-size: .9375rem; cursor: pointer; text-decoration: none; transition: border-color .15s, color .15s; }
.scan-chip:hover { border-color: var(--primary); color: var(--primary-dark); }
.scan-plus { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line); display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.scan-plus .scan-eyebrow { flex: 1 0 100%; margin-bottom: 4px; }
.scan-plus .plus { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 1.05rem; letter-spacing: .04em; }
.scan-plus small { flex: 1 0 100%; color: var(--muted); font-size: .8125rem; margin-top: 4px; }

.scan-when-hero { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 12px; padding: 6px 13px; border-radius: 999px; background: rgba(255, 255, 255, .18); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); border: 1px solid rgba(255, 255, 255, .32); color: #fff; font-size: .95rem; font-weight: 600; }
.scan-when { background: var(--primary-soft); border-color: #cfe3bd; border-left: 4px solid var(--primary); }
.scan-when .scan-eyebrow { color: var(--primary-dark); }
.scan-when-main { font-size: clamp(1.3rem, 5.5vw, 1.7rem); font-weight: 700; color: var(--text); line-height: 1.2; margin: 8px 0 2px; letter-spacing: -.01em; }
.scan-when-sub { color: var(--muted); font-size: 1rem; }
.scan-when-org { margin-top: 8px; font-size: .9375rem; color: var(--muted); }
.scan-when-org b { color: var(--text); }
.scan-when .scan-chip { background: #fff; border-color: var(--primary); color: var(--primary-dark); }

.scan-actions { display: grid; grid-template-columns: 1fr; gap: 10px; margin-bottom: 14px; }
.scan-actions.two { grid-template-columns: 1fr 1fr; }
.scan-actions .btn { min-height: 52px; font-size: 1.0625rem; }

.scan-coords { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center; margin-top: 12px; font-size: .875rem; color: var(--muted); }
.scan-coords b { color: var(--text); }

.scan-cta { background: linear-gradient(135deg, var(--dark) 0%, #143a22 100%); color: #fff; border-radius: 18px; padding: 24px 22px; margin: 16px 0; text-align: center; }
.scan-cta b { font-size: 1.125rem; }
.scan-cta p { color: rgba(255, 255, 255, .82); font-size: .9375rem; margin: 6px 0 16px; }
.scan-cta .btn { min-height: 48px; }

.scan-meta { font-size: .8125rem; color: var(--muted); padding: 8px 4px 0; text-align: center; }
.scan-meta p { margin: 0 0 4px; }
.scan-meta .lock { margin-top: 6px; }
.scan-meta b { color: var(--text); }
.scan-flag { margin-top: 12px; }
.scan-flag summary { cursor: pointer; color: var(--muted); text-decoration: underline; font-size: .875rem; }
.scan-flag-form { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; text-align: left; }
.scan-flag-form select, .scan-flag-form input { flex: 1 1 160px; }

.scan-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 900; padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px)); background: rgba(255, 255, 255, .92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(0, 0, 0, .09); }
.scan-bar-in { display: flex; gap: 10px; max-width: 680px; margin: 0 auto; }
.scan-bar .btn { flex: 1; min-height: 52px; font-size: 1.0625rem; }
.scan-bar .btn-primary { flex: 2; }

/* ===== Danh bạ ===== */
.crumbs { font-size: .875rem; color: var(--muted); margin-bottom: 8px; }
.chip-links { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-links a { display: inline-flex; gap: 6px; align-items: center; padding: 7px 14px; border: 1px solid #d5d9d2; border-radius: 999px; background: #fff; text-decoration: none; color: var(--text); font-size: .9375rem; }
.chip-links a b { color: var(--primary); }
.chip-links a.active { border-color: var(--dark); background: var(--dark); color: #fff; font-weight: 600; }
.chip-links a.active b { color: var(--lime); }
.dir-tabs { margin-bottom: 20px; }
.dir-provinces { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin: 20px 0; }
.dir-province h2 a { color: var(--text); text-decoration: none; }
.dir-province h2 a:hover { color: var(--primary); }
.dir-list { display: grid; gap: 12px; }
.dir-item { display: flex; gap: 16px; text-decoration: none; color: var(--text); margin: 0; padding: 14px; }
.dir-item:hover { border-color: var(--primary); }
.dir-thumb { width: 128px; height: 96px; flex: none; border-radius: 10px; overflow: hidden; background: var(--primary-soft); display: grid; place-items: center; font-size: 2rem; }
.dir-thumb img { width: 100%; height: 100%; object-fit: cover; }
.dir-body { min-width: 0; }
.dir-body h2 { margin: 0 0 4px; font-size: 1.125rem; }
.dir-body p { margin: 6px 0 0; font-size: .9375rem; color: var(--muted); }

/* ===== Cẩm nang (bài viết) ===== */
.art-list { display: grid; gap: 14px; margin: 4px 0 24px; }
.art-card { display: block; background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; text-decoration: none; color: var(--text); box-shadow: var(--shadow); }
.art-card:hover { border-color: var(--primary); }
.art-card h3 { font-size: 1.1875rem; font-weight: 600; margin: 0 0 6px; }
.art-card p { margin: 0 0 8px; color: var(--muted); font-size: .9375rem; }
.art-more { color: var(--primary); font-weight: 600; font-size: .9375rem; }
.article .art-meta { color: var(--muted-2); font-size: .875rem; margin: -6px 0 18px; }
.article .lead { font-size: 1.125rem; color: var(--text); }
.article h2 { font-size: 1.375rem; margin-top: 1.6em; }
.article h2 + p, .article h2 + ul, .article h2 + ol { margin-top: .5em; }
.article ul, .article ol { padding-left: 22px; }
.article li { margin-bottom: 8px; }
.article .cta-card { margin: 32px 0; }
.art-related { margin-top: 32px; border-top: 1px solid var(--line); padding-top: 8px; }
.art-related h2 { font-size: 1.25rem; }

/* ===== Trang quản lý ===== */
.manage-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: flex-end; margin-bottom: 20px; }
.manage-head h1 { margin-bottom: 4px; }
.manage-head p { margin: 0; }
.manage-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.opt-row { display: flex; gap: 12px; align-items: flex-start; }
.opt-label { font-weight: 600; width: 40px; padding-top: 8px; flex: none; }
.opt-row .chip-group { margin-bottom: 10px; }
.plate-preview { background: var(--dark); border-radius: 12px; padding: 22px; display: flex; justify-content: center; margin: 6px 0 16px; }
.plate-preview canvas { max-width: 100%; max-height: 420px; width: auto; height: auto; box-shadow: 0 8px 24px rgba(0, 0, 0, .35); border-radius: 18px; }
.qr-card { text-align: center; }
.qr-card .btn-row { justify-content: center; }
.qr-img { display: block; margin: 0 auto 12px; image-rendering: pixelated; }
.copy-box { display: flex; gap: 8px; margin: 10px 0; }
.copy-box input { flex: 1; min-width: 0; font-size: .875rem; background: #f6f7f5 !important; }
.stats { list-style: none; padding: 0; margin: 0; }
.stats li { padding: 4px 0; }
.flag-list { margin: 8px 0 0; padding-left: 18px; font-size: .875rem; }
.tips ul { padding-left: 20px; margin: 0 0 8px; }
.tips li { margin-bottom: 4px; }
.danger-zone { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }

/* ===== Hướng dẫn ===== */
.prose h2 { margin-top: 1.6em; font-size: 1.375rem; }
.prose li { margin-bottom: 6px; }
.prose details { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; margin-bottom: 8px; }
.prose summary { font-weight: 600; cursor: pointer; }
.prose details p { margin: 8px 0 0; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; background: #fff; border-radius: 10px; overflow: hidden; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #f6f7f5; font-size: .875rem; font-weight: 600; }

/* ===== Cảnh báo trùng địa chỉ ===== */
.dup-box h2 { font-size: 1.125rem; color: #6b3a03; }
.dup-box ul { margin: 6px 0 10px; }
.dup-confirm { background: #fff; border: 2px solid #f0b35b; border-radius: 10px; padding: 12px; margin: 10px 0 6px; color: var(--text); }
.dup-confirm-bottom { border: 1px solid #f0b35b; border-radius: 8px; padding: 10px; }

/* ===== Quản trị ===== */
.admin-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.admin-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.admin-tabs a { padding: 10px 14px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.admin-tabs a.active { color: var(--text); border-bottom-color: var(--primary); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.tile { display: flex; flex-direction: column; gap: 2px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; text-decoration: none; color: var(--text); box-shadow: var(--shadow); }
.tile b { font-size: 1.625rem; line-height: 1.1; font-weight: 600; }
.tile span { font-size: .8125rem; color: var(--muted); }
.tile:hover { border-color: var(--primary); }
.tile-bad b { color: var(--bad); }
.tile-warn b { color: var(--warn); }
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 12px; }
.filter-bar input[name=q] { flex: 1 1 220px; width: auto; }
.filter-bar select { width: auto; }
.filter-bar .check { margin: 0; align-items: center; }
.filter-bar .check input { margin-top: 0; }
.card.flush { padding: 0; overflow: hidden; }
.admin-table { border-radius: 0; }
.admin-table td { font-size: .9375rem; }
.admin-table .row-title { color: var(--text); font-weight: 600; text-decoration: none; }
.admin-table .row-title:hover { color: var(--primary); }
.row-deleted { background: #fafafa; }
.row-deleted td { color: #9ca3af; }
.row-deleted .row-title { color: #9ca3af; text-decoration: line-through; }
.nowrap { white-space: nowrap; }
.badges { display: flex; flex-wrap: wrap; gap: 4px; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: .75rem; font-weight: 600; white-space: nowrap; text-decoration: none; }
.badge a { color: inherit; text-decoration: none; }
.b-ok { background: var(--ok-soft); color: var(--ok); }
.b-warn { background: var(--warn-soft); color: var(--warn); }
.b-bad { background: var(--bad-soft); color: var(--bad); }
.b-muted { background: #eef0ec; color: #6b6f68; }
.b-info { background: var(--primary-soft); color: var(--primary-dark); padding: 6px 10px; }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin-top: 12px; }
.info { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; margin: 0; }
.info dt { color: var(--muted); font-size: .875rem; }
.info dd { margin: 0; overflow-wrap: anywhere; }
.thumb { width: 96px; height: 72px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); vertical-align: middle; }
.history td { font-size: .875rem; }
.diff { list-style: none; margin: 0; padding: 0; }
.diff li { padding: 2px 0; }
.diff .old { background: var(--bad-soft); color: #7a1a14; padding: 0 4px; border-radius: 4px; text-decoration: line-through; }
.diff .new { background: var(--ok-soft); color: #1f4f21; padding: 0 4px; border-radius: 4px; }
.diff .thumb { width: 64px; height: 48px; }
.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li { padding: 8px 0; border-top: 1px solid var(--line); }
.mini-list li:first-child { border-top: 0; }
.admin-ops { display: flex; flex-direction: column; gap: 8px; }
.admin-ops form, .admin-ops .btn { width: 100%; }
.card-bad { border-color: #f3c3bf; }
.count { display: inline-block; min-width: 28px; text-align: center; font-weight: 700; }
.count-warn { color: var(--warn); }
.count-bad { color: var(--bad); }
.login-card { max-width: 420px; margin-top: 40px; }

/* ===== In: chỉ in tấm biển, đúng kích thước thật ===== */
#print-area { display: none; }
@page { margin: 12mm; }
@media print {
  body { background: #fff; }
  body > *:not(#print-area) { display: none !important; }
  #print-area { display: block; }
  #print-area img { display: block; outline: .2mm dashed #999; outline-offset: 1.5mm; }
  #print-area p { font: 9pt Arial, sans-serif; color: #666; margin-top: 4mm; }
}

/* ===== Màn hình nhỏ ===== */
@media (max-width: 1080px) {
  .feat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 960px) {
  .gen-card { grid-template-columns: 1fr; }
  .gen-side { border-left: 0; border-top: 1px solid #2e2e2e; }
  .gen-side-in { position: static; max-width: 480px; margin: 0 auto; }
  .split-card { grid-template-columns: 1fr; }
  .manage-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .sec { padding: 56px 0; }
  .stats-band { padding: 44px 0; }
  .steps3 { grid-template-columns: 1fr; }
  .stats-grid b { font-size: 2.25rem; }
  .pin-ways { grid-template-columns: 1fr; }
  .trust-bar { padding: 14px 16px; }
  .trust-bar .lookup input { flex: 1; width: auto; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 12px; }
  .hero { padding: 24px 0 40px; }
  .hero-sub { margin-bottom: 20px; }
  .gen-card { border-radius: 16px; }
  .gen-main { padding: 18px 16px 22px; }
  .gen-side { padding: 20px 16px; }
  .kind-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
  .kind-tab span { min-width: 0; }
  .photo-slots { grid-template-columns: 1fr; }
  .feat-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr; gap: 20px; }
  .split-text, .split-art { padding: 24px; }
  .card { padding: 16px; }
  .nav { gap: 12px; }
  .nav a:not(.btn) { display: none; }
  .hide-sm { display: none; }
  .map-pick { height: 320px; }
  .opt-row { flex-direction: column; gap: 4px; }
  .opt-label { padding-top: 0; }
  .dir-thumb { width: 88px; height: 72px; }
  .page-hero { padding: 26px 0 28px; }
  .page-hero p { font-size: 1rem; }
}
