﻿/* ==========================================================================
   บัญชีหมายจับแยกตาม บช.ปลายทาง — ชุดสีและโครงหน้าจอ
   ออกแบบแบบ mobile-first: เขียนกฎสำหรับจอเล็กก่อน แล้วขยายที่ 640 / 900 / 1200px
   ========================================================================== */

:root {
  --black: #050506;
  --black-soft: #0b0b0e;
  --panel: #111116;
  --panel-2: #17171d;
  --panel-3: #1e1e25;
  --red: #d10b12;
  --red-bright: #ff2632;
  --red-dark: #5f0006;
  --silver: #bfc4cb;
  --white: #f7f7f5;
  --muted: #92949b;
  --line: rgba(255, 255, 255, .1);
  --line-strong: rgba(255, 255, 255, .18);
  --yellow: #f4c62c;
  --green: #24c875;
  --blue: #4aa8ff;
  --danger: #ff3444;
  --sidebar-width: 268px;
  --radius: 12px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--black);
  color: var(--white);
  font-family: Tahoma, "Leelawadee UI", "Noto Sans Thai", "Sarabun", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  min-height: 100dvh;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: 16px; /* 16px กัน iOS ซูมเองตอนโฟกัสช่องกรอก */
  color: inherit;
}

a { color: var(--blue); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2a2a33; border-radius: 6px; }
::-webkit-scrollbar-track { background: transparent; }

:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }

