/* ===== Token ===== */
:root {
  --ink: #2B1E25;
  --muted: #7A6670;
  --paper: #FBF3F6;
  --surface: #FFFFFF;
  --line: #EBD6DF;
  --pine: #F3B4CB;          /* hồng phấn: màu nền nút, mốc bước */
  --pine-deep: #A62F5C;     /* hồng đậm: chữ và biểu tượng, đủ tương phản trên nền trắng */
  --pine-soft: #FCE7EF;
  --on-pine: #3A1426;
  --amber: #8A5A00;
  --amber-soft: #FBF0D9;
  --amber-line: #E9C97A;
  --red: #B3392F;
  --shadow: 0 1px 2px rgba(80,30,50,.07), 0 6px 18px rgba(80,30,50,.09);
  --r-s: 10px;
  --r-m: 14px;
  --bar-h: 52px;
  --act-h: 76px;
  --font: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #F4E7ED; --muted: #B79DA8; --paper: #1B1217; --surface: #261A21; --line: #43303A;
    --pine: #E39BB6; --pine-deep: #F5B5CC; --pine-soft: #3A2029; --on-pine: #2A0F1B;
    --amber: #F0C25B; --amber-soft: #2E2410; --amber-line: #5B4716; --red: #F07A6E;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 18px rgba(0,0,0,.35);
    color-scheme: dark;
  }
}

/* ===== Nền tảng ===== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 15px/1.45 var(--font);
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, p, dl, dd, ul { margin: 0; padding: 0; }
ul { list-style: none; }
button, select, textarea, input { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { width: 22px; height: 22px; flex: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--pine-deep); outline-offset: 2px; }

/* ===== Thanh trên ===== */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 30;
  height: calc(var(--bar-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 12px 0 16px;
  display: flex; align-items: center; justify-content: space-between;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar__title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar__mark {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: var(--pine); color: var(--pine-deep);
}
.topbar__mark svg { width: 18px; height: 18px; }
.topbar h1 { font-size: 17px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; }

.bubble {
  width: 42px; height: 42px; border-radius: 50%; border: 0;
  display: grid; place-items: center;
  background: var(--pine); color: var(--on-pine);
  box-shadow: var(--shadow);
  transition: transform .15s ease;
}
.bubble:active { transform: scale(.94); }
.bubble--ghost { background: transparent; color: var(--ink); box-shadow: none; }

/* ===== Menu ===== */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(10,20,18,.42); }
.menu {
  position: fixed; z-index: 50;
  top: calc(env(safe-area-inset-top) + 8px); right: 10px;
  width: min(320px, calc(100vw - 20px));
  background: var(--surface); border-radius: 20px; padding: 8px;
  box-shadow: 0 18px 50px rgba(10,20,18,.28);
  transform-origin: top right;
  animation: menu-in .18s ease-out;
}
@keyframes menu-in { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }
.menu__item {
  display: flex; align-items: center; gap: 14px; padding: 12px 12px;
  border-radius: 14px; color: var(--ink); text-decoration: none;
}
.menu__item svg { color: var(--pine-deep); }
.menu__item b { display: block; font-weight: 600; font-size: 15px; }
.menu__item small { display: block; color: var(--muted); font-size: 12.5px; }
.menu__item.is-active { background: var(--pine-soft); }
.menu__item:active { background: var(--pine-soft); }

/* ===== Trang ===== */
.page {
  max-width: 640px; margin: 0 auto;
  padding: calc(var(--bar-h) + env(safe-area-inset-top) + 18px) 16px calc(var(--act-h) + env(safe-area-inset-bottom) + 32px);
}

/* ===== Các bước (dọc, có trục nối) ===== */
.step { position: relative; display: grid; grid-template-columns: 28px 1fr; column-gap: 12px; padding-bottom: 26px; }
.step::before {
  content: ""; position: absolute; left: 13px; top: 30px; bottom: 2px; width: 2px;
  background: var(--line); border-radius: 2px;
}
.step:last-of-type { padding-bottom: 0; }
.step:last-of-type::before { display: none; }
.step__marker {
  width: 28px; height: 28px; border-radius: 50%; margin-top: 1px;
  border: 2px solid var(--line); background: var(--paper);
  display: grid; place-items: center; position: relative; z-index: 1;
  transition: background .2s, border-color .2s;
}
.step[data-state="current"] .step__marker { border-color: var(--pine-deep); }
.step[data-state="current"] .step__marker::after {
  content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--pine-deep);
}
.step[data-state="done"] .step__marker { background: var(--pine); border-color: var(--pine-deep); }
.step[data-state="done"] .step__marker::after {
  content: ""; width: 12px; height: 7px; border-left: 2.5px solid var(--pine-deep); border-bottom: 2.5px solid var(--pine-deep);
  transform: translateY(-1px) rotate(-45deg);
}
.step[data-state="done"]::before { background: var(--pine-deep); opacity: .55; }
.step__body { min-width: 0; }
.step__title { font-size: 18px; font-weight: 700; letter-spacing: -.015em; line-height: 28px; margin-bottom: 12px; }
.sub { font-size: 14px; font-weight: 600; color: var(--muted); margin: 20px 0 8px; display: flex; align-items: center; gap: 8px; }
.count { font-weight: 600; font-size: 12.5px; padding: 1px 9px; border-radius: 99px; background: var(--pine-soft); color: var(--pine-deep); }
.count--warn { background: var(--amber-soft); color: var(--amber); }

