/* Sozialamt Assistant — khung theo Gesamtentwurf A (docs/entwurf_gesamt_app.html), nút kiểu iOS (26.11.2026):
   nút bo tròn, nút phụ nền xanh nhạt (tonal), breadcrumb dạng viên bấm được, ← trên thanh trên điện thoại.
   Cỡ hiển thị 60–150 % trên tablet/điện thoại: js/zoom.js đặt --zoom, mọi cỡ chữ tính theo rem.
   PC ≥ 900px: thanh bên sáng cố định bên trái. Điện thoại: thanh trên + thanh tab Akten · Formulare · Mehr; „Mehr“ là trang riêng.
   Không tải phông chữ từ bên ngoài (bảo mật): dùng phông hệ thống (Segoe UI / San Francisco). */

:root {
  --page: #eef2f8; --surface: #ffffff; --sunk: #f5f7fa; --fg: #17212f; --muted: #5a6577; --line: #d6dce5;
  --navy: #0b3a6e; --navy-2: #134a86; --navy-ink: #ffffff;
  --blue: #1f5fbf; --blue-hover: #174d9e; --blue-soft: #e7eefa;
  --tonal: #dfe8f7; --tonal-hover: #cfdcf3; --tonal-ink: #133f80;
  --neutral: #eceff4; --neutral-hover: #e1e5ec; --neutral-ink: #17212f;
  --ok: #1d6b3f; --ok-soft: #e3f2e9; --warn: #8a5300; --warn-soft: #fbf0dc; --bad: #a8261b; --bad-soft: #fbe7e5;
  --radius: 10px; --side-w: 80px;
  --font: "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --page: #10151c; --surface: #18202a; --sunk: #131a22; --fg: #e6eaf0; --muted: #a1abba; --line: #2c3542;
    --navy: #0f2c4f; --navy-2: #173d68; --blue: #7fa8ee; --blue-hover: #9dbdf3; --blue-soft: #1d2b44;
    --tonal: #233552; --tonal-hover: #2c4166; --tonal-ink: #c9dafa;
    --neutral: #222b36; --neutral-hover: #2b3542; --neutral-ink: #e6eaf0;
    --ok: #5fc38a; --ok-soft: #17301f; --warn: #f0b45c; --warn-soft: #33270f; --bad: #ff8277; --bad-soft: #3a1b18;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; font-size: calc(var(--zoom, 1) * 100%); }
body { margin: 0; background: var(--page); color: var(--fg); font: 1rem/1.5 var(--font); }
h1, h2, h3 { margin: 0; line-height: 1.25; text-wrap: balance; overflow-wrap: anywhere; -webkit-hyphens: auto; hyphens: auto; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.125rem; }
h3 { font-size: 1rem; }
p { margin: 0; }
a { color: var(--blue); }
code { font-family: ui-monospace, Consolas, monospace; }
img { max-width: 100%; height: auto; }
.vi { color: var(--muted); font-size: .8125rem; font-weight: 400; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Khung (Gesamtentwurf A, 26.11.2026) ----------
   Thanh bên (PC), thanh trên và thanh tab (điện thoại) CÙNG MÀU với trang ở cả 4 kiểu giao diện.
   Màu nhấn chỉ cho mục đang chọn và nút chính. Một kiểu hàng duy nhất (.lrow) cho menu, trang „Mehr“ và danh sách. */
.app { min-height: 100vh; min-height: 100dvh; }
.side { position: fixed; inset: 0 auto 0 0; width: var(--side-w); background: var(--page); color: var(--fg); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 6px; padding: 16px 12px 28px; overflow-y: auto; z-index: 30;
  padding-top: max(16px, env(safe-area-inset-top, 0px)); padding-left: max(12px, env(safe-area-inset-left, 0px)); }
.side .brand { display: flex; align-items: center; gap: 10px; padding: 2px 6px 6px; color: var(--fg); text-decoration: none; font-weight: 800; font-size: 1rem; }
.brand-ic { flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--blue); color: #fff; }
.brand-ic svg { width: 17px; height: 17px; }
.devtag { margin-left: auto; font-size: .6875rem; font-weight: 700; border-radius: 999px; padding: 1px 8px; background: var(--neutral); color: var(--muted); }

/* Nhãn nhóm + nhóm hàng (kiểu Cài đặt iPhone) */
.glabel { font-size: .6875rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); padding: 10px 8px 0; }
.glabel .vi { text-transform: none; letter-spacing: 0; font-size: .6875rem; }
.lgrp { display: grid; margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.lrow { position: relative; display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 12px; align-items: center; min-height: 52px;
  padding: 8px 14px; color: var(--fg); text-decoration: none; font: inherit; text-align: left; background: none; border: 0; width: 100%; cursor: pointer; }
.lrow + .lrow::before { content: ""; position: absolute; top: 0; right: 0; left: 56px; border-top: 1px solid var(--line); }
.lrow:hover { background: var(--sunk); }
.lrow:focus-visible { outline: 3px solid var(--blue); outline-offset: -3px; }
.lrow.on { background: var(--tonal); }
.lrow.on .lt b { color: var(--tonal-ink); }
.lic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--tonal); color: var(--tonal-ink); }
.lic svg { width: 17px; height: 17px; }
.lic.av { border-radius: 50%; font-weight: 700; font-size: .75rem; letter-spacing: .02em; }
.lic.mute { background: var(--neutral); color: var(--muted); }
.lic.bad { background: var(--bad-soft); color: var(--bad); }
.lic.ok { background: var(--ok-soft); color: var(--ok); }
.lic.warn { background: var(--warn-soft); color: var(--warn); }
.lt { display: grid; min-width: 0; line-height: 1.25; }
.lt b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lt small { color: var(--muted); font-size: .8125rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lend { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.lend svg { width: 16px; height: 16px; }
.lrow.dim .lt b, .lrow.dim .lic { opacity: .6; }
.lrow.red .lt b { color: var(--bad); }
/* Nhãn trạng thái dạng viên tròn: xanh = bestätigt, vàng = ungeprüft/offen/Frist, đỏ = fehlt, xám = demnächst */
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: .75rem; font-weight: 700; border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.mute { background: var(--neutral); color: var(--muted); }
.pill.acc { background: var(--tonal); color: var(--tonal-ink); }
.navlist { display: grid; gap: 8px; }
.lrow.wrap .lt b, .lrow.wrap .lt small { white-space: normal; overflow-wrap: anywhere; }
.lrow.wrap { align-items: center; }
/* Trang xóa (chung một khung): thẻ đỏ nhạt nêu rõ những gì mất vĩnh viễn */
.dangercard { display: grid; gap: 8px; padding: 16px 18px; border-radius: 16px; background: var(--bad-soft); color: var(--fg);
  border: 1px solid color-mix(in srgb, var(--bad) 35%, transparent); }
.dangercard h2 { display: flex; align-items: center; gap: 8px; color: var(--bad); }
.dangercard h2 .ico { width: 20px; height: 20px; flex: none; }
.dangercard ul { margin: 0; padding-left: 1.2em; display: grid; gap: 4px; }

/* Điền đơn chia từng phần: thanh tiến độ + Zurück/Weiter */
.stepbar { display: grid; gap: 6px; }
.stepbar-text { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; font-weight: 600; }
.steps-wrap { display: grid; gap: 16px; }
.steps-wrap > section { display: grid; gap: 16px; min-width: 0; }
.steps-wrap.stepped > section[hidden], .steps-wrap.stepped .nostep { display: none; }
.stepnav { justify-content: space-between; }
.stepnav .btn[hidden] { display: none; }
.stepnav:has(.btn[hidden]) { grid-template-columns: 1fr; }
@media (max-width: 899px) { .actions.stepnav { grid-template-columns: 1fr 1fr; } }
/* Giấy tờ của một người: hàng không phải link (bên trong có nhiều link) */
.urow { cursor: default; align-items: start; }
.urow:hover { background: none; }
.urow > .lic { margin-top: 2px; }
.urow > .lend { align-self: center; }
.ucells { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; }
.ucells .lmeta { margin-top: 0; }
@media (max-width: 899px) {
  .urow > .lic { grid-row: 1 / span 2; }
  .urow > .ucells { grid-column: 2; grid-row: 2; }
  .urow > .lend { grid-column: 3; grid-row: 1 / span 2; }
}
@media (max-width: 640px) {
  .urow { grid-template-columns: 30px minmax(0, 1fr); }
  .urow > .lend { grid-column: 2; grid-row: 3; justify-content: flex-start; }
}
.lmeta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 4px; font-size: .8125rem; color: var(--muted); }
.panel > .lgrp.flush { border: 0; border-radius: 0; box-shadow: none; background: none; border-top: 1px solid var(--line); }
.main > .glabel { padding: 0 6px; margin-bottom: -12px; }

/* Cột biểu tượng PC – phương án C (27.11.2026): biểu tượng + chữ ngắn; tên đầy đủ ở title */
.side.rail { align-items: center; gap: 4px; padding: 14px 0 18px; padding-top: max(14px, env(safe-area-inset-top, 0px)); padding-left: env(safe-area-inset-left, 0px); }
.rail .brand-ic { margin-bottom: 10px; text-decoration: none; }
.rbtn { width: 64px; display: grid; justify-items: center; gap: 3px; padding: 8px 0 6px; border-radius: 12px; border: 0; background: none;
  font: inherit; font-size: .6875rem; font-weight: 600; line-height: 1.1; color: var(--muted); text-decoration: none; cursor: pointer; text-align: center; }
.rbtn svg { width: 21px; height: 21px; }
.rbtn:hover { background: var(--sunk); color: var(--fg); }
.rbtn:focus-visible { outline: 3px solid var(--blue); outline-offset: 1px; }
.rbtn.on { background: var(--tonal); color: var(--tonal-ink); }
.rbtn.dim { opacity: .55; }
.rbtn.red { color: var(--bad); }
.rsep { width: 36px; border-top: 1px solid var(--line); margin: 6px 0; }
.rlogout { margin-top: auto; }

.shell { margin-left: var(--side-w); min-width: 0; overflow-x: clip; }
.mtop, .tabbar { display: none; }
.main { max-width: 1040px; margin: 0 auto; padding: 24px 32px 48px; display: grid; gap: 20px; align-content: start;
  grid-template-columns: minmax(0, 1fr); }
/* Lưới/flex: con không được rộng hơn khung (nguyên nhân trang trượt ngang trên iPhone) */
.main > *, .pagehead > *, .panel-body > *, .titleline > *, .autoread-head > * { min-width: 0; }
/* Từ ghép tiếng Đức rất dài (Schwerbehindertenausweis …) được ngắt khi màn hình quá hẹp */
.main { overflow-wrap: anywhere; }
.main.narrow { max-width: 640px; }

/* Trang không có thanh bên (đăng nhập) */
.plain .shell { margin-left: 0; }
.plain .main { max-width: 440px; padding-top: max(48px, env(safe-area-inset-top, 0px)); }
.plain-brand { font-weight: 800; color: var(--fg); font-size: 1.125rem; display: flex; gap: 8px; align-items: center; }
.plain-brand .devtag { margin-left: 0; }

/* Nút tròn trên thanh trên (← …) */
.iconbtn { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  background: var(--neutral); color: var(--neutral-ink); border: 0; text-decoration: none; }
.iconbtn:hover { background: var(--neutral-hover); }
.iconbtn svg { width: 22px; height: 22px; }

@media (max-width: 899px) {
  .side { display: none; }
  .shell { margin-left: 0; }
  .mtop { display: flex; position: sticky; top: 0; z-index: 20; align-items: center; gap: 12px; min-height: 60px;
    background: color-mix(in srgb, var(--page) 88%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    color: var(--fg); border-bottom: 1px solid var(--line);
    padding: 8px max(16px, env(safe-area-inset-right, 0px)) 8px max(16px, env(safe-area-inset-left, 0px));
    padding-top: max(8px, env(safe-area-inset-top, 0px)); }
  .mtop .where { display: grid; min-width: 0; line-height: 1.2; flex: 1; }
  .mtop .where span { font-size: .75rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mtop .where strong { font-size: 1.0625rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mback[hidden] { display: none; }
  /* Như iOS: khi tiêu đề lớn còn thấy, thanh trên chỉ ghi nơi đang đứng; cuộn qua tiêu đề thì hiện tên trang */
  .big-title:not(.title-gone) .mtop .where strong { display: none; }
  .big-title:not(.title-gone) .mtop .where span { font-size: .9375rem; font-weight: 600; color: var(--fg); }
  /* Trang gốc của tab (Akten, Formulare, Mehr): không có thanh trên, tiêu đề lớn */
  .is-root .mtop { display: none; }
  .is-root .main { padding-top: max(20px, calc(env(safe-area-inset-top, 0px) + 12px)); }
  .is-root .main h1 { font-size: 1.875rem; letter-spacing: -.02em; font-weight: 800; }
  /* Trang con: ← trên thanh trên thay cho các viên breadcrumb */
  .has-back .crumb { display: none; }
  .main { padding: 16px max(16px, env(safe-area-inset-right, 0px)) 96px max(16px, env(safe-area-inset-left, 0px)); gap: 16px; }
  .tabbar { display: grid; grid-template-columns: repeat(3, 1fr); position: fixed; inset: auto 0 0 0; z-index: 20;
    background: color-mix(in srgb, var(--surface) 92%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    border-top: 1px solid var(--line); padding: 6px max(8px, env(safe-area-inset-right, 0px)) max(8px, env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px)); }
  .tabbar a { display: grid; justify-items: center; gap: 2px; min-height: 48px; align-content: center; color: var(--muted); text-decoration: none; font-size: .6875rem; font-weight: 600; }
  .tabbar svg { width: 24px; height: 24px; }
  .tabbar .on { color: var(--blue); }
  .plain .main { padding-bottom: 48px; }
}

/* ---------- Đầu trang ---------- */
.pagehead { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px 20px; flex-wrap: wrap; }
.pagehead .titles { display: grid; gap: 2px; min-width: 0; }
/* Breadcrumb dạng viên bấm được (phương án B): rõ ràng, đủ to để bấm bằng ngón tay */
.crumb { font-size: .875rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 6px; }
.crumb a { display: inline-flex; align-items: center; min-height: 32px; padding: 3px 12px; border-radius: 999px; max-width: 100%;
  background: var(--surface); border: 1px solid var(--line); color: var(--blue); font-weight: 600; text-decoration: none;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumb a:first-child::before { content: "‹"; margin-right: 6px; font-size: 1.1em; line-height: 1; }
.crumb a:hover { border-color: var(--blue); background: var(--blue-soft); }
.titleline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.headactions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Thẻ (tab) ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 10px 14px; color: var(--muted); text-decoration: none; font-weight: 500; border-bottom: 3px solid transparent; white-space: nowrap; display: flex; gap: 6px; align-items: baseline; }
.tabs a.on { color: var(--fg); border-color: var(--blue); font-weight: 600; }
.tabs .count { font-size: .75rem; color: var(--muted); font-weight: 400; }

/* ---------- Nút ---------- */
/* Nút kiểu iOS (phương án A, 26.11.2026): MỌI nút đều có ô nền, bo 12px, không viền; có biểu tượng ({% icon %}).
   .btn.primary = việc chính, nền đặc — mỗi màn hình/khối chỉ MỘT nút này
   .btn         = việc phụ, nền xanh nhạt (tonal)
   .btn.quiet   = việc thường / Abbrechen, nền xám nhạt (trước đây chỉ là chữ)
   .btn.danger  = xóa, nền đỏ nhạt chữ đỏ
   .btn.icon    = chỉ có biểu tượng (vuông 44px), cần aria-label
   Màu lấy từ biến nên tự hợp với 5 kiểu giao diện trong Einstellungen. */
.btn { font: inherit; font-weight: 600; font-size: .9375rem; line-height: 1.2; border-radius: 12px; padding: 10px 16px; min-height: 44px;
  border: 0; background: var(--tonal); color: var(--tonal-ink); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; text-decoration: none; white-space: nowrap;
  max-width: 100%; transition: background-color .15s ease, transform .1s ease; -webkit-tap-highlight-color: transparent; }
.btn:hover { background: var(--tonal-hover); }
.btn:active { transform: scale(.97); }
.btn .ico { width: 1.15em; height: 1.15em; flex: none; }
.btn.primary { background: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-hover); }
.btn.quiet { background: var(--neutral); color: var(--neutral-ink); }
.btn.quiet:hover { background: var(--neutral-hover); }
.btn.danger { background: var(--bad-soft); color: var(--bad); }
.btn.danger:hover { background: color-mix(in srgb, var(--bad) 18%, var(--bad-soft)); }
.btn.small { padding: 7px 12px; min-height: 36px; font-size: .875rem; border-radius: 10px; }
.btn.icon { padding: 0; width: 44px; }
.btn.icon.small { width: 36px; }
.btn.icon .ico { width: 20px; height: 20px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
/* Điện thoại hẹp: chữ dài trên nút được xuống dòng, không đẩy trang rộng ra */
@media (max-width: 599px) { .btn { white-space: normal; text-align: center; } }
.btn.link { background: none; padding: 0; min-height: 0; color: var(--blue); font-weight: 500; border-radius: 4px; }
.btn:focus-visible, .info:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid color-mix(in srgb, var(--blue) 40%, transparent); outline-offset: 2px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
/* Điện thoại: hàng nút của biểu mẫu thành THANH DƯỚI CỐ ĐỊNH (như app) — luôn thấy, khỏi cuộn xuống tìm */
@media (max-width: 899px) {
  .actions.stack-mobile { display: grid; position: sticky; z-index: 6; bottom: calc(62px + env(safe-area-inset-bottom, 0px));
    margin: 4px -4px 0; padding: 10px; border-radius: 16px; background: color-mix(in srgb, var(--surface) 92%, transparent);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: 0 -2px 14px rgb(0 0 0 / .08); border: 1px solid var(--line); }
  .plain .actions.stack-mobile { bottom: max(8px, env(safe-area-inset-bottom, 0px)); }
  .actions.stack-mobile .btn { width: 100%; }
}

/* Menu ⋯ (việc ít dùng): <details class="more"><summary class="btn quiet icon">…</summary><div class="menu">…</div></details> */
.more { position: relative; display: inline-block; }
.more > summary { list-style: none; }
.more > summary::-webkit-details-marker { display: none; }
.more > .menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 15; min-width: 220px; display: grid; gap: 2px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 10px 30px rgb(0 0 0 / .16); }
.more > .menu .btn { width: 100%; justify-content: flex-start; background: transparent; color: var(--fg); }
.more > .menu .btn:hover { background: var(--neutral); }
.more > .menu .btn.danger { color: var(--bad); }
.more > .menu .btn.danger:hover { background: var(--bad-soft); }
.more > .menu form { margin: 0; }
/* Thẻ một trang giấy tờ: tiêu đề „Seite x“ và nút ⋯ cùng một hàng (không còn nằm lẻ một dòng trên iPhone) */
.pagecardhead { flex-wrap: nowrap; align-items: flex-start; }
/* ⋯ trên thanh trên: chỉ ở điện thoại; trên PC dùng các nút ở đầu trang */
.mtop .topmore { margin-left: auto; }
.mtop .topmore > summary { list-style: none; }
@media (max-width: 899px) { .headactions.hide-mobile { display: none; } }

/* ---------- Nhãn trạng thái ---------- */
.tag { display: inline-block; font-size: .75rem; font-weight: 600; line-height: 1.4; border-radius: 4px; padding: 2px 8px; white-space: nowrap; }
.t-ok { background: var(--ok-soft); color: var(--ok); }
.t-warn { background: var(--warn-soft); color: var(--warn); }
.t-bad { background: var(--bad-soft); color: var(--bad); }
.t-neu { background: var(--sunk); color: var(--muted); border: 1px solid var(--line); }
.t-info { background: var(--blue-soft); color: var(--blue); }

/* ---------- Nút ⓘ và phần giải thích ---------- */
/* :not(.msg): thông báo loại „info“ (class="msg info") không được vẽ thành nút tròn ⓘ */
/* Nút „i“: hình tròn 24 px nhưng vùng bấm 44 px (::after), theo bản vẽ Gesamtentwurf */
.info:not(.msg) { position: relative; width: 24px; height: 24px; border-radius: 50%; border: 0; color: var(--tonal-ink); background: var(--tonal);
  font: italic 700 .8125rem/1 Georgia, "Times New Roman", serif; display: inline-grid; place-items: center; cursor: pointer; padding: 0; flex: none; vertical-align: middle; }
.info:not(.msg)::after { content: ""; position: absolute; inset: -10px; border-radius: 50%; }
.info:not(.msg):hover { background: var(--tonal-hover); }
.info:not(.msg)[aria-expanded="true"] { background: var(--blue); border-color: var(--blue); color: #fff; }
.tip { display: block; flex-basis: 100%; width: 100%; font-size: .875rem; font-weight: 400; font-style: normal; color: var(--fg); background: var(--blue-soft);
  border-radius: 6px; padding: 8px 12px; margin-top: 6px; text-transform: none; letter-spacing: 0; }
.tip[hidden] { display: none; }

/* ---------- Thông báo ---------- */
.msg { padding: 10px 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); border-left-width: 4px; }
.msg.success { border-color: var(--ok); }
.msg.info { border-color: var(--blue); }
.msg.warning { border-color: var(--warn); background: var(--warn-soft); }
.msg.error { border-color: var(--bad); background: var(--bad-soft); color: var(--bad); }
.messages { display: grid; gap: 8px; }

/* ---------- Khối ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; min-width: 0; box-shadow: 0 1px 2px rgb(16 40 80 / .04); }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.panel-head h2, .panel-head h3 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.panel-body { padding: 16px; display: grid; gap: 14px; }
.section-label { font-size: .75rem; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); padding: 10px 16px 6px; background: var(--sunk); border-bottom: 1px solid var(--line); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.section-label .vi { text-transform: none; letter-spacing: 0; font-size: .75rem; }
.empty { padding: 20px 16px; color: var(--muted); text-align: center; }

/* ---------- Danh sách dạng hàng (bảng trên PC, thẻ trên điện thoại) ---------- */
.rows { display: grid; }
.row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 2fr) auto auto; gap: 6px 16px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line); color: inherit; text-decoration: none; }
.rows > .row:first-child, .section-label + .row { border-top: 0; }
a.row:hover { background: var(--sunk); }
.row .name { display: grid; min-width: 0; }
.row .name strong { overflow-wrap: anywhere; }
.row .cellend { justify-self: end; display: flex; gap: 8px; align-items: center; }
.rowhead { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 2fr) auto auto; gap: 16px; padding: 8px 16px; font-size: .6875rem; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font-size: .8125rem; border-radius: 999px; padding: 2px 8px; border: 1px solid var(--line); white-space: nowrap; text-decoration: none; color: var(--fg); }
.chip.ok { color: var(--ok); border-color: var(--ok); }
.chip.miss { color: var(--bad); border-color: var(--bad); }
.chip.opt { color: var(--muted); border-style: dashed; }
a.chip:hover { background: var(--sunk); }
.chev { color: var(--muted); font-size: 1.25rem; line-height: 1; }
@media (max-width: 719px) {
  .rowhead { display: none; }
  .row { grid-template-columns: minmax(0, 1fr) auto; }
  .row > .chips, .row > .rowwide { grid-column: 1 / -1; order: 3; }
  .row > .cellend.action { grid-column: 1 / -1; order: 4; justify-self: start; }
}

