/* TingPush — website giới thiệu.
   Ngôn ngữ hình ảnh lấy từ tấm biển số và hạ tầng đường: chữ in hẹp như biển số, nhựa đường, vàng biển kinh doanh,
   xanh biển báo giao thông. Một điểm nhấn: khung camera đang đọc biển ở đầu trang. */

:root {
    --asphalt: #1f2326;
    --asphalt-2: #2b3034;
    --asphalt-3: #3a4045;
    --paper: #f3f5f6;
    --white: #ffffff;
    --line: #d4d9dc;
    --ink: #1f2326;
    --muted: #5d656b;
    --yellow: #f2c200;
    --yellow-ink: #3a2f00;
    --blue: #1c5fb8;
    --blue-dark: #154a90;
    --red: #d7372f;
    --green: #1e8e4e;
    --violet: #6d4bd1;
    --teal: #0f8a83;
    --orange: #d9670f;

    --display: "Barlow Condensed", "Arial Narrow", sans-serif;
    --body: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", sans-serif;

    --step--1: .875rem;
    --step-0: 1rem;
    --step-1: 1.25rem;
    --step-2: 1.6rem;
    --step-3: 2.25rem;
    --step-4: clamp(2.6rem, 5.4vw, 4.4rem);

    --gutter: clamp(16px, 4vw, 40px);
    --max: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font: 400 var(--step-0)/1.6 var(--body);
    /* trang ngắn: chân trang vẫn nằm sát đáy màn hình */
    min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1 0 auto; }