/* ===== Chọn thành phố ===== */
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); }
.seg button {
  min-height: 46px; border: 0; border-radius: 10px; background: transparent; font-weight: 600; color: var(--muted);
  transition: background .15s, color .15s;
}
.seg button[aria-checked="true"] { background: var(--pine); color: var(--on-pine); box-shadow: inset 0 0 0 1.5px var(--pine-deep); }

.field { margin-top: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.select { position: relative; }
.select::after {
  content: ""; position: absolute; right: 16px; top: 50%; width: 8px; height: 8px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: translateY(-70%) rotate(45deg); pointer-events: none;
}
select {
  width: 100%; min-height: 48px; padding: 0 40px 0 14px; appearance: none; -webkit-appearance: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-s);
}
.office {
  margin-top: 14px; padding: 12px 14px; border-radius: var(--r-s);
  background: var(--pine-soft); border-left: 4px solid var(--pine-deep);
}
.office small { display: block; font-size: 12.5px; color: var(--muted); }
.office b { font-weight: 600; line-height: 1.35; display: block; }

/* ===== Đối tượng ===== */
.options { display: grid; gap: 8px; }
.opt {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  min-height: 56px; padding: 10px 14px; background: var(--surface);
  border: 1.5px solid var(--line); border-radius: var(--r-m);
  transition: border-color .15s, background .15s;
}
.opt__dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); flex: none; display: grid; place-items: center; }
.opt[aria-checked="true"] { border-color: var(--pine-deep); background: var(--pine-soft); }
.opt[aria-checked="true"] .opt__dot { border-color: var(--pine-deep); }
.opt[aria-checked="true"] .opt__dot::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--pine-deep); }
.opt span:last-child { font-weight: 500; line-height: 1.3; }

.checks { display: grid; gap: 6px; }
.check {
  display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-s); cursor: pointer;
}
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check__box { width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--line); display: grid; place-items: center; flex: none; color: transparent; }
.check__box svg { width: 16px; height: 16px; }
.check input:checked + .check__box { background: var(--pine); border-color: var(--pine-deep); color: var(--pine-deep); }
.check input:focus-visible + .check__box { outline: 3px solid var(--pine-deep); outline-offset: 2px; }
.check em { margin-left: auto; font-style: normal; font-size: 12.5px; color: var(--muted); }

/* ===== Danh sách file ===== */
.files { display: grid; gap: 8px; }
.file {
  display: flex; align-items: center; gap: 12px; padding: 10px 8px 10px 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m);
  animation: file-in .22s ease-out;
}
@keyframes file-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.file__ic { width: 38px; height: 44px; border-radius: 6px; background: var(--pine-soft); color: var(--pine-deep); display: grid; place-items: center; flex: none; }
.file__txt { min-width: 0; flex: 1; }
.file__txt b { display: block; font-weight: 600; }
.file__txt span { display: block; font-size: 13px; color: var(--muted); line-height: 1.3; }
.tag { display: inline-block; margin-top: 4px; font-size: 11.5px; font-weight: 600; padding: 1px 8px; border-radius: 99px; background: var(--paper); color: var(--muted); }
.tag--cond { background: var(--amber-soft); color: var(--amber); }
.tag--hand { background: var(--pine-soft); color: var(--pine-deep); }
.iconbtn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; flex: none; }
.iconbtn:active { background: var(--paper); }
.iconbtn--del { color: var(--red); }
.addfile {
  margin-top: 8px; width: 100%; min-height: 48px; display: flex; align-items: center; justify-content: center; gap: 8px;
  background: transparent; border: 1.5px dashed var(--pine-deep); color: var(--pine-deep); border-radius: var(--r-m); font-weight: 600;
}
.undo { margin-top: 8px; font-size: 13px; color: var(--muted); }
.undo button { border: 0; background: none; padding: 4px 2px; color: var(--pine-deep); font-weight: 600; text-decoration: underline; }