/* Thông tin (Angaben): nhãn | giá trị | trạng thái | › */
.frow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto 16px; gap: 4px 16px; align-items: center; padding: 11px 16px; border-top: 1px solid var(--line); color: inherit; text-decoration: none; }
.section-label + .frow { border-top: 0; }
.frow:hover { background: var(--sunk); }
.frow .lab { display: grid; min-width: 0; }
.frow .val { min-width: 0; overflow-wrap: anywhere; }
.frow .val.none { color: var(--muted); }
.frow.conflict { background: color-mix(in srgb, var(--bad) 6%, transparent); }
@media (max-width: 719px) {
  .frow { grid-template-columns: minmax(0, 1fr) auto 16px; }
  .frow .val { grid-column: 1 / 2; grid-row: 2; }
}

/* Thanh tiến độ */
.meter { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: .875rem; color: var(--muted); }
.meter .bar { width: 120px; height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; }
.meter .bar i { display: block; height: 100%; background: var(--ok); }

/* Lưới thẻ (danh sách hồ sơ, người) */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: 12px; }
.card { display: grid; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; color: inherit; text-decoration: none; }
a.card:hover { border-color: var(--blue); }
.card .top { display: grid; gap: 4px; min-width: 0; }
.card.add { border-style: dashed; color: var(--blue); font-weight: 600; place-content: center; text-align: center; min-height: 92px; }