img { max-width: 100%; height: auto; }
a { color: var(--blue); text-underline-offset: .18em; }
a:hover { color: var(--blue-dark); }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
h1, h2, h3 {
    font-family: var(--display);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: .005em;
    margin: 0 0 .5em;
}
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); font-weight: 600; }
p { margin: 0 0 1em; max-width: 68ch; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--yellow); color: var(--yellow-ink); padding: 8px 14px; z-index: 50; }
.skip:focus { left: 8px; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
main > section, main > article { padding-top: clamp(48px, 7vw, 88px); padding-bottom: clamp(48px, 7vw, 88px); }
main > section.wrap + section.wrap:not(.product) { padding-top: 16px; }
h1:focus { outline: none; }

/* ---------------------------------------------------------------- nút */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 46px; padding: 0 22px;
    font: 600 var(--step-1)/1 var(--display); letter-spacing: .02em;
    border: 2px solid transparent; border-radius: 6px;
    text-decoration: none; cursor: pointer;
    transition: background-color .15s, border-color .15s, color .15s;
}
.btn-yellow { background: var(--yellow); color: var(--yellow-ink); }
.btn-yellow:hover { background: #ffd31f; color: var(--yellow-ink); }
.btn-blue { background: var(--blue); color: var(--white); }
.btn-blue:hover { background: var(--blue-dark); color: var(--white); }
.btn-ghost { border-color: rgba(255,255,255,.55); color: var(--white); }
.btn-ghost:hover { border-color: var(--white); color: var(--white); background: rgba(255,255,255,.06); }
.btn-line { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-line:hover { background: var(--ink); color: var(--white); }
.btn-small { min-height: 36px; padding: 0 14px; font-size: var(--step-0); background: var(--blue); color: #fff; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--blue); font: inherit; cursor: pointer; text-decoration: underline; }
.link-btn.danger { color: var(--red); }

/* ---------------------------------------------------------------- đầu trang */
.top { background: var(--white); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.top-in { display: flex; align-items: center; gap: 24px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
/* logo: biểu tượng (wwwroot/logo.svg, sinh từ branding/) + tên cùng font Barlow Condensed với logo chữ */
.brand-mark { display: block; width: 40px; height: 40px; flex: none; }
.brand-name { font: 700 1.75rem/1 var(--display); letter-spacing: .005em; color: var(--ink); }
.brand-sub { font: 600 1.05rem/1 var(--display); color: var(--muted); padding-left: 10px; border-left: 1px solid var(--line); }
.nav { display: flex; align-items: center; gap: 22px; margin-left: auto; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 500; font-size: .95rem; }
.nav a.active { color: var(--blue); box-shadow: inset 0 -2px 0 var(--blue); }
.nav a:hover { color: var(--blue); }
/* đổi ngôn ngữ: ô nhỏ "EN" / "VI" */
.nav .nav-lang { font: 600 .9rem/1 var(--display); letter-spacing: .06em; padding: 6px 8px 5px; border: 1.5px solid var(--line); border-radius: 4px; }
.nav .nav-lang:hover { border-color: var(--blue); }
.doc-lang { display: inline-block; margin: 0 0 20px; padding: 6px 12px; background: var(--white); border: 1px solid var(--line); border-radius: 4px; font-size: var(--step--1); }
.nav .nav-cta { color: var(--white); font-size: var(--step-0); min-height: 40px; }
.nav .nav-cta:hover { color: var(--white); }
.menu-toggle, .menu-btn { display: none; }

@media (max-width: 960px) {
    .menu-btn { display: block; margin-left: auto; width: 44px; height: 44px; cursor: pointer; position: relative; }
    .menu-btn span, .menu-btn span::before, .menu-btn span::after {
        position: absolute; left: 10px; right: 10px; height: 2px; background: var(--ink); content: "";
    }
    .menu-btn span { top: 21px; }
    .menu-btn span::before { top: -7px; left: 0; right: 0; }
    .menu-btn span::after { top: 7px; left: 0; right: 0; }
    .nav {
        display: none; position: absolute; left: 0; right: 0; top: 100%;
        flex-direction: column; align-items: stretch; gap: 0;
        background: var(--white); border-bottom: 1px solid var(--line); padding: 8px var(--gutter) 16px;
    }
    .nav a { padding: 12px 0; border-bottom: 1px solid var(--paper); }
    .nav .nav-cta { margin-top: 12px; }
    .nav .nav-lang { border: 0; border-bottom: 1px solid var(--paper); border-radius: 0; padding: 12px 0; font: 500 .95rem/1.6 var(--body); letter-spacing: 0; }
    .nav .nav-lang [aria-hidden] { display: none; }
    .nav .nav-lang .sr-only { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
    .menu-toggle:checked ~ .nav { display: flex; }
    .menu-toggle:focus-visible + .menu-btn { outline: 3px solid var(--yellow); }
    .menu-toggle { display: block; position: absolute; opacity: 0; width: 44px; height: 44px; right: var(--gutter); }
}

/* ---------------------------------------------------------------- biển số */
.plate {
    display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
    background: #fbfbf7; color: #111;
    border: 3px solid #111; border-radius: 6px;
    box-shadow: inset 0 0 0 2px #fbfbf7, inset 0 0 0 3.5px #111, 0 2px 0 rgba(0,0,0,.25);
    font-family: var(--display); font-weight: 600; letter-spacing: .03em;
    padding: .18em .5em .12em;
    white-space: nowrap;
}
.plate-yellow { background: var(--yellow); box-shadow: inset 0 0 0 2px var(--yellow), inset 0 0 0 3.5px #111, 0 2px 0 rgba(0,0,0,.25); }
.plate-1 { font-size: 2rem; line-height: 1; }
.plate-2 { font-size: 1.5rem; line-height: 1.02; padding: .22em .55em .16em; }

/* ---------------------------------------------------------------- hero: camera ở cổng đang đọc biển */
.hero { background: var(--asphalt); color: var(--white); overflow: hidden; padding-block: clamp(40px, 6vw, 72px) clamp(48px, 7vw, 88px); }
.hero-in { display: grid; grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr); gap: clamp(28px, 5vw, 64px); align-items: center; }
.hero h1 { color: var(--white); max-width: 12ch; font-size: clamp(2.6rem, 5.2vw, 4.6rem); line-height: .98; }
.hero .lead { color: #c9cfd3; font-size: var(--step-1); line-height: 1.55; max-width: 32em; }
.hero-facts { list-style: none; margin: 32px 0 0; padding: 20px 0 0; border-top: 1px solid var(--asphalt-3); display: flex; flex-wrap: wrap; gap: 10px 26px; color: #dfe3e6; font-size: var(--step--1); }
.hero-facts li { display: flex; align-items: center; gap: 8px; }
.hero-facts li::before { content: ""; width: 14px; height: 8px; border: solid var(--yellow); border-width: 0 0 2.5px 2.5px; transform: rotate(-45deg) translateY(-2px); }

.cam { margin: 0; }
.cam-view { position: relative; border-radius: 10px; overflow: hidden; border: 1px solid var(--asphalt-3); background: #14181b; box-shadow: 0 30px 60px -30px rgba(0,0,0,.8); }
.scene { display: block; width: 100%; height: auto; }
.scene-plate { font: 700 19px var(--display); fill: #111; letter-spacing: .5px; }
.scene-label { font: 600 14px var(--display); fill: #08223f; }
.cam-live, .cam-name, .cam-time {
    position: absolute; z-index: 2;
    font: 600 .95rem/1 var(--display); letter-spacing: .03em;
    padding: 6px 9px; border-radius: 4px; background: rgba(0,0,0,.55); color: #fff;
}
.cam-live { left: 12px; top: 12px; }
.cam-live::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #ef4444; margin-right: 7px; vertical-align: 1px; }
.cam-name { right: 12px; top: 12px; }
.cam-time { left: 12px; bottom: 12px; background: none; padding: 0; color: rgba(255,255,255,.75); font-variant-numeric: tabular-nums; }

/* bảng "biển số vừa đọc" ngay dưới hình */
.reads { margin-top: 12px; background: var(--asphalt-2); border-radius: 8px; padding: 6px 16px 8px; }
.reads-head { display: flex; justify-content: space-between; gap: 12px; margin: 6px 0 4px; font-size: var(--step--1); color: #9aa3a9; }
.reads ol { list-style: none; margin: 0; padding: 0; }
.reads li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 9px 0; border-top: 1px solid var(--asphalt-3); }
.reads-what { color: #dfe3e6; font-size: var(--step--1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reads time { font: 600 1.05rem/1 var(--display); color: #c9cfd3; font-variant-numeric: tabular-nums; }
.reads-ok { font: 600 .95rem/1 var(--display); color: #8fdcab; }
.reads-ok::before { content: "✓ "; }
.plate.plate-mini { font-size: 1.1rem; line-height: 1.15; padding: .2em .5em .22em; min-width: 6.4em; border-width: 2px; border-radius: 4px; box-shadow: inset 0 0 0 1.5px #fbfbf7, inset 0 0 0 2.5px #111; }
.plate.plate-mini.plate-yellow { box-shadow: inset 0 0 0 1.5px var(--yellow), inset 0 0 0 2.5px #111; }
.reads-new { background: linear-gradient(90deg, rgba(242,194,0,.14), transparent 70%); margin: 0 -16px; padding-inline: 16px !important; }

/* một lần khi tải trang: xe tới, AI khoanh xe rồi khoanh biển, kết quả hiện ra, barie mở */
.scene-car, .scene-vehicle, .scene-lock, .scene-arm { transform-box: view-box; }
.scene-car { transform-origin: 400px 405px; }
.scene-lock { transform-origin: 400px 352px; }
.scene-arm { transform-origin: 742px 431px; }
@media (prefers-reduced-motion: no-preference) {
    .scene-car { animation: car-in 1.4s cubic-bezier(.2,.7,.2,1) both; }
    .scene-vehicle { animation: show .35s ease-out 1.3s both; }
    .scene-lock { animation: lock .6s cubic-bezier(.2,.8,.2,1) 1.7s both; }
    .reads-new { animation: read-in .5s ease-out 2.3s both; }
    .scene-arm { animation: arm-up 1.1s ease-in-out 2.9s both; }
}
@keyframes car-in { from { transform: translateY(-46px) scale(.8); opacity: .3; } to { transform: none; opacity: 1; } }
@keyframes lock { from { opacity: 0; transform: scale(1.5); } to { opacity: 1; transform: none; } }
@keyframes read-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes arm-up { to { transform: rotate(78deg); } }
@keyframes show { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 960px) {
    .hero-in { grid-template-columns: 1fr; }
    .hero h1 { max-width: 14ch; }
}
@media (max-width: 520px) {
    .reads li { grid-template-columns: auto minmax(0, 1fr) auto; }
    .reads-ok { display: none; }
    .reads-head span + span { display: none; }
}

/* ---------------------------------------------------------------- đầu mục */
.section-head { margin-bottom: 32px; }
.section-head p { color: var(--muted); font-size: var(--step-1); line-height: 1.5; }
.band { background: var(--white); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.band-dark { background: var(--asphalt); color: #dfe3e6; border: 0; }
.band-dark h2, .band-dark h3 { color: var(--white); }
.band-dark a { color: #ffd84a; }
.more { margin-top: 24px; }

/* ---------------------------------------------------------------- nhật ký một ngày ở cổng */
.day { display: grid; grid-template-columns: minmax(0, .7fr) minmax(0, 1.3fr); gap: clamp(28px, 6vw, 88px); align-items: start; }
.day-head { position: sticky; top: 100px; }
.day-head p { color: var(--muted); font-size: var(--step-1); line-height: 1.5; margin-bottom: 24px; }
.log { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.log li { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 20px; align-items: start; padding: 24px 0; border-bottom: 1px solid var(--line); }
.log time { font: 700 var(--step-3)/.9 var(--display); letter-spacing: .01em; color: var(--ink); font-variant-numeric: tabular-nums; }
.tag {
    justify-self: start; display: inline-block; padding: 4px 9px 3px; border-radius: 4px; margin-bottom: 10px;
    font: 600 .95rem/1.1 var(--display); letter-spacing: .03em; color: #fff;
}
.tag-plate { background: var(--yellow); color: var(--yellow-ink); }
.tag-count { background: var(--blue); }
.tag-alert { background: var(--red); }
.tag-custom { background: var(--teal); }
.tag-busy { background: var(--orange); }
.tag-face { background: var(--violet); }
.log-body { display: flex; flex-direction: column; align-items: flex-start; }
.log-body p { margin: 0; }
.log-body p + p { color: var(--muted); margin-top: 4px; }
.log-body .log-plate { margin-top: 12px; }
.log-big { font: 600 var(--step-2)/1.1 var(--display); color: var(--ink); }
@media (max-width: 860px) {
    .day { grid-template-columns: 1fr; }
    .day-head { position: static; }
}
@media (max-width: 520px) {
    .log li { grid-template-columns: 58px minmax(0, 1fr); gap: 12px; }
    .log time { font-size: var(--step-2); }
}

/* ---------------------------------------------------------------- hai cột */
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(28px, 5vw, 72px); }
.split h2 { font-size: clamp(1.8rem, 3vw, 2.25rem); }
.split .muted { color: var(--muted); }
/* đường đi của hình: camera -> máy chủ -> điện thoại, chỉ một chiều đi ra */
.flow { list-style: none; margin: 28px 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.flow li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; font: 600 1.1rem/1.15 var(--display); }
.flow svg { width: 64px; height: 64px; padding: 16px; border-radius: 50%; background: var(--asphalt); fill: none; stroke: var(--yellow); stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.flow li + li::before { content: ""; position: absolute; top: 31px; right: calc(50% + 40px); width: calc(100% - 52px); border-top: 2px dashed var(--asphalt-3); }
.flow li + li::after { content: ""; position: absolute; top: 26px; right: calc(50% + 38px); border: 6px solid transparent; border-left: 8px solid var(--asphalt-3); }
.payload { margin: 20px 0; padding: 18px 20px; background: var(--asphalt); color: #dfe3e6; border-radius: 8px; font: 400 .86rem/1.6 ui-monospace, "Cascadia Mono", Consolas, monospace; overflow-x: auto; }
.payload code { white-space: pre; }
@media (max-width: 760px) { .split { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- các bước lắp đặt (thứ tự thật) */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: s; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; }
.steps li { counter-increment: s; padding: 0 24px 0 0; position: relative; }
.steps li::before {
    content: counter(s);
    display: flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; margin-bottom: 16px;
    font: 700 1.5rem/1 var(--display); color: var(--asphalt);
    background: var(--yellow); border-radius: 50%;
}
.steps li::after { content: ""; position: absolute; top: 22px; left: 54px; right: 10px; border-top: 2px dashed var(--asphalt-3); }
.steps li:last-child::after { display: none; }
.steps h3 { font-size: var(--step-1); }
.steps p { color: #b8bfc4; font-size: .95rem; }
@media (max-width: 860px) {
    .steps { grid-template-columns: 1fr 1fr; gap: 28px 0; }
    .steps li::after { display: none; }
}
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- bảng giá */
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--white); }
.plans { width: 100%; border-collapse: collapse; min-width: 640px; }
.plans th, .plans td { padding: 14px 18px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.plans thead th { vertical-align: top; border-bottom: 2px solid var(--ink); padding-top: 20px; }
.plans tbody th { font-weight: 500; color: var(--muted); width: 30%; }
.plans tbody tr:last-child > * { border-bottom: 0; }
.plan-name { display: block; font: 700 var(--step-2)/1 var(--display); }
.plan-price { display: block; font: 600 var(--step-1)/1.2 var(--display); color: var(--blue); margin-top: 6px; }
.plan-unit, .plan-desc { display: block; font-weight: 400; font-size: var(--step--1); color: var(--muted); }

.price-list { width: 100%; max-width: 820px; border-collapse: collapse; margin-bottom: 8px; }
.price-list th, .price-list td { padding: 16px 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.price-list th { font-weight: 600; padding-right: 24px; }
.price-list th span { display: block; font-weight: 400; color: var(--muted); font-size: .95rem; margin-top: 4px; }
.price-list td { white-space: nowrap; font: 600 var(--step-1)/1.3 var(--display); text-align: right; }
.price-list .total th, .price-list .total td { border-bottom: 2px solid var(--ink); }

/* ---------------------------------------------------------------- hỏi đáp */
.faq { display: grid; grid-template-columns: minmax(0, .7fr) minmax(0, 1.3fr); column-gap: clamp(28px, 6vw, 88px); align-items: start; }
.faq h2 { grid-column: 1; grid-row: 1 / span 20; margin-bottom: 20px; }
.faq details { grid-column: 2; border-top: 1px solid var(--line); }
@media (max-width: 860px) { .faq { grid-template-columns: 1fr; } .faq h2, .faq details { grid-column: 1; grid-row: auto; } }
.faq details:last-of-type { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; padding: 18px 32px 18px 0; font-weight: 600; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 12px; font: 600 1.6rem/1 var(--display); color: var(--blue); }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--muted); padding-bottom: 8px; }

/* ---------------------------------------------------------------- lời mời cuối trang */
.cta { background: var(--yellow); }
.cta-in { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.cta h2 { color: var(--yellow-ink); margin: 0; max-width: 28ch; }
.cta .btn-yellow { background: var(--asphalt); color: var(--white); }
.cta .btn-yellow:hover { background: #000; color: var(--white); }

/* ---------------------------------------------------------------- trang con */
.page-head { background: var(--white); border-bottom: 1px solid var(--line); }
.page-head h1 { max-width: 16ch; }
.lead { font-size: var(--step-1); line-height: 1.55; color: var(--muted); max-width: 40em; }
.ticks { list-style: none; padding: 0; margin: 0; }
.ticks li { padding: 10px 0 10px 28px; border-bottom: 1px solid var(--line); position: relative; }
.ticks li::before { content: ""; position: absolute; left: 2px; top: 18px; width: 12px; height: 7px; border-left: 2.5px solid var(--green); border-bottom: 2.5px solid var(--green); transform: rotate(-45deg); }

.product { border-top: 2px solid var(--ink); }
main > section.product { padding-top: 32px; }
.product-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.price { font: 600 var(--step-2)/1 var(--display); color: var(--blue); margin: 0; }
.specs { display: grid; grid-template-columns: minmax(140px, 220px) minmax(0, 1fr); margin: 20px 0 0; max-width: 820px; }
.specs dt, .specs dd { margin: 0; padding: 10px 0; border-bottom: 1px solid var(--line); }
.specs dt { color: var(--muted); padding-right: 16px; }

.solutions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px 64px; }
.solutions article { border-top: 2px solid var(--ink); padding-top: 18px; }
.solutions .uses { color: var(--muted); font-size: .95rem; }
@media (max-width: 760px) { .solutions { grid-template-columns: 1fr; } }

.downloads { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; }
.downloads article { border-top: 2px solid var(--ink); padding-top: 18px; }
@media (max-width: 860px) { .downloads { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- form */
.form-page { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 56px; align-items: start; }
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
.form-1 { grid-template-columns: minmax(0, 1fr); max-width: 760px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-wide, .form > .notice { grid-column: 1 / -1; }
label { font-weight: 500; }
.opt { font-weight: 400; color: var(--muted); }
input:not([type=checkbox]):not([type=hidden]), select, textarea {
    font: inherit; color: var(--ink);
    padding: 11px 12px; border: 1.5px solid #b7bec3; border-radius: 6px; background: var(--white);
    width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--blue); outline: 3px solid rgba(28,95,184,.2); outline-offset: 0; }
textarea { resize: vertical; }
textarea.mono { font-family: Consolas, "Courier New", monospace; font-size: .92rem; }
.check { display: flex; gap: 10px; align-items: center; font-weight: 400; margin: 12px 0; }
.check input { width: 18px; height: 18px; }
.validation-message { color: var(--red); font-size: var(--step--1); }
input.invalid, textarea.invalid { border-color: var(--red); }
.hp { position: absolute; left: -5000px; width: 1px; height: 1px; overflow: hidden; }
.notice { padding: 16px 18px; border-radius: 6px; border-left: 4px solid; margin: 0 0 20px; }
.notice h2 { font-size: var(--step-2); }
.notice-ok { background: #e7f5ec; border-color: var(--green); }
.notice-bad { background: #fbe9e8; border-color: var(--red); }
.contact-side { border-top: 2px solid var(--ink); padding-top: 18px; }
.contact-side h2 { font-size: var(--step-2); }
.big-link { font: 700 var(--step-3)/1 var(--display); text-decoration: none; color: var(--ink); }
@media (max-width: 860px) {
    .form-page { grid-template-columns: 1fr; }
    .form { grid-template-columns: 1fr; }
}

.order { max-width: 860px; }
.order fieldset { border: 0; border-top: 2px solid var(--ink); padding: 18px 0 28px; margin: 0; }
.order legend { font: 700 var(--step-2)/1 var(--display); padding: 0 12px 0 0; }
.order-row { display: grid; grid-template-columns: minmax(0, 1fr) 110px; gap: 16px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.order-name { display: block; font-weight: 600; }
.order-price { display: block; color: var(--muted); font-weight: 400; font-size: .95rem; }
.order-customer { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
.order-customer legend { grid-column: 1 / -1; }
@media (max-width: 640px) { .order-customer { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- tin tức, tài liệu */
.posts { max-width: 860px; }
.post-item { padding: 24px 0; border-bottom: 1px solid var(--line); }
.post-item:first-child { border-top: 2px solid var(--ink); }
.post-item time { color: var(--muted); font-size: var(--step--1); }
.post-item h2 { font-size: var(--step-2); margin: 4px 0 8px; }
.post-item h2 a { color: var(--ink); text-decoration: none; }
.post-item h2 a:hover { color: var(--blue); }
.post-item p { color: var(--muted); margin: 0; }

.article { max-width: 820px; }
.article-doc { max-width: 960px; }
.article-doc:has(.doc-layout) { max-width: 1180px; }
.doc-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 44px; align-items: start; }
.doc-toc { position: sticky; top: 92px; max-height: calc(100vh - 112px); overflow-y: auto; font-size: var(--step--1); border-left: 2px solid var(--line); padding-left: 14px; }
.doc-toc summary { font-weight: 600; cursor: pointer; margin-bottom: 6px; }
.doc-toc ol { list-style: none; margin: 0; padding: 0; }
.doc-toc li { margin: 7px 0; line-height: 1.35; }
.doc-toc a { color: var(--muted); text-decoration: none; }
.doc-toc a:hover { color: var(--blue); }
.prose h2[id], .prose h3[id] { scroll-margin-top: 92px; }
.post-item.lead-doc { background: var(--white); border: 1px solid var(--line); border-left: 4px solid var(--yellow); padding: 20px 22px; margin: 0 0 8px; }
.post-item.lead-doc + .post-item { border-top: 2px solid var(--ink); }
.lead-doc .lead-tag { display: inline-block; font-size: var(--step--1); font-weight: 600; color: var(--yellow-ink); background: var(--yellow); padding: 2px 8px; border-radius: 3px; }
@media (max-width: 1000px) {
    .doc-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .doc-toc { position: static; max-height: none; border: 1px solid var(--line); border-radius: 6px; background: var(--white); padding: 12px 16px; }
}
.crumbs { margin-bottom: 12px; }
.article h1 { font-size: var(--step-4); max-width: none; }
.meta { color: var(--muted); }
.cover { border-radius: 8px; margin: 8px 0 24px; }
.prose { font-size: 1.05rem; }
.prose h2 { font-size: var(--step-2); margin-top: 1.6em; }
.prose h3 { font-size: var(--step-1); margin-top: 1.4em; }
.prose ul, .prose ol { padding-left: 1.3em; max-width: 68ch; }
.prose li { margin: .3em 0; }
.prose code { font-family: Consolas, "Courier New", monospace; font-size: .9em; background: #e6eaec; padding: .1em .35em; border-radius: 3px; }
.prose pre { background: var(--asphalt); color: #e5e8ea; padding: 16px; border-radius: 6px; overflow-x: auto; font-size: .88rem; line-height: 1.5; }
.prose pre code { background: none; padding: 0; color: inherit; }
.prose :not(pre) > code { overflow-wrap: anywhere; }
.prose table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; margin: 1em 0; font-size: .95rem; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.prose th { background: var(--white); }
.prose blockquote { margin: 1em 0; padding: 8px 16px; border-left: 4px solid var(--yellow); background: var(--white); }
.article-cta { margin-top: 48px; padding: 24px; background: var(--white); border: 1px solid var(--line); border-radius: 8px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.article-cta p { margin: 0; font: 600 var(--step-2)/1.1 var(--display); }
.preview { background: var(--white); border: 1px solid var(--line); border-radius: 8px; padding: 20px 24px; }

/* ---------------------------------------------------------------- chân trang */
.foot { background: var(--asphalt); color: #b8bfc4; padding: 56px 0 28px; }
.foot-in { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 32px; }
.brand-foot { margin-bottom: 14px; }
.brand-foot .brand-mark { box-shadow: 0 0 0 1px rgba(255,255,255,.14); border-radius: 9px; }
.brand-foot .brand-name { color: var(--white); }
.foot h2 { font: 600 var(--step-1)/1 var(--display); color: var(--white); margin-bottom: 12px; }
.foot a { display: block; color: #d7dcdf; text-decoration: none; padding: 4px 0; }
.foot a:hover { color: var(--yellow); }
.foot-legal { display: flex; flex-wrap: wrap; gap: 6px 24px; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--asphalt-3); font-size: var(--step--1); }
@media (max-width: 760px) { .foot-in { grid-template-columns: 1fr 1fr; } .foot-brand { grid-column: 1 / -1; } }

/* ---------------------------------------------------------------- quản trị */
.narrow { max-width: 520px; }
.admin { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 36px; padding-top: 32px; padding-bottom: 64px; }
.admin-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 90px; align-self: start; }
.admin-nav a { padding: 9px 12px; border-radius: 6px; color: var(--ink); text-decoration: none; }
.admin-nav a.active { background: var(--white); box-shadow: inset 3px 0 0 var(--blue); font-weight: 600; }
.admin-nav form { padding: 9px 12px; }
.admin h1 { font-size: var(--step-3); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 28px; }
.stats > * { background: var(--white); border: 1px solid var(--line); border-radius: 8px; padding: 16px; color: var(--ink); text-decoration: none; }
.stats strong { display: block; font: 700 var(--step-3)/1 var(--display); color: var(--blue); }
.grid { width: 100%; border-collapse: collapse; background: var(--white); border: 1px solid var(--line); }
.grid th, .grid td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.grid th { background: #eef1f3; font-weight: 600; font-size: .9rem; }
.num { text-align: right !important; white-space: nowrap; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filters a { padding: 6px 12px; border: 1px solid var(--line); border-radius: 20px; text-decoration: none; color: var(--ink); background: var(--white); }
.filters a.on { background: var(--ink); color: var(--white); border-color: var(--ink); }
.head-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.lead-row { background: var(--white); border: 1px solid var(--line); border-radius: 8px; padding: 16px; margin-bottom: 12px; }
.lead-row header { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: baseline; margin-bottom: 6px; }
.lead-row .msg { white-space: pre-wrap; background: var(--paper); padding: 10px; border-radius: 6px; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline-form select { width: auto; }
.inline-form input { flex: 1; min-width: 200px; }
.status { padding: 3px 8px; border-radius: 4px; font-size: .85rem; background: #e6eaec; }
.status-new { background: #fff3c2; }
.status-done { background: #dcf1e4; }
.status-cancelled { background: #f4dcdb; }
@media (max-width: 860px) { .admin { grid-template-columns: 1fr; } .admin-nav { position: static; flex-direction: row; flex-wrap: wrap; } .stats { grid-template-columns: 1fr 1fr; } }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