.numeric { font-family: "Arial Narrow", "Tahoma", sans-serif; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- หน้าจอบูต */

.boot-screen {
  align-items: center; display: flex; flex-direction: column;
  gap: 12px; justify-content: center; min-height: 100dvh; padding: 24px; text-align: center;
}
.boot-mark { color: var(--red-bright); font-size: 1.1rem; font-weight: 700; letter-spacing: .04em; }
.boot-note { color: var(--muted); font-size: .9rem; }

/* ---------------------------------------------------------------- หน้าล็อกอิน */

.login-shell {
  align-items: center; display: flex; justify-content: center;
  min-height: 100dvh; padding: 20px;
  background: radial-gradient(120% 90% at 50% 0%, rgba(209, 11, 18, .18), transparent 60%), var(--black);
}
.login-card {
  background: linear-gradient(160deg, rgba(23, 23, 29, .98), rgba(10, 10, 13, .98));
  border: 1px solid var(--line); border-radius: var(--radius);
  max-width: 430px; padding: 26px 22px; width: 100%;
}
.login-badge {
  background: var(--red-dark); border-radius: 999px; color: var(--white);
  display: inline-block; font-size: .68rem; letter-spacing: .18em;
  margin-bottom: 14px; padding: 5px 12px; text-transform: uppercase;
}
.login-card h1 { font-size: 1.32rem; line-height: 1.35; margin: 0 0 6px; }
.login-card p.lead { color: var(--muted); font-size: .9rem; margin: 0 0 20px; }
.login-steps { color: var(--muted); font-size: .82rem; margin-top: 18px; }
.login-steps li { margin-bottom: 4px; }

/* ---------------------------------------------------------------- ฟอร์ม */

.field { display: block; margin-bottom: 14px; }
.field > span { color: var(--silver); display: block; font-size: .82rem; margin-bottom: 6px; }
.input, .select, textarea.input {
  background: var(--black-soft); border: 1px solid var(--line-strong);
  border-radius: 9px; color: var(--white); padding: 12px 13px; width: 100%;
}
.input:focus, .select:focus { border-color: var(--red-bright); }
.otp-input { font-size: 1.6rem; letter-spacing: .5em; text-align: center; }

.primary-button, .ghost-button, .danger-button {
  align-items: center; border-radius: 9px; cursor: pointer; display: inline-flex;
  font-weight: 700; gap: 8px; justify-content: center;
  min-height: 44px; padding: 10px 18px; transition: filter .15s, transform .05s;
}
.primary-button { background: linear-gradient(135deg, #e0141b, #8b0008); border: 0; color: #fff; }
.ghost-button { background: transparent; border: 1px solid var(--line-strong); color: var(--silver); }
.danger-button { background: transparent; border: 1px solid rgba(255, 52, 68, .5); color: var(--danger); }
.primary-button:hover, .ghost-button:hover, .danger-button:hover { filter: brightness(1.18); }
.primary-button:active, .ghost-button:active, .danger-button:active { transform: translateY(1px); }
.primary-button[disabled], .ghost-button[disabled] { cursor: not-allowed; filter: grayscale(.6); opacity: .55; }
.full-width { width: 100%; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------------------------------------------------------------- โครงหน้าจอหลัก */

.portal-shell { display: flex; min-height: 100dvh; }

.sidebar {
  background: linear-gradient(180deg, #0d0d11, #08080a);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  height: 100dvh; left: 0; position: fixed; top: 0;
  transform: translateX(-100%); transition: transform .22s ease;
  width: min(84vw, var(--sidebar-width)); z-index: 60;
}
.sidebar.open { transform: translateX(0); }
.sidebar-brand { border-bottom: 1px solid var(--line); padding: 18px 18px 16px; }
.sidebar-brand strong { color: var(--red-bright); display: block; font-size: 1rem; letter-spacing: .03em; }
.sidebar-brand span { color: var(--muted); display: block; font-size: .74rem; margin-top: 3px; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 10px; }
.nav-section { margin-bottom: 16px; }
.nav-section > h4 {
  color: var(--muted); font-size: .68rem; letter-spacing: .16em;
  margin: 0 0 8px 8px; text-transform: uppercase;
}
.nav-item {
  background: transparent; border: 0; border-radius: 9px; color: var(--silver);
  cursor: pointer; display: block; font-size: .92rem; margin-bottom: 3px;
  min-height: 44px; padding: 11px 12px; text-align: right; width: 100%;
}
.nav-item:hover { background: rgba(255, 255, 255, .05); color: var(--white); }
.nav-item.active { background: linear-gradient(90deg, rgba(209, 11, 18, .28), rgba(209, 11, 18, .05)); color: var(--white); font-weight: 700; }
.sidebar-foot { border-top: 1px solid var(--line); padding: 14px; }
.sidebar-foot .who { font-size: .85rem; margin-bottom: 2px; }
.sidebar-foot .role { color: var(--muted); font-size: .74rem; margin-bottom: 10px; word-break: break-all; }

.scrim {
  background: rgba(0, 0, 0, .6); inset: 0; position: fixed; z-index: 55;
}

.portal-main {
  display: flex; flex-direction: column; flex: 1; min-width: 0;
  padding-bottom: 76px; /* เว้นที่ให้แถบแท็บล่างบนมือถือ */
}

.topbar {
  align-items: center; backdrop-filter: blur(6px);
  background: rgba(8, 8, 10, .92); border-bottom: 1px solid var(--line);
  display: flex; gap: 10px; padding: 10px 14px; position: sticky; top: 0; z-index: 40;
}
.menu-button {
  background: transparent; border: 1px solid var(--line-strong); border-radius: 9px;
  color: var(--white); cursor: pointer; font-size: 1.15rem; height: 44px; width: 44px;
}
.topbar-title { flex: 1; min-width: 0; }
.topbar-title strong { display: block; font-size: 1rem; line-height: 1.3; }
.topbar-title span { color: var(--muted); display: block; font-size: .74rem; }
.live-pill {
  align-items: center; background: rgba(36, 200, 117, .12); border: 1px solid rgba(36, 200, 117, .4);
  border-radius: 999px; color: var(--green); display: inline-flex; gap: 6px;
  font-size: .7rem; padding: 5px 10px; white-space: nowrap;
}
.live-pill i { animation: pulse 1.8s infinite; background: var(--green); border-radius: 50%; height: 7px; width: 7px; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
.live-pill.stale { background: rgba(244, 198, 44, .12); border-color: rgba(244, 198, 44, .4); color: var(--yellow); }
.live-pill.stale i { background: var(--yellow); }

#content-area { flex: 1; padding: 14px; }
.portal-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .72rem; padding: 14px; text-align: center; }

.mobile-tabs {
  background: rgba(8, 8, 10, .97); border-top: 1px solid var(--line);
  bottom: 0; display: grid; gap: 2px; grid-template-columns: repeat(4, 1fr);
  left: 0; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); position: fixed; right: 0; z-index: 45;
}
.mobile-tabs button {
  background: transparent; border: 0; border-radius: 8px; color: var(--muted);
  cursor: pointer; font-size: .66rem; line-height: 1.25; min-height: 46px; padding: 5px 2px;
}
.mobile-tabs button.active { background: rgba(209, 11, 18, .18); color: var(--white); }
.mobile-tabs button em { display: block; font-size: 1.05rem; font-style: normal; }

/* ---------------------------------------------------------------- การ์ดเนื้อหา */

.content-card {
  background: linear-gradient(145deg, rgba(21, 21, 26, .98), rgba(12, 12, 15, .98));
  border: 1px solid var(--line); border-radius: var(--radius);
  margin-bottom: 14px; padding: 16px 14px;
}
.eyebrow {
  color: var(--red-bright); font-size: .66rem; font-weight: 700;
  letter-spacing: .19em; margin-bottom: 4px; text-transform: uppercase;
}
.section-heading {
  align-items: flex-start; display: flex; flex-wrap: wrap;
  gap: 10px; justify-content: space-between; margin-bottom: 14px;
}
.section-heading h3 { font-size: 1.05rem; margin: 0; }
.section-heading p { color: var(--muted); font-size: .8rem; margin: 4px 0 0; }
.section-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.hint { color: var(--muted); font-size: .78rem; margin: 8px 0 0; }
.empty-state { color: var(--muted); font-size: .86rem; padding: 22px 8px; text-align: center; }

/* ---------------------------------------------------------------- การ์ดตัวเลข */

.summary-grid { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.summary-card {
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 10px; cursor: pointer; overflow: hidden;
  padding: 12px 12px 14px; position: relative; text-align: right; width: 100%;
}
.summary-card::before { content: ""; height: 3px; left: 0; position: absolute; right: 0; top: 0; }
.summary-card.neutral::before { background: var(--silver); }
.summary-card.accent::before { background: var(--red-bright); }
.summary-card.warning::before { background: var(--yellow); }
.summary-card.success::before { background: var(--green); }
.summary-card.danger::before { background: var(--danger); }
.summary-card.info::before { background: var(--blue); }
.summary-card span { color: var(--muted); display: block; font-size: .74rem; line-height: 1.35; }
.summary-card strong {
  display: block; font-family: "Arial Narrow", Tahoma, sans-serif;
  font-size: clamp(1.7rem, 7vw, 2.3rem); font-variant-numeric: tabular-nums; line-height: 1.15; margin-top: 4px;
}
.summary-card small { color: var(--muted); display: block; font-size: .68rem; }
button.summary-card:hover { border-color: var(--line-strong); filter: brightness(1.12); }
button.summary-card::after {
  color: var(--muted); content: "▸ ดูรายละเอียด"; display: block; font-size: .64rem; margin-top: 6px;
}

/* ตัวเลขที่กดดูรายละเอียดได้ (ในตาราง/แผง) */
.stat-link {
  background: transparent; border: 0; border-bottom: 1px dotted rgba(255, 255, 255, .35);
  color: inherit; cursor: pointer; font-family: "Arial Narrow", Tahoma, sans-serif;
  font-variant-numeric: tabular-nums; padding: 2px 3px;
}
.stat-link:hover { background: rgba(255, 255, 255, .07); border-bottom-color: var(--red-bright); color: var(--white); }
.stat-link.zero { color: var(--muted); cursor: default; border-bottom-color: transparent; }
.stat-link.strong { font-size: 1.15rem; font-weight: 700; }

/* ---------------------------------------------------------------- กราฟแท่ง */

.bar-chart { display: flex; flex-direction: column; gap: 9px; }
.bar-row { align-items: center; display: grid; gap: 8px; grid-template-columns: 56px 1fr; }
.bar-label { color: var(--silver); font-size: .8rem; }
.bar-track { background: var(--panel-3); border-radius: 5px; height: 24px; overflow: hidden; position: relative; }
.bar-track i { border-radius: 5px; display: block; height: 100%; left: 0; position: absolute; top: 0; }
.bar-total { background: linear-gradient(90deg, rgba(191, 196, 203, .38), rgba(191, 196, 203, .16)); }
.bar-caught { background: linear-gradient(90deg, var(--green), rgba(36, 200, 117, .45)); }
.bar-value {
  color: var(--white); font-family: "Arial Narrow", Tahoma, sans-serif; font-size: .78rem;
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
}
.chart-legend { color: var(--muted); display: flex; flex-wrap: wrap; font-size: .72rem; gap: 14px; margin-top: 12px; }
.chart-legend span { align-items: center; display: inline-flex; gap: 6px; }
.chart-legend em { border-radius: 3px; height: 10px; width: 16px; }

/* ---------------------------------------------------------------- ตาราง */

.table-scroll { -webkit-overflow-scrolling: touch; margin: 0 -14px; overflow-x: auto; padding: 0 14px; }
table.data-table, table.coordination-matrix {
  border-collapse: separate; border-spacing: 0; font-size: .82rem; width: 100%;
}
.data-table th, .data-table td, .coordination-matrix th, .coordination-matrix td {
  border-bottom: 1px solid var(--line); padding: 9px 10px; text-align: right; white-space: nowrap;
}
.data-table th, .coordination-matrix th {
  background: var(--panel-3); color: var(--silver); font-size: .72rem;
  font-weight: 700; position: sticky; top: 0; z-index: 2;
}
.data-table td.wrap { max-width: 260px; white-space: normal; }
.data-table tbody tr:hover { background: rgba(255, 255, 255, .035); }

.coordination-matrix th:first-child, .coordination-matrix td:first-child {
  background: var(--panel-2); left: 0; position: sticky; z-index: 3; text-align: right;
}
.coordination-matrix thead th:first-child { z-index: 4; }
.coordination-matrix td { font-family: "Arial Narrow", Tahoma, sans-serif; text-align: center; }
.coordination-matrix td.matrix-disabled {
  background: repeating-linear-gradient(45deg, rgba(255,255,255,.03) 0 6px, transparent 6px 12px);
  color: #4b4b53;
}
.matrix-cell b { color: var(--green); }
.matrix-cell s { color: var(--muted); text-decoration: none; }

/* การ์ดแทนตารางบนจอเล็ก */
.record-list { display: flex; flex-direction: column; gap: 9px; }
.record-card {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px;
}
.record-card .record-top { align-items: flex-start; display: flex; gap: 8px; justify-content: space-between; }
.record-card .record-name { font-size: .95rem; font-weight: 700; }
.record-card dl { display: grid; gap: 4px 10px; grid-template-columns: auto 1fr; margin: 8px 0 0; }
.record-card dt { color: var(--muted); font-size: .74rem; }
.record-card dd { font-size: .8rem; margin: 0; word-break: break-word; }
.record-more { background: transparent; border: 0; color: var(--blue); cursor: pointer; font-size: .76rem; margin-top: 6px; padding: 6px 0; }

/* ---------------------------------------------------------------- ป้ายสถานะ */

.pill {
  border-radius: 999px; display: inline-block; font-size: .7rem;
  padding: 3px 10px; white-space: nowrap;
}
.pill.ok { background: rgba(36, 200, 117, .16); color: var(--green); }
.pill.wait { background: rgba(244, 198, 44, .16); color: var(--yellow); }
.pill.off { background: rgba(146, 148, 155, .16); color: var(--silver); }
.pill.hot { background: rgba(255, 52, 68, .16); color: var(--danger); }
.pill.info { background: rgba(74, 168, 255, .16); color: var(--blue); }

/* ---------------------------------------------------------------- แผงรายหน่วย */

.unit-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
.unit-panel { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 13px 12px; }
.unit-panel header { align-items: center; border-bottom: 1px solid var(--line); display: flex; gap: 8px; justify-content: space-between; margin-bottom: 11px; padding-bottom: 9px; }
.unit-panel header strong { font-size: 1.02rem; }
.unit-panel header span { color: var(--muted); font-size: .72rem; }
.mini-metrics { display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 12px; }
.mini-metric { background: var(--black-soft); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.mini-metric span { color: var(--muted); display: block; font-size: .68rem; line-height: 1.3; }
.mini-metric strong { display: block; font-family: "Arial Narrow", Tahoma, sans-serif; font-size: 1.42rem; }
.breakdown-pair { display: grid; gap: 10px; grid-template-columns: 1fr; }
.breakdown-pair h5 { color: var(--silver); font-size: .76rem; margin: 0 0 6px; }

.chip-row { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  background: var(--panel-3); border: 1px solid var(--line); border-radius: 999px;
  color: var(--silver); cursor: pointer; font-size: .8rem; min-height: 38px; padding: 7px 14px;
}
.chip.active { background: linear-gradient(135deg, #e0141b, #8b0008); border-color: transparent; color: #fff; font-weight: 700; }

/* ---------------------------------------------------------------- จัดการตัวผู้ต้องหา */

.group-grid { display: grid; gap: 11px; grid-template-columns: 1fr; }
.group-card { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 13px 12px; }
.group-card.pending { border-color: rgba(244, 198, 44, .45); }
.group-card header { align-items: baseline; display: flex; gap: 8px; justify-content: space-between; }
.group-card header strong { font-size: 1rem; }
.group-count { font-family: "Arial Narrow", Tahoma, sans-serif; font-size: 2.1rem; line-height: 1.1; }
.group-sub { color: var(--muted); font-size: .74rem; }
.group-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

.person-card { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; padding: 13px 12px; }
.person-card.choice { border-color: rgba(244, 198, 44, .5); }
.person-head { align-items: flex-start; display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; }
.person-head strong { font-size: 1rem; }
.person-meta { color: var(--muted); font-size: .76rem; margin-top: 3px; }
.person-warrants { display: flex; flex-direction: column; gap: 7px; margin: 11px 0; }
.warrant-mini {
  background: var(--black-soft); border: 1px solid var(--line); border-left: 3px solid var(--red);
  border-radius: 8px; font-size: .78rem; padding: 8px 10px;
}
.warrant-mini b { color: var(--white); }
.warrant-mini span { color: var(--muted); }
.choose-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.choose-row .chip { min-height: 40px; }

/* ---------------------------------------------------------------- Modal */

.modal-backdrop {
  align-items: stretch; background: rgba(0, 0, 0, .78); display: flex;
  inset: 0; justify-content: center; position: fixed; z-index: 80;
}
.modal {
  background: var(--panel); border: 1px solid var(--line-strong);
  display: flex; flex-direction: column; max-height: 100dvh; width: 100%;
}
.modal-head {
  align-items: flex-start; border-bottom: 1px solid var(--line); display: flex;
  gap: 10px; justify-content: space-between; padding: 13px 14px;
}
.modal-head h3 { font-size: 1rem; margin: 0; }
.modal-head p { color: var(--muted); font-size: .78rem; margin: 3px 0 0; }
.modal-close {
  background: transparent; border: 1px solid var(--line-strong); border-radius: 9px;
  color: var(--white); cursor: pointer; flex: none; font-size: 1.1rem; height: 40px; width: 40px;
}
.modal-toolbar {
  align-items: center; border-bottom: 1px solid var(--line); display: flex;
  flex-wrap: wrap; gap: 8px; padding: 10px 14px;
}
.modal-toolbar .input { flex: 1 1 180px; min-width: 0; }
.modal-body { flex: 1; overflow-y: auto; padding: 12px 14px; }
.modal-foot {
  align-items: center; border-top: 1px solid var(--line); display: flex;
  flex-wrap: wrap; gap: 10px; justify-content: space-between; padding: 11px 14px;
}
.pager { align-items: center; color: var(--muted); display: flex; font-size: .78rem; gap: 8px; }
.pager button { background: var(--panel-3); border: 1px solid var(--line); border-radius: 8px; color: var(--white); cursor: pointer; min-height: 38px; padding: 6px 12px; }
.pager button[disabled] { opacity: .4; }

/* ---------------------------------------------------------------- Toast */

#toast-root { bottom: 84px; display: flex; flex-direction: column; gap: 8px; left: 12px; position: fixed; right: 12px; z-index: 90; }
.toast {
  animation: rise .18s ease; background: var(--panel-2); border: 1px solid var(--line-strong);
  border-left: 4px solid var(--silver); border-radius: 9px; font-size: .85rem; padding: 11px 13px;
}
.toast.ok { border-left-color: var(--green); }
.toast.err { border-left-color: var(--danger); }
.toast.info { border-left-color: var(--blue); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- ล็อกหน้าจอเมื่อไม่ใช้งาน */

.idle-lock {
  align-items: center; backdrop-filter: blur(4px); background: rgba(0, 0, 0, .88);
  display: flex; inset: 0; justify-content: center; position: fixed; text-align: center; z-index: 95;
}

/* สลับตาราง (จอกว้าง) กับการ์ด (จอแคบ) — ค่าเริ่มต้นคือจอแคบ */
.only-wide { display: none; }
.only-narrow { display: block; }

/* ---------------------------------------------------------------- จอ ≥ 640px */

@media (min-width: 640px) {
  .summary-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .mini-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .breakdown-pair { grid-template-columns: 1fr 1fr; }
  .group-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #content-area, .topbar, .portal-footer { padding-left: 20px; padding-right: 20px; }
  .table-scroll { margin: 0 -20px; padding: 0 20px; }
  .content-card { padding: 18px 20px; }
  .modal-backdrop { align-items: center; padding: 20px; }
  .modal { border-radius: var(--radius); max-height: calc(100dvh - 40px); max-width: 1000px; }
  #toast-root { left: auto; right: 20px; width: 340px; }
}

/* ---------------------------------------------------------------- จอ ≥ 900px */

@media (min-width: 900px) {
  .sidebar { position: fixed; transform: translateX(0); }
  .portal-main { margin-left: var(--sidebar-width); padding-bottom: 0; }
  .menu-button, .mobile-tabs, .scrim { display: none; }
  .unit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .group-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #toast-root { bottom: 20px; }
  .bar-row { grid-template-columns: 72px 1fr; }
  .only-wide { display: block; }
  .only-narrow { display: none; }
}

/* ---------------------------------------------------------------- จอ ≥ 1200px */

@media (min-width: 1200px) {
  .summary-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .summary-grid.wide { grid-template-columns: repeat(8, minmax(0, 1fr)); }
  .group-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  #content-area { margin: 0 auto; max-width: 1560px; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