/* ---------- Biểu mẫu ---------- */
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field > .lab { display: flex; align-items: center; gap: 6px 8px; flex-wrap: wrap; font-weight: 600; }
.field > .lab .vi { font-weight: 400; }
/* max(16px, …): iPhone tự phóng to trang khi bấm vào ô chữ nhỏ hơn 16px → không bao giờ nhỏ hơn */
input[type="text"], input[type="password"], input:not([type]), input[type="number"], input[type="date"], input[type="email"], select, textarea {
  font: inherit; font-size: max(16px, 1rem); width: 100%; padding: 10px 12px; min-height: 44px; border: 1.5px solid var(--muted); border-radius: 6px; background: var(--surface); color: var(--fg); }
/* Ô mật khẩu có nút con mắt (app.js tự thêm) */
.pw { position: relative; display: block; }
.pw > input { padding-right: 52px; }
.pw-toggle { position: absolute; top: 0; right: 0; width: 48px; height: 100%; min-height: 44px; display: grid; place-items: center;
  border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 0 6px 6px 0; }
.pw-toggle:hover, .pw-toggle[aria-pressed="true"] { color: var(--blue); }
.pw-toggle:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.pw-toggle svg { width: 22px; height: 22px; }
.pw-toggle .eye-off, .pw-toggle[aria-pressed="true"] .eye-on { display: none; }
.pw-toggle[aria-pressed="true"] .eye-off { display: block; }
input[type="file"] { font: inherit; font-size: max(16px, 1rem); width: 100%; padding: 10px; border: 1.5px dashed var(--muted); border-radius: 6px; background: var(--sunk); color: var(--fg); }
input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; accent-color: var(--blue); flex: none; margin: 2px 0 0; }
.choice { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; cursor: pointer; }
fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
legend { font-weight: 600; padding: 0; margin-bottom: 6px; display: flex; gap: 8px; align-items: center; }
.err { color: var(--bad); font-size: .875rem; }
.field > .hint { margin: -2px 0 2px; color: var(--muted); font-size: .8125rem; max-width: 62ch; }