/* ===== Ô dán + nút ===== */
.paste { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); overflow: hidden; }
.paste textarea { display: block; width: 100%; border: 0; resize: vertical; min-height: 130px; padding: 14px; background: transparent; line-height: 1.5; }
.paste textarea:focus { outline: none; }
.paste:focus-within { border-color: var(--pine-deep); box-shadow: 0 0 0 3px var(--pine-soft); }
.paste__bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--paper) 55%, var(--surface)); }
.link { border: 0; background: none; color: var(--muted); text-decoration: underline; padding: 10px 6px; font-size: 13.5px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border-radius: 12px; border: 0; font-weight: 600; transition: transform .12s, opacity .15s;
}
.btn:active { transform: scale(.97); }
.btn--primary { background: var(--pine); color: var(--on-pine); }
.btn--lg { min-height: 52px; padding: 0 22px; font-size: 16px; border-radius: 14px; }
.btn[aria-disabled="true"] { background: var(--line); color: var(--muted); box-shadow: none; }

/* ===== Bảng kiểm tra thông tin ===== */
.rows { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); overflow: hidden; }
.row { padding: 10px 14px; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row label { display: block; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.row input {
  width: 100%; border: 0; background: transparent; padding: 4px 0 2px; font-weight: 500; font-size: 15.5px; min-height: 30px;
}
.row input:focus { outline: none; box-shadow: inset 0 -2px 0 var(--pine-deep); }
.row--miss { background: var(--amber-soft); }
.row--miss label { color: var(--amber); display: flex; align-items: center; gap: 6px; }
.row--miss label svg { width: 15px; height: 15px; }
.row--miss input { box-shadow: inset 0 -1.5px 0 var(--amber-line); }
.addr { margin-top: 8px; padding: 10px 12px; border-radius: var(--r-s); background: var(--paper); font-size: 14px; }
.addr__old { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 50%, transparent); }
.addr__new { display: flex; align-items: flex-start; gap: 8px; margin-top: 6px; font-weight: 600; }
.addr__new svg { width: 18px; height: 18px; color: var(--pine-deep); margin-top: 2px; }
.addr--choose { background: var(--amber-soft); border: 1px solid var(--amber-line); }
.addr--choose p { color: var(--amber); font-weight: 600; font-size: 13.5px; margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { min-height: 38px; padding: 0 14px; border-radius: 99px; border: 1.5px solid var(--amber-line); background: var(--surface); font-weight: 600; font-size: 14px; }
.chip[aria-pressed="true"] { background: var(--pine); border-color: var(--pine-deep); color: var(--on-pine); }

/* ===== Tổng hợp ===== */
.sum { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 4px 14px; }
.sum div { padding: 10px 0; border-top: 1px solid var(--line); }
.sum div:first-child { border-top: 0; }
.sum dt { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.sum dd { font-weight: 500; }
.sum dd.is-empty { color: var(--muted); font-weight: 400; font-style: italic; }
.sum ol { padding-left: 18px; margin-top: 2px; }

/* ===== Thanh hành động dưới ===== */
.actionbar {
  position: fixed; inset: auto 0 0 0; z-index: 20;
  min-height: calc(var(--act-h) + env(safe-area-inset-bottom));
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.actionbar__info { min-width: 0; }
.actionbar__info b { display: block; font-size: 15px; line-height: 1.25; }
.actionbar__info small { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.3; }
.actionbar.is-ready .actionbar__info b { color: var(--pine-deep); }

/* ===== Hộp chọn thêm file ===== */
.sheet { position: fixed; inset: 0; z-index: 60; background: rgba(10,20,18,.42); display: flex; align-items: flex-end; justify-content: center; }
.sheet__panel {
  width: 100%; max-width: 640px; max-height: 80vh; overflow: auto; background: var(--surface);
  border-radius: 22px 22px 0 0; padding: 8px 16px calc(20px + env(safe-area-inset-bottom));
  animation: sheet-in .22s ease-out;
}
@keyframes sheet-in { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
.sheet__head { display: flex; align-items: center; justify-content: space-between; padding: 6px 0 4px; }
.sheet__head h3 { font-size: 17px; }
.pick { display: grid; gap: 6px; margin-top: 6px; }
.pick button { width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); }
.pick .file__ic { width: 34px; height: 40px; }
.pick p { color: var(--muted); padding: 14px 4px; }

/* ===== Thông báo ===== */
.toast {
  position: fixed; z-index: 70; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--act-h) + env(safe-area-inset-bottom) + 14px);
  max-width: calc(100vw - 32px); padding: 12px 18px; border-radius: 14px;
  background: var(--ink); color: var(--paper); font-weight: 500; text-align: center; box-shadow: var(--shadow);
  animation: file-in .2s ease-out;
}

/* ===== Màn hình chưa làm ===== */
.page--empty { display: grid; place-items: center; min-height: 80vh; }
.empty { text-align: center; color: var(--muted); }
.empty svg { width: 44px; height: 44px; margin-bottom: 10px; color: var(--pine-deep); }
.empty h2 { color: var(--ink); margin-bottom: 4px; }

/* ===== Màn hình rộng: 2 cột, form bên trái, tổng hợp bên phải ===== */
@media (min-width: 940px) {
  .page { max-width: 1080px; display: grid; grid-template-columns: minmax(0, 1fr) 360px; column-gap: 40px; align-items: start; }
  #screen-bo .step { grid-column: 1; }
  #step-sum { grid-column: 2; grid-row: 1 / span 3; position: sticky; top: calc(var(--bar-h) + 24px); padding-bottom: 0; }
  #step-sum::before { display: none; }
  .actionbar { justify-content: center; gap: 28px; }
  .menu { right: max(10px, calc((100vw - 1080px) / 2)); }
}

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

/* ===== Nhập thông tin: ảnh, Excel, chữ ===== */
:root { --ok: #2C7A5A; --ok-soft: #E3F3EB; --bad: #B3392F; --bad-soft: #FBE6E3; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --ok: #6CCB9E; --ok-soft: #173126; --bad: #F07A6E; --bad-soft: #3A1B18; } }
.intake { display: grid; gap: 10px; }
.intake__add { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn--soft { background: var(--surface); color: var(--pine-deep); border: 1.5px dashed var(--pine-deep); }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.thumb { position: relative; border-radius: var(--r-s); overflow: hidden; background: var(--surface); border: 1px solid var(--line); animation: file-in .22s ease-out; }
.thumb__img { height: 76px; display: grid; place-items: center; background: var(--pine-soft); color: var(--pine-deep); background-size: cover; background-position: center; }
.thumb__img svg { width: 28px; height: 28px; opacity: .7; }
.thumb__cap { padding: 6px 8px 7px; font-size: 12px; line-height: 1.25; font-weight: 600; }
.thumb__cap small { display: block; font-weight: 500; color: var(--muted); }
.thumb--skip .thumb__cap { color: var(--muted); }
.thumb__x { position: absolute; top: 3px; right: 3px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(43,30,37,.62); color: #fff; display: grid; place-items: center; }
.thumb__x svg { width: 15px; height: 15px; }

.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin-top: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); }
.tabs button { min-height: 52px; border: 0; border-radius: 10px; background: transparent; text-align: left; padding: 6px 12px; line-height: 1.25; color: var(--muted); font-weight: 600; }
.tabs button small { display: block; font-weight: 500; font-size: 12px; }
.tabs button b { display: block; color: var(--ink); font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tabs button[aria-selected="true"] { background: var(--pine); }
.tabs button[aria-selected="true"] small { color: var(--on-pine); }
.tabs button .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); margin-left: 6px; }
.applicant { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 13.5px; color: var(--muted); font-weight: 600; flex-wrap: wrap; }
.applicant .chips { gap: 6px; }
.applicant .chip { border-color: var(--line); min-height: 34px; font-size: 13.5px; }
.applicant .chip[aria-pressed="true"] { border-color: var(--pine-deep); }

.legend { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.src { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600; line-height: 1.6; white-space: nowrap; }
.src--ok { background: var(--ok-soft); color: var(--ok); }
.src--mid { background: var(--pine-soft); color: var(--pine-deep); }
.src--warn { background: var(--amber-soft); color: var(--amber); }
.src--bad { background: var(--bad-soft); color: var(--bad); }

.row { border-left: 4px solid transparent; }
.row[data-s="ok"] { border-left-color: var(--ok); }
.row[data-s="mid"] { border-left-color: var(--pine); }
.row[data-s="warn"] { border-left-color: var(--amber-line); background: var(--amber-soft); }
.row[data-s="bad"] { border-left-color: var(--bad); background: var(--bad-soft); }
.row[data-s="miss"] { border-left-color: var(--amber-line); }
.row__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.row__head label { display: flex; align-items: center; gap: 6px; }
.row__head label svg { width: 15px; height: 15px; }
.row[data-s="warn"] label, .row[data-s="miss"] label { color: var(--amber); }
.row[data-s="bad"] label { color: var(--bad); }
.opt-note { font-weight: 500; color: var(--muted); }
.addr__tools { margin-top: 8px; }
.addr__tools a { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--pine-deep); text-decoration: none; min-height: 36px; }
.addr__tools a svg { width: 16px; height: 16px; }

.conflict { margin-top: 12px; padding: 12px; border-radius: var(--r-m); background: var(--bad-soft); border: 1.5px solid var(--bad); }
.conflict h4 { margin: 0 0 8px; font-size: 14.5px; color: var(--bad); display: flex; align-items: center; gap: 8px; }
.conflict h4 svg { width: 18px; height: 18px; }
.conflict__opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.conflict__opts button { min-height: 62px; padding: 8px 10px; text-align: left; border-radius: var(--r-s); border: 1.5px solid var(--line); background: var(--surface); line-height: 1.3; }
.conflict__opts button small { display: block; color: var(--muted); font-size: 12px; font-weight: 500; }
.conflict__opts button b { font-weight: 600; font-size: 15px; }
.conflict__opts button[aria-pressed="true"] { border-color: var(--pine-deep); background: var(--pine-soft); }
.conflict--done { background: var(--ok-soft); border-color: var(--ok); }
.conflict--done h4 { color: var(--ok); }
.sum .who { margin-top: 2px; }
.btn--lg { white-space: nowrap; flex: none; }
.actionbar__info { flex: 1; }
.actionbar__info b { font-size: 14.5px; }
.row textarea { width: 100%; border: 0; background: transparent; padding: 4px 0 2px; font-weight: 500; font-size: 15.5px; line-height: 1.4; resize: none; overflow: hidden; min-height: 30px; }
.row textarea:focus { outline: none; box-shadow: inset 0 -2px 0 var(--pine-deep); }

/* ===== Bổ sung: ô nhập bước 1, nút 2 lựa chọn, ghi chú quy tắc ===== */
.text-in {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; outline: none;
}
.text-in:focus { border-color: var(--pine-deep); box-shadow: 0 0 0 3px var(--pine-soft); }
.office .field { margin-top: 12px; }
.office .field:first-child { margin-top: 0; }
.office .hint { margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.seg--2 { grid-template-columns: repeat(2, 1fr); }
.card-sub { margin-top: 14px; }
.army-seg { margin-top: 10px; }
.rule-notes { margin-top: 10px; padding: 10px 12px; border-radius: var(--r-s); background: var(--amber-soft); color: var(--amber); font-size: 13.5px; }
.rule-notes p { margin: 2px 0; }
.addr__tools .link { padding: 6px 0 0; }
.hint { color: var(--muted); font-size: 13px; }

/* ===== Danh sách hồ sơ: nhóm, đường dẫn file, file còn thiếu ===== */
.files__group { list-style: none; margin: 14px 0 0; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.files__group:first-child { margin-top: 0; }
.file__path { font-size: 12px; overflow-wrap: anywhere; }
.file--miss { border-color: var(--amber-line); background: var(--amber-soft); }
.file--miss .file__path { color: var(--amber); font-weight: 600; }


/* ---- Thiếu thì báo đỏ ---- */
.count--warn { background: var(--bad-soft); color: var(--bad); }
.row[data-s="miss"] { border-left-color: var(--bad); background: var(--bad-soft); }
.row[data-s="miss"] label { color: var(--bad); }
.row[data-s="miss"] input, .row[data-s="miss"] textarea { box-shadow: inset 0 -2px 0 var(--bad); }
.file--miss { border-color: var(--bad); background: var(--bad-soft); }
.file--miss .file__path { color: var(--bad); }
.tabs button .dot { background: var(--bad); }
.is-miss { outline: 2px solid var(--bad); outline-offset: 5px; border-radius: var(--r-m); background: var(--bad-soft); animation: missPulse .5s ease-out 1; }
@keyframes missPulse { from { outline-offset: 12px; outline-color: transparent; } }
@media (prefers-reduced-motion: reduce) { .is-miss { animation: none; } }
.actionbar.is-bad .actionbar__info b { color: var(--bad); }

/* ---- Danh sách file đã tạo ---- */
.review .file { align-items: flex-start; gap: 10px; }
.review .file--bad { border-color: var(--bad); background: var(--bad-soft); }
.review .file.is-off { opacity: .5; }
.review .file__chk { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--pine-deep); flex: none; }
.review .file__dl { margin-left: auto; flex: none; min-height: 36px; padding: 0 12px; border-radius: 99px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 600; font-size: 13.5px; color: var(--ink); }
.tag--bad { background: var(--bad-soft); color: var(--bad); font-weight: 600; }
.review .file--bad .tag--bad { background: var(--surface); border: 1px solid var(--bad); }
