:root {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #172b45;
  background: #f2f5fa;
  font-synthesis: none;
  line-height: 1.6;
  --primary: #154d92;
  --primary-dark: #123b70;
  --navy: #102e55;
  --muted: #52657d;
  --line: #dbe3ee;
  --surface: #fff;
  --tint: #edf3fc;
  --radius: 10px;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button, a, select, input { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a, button, input, select, summary { touch-action: manipulation; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid #cf8a13;
  outline-offset: 4px;
}
h1, h2, h3, p { overflow-wrap: anywhere; }
h2 { margin: 0 0 12px; font-size: 21px; line-height: 1.4; letter-spacing: -.3px; }
h3 { margin: 0 0 6px; font-size: 15px; line-height: 1.5; }
section { margin-bottom: 30px; }
.ui-icon { display: inline-block; width: 24px; height: 24px; flex-shrink: 0; vertical-align: middle; }

/* Khung ứng dụng: thanh bên máy tính, thanh dưới trên điện thoại. */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 244px; padding: 32px 20px;
  display: flex; flex-direction: column; background: var(--navy); color: #fff;
}
.brand { display: flex; gap: 12px; align-items: center; padding: 0 8px; font-size: 20px; font-weight: 750; line-height: 1.35; }
.logo { display: grid; place-items: center; width: 44px; height: 48px; flex-shrink: 0; background: var(--primary); color: #fff; border: 1px solid #ffffff30; border-radius: 8px; }
.logo .ui-icon { width: 28px; height: 28px; }
.workspace { margin: 42px 14px 14px; color: #b2c6df; font-size: 10px; font-weight: 650; letter-spacing: 1.2px; }
nav { display: grid; gap: 8px; }
nav a { display: flex; align-items: center; gap: 13px; min-height: 50px; padding: 12px 16px; border-radius: 7px; color: #d1deee; font-size: 14px; font-weight: 600; border: 1px solid transparent; }
nav a > span { display: flex; }
nav a:hover { background: #ffffff0d; color: #fff; }
nav a[aria-current] { background: #fff; color: var(--primary-dark); border-color: #fff; box-shadow: 0 2px 8px #061b3026; }
.sidebar-note { margin-top: auto; padding: 20px 10px 0; border-top: 1px solid #ffffff26; color: #d1deee; font-size: 12px; }
.sidebar-note small { display: block; margin-top: 5px; color: #b2c6df; font-size: 11px; }
.dot { display: inline-block; width: 6px; height: 6px; margin-right: 5px; background: #8cb7f1; border-radius: 50%; }
.shell { margin-left: 244px; max-width: 1600px; }
header { min-height: 70px; padding: 16px 40px; display: flex; align-items: center; justify-content: space-between; gap: 16px; background: var(--surface); border-bottom: 1px solid var(--line); color: #455f7e; font-size: 11px; font-weight: 650; letter-spacing: 1.1px; }
.version { flex-shrink: 0; padding: 4px 11px; border: 1px solid #ccdaed; border-radius: 5px; background: var(--tint); color: var(--primary-dark); letter-spacing: 0; font-size: 11px; }
.safety { display: flex; align-items: center; gap: 12px; margin: 22px 40px 0; padding: 12px 16px; background: #fff8e9; border: 1px solid #e9d39e; border-left: 3px solid #b57712; border-radius: 7px; color: #6f490e; font-size: 12px; }
.safety > span { display: flex; flex-shrink: 0; }
.safety small { display: block; margin-top: 2px; font-size: 11px; }
main { min-height: 75vh; padding: 24px 40px 36px; }
main:focus { outline: none; }
footer { display: flex; justify-content: space-between; gap: 16px; margin: 0 40px; padding: 22px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }

/* Tìm kiếm là trọng tâm của trang chủ. */
.hero { padding: 26px 30px 24px; background: var(--primary-dark); color: #fff; border-radius: var(--radius); margin-bottom: 30px; }
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 15px; }
.eyebrow { margin: 0 0 7px; color: #4c6583; font-size: 10px; letter-spacing: 1.2px; font-weight: 750; }
.hero .eyebrow { margin: 0; color: #d4e4fc; }
.hero-tag { flex-shrink: 0; padding: 3px 7px; border: 1px solid #6b93c7; border-radius: 4px; color: #e0ebfb; font-size: 9px; font-weight: 650; letter-spacing: .6px; }
.hero h1 { margin: 0 0 7px; font-size: 36px; line-height: 1.25; letter-spacing: -.8px; }
.hero > p { margin: 0; color: #deE9fa; font-size: 14px; }
.search-form { display: flex; align-items: center; gap: 12px; margin: 22px 0 28px; padding: 7px 8px 7px 17px; background: #fff; border: 1px solid #b2c6e1; border-radius: 8px; }
.search-form > span { display: flex; color: var(--primary); }
.search-form input { flex: 1; min-width: 0; min-height: 46px; padding: 8px 0; border: 0; border-radius: 2px; background: transparent; color: #172b45; font-size: 15px; }
.search-form input::placeholder { color: #5b6e84; opacity: 1; }
.search-form:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px #296dcc24; }
.search-form button { display: flex; align-items: center; justify-content: center; gap: 18px; flex-shrink: 0; min-height: 46px; padding: 10px 18px; background: var(--primary); border: 1px solid var(--primary); border-radius: 5px; color: #fff; font-size: 14px; font-weight: 650; }
.search-form button:hover { background: #0d3870; }
.search-form button .ui-icon { width: 18px; height: 18px; }
.hero .search-form { margin: 22px 0 0; border-color: #fff; box-shadow: 0 3px 12px #001b4226; }
.hero .search-form:focus-within { outline: 3px solid #a7caff; outline-offset: 4px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.section-heading h2 { margin: 0; }
.count { color: var(--muted); font-size: 12px; white-space: nowrap; }
.categories { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.category { min-width: 0; padding: 21px 18px 17px; background: #fff; border: 1px solid var(--line); border-top: 3px solid #2d67af; border-radius: 8px; transition: border-color .15s, box-shadow .15s; }
.category:hover { border-color: #6994cb; box-shadow: 0 4px 14px #173e6b0c; }
.category-icon, .device-icon { display: grid; place-items: center; flex-shrink: 0; background: var(--tint); color: var(--primary); border: 1px solid #dde7f6; border-radius: 7px; }
.category-icon { width: 46px; height: 46px; margin-bottom: 15px; }
.category-icon .ui-icon { width: 28px; height: 28px; }
.category h3 { font-size: 15px; }
.category p { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.category p .ui-icon { width: 18px; height: 18px; color: var(--primary); }
.text-link { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; color: var(--primary); font-size: 12px; font-weight: 650; white-space: nowrap; }
.text-link .ui-icon { width: 17px; height: 17px; }
.text-link:hover, .back:hover { text-decoration: underline; }

/* Thẻ dữ liệu và tài liệu luôn giữ trạng thái minh họa / nguồn. */
.doc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.doc-card { display: flex; align-items: flex-start; gap: 15px; min-width: 0; padding: 22px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.doc-icon { display: grid; place-items: center; width: 40px; height: 46px; flex-shrink: 0; color: var(--primary); background: var(--tint); border-radius: 5px; }
.doc-content { min-width: 0; }
.meta { margin-bottom: 6px; color: var(--muted); font-size: 11px; }
.meta span { color: var(--muted); }
.doc-card h3 { font-size: 15px; }
.pill { display: inline-block; padding: 3px 7px; background: #f1f3f7; border: 1px solid #dce2eb; border-radius: 4px; color: #4f5f74; font-size: 10px; font-weight: 600; }
.data-label { margin: 10px 0 0; color: #80520c; font-size: 11px; font-weight: 600; }
.muted { color: var(--muted); font-size: 13px; }
.doc-card .muted { margin: 6px 0 0; font-size: 11px; }
.info-note { padding: 15px 18px; background: #e8eff9; border: 1px solid #d5e1f1; border-left: 3px solid #4a77b4; border-radius: 6px; color: #405c7e; font-size: 12px; }
.info-note strong { color: #264c7b; font-size: 13px; }
.info-note p { margin: 5px 0 0; }
.page-heading { margin: 2px 0 24px; }
.page-heading h1 { margin: 0 0 8px; font-size: 32px; letter-spacing: -.6px; line-height: 1.3; }
.page-heading > p:last-child { margin: 0; color: var(--muted); font-size: 14px; }
.filter-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 16px; background: #eaf0f8; border: 1px solid var(--line); border-radius: 8px; font-size: 12px; }
.filter-bar label { font-weight: 650; }
.filter-bar select { min-height: 46px; max-width: 100%; padding: 9px 28px 9px 11px; border: 1px solid #bacce2; border-radius: 5px; background: #fff; color: #233e60; font-size: 13px; }
.result-count { margin: 24px 0 14px; color: var(--muted); font-size: 13px; }
.device-list, .fault-list { display: grid; gap: 14px; }
.device-card { display: flex; align-items: center; gap: 18px; min-width: 0; padding: 22px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.device-card:hover { border-color: #6994cb; }
.device-card > div { min-width: 0; }
.device-card p:not(.data-label) { margin: 0; color: var(--muted); font-size: 13px; }
.device-icon { width: 52px; height: 58px; }
.device-icon .ui-icon { width: 28px; height: 28px; }
.arrow { display: flex; margin-left: auto; color: var(--primary); }
.arrow .ui-icon { width: 20px; height: 20px; }
.empty { grid-column: 1/-1; padding: 40px 24px; text-align: center; border: 1px dashed #b8cbe1; border-radius: var(--radius); background: #fff; }
.empty > span { display: block; margin-bottom: 15px; color: var(--primary); }
.empty > span .ui-icon { width: 36px; height: 36px; }
.empty p { margin-bottom: 0; color: var(--muted); font-size: 13px; }
.approval-note { padding: 17px 20px; background: var(--tint); border: 1px solid #cfddf0; border-left: 3px solid #4a77b4; border-radius: 7px; color: #284b75; font-size: 13px; }
.approval-note p { margin: 5px 0 0; color: #405c7e; font-size: 12px; }
.panel { margin-top: 22px; padding: 26px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.panel p { color: var(--muted); font-size: 14px; }
.panel .data-label { color: #80520c; font-size: 11px; }
.panel h2:not(:first-child) { margin-top: 24px; }
dl { margin: 16px 0 0; }
dl > div { display: flex; gap: 24px; padding: 14px 0; border-bottom: 1px solid #e6ecf4; font-size: 13px; }
dt { width: 125px; flex-shrink: 0; color: #4f6480; }
dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.back { display: inline-flex; align-items: center; min-height: 44px; margin-bottom: 16px; color: var(--primary); font-size: 13px; font-weight: 600; }
.about .logo { margin-bottom: 20px; }
.search-hint { color: var(--muted); font-size: 12px; }
.search-hint button { min-height: 44px; margin: 3px; padding: 5px 10px; border: 1px solid #bdcee5; border-radius: 5px; background: #fff; color: var(--primary-dark); font-size: 12px; font-weight: 600; }
.search-hint button:hover { background: #e2ecfa; }
.fault-card { min-width: 0; padding: 22px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.fault-header { display: flex; align-items: center; gap: 16px; }
.fault-header > div { min-width: 0; }
.fault-code { min-width: 80px; padding: 10px 14px; background: var(--tint); border: 1px solid #d9e5f5; border-radius: 6px; color: var(--primary-dark); font-family: ui-monospace, monospace; font-size: 20px; font-weight: 750; text-align: center; }
.fault-header .meta { margin: 0 0 4px; }
.fault-header h3 { margin: 0; }
.fault-card details { margin-top: 16px; padding-top: 8px; border-top: 1px solid var(--line); }
.fault-card summary { min-height: 44px; padding: 10px 0; color: var(--primary); font-size: 13px; font-weight: 650; cursor: pointer; }
.fault-card details[open] summary { border-bottom: 1px solid var(--line); }
.pdf-link { display: inline-block; min-height: 44px; margin-top: 8px; padding: 10px 0; color: var(--primary); font-size: 12px; font-weight: 650; text-decoration: underline; text-underline-offset: 3px; }
.pdf-link .ui-icon { width: 14px; height: 14px; margin-left: 5px; }
.source-status { color: #405c7e; font-size: 12px; }
.source-pill { background: #e7effc; border-color: #c9d9f1; color: #234e85; }
.reference-card .muted { font-size: 12px; line-height: 1.7; }
.fault-card .muted { font-size: 13px; }
.sr-only, .skip { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.skip:focus { position: fixed; top: 10px; left: 10px; z-index: 10; width: auto; height: auto; clip-path: none; padding: 12px; border: 2px solid var(--primary); background: #fff; color: var(--primary-dark); }

@media (max-width: 1100px) {
  .sidebar { width: 212px; padding: 28px 14px; }
  .brand { font-size: 18px; gap: 10px; }
  .shell { margin-left: 212px; }
  header { padding: 16px 26px; }
  main { padding: 22px 26px 30px; }
  .safety { margin: 20px 26px 0; }
  footer { margin: 0 26px; }
  .categories { gap: 12px; }
  .category { padding: 18px 13px; }
  .category h3 { font-size: 13px; }
  .filter-bar label[for="fault-brand"] { flex-basis: 100%; }
}
@media (min-width: 701px) and (max-width: 900px) {
  .categories, .doc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .doc-grid { grid-template-columns: 1fr; }
  .hero { padding: 24px; }
  .hero-top { align-items: flex-start; }
  .hero h1 { font-size: 30px; }
  .hero-tag { display: none; }
}
@media (max-width: 700px) {
  .sidebar { inset: auto 0 0; z-index: 5; width: auto; height: auto; padding: 5px 8px calc(5px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid #cad7e8; background: #fff; box-shadow: 0 -3px 16px #14345b0a; }
  .brand, .workspace, .sidebar-note { display: none; }
  nav { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
  nav a { min-height: 58px; padding: 7px 2px; flex-direction: column; gap: 3px; color: #52657d; font-size: 11px; line-height: 1.4; border-radius: 6px; }
  nav a:hover { background: var(--tint); color: var(--primary-dark); }
  nav a[aria-current] { border-color: #d2e0f4; background: #e7effc; color: #123b70; box-shadow: none; }
  nav .ui-icon { width: 23px; height: 23px; }
  .shell { margin-left: 0; padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
  header { min-height: 56px; padding: 12px 18px; gap: 10px; font-size: 9px; letter-spacing: .5px; }
  .version { padding: 3px 7px; font-size: 10px; }
  .safety { margin: 16px 16px 0; padding: 10px 11px; gap: 9px; align-items: flex-start; font-size: 11px; }
  .safety .ui-icon { width: 20px; height: 20px; }
  .safety small { margin-top: 3px; font-size: 10px; line-height: 1.5; }
  main { padding: 18px 16px 26px; }
  section { margin-bottom: 26px; }
  .hero { padding: 20px 18px 18px; margin-bottom: 25px; }
  .hero-top { margin-bottom: 12px; }
  .hero .eyebrow { font-size: 9px; letter-spacing: .7px; }
  .hero-tag { display: none; }
  .hero h1 { font-size: 27px; letter-spacing: -.7px; }
  .hero > p { font-size: 12px; line-height: 1.7; }
  .hero .search-form { margin-top: 18px; }
  .search-form { gap: 8px; padding: 6px 6px 6px 10px; margin: 20px 0 24px; }
  .search-form > span .ui-icon { width: 20px; height: 20px; }
  .search-form input { min-height: 44px; font-size: 16px; }
  .search-form input::placeholder { font-size: 12px; }
  .search-form button { min-height: 44px; padding: 9px 10px; gap: 0; font-size: 12px; }
  .search-form button > span { display: none; }
  .section-heading { gap: 10px; margin-bottom: 14px; }
  .section-heading h2, h2 { font-size: 19px; }
  .section-heading .eyebrow { font-size: 9px; letter-spacing: 1px; }
  .count { font-size: 11px; }
  .categories { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .category { padding: 17px 15px 14px; }
  .category-icon { width: 42px; height: 42px; margin-bottom: 13px; }
  .category-icon .ui-icon { width: 26px; height: 26px; }
  .category h3 { font-size: 14px; }
  .category p { font-size: 11px; }
  .text-link { gap: 4px; font-size: 11px; }
  .text-link .ui-icon { width: 15px; height: 15px; }
  .doc-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .doc-card { padding: 18px 15px; gap: 12px; }
  .doc-icon { width: 34px; height: 42px; }
  .doc-icon .ui-icon { width: 22px; height: 22px; }
  .doc-card h3 { font-size: 14px; }
  .meta { font-size: 11px; }
  .data-label { font-size: 10px; }
  .page-heading h1 { font-size: 28px; }
  .page-heading > p:last-child { font-size: 13px; }
  .filter-bar { display: grid; grid-template-columns: minmax(0, 1fr); gap: 7px; padding: 14px; }
  .filter-bar select { width: 100%; min-width: 0; margin-bottom: 6px; font-size: 14px; }
  .filter-bar select:last-child { margin-bottom: 0; }
  .device-card { padding: 16px 13px; gap: 12px; }
  .device-icon { width: 40px; height: 48px; }
  .device-icon .ui-icon { width: 25px; height: 25px; }
  .device-card h3 { font-size: 14px; }
  .device-card p:not(.data-label) { font-size: 12px; }
  .arrow .ui-icon { width: 17px; height: 17px; }
  .panel, .fault-card { padding: 18px; }
  .panel p { font-size: 13px; }
  .panel .data-label { font-size: 10px; }
  dl > div { gap: 12px; font-size: 13px; }
  dt { width: 90px; }
  .fault-header { gap: 12px; }
  .fault-code { min-width: 64px; padding: 8px; font-size: 18px; }
  .fault-header h3 { font-size: 14px; }
  .fault-card dl > div { display: block; }
  .fault-card dt { width: auto; margin-bottom: 5px; font-weight: 650; }
  .search-hint { font-size: 11px; }
  .approval-note { padding: 15px; }
  .empty { padding: 30px 16px; }
  footer { margin: 0 16px; font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
/* Tệp PDF do người dùng chọn chỉ tồn tại trong phiên trình duyệt. */
.pdf-slot { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.file-picker { position: relative; display: inline-flex; align-items: center; min-height: 44px; margin: 12px 0; padding: 8px 12px; border: 1px solid #bdcee5; border-radius: 5px; background: var(--tint); color: var(--primary-dark); font-size: 12px; font-weight: 650; cursor: pointer; }
.file-picker input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); opacity: 0; }
.file-picker:focus-within { outline: 3px solid #cf8a13; outline-offset: 4px; }
.clear-pdf { display: block; min-height: 44px; margin: 7px 0; padding: 8px 12px; border: 1px solid #bdcee5; border-radius: 5px; background: var(--tint); color: var(--primary-dark); font: inherit; font-size: 12px; cursor: pointer; }