/* Ô "Steht in" (gợi ý giấy tờ) */
.found { display: grid; gap: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--sunk); overflow: hidden; }
.found-head { padding: 10px 12px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-weight: 600; }
.found-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; align-items: center; padding: 10px 12px; border-top: 1px solid var(--line); font-size: .9375rem; }
.found-row .what { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; min-width: 0; }
.found-row details { grid-column: 1 / -1; }
.found-row summary { cursor: pointer; color: var(--blue); font-weight: 500; font-size: .875rem; }
.found-row .note { grid-column: 1 / -1; font-size: .8125rem; color: var(--muted); }

/* Giá trị hiện có */
.values { display: grid; gap: 10px; }
.value { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.value .big { font-size: 1.25rem; font-weight: 600; overflow-wrap: anywhere; }
.value .meta { grid-column: 1 / -1; font-size: .8125rem; color: var(--muted); }
details.history summary { cursor: pointer; color: var(--blue); font-weight: 500; }
details.history ul { margin: 8px 0 0; padding-left: 1.2em; display: grid; gap: 4px; }

/* ---------- Giấy tờ ---------- */
.pages { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.page { display: grid; gap: 8px; align-content: start; }
.dangerzone { margin: 28px 0 8px; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.delete-list { margin: 6px 0 12px; padding-left: 20px; }
.delete-preview { display: block; max-width: min(100%, 420px); height: auto; margin: 10px 0; border: 1px solid var(--line); border-radius: 6px; }
.page img, .doc-preview { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 6px; background: var(--sunk); }
.doc-thumb { display: block; max-width: 100%; max-height: 240px; width: auto; border-radius: 6px; border: 1px solid var(--line); }
.checklist { display: grid; }
.checkrow { display: grid; grid-template-columns: 28px minmax(0, 1fr) minmax(0, 1.4fr); gap: 6px 12px; align-items: start; padding: 12px 16px; border-top: 1px solid var(--line); }
.checkrow:first-child { border-top: 0; }
.checkrow.locked { background: color-mix(in srgb, var(--bad) 6%, transparent); }
.checkrow .val { display: grid; gap: 6px; min-width: 0; }
.checkrow .val strong { overflow-wrap: anywhere; }
.fieldwarn { margin: 0; padding: 6px 10px; border-left: 3px solid var(--warn); background: var(--warn-soft); color: var(--fg);
  font-size: .875rem; border-radius: 0 6px 6px 0; }
.checkrow .tags { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
@media (max-width: 719px) { .checkrow { grid-template-columns: 28px minmax(0, 1fr); } .checkrow .val { grid-column: 2; } }

/* ---------- Tình trạng hệ thống, nhật ký ---------- */
.checks { display: grid; }
.check { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 2px 10px; padding: 12px 16px; border-top: 1px solid var(--line); }
.check:first-child { border-top: 0; }
.check .icon { font-size: 1.125rem; line-height: 1.3; }
.check.ok .icon { color: var(--ok); }
.check.fail .icon { color: var(--bad); }
.check .detail { grid-column: 2; color: var(--muted); font-size: .875rem; overflow-wrap: anywhere; }
.tablewrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.table th { text-align: left; font-size: .6875rem; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); padding: 8px 16px; border-bottom: 1px solid var(--line); }
.table td { padding: 10px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.nowrap { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- Tài khoản ---------- */
.qr { display: flex; justify-content: center; background: #fff; padding: 12px; border-radius: 8px; }
.secret { font-size: 1.0625rem; word-break: break-all; }
.codes { columns: 2; font-size: 1.125rem; margin: 0; padding: 0 0 0 1.6em; }
.recovery-key { text-align: center; font-size: 1.25rem; letter-spacing: 1px; word-break: break-all; padding: 16px; }
.steps { margin: 0; padding-left: 1.3em; display: grid; gap: 6px; }

@media print {
  .side, .mtop, .tabbar, .btn { display: none !important; }
  .shell { margin: 0; }
  body { background: #fff; }
}
@media (max-width: 719px) { .tabs .count { display: none; } .tabs a { padding: 10px 12px; } }

.checkrow .shared-ok { margin-top: .4rem; font-size: .92em; }

/* Formulare (danh mục mẫu đơn) */
.row.formrow, .rowhead.formrow { grid-template-columns: minmax(0, 1fr) auto auto; }
.row.formrow .meta { color: var(--muted); font-size: .875rem; white-space: nowrap; }
@media (max-width: 719px) { .row.formrow { grid-template-columns: minmax(0, 1fr) auto; } .row.formrow .meta { grid-column: 1; } .rowhead.formrow { display: none; } }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px 20px; padding: 14px 16px; margin: 0; }
.facts dt { font-size: .6875rem; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.facts dd { margin: 2px 0 0; min-width: 0; }
.facts .wide { grid-column: 1 / -1; }
.facts .hash { font-size: .75rem; overflow-wrap: anywhere; }
.pager { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0; }
.pager a { display: inline-flex; align-items: baseline; gap: 4px; min-width: 40px; min-height: 36px; justify-content: center; align-items: center; padding: 4px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: inherit; text-decoration: none; font-weight: 600; }
.pager a small { font-weight: 400; color: var(--muted); font-size: .7rem; }
.pager a.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.pager a.on small { color: #fff; opacity: .8; }
.formpage { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; align-items: start; }
@media (max-width: 1099px) { .formpage { grid-template-columns: minmax(0, 1fr); } }
.formimg { margin: 0; padding: 8px; }
.formimg img { display: block; width: 100%; height: auto; background: #fff; border-radius: 4px; }
.formimg figcaption { padding: 6px 4px 0; }
.fieldlist { list-style: none; margin: 0; padding: 0; max-height: 80vh; overflow-y: auto; }
.fieldlist li { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 8px 16px; border-top: 1px solid var(--line); }
.fieldlist li:first-child { border-top: 0; }
.fieldlist .num { font-variant-numeric: tabular-nums; font-weight: 700; color: #c83c14; text-align: right; }
.fieldlist .name { display: grid; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 1099px) { .fieldlist { max-height: none; } }

/* Tự đọc tất cả giấy tờ + chế độ xem lại trên trang Angaben */
.autoread { padding: 12px 16px; display: grid; gap: 8px; margin-bottom: 16px; }
.autoread-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.autoread .counts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.autoread .note { margin: 0; color: var(--muted); font-size: .85rem; }
.autoread-progress { margin: 0; padding: 8px 12px; border-radius: var(--radius); background: var(--sunk); font-size: .9rem; }
.rrow { display: grid; grid-template-columns: 22px minmax(0, 14rem) minmax(0, 1fr); gap: 4px 12px; align-items: start; padding: 11px 16px; border-top: 1px solid var(--line); }
.section-label + .rrow { border-top: 0; }
.rrow > input[type=checkbox] { width: 18px; height: 18px; margin-top: 3px; }
.rrow .lab { display: grid; min-width: 0; }
.rrow.conflict { background: color-mix(in srgb, var(--bad) 6%, transparent); }
.rval { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; min-width: 0; }
.rval input, .rval select { flex: 1 1 14rem; min-width: 0; }
.rval .choice { flex: 1 1 100%; }
.rsrc, .rwarn, .rshared { grid-column: 3; margin: 0; font-size: .8rem; color: var(--muted); }
.rwarn { color: var(--bad); }
.savebar { position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding: 12px 16px; margin-top: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 -4px 12px rgb(0 0 0 / .06); }
.savebar p { flex: 1 1 16rem; margin: 0; font-size: .85rem; color: var(--muted); }
@media (max-width: 640px) {
  .rrow { grid-template-columns: 22px minmax(0, 1fr); }
  .savebar { padding: 10px 12px; }
  .savebar p { display: none; }
  .rval, .rsrc, .rwarn, .rshared { grid-column: 2; }
}
@media (max-width: 899px) {
  /* Điện thoại: thanh menu dưới cùng cố định → đặt thanh Speichern ngay trên nó */
  .savebar { bottom: calc(62px + env(safe-area-inset-bottom, 0px)); }
}

/* Tải nhiều ảnh: danh sách ảnh + loại đã nhận ra */
.bulk { margin-bottom: 16px; }
.bulk .autoread-progress { margin: 12px 16px 0; }
.brow { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px 16px; padding: 12px 16px; border-top: 1px solid var(--line); align-items: start; }
.brow:first-of-type { border-top: 0; }
.bthumb { width: 120px; max-height: 120px; object-fit: contain; border-radius: 6px; border: 1px solid var(--line); background: var(--sunk); }
.binfo { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; min-width: 0; }
.binfo > strong { flex: 1 1 100%; }
.binfo .vi { flex: 1 1 100%; }
.bpick { display: flex; flex-wrap: wrap; gap: 8px; flex: 1 1 100%; }
.bpick select { flex: 1 1 14rem; min-width: 0; }
@media (max-width: 640px) { .brow { grid-template-columns: 84px minmax(0, 1fr); } .bthumb { width: 84px; } }

/* ---------- Bild zuschneiden ---------- */
.zs-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 860px) { .zs-grid { grid-template-columns: 1fr; } }
.zs-stage { position: relative; line-height: 0; touch-action: none; user-select: none; -webkit-user-select: none; }
.zs-stage img { width: 100%; height: auto; display: block; border-radius: 6px; }
.zs-stage svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.zs-stage svg { overflow: visible; }
.zs-shade { fill: rgb(15 23 42 / .5); }
.zs-poly { fill: none; stroke: #fff; stroke-width: 1.5px; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 1px rgb(0 0 0 / .8)); }
.zs-handle { fill: #fff; stroke: var(--blue); stroke-width: 2px; vector-effect: non-scaling-stroke; cursor: grab;
  filter: drop-shadow(0 1px 2px rgb(0 0 0 / .6)); }
.zs-poly.flash { animation: zs-flash .9s ease-out; }
@keyframes zs-flash { 0%, 40% { stroke: #4ade80; stroke-width: 4px; } 100% { stroke: #fff; stroke-width: 1.5px; } }
.zs-msg { min-height: 1.2em; margin: 6px 0 0; }
.zs-handle.active { fill: var(--blue); fill-opacity: .6; cursor: grabbing; }
.zs-loupe { position: absolute; top: 10px; width: 112px; height: 112px; border-radius: 50%; border: 2px solid #fff;
  box-shadow: 0 2px 10px rgb(0 0 0 / .5); background-repeat: no-repeat; background-color: #000; pointer-events: none; z-index: 2; }
.zs-loupe::before, .zs-loupe::after { content: ""; position: absolute; background: #fff; box-shadow: 0 0 1px #000; }
.zs-loupe::before { left: 50%; top: 30%; bottom: 30%; width: 1px; }
.zs-loupe::after { top: 50%; left: 30%; right: 30%; height: 1px; }
.zs-loupe[hidden] { display: none; }
.badge-check { font-size: .8rem; font-weight: 600; color: #8a5a00; background: #fff4d6; border: 1px solid #f0d48a;
  border-radius: 999px; padding: 2px 10px; text-decoration: none; display: inline-block; }
.zs-preview { background: var(--line); border-radius: 6px; padding: 8px; display: grid; gap: 6px; justify-items: center; min-height: 120px; }
.zs-preview img:not([src]) { display: none; }
.zs-preview img { max-width: 100%; max-height: 420px; height: auto; box-shadow: 0 1px 4px rgb(0 0 0 / .25); background: #fff; }
.zs-tools { display: grid; gap: 14px; }
.zs-tool { display: grid; gap: 6px; }
.zs-tool > .lbl { font-weight: 600; }
.zs-tool select, .zs-tool input[type=range] { width: 100%; }
.zs-tool .actions { gap: 6px 14px; }
.zs-bottom { margin-top: 16px; }
.badge-edited { font-size: .8rem; color: var(--ok); font-weight: 600; }

/* ---------- Seite eines Dokuments: Aktionen ---------- */
.pageacts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pageacts .push { margin-left: auto; }

/* ---------- Anzeigegröße 60–150 % (nur Tablet/Smartphone; js/zoom.js) — chỉ ở trang Einstellungen ---------- */
.zoomctl { display: grid; gap: 12px; max-width: 360px; }
.zoomrow { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; gap: 8px; align-items: center; }
.zoomrow output { text-align: center; font-weight: 700; font-size: 1.125rem; font-variant-numeric: tabular-nums; }
.zoomrow .btn[disabled] { opacity: .4; cursor: default; }

/* ---------- Thẻ người: avatar chữ cái đầu ---------- */
.card .who { display: flex; gap: 10px; align-items: center; min-width: 0; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none;
  font-weight: 700; font-size: .9375rem; letter-spacing: .02em; background: var(--blue-soft); color: var(--blue); }
.avatar.av-b { background: var(--ok-soft); color: var(--ok); }

/* ---------- Einstellungen: chọn phong cách ---------- */
.stilwahl { display: grid; gap: 10px; }
.stiloption { display: grid; grid-template-columns: 20px 72px minmax(0, 1fr); gap: 12px; align-items: center; cursor: pointer;
  padding: 12px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); }
.stiloption:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); }
.stiloption input { margin: 0; }
.stiltext { display: grid; gap: 1px; min-width: 0; }
.stiltext > span:not(.vi) { font-size: .875rem; color: var(--muted); }
.stilprobe { position: relative; width: 72px; height: 50px; border-radius: 9px; overflow: hidden; border: 1px solid var(--line); display: block; }
.stilprobe i { position: absolute; inset: 0 auto 0 0; width: 16px; }
.stilprobe b { position: absolute; left: 22px; right: 6px; height: 12px; border-radius: 4px; }
.stilprobe b:first-of-type { top: 7px; } .stilprobe b + b { top: 23px; right: 26px; }
.stilprobe em { position: absolute; right: 6px; bottom: 6px; width: 16px; height: 9px; border-radius: 99px; }
.probe-klassisch { background: #eef2f8; } .probe-klassisch i { background: #eef2f8; border-right: 1px solid #d6dce5; } .probe-klassisch b { background: #fff; border: 1px solid #d6dce5; } .probe-klassisch em { background: #1f5fbf; }
.probe-hell { background: #f6f7f9; } .probe-hell i { background: #fff; border-right: 1px solid #e5e7eb; } .probe-hell b { background: #fff; border: 1px solid #e5e7eb; } .probe-hell em { background: #111827; }
.probe-dunkel { background: radial-gradient(80% 80% at 100% 0%, #5b2bb5, transparent 70%), #0b0d17; } .probe-dunkel i { background: #0e1120; } .probe-dunkel b { background: rgb(255 255 255 / .12); } .probe-dunkel em { background: linear-gradient(90deg, #7c3aed, #22d3ee); }
.probe-pop { background: #fff8f1; } .probe-pop i { background: #fff8f1; border-right: 2px solid #1f1a17; } .probe-pop b { background: #c9e7ff; border: 1.5px solid #1f1a17; } .probe-pop b + b { background: #d9f5c7; } .probe-pop em { background: #ff6b4a; border: 1.5px solid #1f1a17; }
.probe-auto { background: linear-gradient(135deg, #f6f7f9 50%, #0b0d17 50%); } .probe-auto i { background: linear-gradient(180deg, #fff 50%, #0e1120 50%); } .probe-auto b { background: rgb(127 127 127 / .3); } .probe-auto em { background: #4f46e5; }
.zoom-desktop-note { display: none; }
@media (hover: hover) and (pointer: fine) and (min-width: 1200px) { .zoom-desktop-note { display: block; } }
kbd { font: inherit; font-size: .8125rem; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; background: var(--surface); }

/* ---------- PC – phương án B (27.11.2026): danh sách dạng bảng, dải số liệu, đường dẫn dạng chữ ----------
   Chỉ màn hình rộng (≥ 900 px). Điện thoại giữ nguyên hàng to (Gesamtentwurf A). */
@media (max-width: 899px) { .only-desktop { display: none !important; } }
@media (min-width: 900px) {
  .only-mobile { display: none !important; }

  /* Đường dẫn trên tiêu đề: chữ thường „Familie … ›“ thay cho viên tròn */
  .crumb { margin-bottom: 2px; }
  .crumb a, html[data-look] nav.crumb a { min-height: 28px; padding: 2px 0; border: 0; background: none; color: var(--muted); font-weight: 500; }
  .crumb a:first-child::before { content: none; }
  .crumb a:hover { background: none; color: var(--blue); text-decoration: underline; }

  /* Dải số liệu một hàng */
  .statstrip { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 26px; padding: 12px 18px;
    background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
  .statstrip .stat { display: grid; line-height: 1.2; }
  .statstrip .stat b { font-size: 1.125rem; font-variant-numeric: tabular-nums; }
  .statstrip .stat small { color: var(--muted); font-size: .75rem; }
  .statstrip .stat.ok b { color: var(--ok); }
  .statstrip .stat.warn b { color: var(--warn); }
  .statstrip .stat.bad b { color: var(--bad); }
  .statstrip .bar { width: 180px; height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; margin-left: -12px; }
  .statstrip .bar i { display: block; height: 100%; background: var(--ok); }
  .statstrip .end { margin-left: auto; }

  /* Bảng: hàng đầu là tên cột, các hàng thấp hơn, cột thẳng hàng */
  .thead, .uhead { display: grid; gap: 12px; align-items: end; padding: 8px 14px 6px; border-bottom: 1px solid var(--line);
    font-size: .6875rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
  .tbl > .lrow, .urows > .lrow { min-height: 44px; padding-top: 6px; padding-bottom: 6px; }
  .tbl .lic, .urows .lic { width: 26px; height: 26px; border-radius: 8px; }
  .tbl .lic svg, .urows .lic svg { width: 15px; height: 15px; }
  .tbl > .lrow + .lrow::before, .urows > .lrow + .lrow::before { left: 14px; }
  .tcell { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
  .tbl-akten > .lrow, .tbl-akten > .thead { grid-template-columns: 26px minmax(0, 1fr) 110px 130px 20px; }
  .tbl-form > .lrow, .tbl-form > .thead { grid-template-columns: 26px minmax(0, 1fr) 90px 70px 120px 20px; }
  .urows > .lrow, .urows > .uhead { grid-template-columns: 26px minmax(170px, 1fr) 130px minmax(0, 1.5fr) 170px; }
  .urow { align-items: center; }
  .urow > .lic { margin-top: 0; }
  .ucells { display: contents; }
  .urow .lend { justify-content: flex-end; }
}

/* ---------- PC – phương án C (27.11.2026): cột danh sách giấy tờ (trang người + trang giấy tờ) ----------
   Bấm giấy tờ → trang giấy tờ mở ở phần bên phải, cột danh sách giữ nguyên. Điện thoại: không có cột này. */
.listcol { display: none; }
@media (min-width: 900px) {
  .has-listcol .shell { display: grid; grid-template-columns: 320px minmax(0, 1fr); align-items: start; }
  .listcol { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; position: sticky; top: 0; height: 100vh; height: 100dvh;
    border-right: 1px solid var(--line); background: var(--page); min-width: 0; }
  .lchead { display: grid; gap: 6px; padding: 18px 16px 12px; border-bottom: 1px solid var(--line); }
  .lcakte { font-size: .8125rem; color: var(--muted); text-decoration: none; justify-self: start; }
  .lcakte:hover { color: var(--blue); text-decoration: underline; }
  .lchead h2 { margin: 0; font-size: 1.25rem; }
  .who { display: flex; flex-wrap: wrap; gap: 6px; }
  .whochip { font-size: .8125rem; font-weight: 600; border-radius: 999px; padding: 4px 11px; background: var(--neutral); color: var(--fg); text-decoration: none; }
  .whochip:hover { background: var(--sunk); }
  .whochip.on { background: var(--tonal); color: var(--tonal-ink); box-shadow: inset 0 0 0 1.5px currentColor; }
  .lcitems { overflow-y: auto; padding: 4px 8px 12px; display: grid; gap: 2px; align-content: start; }
  .lcitems .glabel { padding: 12px 8px 4px; }
  .lcit { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px;
    color: var(--fg); text-decoration: none; }
  .lcit:hover { background: var(--sunk); }
  .lcit:focus-visible { outline: 3px solid var(--blue); outline-offset: -3px; }
  .lcit.on { background: var(--tonal); }
  .lcit.on .lt b { color: var(--tonal-ink); }
  .lcit .lic { width: 28px; height: 28px; border-radius: 8px; }
  .lcit .lic svg { width: 15px; height: 15px; }
  .lcit .lt small { font-size: .75rem; }
  .lcfoot { padding: 12px 16px; border-top: 1px solid var(--line); display: grid; }
  .has-listcol .main { max-width: 980px; margin: 0; padding-left: 28px; padding-right: 28px; }
  .pickhint { display: flex; gap: 12px; align-items: center; }
}
