/* WanTech TeamHub — brand tokens live here; change these to rebrand. */
:root {
  --brand: #0b3d5c;        /* WanTech navy */
  --brand-2: #0e8c8c;      /* teal accent */
  --brand-ink: #ffffff;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --ink: #17232d;
  --muted: #5b6770;
  --line: #dde3e8;
  --soft: #eef3f6;
  --ok: #1f8a4c;  --ok-bg: #e6f4ec;
  --warn: #a15c00; --warn-bg: #fff3df;
  --bad: #b42318;  --bad-bg: #fde8e6;
  --info: #175cd3; --info-bg: #e8effc;
  --hold: #6941c6; --hold-bg: #f0ebfb;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
  --side: 232px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); line-height: 1.45; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.45rem; margin: 0 0 .25rem; }
h2 { font-size: 1.05rem; margin: 0 0 .6rem; }
h3 { font-size: .95rem; margin: 0 0 .4rem; }
small, .muted { color: var(--muted); }
code { background: var(--soft); padding: 0 .3em; border-radius: 4px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1rem 0; }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.side { background: var(--brand); color: var(--brand-ink); padding: 14px 10px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brandmark { display: flex; gap: 10px; align-items: center; padding: 4px 8px 16px; color: #fff; font-weight: 700; letter-spacing: .2px; }
.brandmark svg { flex: none; }
.brandmark small { display: block; color: #9cc3d6; font-weight: 500; font-size: .72rem; }
.nav a { display: flex; align-items: center; gap: 10px; color: #d7e6ee; padding: 8px 10px; border-radius: 6px; font-size: .93rem; }
.nav a:hover { background: rgba(255,255,255,.08); text-decoration: none; color: #fff; }
.nav a.active { background: rgba(255,255,255,.14); color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 var(--brand-2); }
.nav .count { margin-left: auto; background: var(--brand-2); color: #fff; border-radius: 999px; padding: 0 7px; font-size: .75rem; }
.nav .sep { height: 1px; background: rgba(255,255,255,.12); margin: 10px 6px; }
.main { min-width: 0; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 10px 22px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.topbar form.search { flex: 1; max-width: 420px; }
.topbar .search input { width: 100%; }
.topbar .right { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.btn.menu-btn { display: none; }
.content { padding: 20px 22px 60px; max-width: 1400px; }
.page-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; justify-content: space-between; margin-bottom: 14px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.demo-ribbon { background: var(--warn-bg); color: var(--warn); font-size: .8rem; padding: 4px 22px; border-bottom: 1px solid #f3d9a8; }

/* ---------- panels & grid ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; margin-bottom: 16px; }
.panel > h2:first-child { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g-main { grid-template-columns: minmax(0,2fr) minmax(280px,1fr); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px,1fr)); gap: 12px; margin-bottom: 16px; }
.stat { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); color: var(--ink); }
.stat:hover { border-color: var(--brand-2); text-decoration: none; }
.stat .n { font-size: 1.7rem; font-weight: 700; line-height: 1.1; }
.stat .l { color: var(--muted); font-size: .82rem; }
.stat.bad .n { color: var(--bad); } .stat.warn .n { color: var(--warn); } .stat.ok .n { color: var(--ok); } .stat.info .n { color: var(--info); }

/* ---------- tables & lists ---------- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: .9rem; }
th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; background: #fafbfc; }
tr.overdue td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
.table-wrap { overflow-x: auto; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.tasklist { list-style: none; margin: 0; padding: 0; }
.tasklist li { display: flex; gap: 10px; align-items: flex-start; padding: 9px 2px; border-bottom: 1px solid var(--line); }
.tasklist li:last-child { border-bottom: 0; }
.tasklist .t-main { flex: 1; min-width: 0; }
.tasklist .t-title { font-weight: 600; }
.tasklist .t-meta { color: var(--muted); font-size: .82rem; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.empty { color: var(--muted); padding: 10px 2px; font-size: .9rem; }
.ref { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .82rem; color: var(--muted); }

/* ---------- badges ---------- */
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .75rem; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.s-new { background: var(--soft); color: var(--muted); }
.s-assigned { background: var(--info-bg); color: var(--info); }
.s-in_progress { background: #e3f4f4; color: #0b6e6e; }
.s-submitted { background: var(--hold-bg); color: var(--hold); }
.s-completed { background: var(--ok-bg); color: var(--ok); }
.s-blocked { background: var(--bad-bg); color: var(--bad); }
.s-waiting_external { background: var(--warn-bg); color: var(--warn); }
.s-on_hold { background: #eceff2; color: #475467; }
.s-cancelled { background: #f2f4f7; color: #98a2b3; text-decoration: line-through; }
.p-urgent { background: var(--bad); color: #fff; } .p-high { background: var(--warn-bg); color: var(--warn); }
.p-normal { background: var(--soft); color: var(--muted); } .p-low { background: #f8f9fa; color: #98a2b3; }
.flag-overdue { background: var(--bad-bg); color: var(--bad); }
.flag-soon { background: var(--warn-bg); color: var(--warn); }
.flag-stale { background: #fff7e0; color: #8a5a00; border-color: #f0d38a; }
.flag-est { background: #f2f4f7; color: var(--muted); font-weight: 500; }
.score { font-weight: 700; font-variant-numeric: tabular-nums; }
.score.na { color: var(--muted); font-weight: 500; }
.score.good { color: var(--ok); } .score.mid { color: var(--warn); } .score.low { color: var(--bad); }

/* progress */
.bar { height: 6px; background: var(--soft); border-radius: 999px; overflow: hidden; min-width: 60px; }
.bar > span { display: block; height: 100%; background: var(--brand-2); }
.bar.over > span { background: var(--bad); }
.progress-label { font-size: .75rem; color: var(--muted); }

/* ---------- forms ---------- */
label { display: block; font-size: .82rem; font-weight: 600; color: #344054; margin: 0 0 3px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=datetime-local],
input[type=time], input[type=search], input[type=file], input:not([type]), select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid #c4ccd3; border-radius: 6px; font: inherit; background: #fff; color: var(--ink);
}
textarea { min-height: 70px; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 1px; }
.field { margin-bottom: 10px; }
.row { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.check { display: flex; gap: 8px; align-items: center; font-weight: 500; }
.check input { width: auto; }
.hint { font-size: .78rem; color: var(--muted); margin-top: 2px; font-weight: 400; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 6px; border: 1px solid #c4ccd3; background: #fff; color: var(--ink); font: inherit; font-weight: 600; font-size: .88rem; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--soft); text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: #0a3350; }
.btn.accent { background: var(--brand-2); border-color: var(--brand-2); color: #fff; }
.btn.good { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.danger { color: var(--bad); border-color: #f0b8b2; }
.btn.small { padding: 3px 9px; font-size: .8rem; }
.btn[disabled], .btn.busy { opacity: .6; cursor: progress; }
.inline { display: inline; }
details.action { border: 1px solid var(--line); border-radius: 6px; margin-bottom: 8px; background: #fff; }
details.action > summary { cursor: pointer; padding: 8px 12px; font-weight: 600; font-size: .9rem; list-style: none; }
details.action > summary::-webkit-details-marker { display: none; }
details.action > summary::before { content: "▸ "; color: var(--muted); }
details.action[open] > summary::before { content: "▾ "; }
details.action > div { padding: 4px 12px 12px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.filters .field { margin: 0; min-width: 130px; flex: 1 1 130px; max-width: 220px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 12px; flex-wrap: wrap; }
.tabs a { padding: 7px 12px; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 600; font-size: .9rem; }
.tabs a.on { color: var(--brand); border-color: var(--brand-2); }

/* ---------- flash ---------- */
.flash { padding: 9px 12px; border-radius: 6px; margin-bottom: 10px; font-size: .92rem; }
.flash.ok { background: var(--ok-bg); color: #135a32; border: 1px solid #b7e0c6; }
.flash.error { background: var(--bad-bg); color: #8a1c12; border: 1px solid #f5c2bd; }
.flash.warn { background: var(--warn-bg); color: #7a4600; border: 1px solid #f3d9a8; }
.notice { background: var(--info-bg); color: #1d3f86; border: 1px solid #c7d7f6; padding: 9px 12px; border-radius: 6px; font-size: .88rem; margin-bottom: 12px; }

/* ---------- task detail ---------- */
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 4px 10px; font-size: .9rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.feed { list-style: none; padding: 0; margin: 0; }
.feed li { display: grid; grid-template-columns: 34px 1fr; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.feed .ic { width: 28px; height: 28px; border-radius: 50%; background: var(--soft); display: grid; place-items: center; font-size: .72rem; font-weight: 700; color: var(--brand); }
.feed .k-status .ic, .feed .k-deadline .ic { background: var(--info-bg); color: var(--info); }
.feed .k-approval .ic { background: var(--hold-bg); color: var(--hold); }
.feed .k-update .ic { background: #e3f4f4; color: #0b6e6e; }
.feed .k-block .ic, .feed .k-escalation .ic { background: var(--bad-bg); color: var(--bad); }
.feed .who { font-weight: 600; font-size: .88rem; }
.feed .when { color: var(--muted); font-size: .78rem; }
.feed .body { white-space: pre-wrap; font-size: .92rem; margin-top: 2px; }
.update-card { background: #f7fbfb; border: 1px solid #d3eaea; border-radius: 6px; padding: 8px 10px; margin-top: 4px; font-size: .9rem; }
.update-card b { color: #0b6e6e; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; display: block; }
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; gap: 8px; align-items: center; padding: 5px 0; border-bottom: 1px dashed var(--line); }
.checklist li.done span { text-decoration: line-through; color: var(--muted); }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.thumbs a { display: block; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--soft); font-size: .75rem; }
.thumbs img { width: 100%; height: 90px; object-fit: cover; display: block; }
.thumbs .cap { padding: 3px 6px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.blockbox { border: 1px solid #f5c2bd; background: var(--bad-bg); border-radius: 6px; padding: 10px 12px; margin-bottom: 12px; }
.blockbox.waiting { background: var(--warn-bg); border-color: #f3d9a8; }

/* ---------- kanban ---------- */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 10px; overflow-x: auto; padding-bottom: 8px; }
.kcol { background: #e9eef2; border-radius: var(--radius); padding: 8px; min-height: 200px; }
.kcol h3 { display: flex; justify-content: space-between; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 2px 4px 8px; }
.kcard { display: block; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 8px 9px; margin-bottom: 7px; color: var(--ink); box-shadow: var(--shadow); font-size: .86rem; }
.kcard:hover { border-color: var(--brand-2); text-decoration: none; }
.kcard.overdue { border-left: 3px solid var(--bad); }

/* ---------- calendar ---------- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.cal .dow { background: #fafbfc; font-size: .72rem; font-weight: 700; color: var(--muted); padding: 5px 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-transform: uppercase; }
.cal .day { min-height: 104px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 4px 5px; background: #fff; font-size: .78rem; }
.cal .day.other { background: #fafbfc; color: #98a2b3; }
.cal .day.today { box-shadow: inset 0 0 0 2px var(--brand-2); }
.cal .day.hol { background: #fff8ec; }
.cal .dn { font-weight: 700; font-size: .78rem; }
.cal .ev { display: block; margin-top: 3px; padding: 1px 5px; border-radius: 4px; background: var(--soft); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal .ev.overdue { background: var(--bad-bg); color: var(--bad); }
.cal .ev.completed { background: var(--ok-bg); color: var(--ok); }

/* ---------- KPI ---------- */
.measure { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 14px; background: #fff; }
.measure header { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; padding: 10px 14px; background: #fafbfc; border-bottom: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0; }
.measure header .big { font-size: 1.5rem; }
.measure .def { padding: 8px 14px; font-size: .84rem; color: #344054; background: #fcfcfd; border-bottom: 1px solid var(--line); }
.measure .def dt { font-weight: 700; margin-top: 4px; }
.measure .def dd { margin: 0 0 2px; }
.measure table { margin: 0; }
tr.excluded td { color: var(--muted); }
.ratio { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .88rem; }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(160deg, var(--brand) 0%, #0f5578 55%, var(--brand-2) 140%); padding: 20px; }
.auth .card { background: #fff; width: 100%; max-width: 400px; border-radius: 12px; padding: 26px; box-shadow: 0 10px 30px rgba(0,0,0,.2); }
.auth .logo { display: flex; gap: 10px; align-items: center; margin-bottom: 18px; color: var(--brand); font-weight: 700; font-size: 1.15rem; }

/* ---------- field mode ---------- */
.field-page .content { max-width: 720px; }
.bigbtns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.bigbtns .btn { justify-content: center; padding: 12px; font-size: .95rem; }
.queue { border: 1px dashed var(--warn); background: var(--warn-bg); padding: 8px 10px; border-radius: 6px; font-size: .85rem; margin-bottom: 10px; display: none; }
.queue.show { display: block; }
.draft-note { font-size: .75rem; color: var(--muted); }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .g-main, .g3 { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 30; left: 0; top: 0; width: 260px; transform: translateX(-100%); transition: transform .15s; }
  body.nav-open .side { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.35); }
  .btn.menu-btn { display: inline-flex; }
  .content { padding: 14px 12px 60px; }
  .topbar { padding: 8px 12px; }
  .g2 { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
  .kv { grid-template-columns: 110px 1fr; }
  .cal .day { min-height: 70px; }
  .cal .ev { font-size: .68rem; }
}
@media (max-width: 520px) { .topbar form.search { display: none; } }
@media print {
  .side, .topbar, .no-print, .btn { display: none !important; }
  .shell { display: block; }
  .panel { box-shadow: none; break-inside: avoid; }
}

/* ---------- phase 2: RAG, PO status, Gantt ---------- */
.rag { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: .75rem; font-weight: 700; color: #fff; background: #98a2b3; }
.rag-green { background: var(--ok); } .rag-amber { background: #c77700; } .rag-red { background: var(--bad); }
.po-draft, .po-rejected { background: var(--soft); color: var(--muted); }
.po-submitted { background: var(--hold-bg); color: var(--hold); }
.po-approved, .po-ordered { background: var(--info-bg); color: var(--info); }
.po-partially_received { background: var(--warn-bg); color: var(--warn); }
.po-received, .po-closed { background: var(--ok-bg); color: var(--ok); }
.po-cancelled { background: #f2f4f7; color: #98a2b3; text-decoration: line-through; }
.gantt { overflow-x: auto; }
.gantt .g-head, .gantt .g-row { display: grid; grid-template-columns: 260px minmax(560px, 1fr); }
.gantt .g-row { border-top: 1px solid var(--line); min-height: 38px; }
.gantt .g-label { padding: 5px 8px 5px 0; font-size: .82rem; overflow: hidden; }
.gantt .g-track { position: relative; background: repeating-linear-gradient(90deg, transparent 0, transparent calc(100%/14 - 1px), #f1f4f6 calc(100%/14 - 1px), #f1f4f6 calc(100%/14)); }
.gantt .g-head .g-track { height: 22px; background: none; }
.gantt .g-week { position: absolute; top: 2px; font-size: .68rem; color: var(--muted); white-space: nowrap; border-left: 1px solid var(--line); padding-left: 3px; }
.gantt .g-bar { position: absolute; top: 9px; height: 18px; border-radius: 4px; background: #9fb3c2; overflow: hidden; min-width: 6px; }
.gantt .g-bar.s-in_progress { background: #5fb3b3; } .gantt .g-bar.s-completed { background: #6cc08b; } .gantt .g-bar.s-submitted { background: #a48ae0; }
.gantt .g-bar.s-blocked, .gantt .g-bar.s-waiting_external { background: #e9a23b; } .gantt .g-bar.s-assigned, .gantt .g-bar.s-new { background: #8fa8d8; }
.gantt .g-bar.overdue { outline: 2px solid var(--bad); }
.gantt .g-bar.nodue { background: repeating-linear-gradient(45deg, #c9d3da, #c9d3da 4px, #e4e9ed 4px, #e4e9ed 8px); }
.gantt .g-prog { display: block; height: 100%; background: rgba(0,0,0,.18); }
.gantt .g-diamond { position: absolute; top: 11px; width: 13px; height: 13px; margin-left: -6px; transform: rotate(45deg); background: var(--brand); }
.gantt .g-diamond.done { background: var(--ok); } .gantt .g-diamond.late { background: var(--bad); }
.gantt .g-today { position: absolute; top: 0; bottom: 0; border-left: 2px solid var(--bad); z-index: 2; }
.gantt .g-baseline { position: absolute; top: 0; bottom: 0; border-left: 2px dashed var(--muted); z-index: 1; }
.sar-draft, .sar-cancelled { background: var(--soft); color: var(--muted); }
.sar-submitted { background: var(--hold-bg); color: var(--hold); }
.sar-approved { background: var(--ok-bg); color: var(--ok); }
.sar-rejected { background: var(--bad-bg); color: var(--bad); }
.signbox { border: 2px solid var(--brand-2); border-radius: var(--radius); padding: 12px 14px; background: #f5fbfb; }
.fin td { padding: 4px 8px; } .fin td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
td.num, th.num { white-space: nowrap; }

/* ---- reference documents & viewer (1.3) ---- */
.doc-row { display: flex; gap: 10px; align-items: center; padding: 8px 2px; border-bottom: 1px solid var(--line); }
.doc-row:last-of-type { border-bottom: 0; }
.doc-main { flex: 1; min-width: 0; }
.doc-name { font-weight: 600; overflow-wrap: anywhere; }
.doc-desc { font-size: .85rem; }
.doc-meta { color: var(--muted); font-size: .78rem; }
.doc-act { display: flex; gap: 4px; align-items: center; flex-shrink: 0; }
.doc-ic { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 40px; height: 26px; border-radius: 4px;
  font: 700 .66rem/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .03em; color: #fff; background: #667085; }
.doc-pdf { background: #b42318; } .doc-docx { background: #1f5fbf; } .doc-xlsx { background: #137a45; }
.doc-sub { font-size: .8rem; color: var(--muted); margin: 10px 0 2px; text-transform: uppercase; letter-spacing: .04em; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font: inherit; }
form.inline { display: inline; }

.dv-head { display: grid; gap: 8px; margin-bottom: 14px; }
.dv-back { font-size: .88rem; }
.dv-title { display: flex; gap: 10px; align-items: flex-start; }
.dv-title h1 { margin: 0; font-size: 1.25rem; overflow-wrap: anywhere; }
.dv-sub { font-size: .82rem; }
.dv-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.dv-zoom { display: inline-flex; gap: 2px; }
.dv-pdf { --dv-w: 900px; display: grid; gap: 14px; justify-items: center; overflow-x: auto; padding-bottom: 8px; }
.dv-page { margin: 0; width: min(100%, var(--dv-w)); }
.dv-pdf.zoomed .dv-page { width: var(--dv-w); max-width: none; }
.dv-page img { display: block; width: 100%; height: auto; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); }
.dv-page figcaption { text-align: center; color: var(--muted); font-size: .75rem; margin-top: 4px; }
.dv-docx { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: clamp(16px, 4vw, 48px); max-width: 900px; margin: 0 auto; line-height: 1.55; overflow-wrap: anywhere; }
.dv-docx h1, .dv-docx h2, .dv-docx h3, .dv-docx h4 { margin: 1.1em 0 .4em; line-height: 1.25; }
.dv-docx p { margin: 0 0 .55em; }
.dv-docx img { max-width: 100%; height: auto; }
.dv-docx .a-c { text-align: center; } .dv-docx .a-r { text-align: right; } .dv-docx .a-j { text-align: justify; }
.dv-docx table { margin: .6em 0; }
.dv-docx td { border: 1px solid var(--line); font-size: .88rem; }
.dv-docx td p { margin: 0; }
.dv-note { color: var(--muted); font-style: italic; }
.dv-tablewrap { overflow-x: auto; max-width: 100%; }
.dv-sheet { border-collapse: collapse; font-variant-numeric: tabular-nums; }
.dv-sheet th, .dv-sheet td { border: 1px solid var(--line); padding: 3px 7px; font-size: .82rem; white-space: nowrap; max-width: 360px; overflow: hidden; text-overflow: ellipsis; }
.dv-sheet thead th { position: sticky; top: 0; text-align: center; }
.dv-sheet tbody th { text-align: right; min-width: 36px; }
.dv-sheet td.n { text-align: right; }
.dv-xlsx { overflow: hidden; }
.dv-xlsx .dv-tablewrap { max-height: 75vh; overflow: auto; }

/* ---- SMTP test (1.3.2) ---- */
.smtp-result { border: 1px solid var(--line); border-left: 4px solid var(--ok); border-radius: var(--radius); padding: 10px 12px; margin-top: 10px; background: var(--ok-bg); }
.smtp-result.bad { border-left-color: var(--bad); background: var(--bad-bg); }
.smtp-result ol { margin: 6px 0 0; padding-left: 0; list-style: none; display: grid; gap: 4px; font-size: .88rem; overflow-wrap: anywhere; }
.smtp-result li.ok span { color: var(--ok); font-weight: 600; }
.smtp-result li.bad span { color: var(--bad); font-weight: 600; }
.smtp-hint { margin-top: 2px; font-weight: 600; }
.bad-text { color: var(--bad); }
