/* 中智优力 · 财税服务提效系统
   版式：「报表」——整页一张纸，靠留白、三线表和「一、二、三、」分节，不用卡片与阴影。
   两色为主：墨（正文、线、唯一的实心按钮）+ 账簿红（只用在：已超期、分节序号、今天、合计下的结账双线）。
   字体只用系统字体（国内打得开）：正文黑体；宋体只用于 22px 以上的标题与分节，一律 400 字重（Windows 退回 SimSun 时不糊）。 */
[hidden], .is-hidden { display: none !important; }

:root {
  --paper: #FAF9F5;
  --white: #FFFFFF;
  --ink: #1D1D1B;
  --ink2: #45433E;
  --muted: #6B675E;
  --faint: #8C877C;
  --rule: #D6D1C6;
  --rule-soft: #E6E2D8;
  --cell: #F1EEE6;
  --hover: #F3F1EA;
  --red: #9A2F24;
  --red-tint: #F4E4DF;
  --link: #22497A;
  --warn: #7E5200;
  --ok: #2E6644;
  --field: #948D80;       /* 输入框边框：对白底 3.3:1（表单控件边界要 ≥3:1） */
  /* 旧变量名保留，指到新色上 */
  --bg: var(--paper);
  --accent: var(--ink);
  --accent-weak: var(--cell);
  --danger: var(--red);
  --r: 2px;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --serif: "Songti SC", "STZhongsong", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", "SimSun", serif;
  --num: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  --fig: "Times New Roman", Times, "Songti SC", "STSong", "SimSun", serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 14px/1.6 var(--font); }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
h1 { font-size: 20px; }
h2 { font-size: 15px; }
h3 { font-size: 14px; }
p { margin: 0 0 8px; }
.num, .tabnum { font-variant-numeric: tabular-nums lining-nums; }
.code, .tbl td.code { font-variant-numeric: tabular-nums; white-space: nowrap; text-align: left; }
.show-sm { display: none; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.grow { flex: 1; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stack > * + * { margin-top: 16px; }
.late { color: var(--red); }

/* ---------------- 顶栏：报头，下面一粗一细两道墨线 ---------------- */
.topbar { background: var(--paper); position: sticky; top: 0; z-index: 20; }
.topbar::after { content: ""; display: block; height: 4px; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--ink); }
.topbar-in { max-width: 1320px; margin: 0 auto; padding: 0 24px; display: flex; align-items: stretch; gap: 26px; min-height: 54px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand .nm { font-family: var(--serif); font-size: 19px; font-weight: 400; letter-spacing: .1em; }
.brand .sys { font-size: 12.5px; color: var(--muted); padding-left: 12px; border-left: 1px solid var(--rule); letter-spacing: .04em; }
.nav { display: flex; align-items: stretch; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { display: flex; align-items: center; padding: 0 11px; color: var(--ink2); border-bottom: 3px solid transparent;
  white-space: nowrap; font-size: 14px; }
.nav a:hover { color: var(--ink); text-decoration: none; background: var(--hover); }
.nav a.on { color: var(--ink); border-bottom-color: var(--ink); font-weight: 600; }
.me { display: flex; align-items: center; gap: 14px; white-space: nowrap; font-size: 13px; color: var(--ink2); }
.me a { color: var(--ink2); }
.me form { margin: 0; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--ink2); font: inherit; cursor: pointer; }
.linkbtn:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------------- 页面与页头 ---------------- */
.page { max-width: 1320px; margin: 0 auto; padding: 22px 24px 40px; counter-reset: sec; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px;
  padding-bottom: 10px; border-bottom: 1px solid var(--ink2); }
.page-head h1, .cust-head h1 { font-family: var(--serif); font-weight: 400; font-size: 26px; letter-spacing: .1em; line-height: 1.25; }
.page-head .sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.crumb { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.crumb a { color: var(--muted); }

/* 报表页的「编制」行、工作台的征期行 */
.madeby { display: flex; justify-content: space-between; gap: 4px 20px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink2);
  margin: -10px 0 18px; padding: 7px 0; border-bottom: 1px solid var(--rule); }
.madeby b { font-weight: 600; color: var(--ink); }
.taxline { display: flex; gap: 6px 16px; flex-wrap: wrap; align-items: baseline; font-size: 13px; color: var(--ink2);
  margin: -10px 0 18px; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.taxline .lb { color: var(--red); letter-spacing: .3em; font-size: 12px; }
.taxline b { font-weight: 600; color: var(--ink); }
.taxline b.late { color: var(--red); }
.taxline .set { margin-left: auto; font-size: 12.5px; }

.flash { padding: 9px 14px; margin-bottom: 16px; border-left: 3px solid var(--ink); background: var(--cell); font-size: 13.5px; }
.flash.err { border-color: var(--red); background: var(--red-tint); }

/* ---------------- 版块：不要盒子，分节标题「一、二、三、」 ---------------- */
.sheet { background: none; border: 0; }
.sheet-h { display: flex; align-items: baseline; gap: 12px; padding: 0 0 7px; }
.sheet-h h2 { font-family: var(--serif); font-weight: 400; font-size: 17px; letter-spacing: .04em; }
.sheet-h h2::before { counter-increment: sec; content: counter(sec, simp-chinese-informal) "、"; color: var(--red); }
.sheet-h .more { margin-left: auto; font-size: 12.5px; white-space: nowrap; }
.sheet-b { padding: 14px 0 0; border-top: 1.5px solid var(--ink); }
.sheet-b.flush { padding: 0; border-top: 0; }
.sheet-b.flush > .empty, .sheet-b.flush > .kv, .sheet-b.flush > p { border-top: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 34px 40px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 34px 32px; }
.sheet + .sheet { margin-top: 34px; }
.grid-2 > .sheet + .sheet, .grid-3 > .sheet + .sheet { margin-top: 0; }

/* 数字栏：一行报表数，标签在上、数在下，右对齐 */
.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); border-top: 1.5px solid var(--ink);
  border-bottom: 1.5px solid var(--ink); margin-bottom: 34px; }
.fig { display: flex; flex-direction: column-reverse; align-items: flex-end; padding: 8px 18px 10px; border-left: 1px solid var(--rule); min-width: 0; }
.fig:first-child { border-left: 0; }
.fig b { display: block; font-family: var(--fig); font-weight: 400; font-size: 32px; line-height: 1.2;
  font-variant-numeric: lining-nums tabular-nums; }
.fig b small { font-family: var(--font); font-size: 12px; color: var(--muted); margin-left: 4px; }
.fig span { font-size: 12.5px; color: var(--muted); letter-spacing: .06em; white-space: nowrap; }
.fig a { color: inherit; }
.fig a:hover { text-decoration: none; }
.fig:has(a):hover { background: var(--hover); }
.fig.alert b { color: var(--red); }

/* ---------------- 表格：三线表 ---------------- */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; border-top: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); }
.tbl th { text-align: left; font-weight: 400; color: var(--muted); font-size: 12px; letter-spacing: .06em; padding: 6px 10px 5px;
  border-bottom: 1px solid var(--ink2); white-space: nowrap; }
.tbl td { padding: 8px 10px; border-bottom: 1px solid var(--rule-soft); vertical-align: top; }
.tbl tbody tr:hover td { background: var(--hover); }
.tbl th:first-child, .tbl td:first-child { padding-left: 4px; }
.tbl th:last-child, .tbl td:last-child { padding-right: 4px; }
.tbl .num, .tbl th.num { text-align: right; font-family: var(--num); font-variant-numeric: tabular-nums lining-nums; }
.tbl .c { text-align: center; }
.tbl .ln, .tbl th.ln { width: 44px; text-align: center; color: var(--muted); font-size: 12.5px; padding-left: 0; padding-right: 0; }
.tbl tr.done td { color: var(--muted); }
/* 合计：上单线、下结账双线（红） */
.tbl tfoot td { font-weight: 600; border-top: 1px solid var(--ink); border-bottom: 3px double var(--red); padding-top: 8px; padding-bottom: 7px; }
.tbl tfoot td.lbl { letter-spacing: .3em; }
.capital { display: flex; justify-content: space-between; gap: 4px 16px; flex-wrap: wrap; margin-top: 8px; font-size: 12.5px; color: var(--ink2); }
.capital b { font-weight: 600; color: var(--ink); letter-spacing: .04em; }

/* 标记：方角细框；只有「已超期 / 过期」是实心红 */
.tag { display: inline-block; padding: 0 5px; font-size: 12px; line-height: 18px; border: 1px solid var(--rule);
  border-radius: 1px; color: var(--muted); white-space: nowrap; background: transparent; }
.tag-accent { color: var(--ink); border-color: var(--ink2); }
.tag-ok { color: var(--ok); border-color: #9DB9A6; }
.tag-warn { color: var(--warn); border-color: #CDB27A; }
.tag-danger { color: #fff; border-color: var(--red); background: var(--red); }
.tag-muted { color: var(--muted); border-color: var(--rule-soft); }

/* 键值对 */
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 7px 16px; margin: 0; font-size: 13.5px; padding: 10px 0; }
.kv dt { color: var(--muted); white-space: nowrap; }
.kv dd { margin: 0; word-break: break-all; }
.kv-4 { grid-template-columns: max-content minmax(0, 1fr) max-content minmax(0, 1fr); }

/* ---------------- 按钮与表单 ---------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 14px;
  border: 1px solid var(--ink2); background: transparent; color: var(--ink); border-radius: var(--r); font: 13.5px var(--font);
  cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--hover); text-decoration: none; }
.btn-primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-primary:hover { background: #3A3935; }
.btn-danger { color: var(--red); border-color: #C9A29C; }
.btn-danger:hover { border-color: var(--red); background: var(--red-tint); }
.btn-sm { height: 26px; padding: 0 9px; font-size: 12.5px; }
.btn-link { border: 0; background: none; color: var(--link); padding: 0; height: auto; }
.btn:focus-visible, .linkbtn:focus-visible, a:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.inline { display: inline; margin: 0; }

input:not([type]), input[type=tel], input[type=text], input[type=password], input[type=date], input[type=month], input[type=number], input[type=search], select, textarea {
  width: 100%; height: 34px; padding: 0 10px; border: 1px solid var(--field); border-radius: var(--r); background: var(--white);
  font: 14px var(--font); color: var(--ink); }
textarea { height: auto; min-height: 72px; padding: 8px 10px; line-height: 1.55; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
input[type=checkbox], input[type=radio] { accent-color: var(--ink); width: 15px; height: 15px; vertical-align: -2px; }
input[type=file] { font: 13px var(--font); max-width: 100%; }
label { font-size: 13px; color: var(--ink2); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; margin-bottom: 4px; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 3px; }
.field .req { color: var(--red); }
.form-actions { display: flex; gap: 8px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--rule); }
.form-error { padding: 8px 12px; background: var(--red-tint); border-left: 3px solid var(--red); margin-bottom: 12px; font-size: 13.5px; }

/* 筛选条：一道填写栏带 */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 12px; background: var(--cell);
  border-top: 1px solid var(--ink2); border-bottom: 1px solid var(--rule); margin-bottom: 18px; }
.filters input[type=search], .filters input[type=text] { width: 220px; }
.filters select { width: auto; min-width: 110px; }
.filters .sep { width: 1px; align-self: stretch; background: var(--rule); margin: 0 4px; }
.seg { display: inline-flex; border: 1px solid var(--ink2); border-radius: var(--r); overflow: hidden; background: var(--white); }
.seg a { padding: 4px 12px; color: var(--ink2); font-size: 13px; border-right: 1px solid var(--rule); }
.seg a:last-child { border-right: 0; }
.seg a.on { background: var(--ink); color: #fff; }
.seg a:hover { text-decoration: none; }

.pager { display: flex; gap: 6px; align-items: center; justify-content: flex-end; margin-top: 12px; font-size: 13px; }
.empty { padding: 26px 16px; text-align: center; color: var(--muted); }

/* ---------------- 客户档案：左侧档案目录（纯文字，不是图标栏） ---------------- */
.cust-head { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 10px 16px; margin-bottom: 18px; padding-bottom: 10px;
  border-bottom: 1px solid var(--ink2); }
.cust-head .code { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; }
.cust-head .actions { margin-left: auto; display: flex; gap: 8px; }
.dossier-wrap { display: grid; grid-template-columns: 188px minmax(0, 1fr); gap: 32px; align-items: start; }
.dossier { position: sticky; top: 76px; border-top: 1.5px solid var(--ink); border-bottom: 1px solid var(--rule); padding: 6px 0;
  font-size: 13.5px; }
.dossier .lbl { padding: 10px 12px 3px; font-size: 11.5px; color: var(--muted); letter-spacing: .15em; }
.dossier a { display: block; padding: 5px 12px; color: var(--ink2); border-left: 3px solid transparent; }
.dossier a:hover { background: var(--hover); text-decoration: none; color: var(--ink); }
.dossier a.on { border-left-color: var(--ink); color: var(--ink); background: var(--cell); font-weight: 600; }

.section-block { margin-bottom: 34px; scroll-margin-top: 76px; }
.edit-box { background: var(--cell); border-top: 1px dashed var(--rule); padding: 14px 16px; }

/* 确认表 */
.confirm-tbl td textarea { min-height: 54px; font-size: 13px; }
.confirm-tbl .grp { font-weight: 600; background: var(--cell); width: 76px; }
.thumbs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.thumbs img { width: 64px; height: 64px; object-fit: cover; border: 1px solid var(--rule); }

/* 时间轴 */
.timeline { list-style: none; margin: 0; padding: 14px 0 0; border-top: 1.5px solid var(--ink); }
.timeline li { position: relative; padding: 0 0 18px 22px; border-left: 1px solid var(--rule); margin-left: 6px; }
.timeline li::before { content: ""; position: absolute; left: -5px; top: 6px; width: 9px; height: 9px; background: var(--paper);
  border: 1.5px solid var(--ink); }
.timeline li:last-child { border-left-color: transparent; }
.timeline .when { font-size: 12.5px; color: var(--muted); }

/* 知识库 */
.kb-wrap { display: grid; grid-template-columns: 228px minmax(0, 1fr); gap: 32px; align-items: start; }
.tree { border-top: 1.5px solid var(--ink); border-bottom: 1px solid var(--rule); padding: 6px 0; font-size: 13.5px; }
.tree a { display: flex; gap: 6px; padding: 5px 12px; color: var(--ink2); border-left: 3px solid transparent; }
.tree a:hover { background: var(--hover); text-decoration: none; }
.tree a.on { border-left-color: var(--ink); background: var(--cell); color: var(--ink); font-weight: 600; }
.tree .n { margin-left: auto; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.snip { font-size: 12.5px; color: var(--ink2); margin-top: 2px; }
.snip mark { background: #F3E6C4; color: inherit; padding: 0 1px; }

/* 预览 */
.doc-preview { background: var(--white); border: 1px solid var(--rule); padding: 24px 28px; line-height: 1.8; }
.doc-preview p.gap { height: 8px; margin: 0; }
.doc-preview h4 { margin: 16px 0 6px; }
.scroll { overflow-x: auto; }
table.grid { border-collapse: collapse; font-size: 13px; background: var(--white); }
table.grid td { border: 1px solid var(--rule); padding: 4px 8px; white-space: nowrap; }
pre.doc-preview { white-space: pre-wrap; font: 13px/1.6 ui-monospace, Menlo, Consolas, monospace; }
.pdf-frame { width: 100%; height: 78vh; border: 1px solid var(--rule); background: #fff; }

/* 计划月格 */
.mgrid td.m { text-align: center; font-variant-numeric: tabular-nums; font-size: 12.5px; min-width: 58px; }
.rate-hi { color: var(--ok); }
.rate-mid { color: var(--warn); }
.rate-lo { color: var(--red); }
.bar { height: 4px; background: var(--rule-soft); overflow: hidden; margin-top: 4px; }
.bar i { display: block; height: 100%; background: var(--ink2); }

.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1.5px solid var(--ink); border-bottom: 1px solid var(--rule);
  margin-bottom: 20px; }
.week a { padding: 8px 10px; border-right: 1px solid var(--rule-soft); color: var(--ink2); font-size: 12.5px; }
.week a:last-child { border-right: 0; }
.week a.on { background: var(--cell); color: var(--ink); box-shadow: inset 0 -3px 0 var(--ink); }
.week a b { display: block; font-family: var(--fig); font-weight: 400; font-size: 17px; font-variant-numeric: tabular-nums lining-nums; }
.week a:hover { text-decoration: none; background: var(--hover); }

.wage-frame { width: 100%; height: calc(100vh - 150px); min-height: 560px; border: 1px solid var(--rule); background: #fff; }

/* ICP 备案号：页面底部居中 */
.site-foot { text-align: center; font-size: 12px; padding: 8px 16px 26px; }
.site-foot a { color: var(--muted); }

/* ---------------- 登录页：报表式报头 + 申报日历 + 申报表式填写栏 ---------------- */
.lg-page { max-width: 1180px; margin: 0 auto; padding: 42px 40px 0; min-height: 100vh; display: flex; flex-direction: column; }
.lg-mast { text-align: center; }
.lg-mast h1 { font-family: var(--serif); font-weight: 400; font-size: 30px; letter-spacing: .12em; padding-left: .12em; line-height: 1.3; }
.lg-mast h1::after { content: ""; display: block; width: 7.5em; max-width: 80%; margin: 8px auto 0; height: 4px;
  border-top: 1px solid var(--red); border-bottom: 1px solid var(--red); }
.lg-mast-line { display: flex; justify-content: space-between; gap: 6px 24px; flex-wrap: wrap; margin-top: 18px; padding-bottom: 8px;
  font-size: 13px; color: var(--ink2); border-bottom: 2px solid var(--ink); }
.lg-mast-line b { font-weight: 600; color: var(--ink); }
.lg-body { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 380px; }
.lg-left { padding: 28px 44px 28px 0; border-right: 1px solid var(--rule); }
.lg-right { padding: 28px 0 28px 44px; }
.lg-sec-h { display: flex; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.lg-sec-h h2 { font-family: var(--serif); font-weight: 400; font-size: 17px; letter-spacing: .04em; }
.lg-sec-h .no { color: var(--red); }
.lg-sec-h .aside { margin-left: auto; font-size: 12.5px; color: var(--muted); }
.lg-sec2 { margin-top: 28px; }
.lg-cal-wrap { display: grid; grid-template-columns: 322px minmax(0, 1fr); gap: 28px; align-items: start; }
table.lg-cal { border-collapse: collapse; width: 322px; table-layout: fixed; border-top: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); }
.lg-cal th { font-weight: 400; font-size: 12px; color: var(--muted); height: 28px; border-bottom: 1px solid var(--ink2); }
.lg-cal td { height: 34px; text-align: center; font-size: 13.5px; border-bottom: 1px solid var(--rule-soft); font-variant-numeric: tabular-nums; }
.lg-cal tr:last-child td { border-bottom: 0; }
.lg-cal td.out { color: var(--faint); font-size: 12.5px; }
.lg-cal td.win { background: var(--red-tint); }
.lg-cal td.end { color: var(--red); font-weight: 700; }
.lg-cal td.today span { display: inline-grid; place-items: center; width: 28px; height: 26px; border: 1.5px solid var(--ink); font-weight: 700; }
.lg-legend { font-size: 13px; color: var(--ink2); }
.lg-legend .it { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; align-items: start; padding: 9px 0;
  border-bottom: 1px solid var(--rule-soft); }
.lg-legend .it:first-child { padding-top: 2px; }
.lg-legend .sw { width: 22px; height: 16px; margin-top: 3px; display: block; }
.lg-legend .sw.win { background: var(--red-tint); }
.lg-legend .sw.end { background: var(--red-tint); box-shadow: inset 0 -2px 0 var(--red); }
.lg-legend .sw.today { border: 1.5px solid var(--ink); }
.lg-legend b { font-weight: 600; color: var(--ink); }
table.lg-stmt { width: 100%; border-collapse: collapse; border-top: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); }
.lg-stmt th { text-align: left; font-weight: 400; font-size: 12px; color: var(--muted); padding: 6px 10px 5px; border-bottom: 1px solid var(--ink2); white-space: nowrap; }
.lg-stmt td { padding: 7px 10px; border-bottom: 1px solid var(--rule-soft); vertical-align: top; }
.lg-stmt .ln { width: 44px; text-align: center; color: var(--muted); font-size: 12.5px; padding-left: 0; padding-right: 0; }
.lg-stmt .item { width: 92px; font-weight: 600; white-space: nowrap; }
.lg-stmt .desc { color: var(--ink2); }
.lg-form h2 { font-family: var(--serif); font-weight: 400; font-size: 22px; letter-spacing: .1em; }
.lg-form .lead { color: var(--muted); font-size: 13px; margin: 4px 0 20px; }
.lg-fill { border: 1px solid var(--ink2); background: var(--white); }
.lg-fill .row { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 0; align-items: stretch; flex-wrap: nowrap; }
.lg-fill .row + .row { border-top: 1px solid var(--ink2); }
.lg-fill label { display: flex; align-items: center; padding: 0 14px; background: var(--cell); border-right: 1px solid var(--ink2);
  font-size: 13.5px; color: var(--ink); letter-spacing: .2em; margin: 0; }
.lg-fill input { height: 46px; border: 0; border-radius: 0; padding: 0 14px; font-size: 15px; background: var(--white); }
.lg-fill input:focus { box-shadow: none; }
.lg-fill .row:focus-within { box-shadow: inset 0 0 0 2px var(--ink); }
.lg-submit { width: 100%; height: 44px; margin-top: 16px; font-size: 15px; font-weight: 600; letter-spacing: .5em; padding-left: calc(14px + .5em); }
.lg-form .help { margin-top: 14px; font-size: 12.5px; color: var(--muted); line-height: 1.7; }
.lg-foot { display: flex; justify-content: space-between; gap: 6px 20px; flex-wrap: wrap; border-top: 3px double var(--red);
  padding: 10px 0 0; font-size: 12.5px; color: var(--muted); }
.lg .site-foot { padding: 12px 16px 22px; }

/* ---------------- 窄屏 ---------------- */
@media (max-width: 900px) {
  .topbar-in { flex-wrap: wrap; gap: 0 12px; padding: 0 14px; }
  .brand { min-height: 46px; }
  .brand .sys { display: none; }
  .me { margin-left: auto; }
  .nav { order: 3; flex-basis: 100%; border-top: 1px solid var(--rule); margin: 0 -14px; padding: 0 6px; }
  .nav a { padding: 10px 10px; }
  .page { padding: 16px 14px 36px; }
  .page-head h1, .cust-head h1 { font-size: 23px; }
  .page-head .actions { margin-left: 0; width: 100%; }
  .grid-2, .grid-3, .form-grid { grid-template-columns: minmax(0, 1fr); }
  .dossier-wrap, .kb-wrap { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .dossier { position: static; display: flex; overflow-x: auto; padding: 0; white-space: nowrap; }
  .dossier .lbl { display: none; }
  .dossier a { border-left: 0; border-bottom: 3px solid transparent; padding: 9px 12px; }
  .dossier a.on { border-bottom-color: var(--ink); background: none; }
  .tree { display: flex; overflow-x: auto; padding: 0; white-space: nowrap; }
  .tree a { border-left: 0; border-bottom: 3px solid transparent; padding: 9px 12px; padding-left: 12px !important; }
  .tree a.on { border-bottom-color: var(--ink); background: none; }
  /* 数字栏：左名右数的小余额表 */
  .figures { display: block; padding: 2px 0; }
  .fig { flex-direction: row-reverse; justify-content: space-between; align-items: baseline; border-left: 0; padding: 6px 2px;
    border-bottom: 1px solid var(--rule-soft); }
  .fig:last-child { border-bottom: 0; }
  .fig b { font-size: 22px; }
  .fig span { font-size: 13.5px; color: var(--ink2); letter-spacing: 0; }
  .kv-4 { grid-template-columns: max-content minmax(0, 1fr); }
  .filters input[type=search], .filters input[type=text] { width: 100%; }
  .filters select { flex: 1 1 40%; }
  .madeby, .taxline { font-size: 12.5px; }
  .taxline .set { margin-left: 0; }
  .hide-sm { display: none; }
  .show-sm { display: block; }
  /* 窄屏表格：不把列挤成一字一行，保持列宽、在容器里左右滑动 */
  .tbl-wrap, .sheet-b.flush { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tbl td { word-break: normal; }
  .tbl th, .tbl td { padding-left: 6px; padding-right: 6px; }
  /* 列多的表（档案分类、日志、汇总）：短字段不折行，整表左右滑；长文字列保底 14 字宽 */
  .tbl.wide th, .tbl.wide td { white-space: nowrap; }
  .tbl.wide td.small, .tbl.wide td.wrap, .tbl.wide td[colspan] { white-space: normal; }
  .tbl.wide td.small, .tbl.wide td.wrap { min-width: 14em; }
  .tbl.wide .edit-box { position: sticky; left: 0; max-width: calc(100vw - 34px); }
  .kb-search { min-width: 0 !important; width: 100%; }
  .me .who { display: none; }
  /* 登录：先表单，后日历 */
  .lg-page { padding: 24px 16px 0; }
  .lg-mast h1 { font-size: 22px; letter-spacing: .06em; padding-left: .06em; }
  .lg-mast-line { margin-top: 14px; font-size: 12px; justify-content: center; text-align: center; }
  .lg-unit { display: none; }
  .lg-body { grid-template-columns: minmax(0, 1fr); }
  .lg-right { order: -1; padding: 22px 0 26px; border-bottom: 1px solid var(--rule); }
  .lg-left { padding: 22px 0 24px; border-right: 0; }
  .lg-fill input { font-size: 16px; }
  .lg-cal-wrap { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  table.lg-cal { width: 100%; }
  .lg-stmt .item { width: auto; }
  .lg-stmt .desc { font-size: 13px; }
  .lg-foot { flex-direction: column; align-items: center; text-align: center; gap: 2px; }
}
@media print {
  .topbar, .no-print, .dossier, .taxline { display: none !important; }
  body { background: #fff; }
  .page { padding: 0; max-width: none; }
  .dossier-wrap { display: block; }
}


/* 页头下线紧跟无标题版块的上线、分节上线紧跟时间轴上线：只留一道 */
.page-head + .sheet > .sheet-b:first-child { border-top: 0; padding-top: 4px; }
.sheet-b > .timeline:first-child { border-top: 0; }
@media (max-width: 900px) {
  /* 手机导航横向可滑：右缘渐隐提示后面还有 */
  .nav { -webkit-mask-image: linear-gradient(to right, #000 86%, transparent); mask-image: linear-gradient(to right, #000 86%, transparent); }
}

/* ======================================================================
   蓝色配色（系统设置 → 选项与参数 → 界面配色 = 蓝色）· 方案 A「蓝色报头」
   09-29 老板：空白处用白色，满屏蓝难看；客户只指定了蓝色。定稿思路：
   · 09-29 用户要「金蝶那种蓝」→ 主色改金蝶官网主色 #0360C3（亮蓝，与众衡藏青 #1F3864 ΔE16.9、众衡按钮 #2F6FDB ΔE6.3；
     金蝶设计系统的 #276FF5 / 官网 #2F76F6 离众衡按钮只有 ΔE3–4，不用）。
   · 工作页：顶栏金蝶蓝实色白字，下面白缝 + 细蓝线（报表双线的样子）
     （3px + 白缝 + 1px）；报头以下整页白纸。标题、分节序号、报表数、粗线、主按钮用深账簿蓝 #1D4F72，
     表格直接印在白纸上（三线表，表头不铺底）。红色只留给已超期、合计结账线、征期。
   · 登录页：左页（62%）深账簿蓝实色放报头 / 申报日历 / 覆盖事项（浅色字），右页白纸放登录填写栏，
     中间一道装订双线；手机：蓝色报头 → 白色登录栏 → 深蓝日历。
   🔴 合同要求与众衡界面不同，蓝色版永远不许：深色实心顶栏配白字、左侧图标栏、冷灰底白卡片、一排 KPI 卡片、
   亮蓝圆角按钮、表头铺底色带、选中 / 悬停铺浅蓝药丸（众衡 #E8EFFC）、蓝色渐变底 + 居中白色圆角卡片的登录。
   ====================================================================== */
body.theme-blue {
  --paper: #FFFFFF;         /* 报头以下整页白纸 */
  --white: #FFFFFF;
  --ink: #1B2636;           /* 正文 15.3 */
  --ink2: #34465C;          /* 次正文 9.7 */
  --muted: #56667A;         /* 表头、标签 5.9（悬停行上 5.3） */
  --faint: #56667A;
  --rule: #C3CFDC;          /* 装饰细线 */
  --rule-soft: #E0E6ED;     /* 表格行线 */
  --cell: #F1EFE8;          /* 编辑格、提示条（非交互的淡底）：暖白，离众衡冷灰底远 */
  --hover: #F4F4F1;         /* 行悬停：中性微暖，远离众衡浅蓝药丸 */
  --red: #9A2F24;
  --red-tint: #F7E6E2;
  --link: #0360C3;          /* 金蝶蓝，白底 6.1 */
  --warn: #7A4F00;
  --ok: #2A5E3F;
  --field: #6F86A0;         /* 输入框框线：白底 3.75、提示底 3.26 */
  --ledger: #0360C3;        /* 金蝶蓝（金蝶官网主色）：顶栏、标题、粗线、主按钮；白字 6.1。与众衡藏青 ΔE16.9、众衡按钮蓝 ΔE6.3 */
  --ledger-hover: #0A58B8;  /* 主按钮悬停往深处走一档（不往众衡按钮蓝 #2F6FDB 走）：白字 6.8 */
  --rule-mid: #6F86A0;      /* 表头下线、页头下线、次按钮框 */
  --band: #0360C3;          /* 顶栏：金蝶蓝实色，白字 */
  --band-text: #EAF2FC;     /* 顶栏上的导航字 5.4 */
  --band-line: #6FA6E2;     /* 顶栏内分隔线、导航悬停下划线 */
  --band-muted: #DDE9F8;    /* 顶栏上的次要字 4.9 */
  --r: 0;
  --deep: #0360C3;          /* 登录左页：金蝶蓝 */
  --on-deep: #FFFFFF;       /* 6.1 */
  --on-deep2: #EAF2FC;      /* 5.4 */
  --on-deep-muted: #D5E5F7; /* 4.7 */
  --on-deep-rule: #CFE0F5;
  --on-deep-line: #4A8BD6;
  --win: #D6E7F9;           /* 申报期格：深蓝页上挖出的浅格，深字 12.1 */
}

/* ---------------- 报头：中浅蓝色带 + 深蓝双线 ---------------- */
body.theme-blue .topbar { background: var(--band); }
body.theme-blue .topbar::after { height: 6px; background: var(--paper); border-top: 3px solid var(--ledger); border-bottom: 1px solid var(--ledger); }
body.theme-blue .brand .nm { color: #fff; }
body.theme-blue .brand .sys { color: var(--band-muted); border-left-color: var(--band-line); }
body.theme-blue .nav a { color: var(--band-text); }
body.theme-blue .nav a:hover { background: none; color: #fff; border-bottom-color: var(--band-line); }
body.theme-blue .nav a.on { color: #fff; border-bottom-color: #fff; }
body.theme-blue .me, body.theme-blue .me a, body.theme-blue .topbar .linkbtn { color: var(--band-text); }
body.theme-blue .topbar a:focus-visible, body.theme-blue .topbar .linkbtn:focus-visible { outline-color: #fff; }

/* ---------------- 白纸上的报表 ---------------- */
body.theme-blue .page-head h1, body.theme-blue .cust-head h1,
body.theme-blue .sheet-h h2, body.theme-blue .sheet-h h2::before,
body.theme-blue .fig b, body.theme-blue .tag-accent { color: var(--ledger); }
body.theme-blue .fig.alert b { color: var(--red); }
body.theme-blue .fig:has(a):hover { background: var(--hover); }
body.theme-blue .tbl, body.theme-blue .figures,
body.theme-blue .sheet-b.flush > .empty, body.theme-blue .sheet-b.flush > .kv, body.theme-blue .sheet-b.flush > p {
  border-top-color: var(--ledger); border-bottom-color: var(--ledger); }
body.theme-blue .sheet-b, body.theme-blue .timeline, body.theme-blue .dossier, body.theme-blue .tree, body.theme-blue .week,
body.theme-blue .tbl tfoot td { border-top-color: var(--ledger); }
body.theme-blue .tbl th, body.theme-blue .page-head, body.theme-blue .cust-head { border-bottom-color: var(--rule-mid); }
body.theme-blue .madeby, body.theme-blue .taxline { border-bottom-color: var(--rule); }
body.theme-blue .fig { border-left-color: var(--rule); }
/* 筛选条：不铺底，上深蓝细线、下浅线（铺底会像众衡的表头色带）；紧跟页头时不再画上线（否则两道线叠在一起） */
body.theme-blue .filters { background: none; border-top-color: var(--rule-mid); border-bottom-color: var(--rule); padding-left: 0; padding-right: 0; }
body.theme-blue .page-head + .filters { border-top: 0; margin-top: -10px; }
body.theme-blue .flash { border-left-color: var(--ledger); background: var(--cell); }
body.theme-blue .tag { border-radius: 0; }
body.theme-blue .tag-accent { border-color: var(--rule-mid); }
body.theme-blue .tag-ok { border-color: #8FB39C; }
body.theme-blue .tag-warn { border-color: #C9AA6C; }
/* 选中与悬停：只留竖线、粗字、下划线，不铺色块 */
body.theme-blue .dossier a.on, body.theme-blue .tree a.on { background: none; border-color: var(--ledger); color: var(--ledger); }
body.theme-blue .dossier a:hover, body.theme-blue .tree a:hover { background: none; color: var(--ledger); text-decoration: underline; text-underline-offset: 3px; }
body.theme-blue .week a.on { background: none; box-shadow: inset 0 -3px 0 var(--ledger); color: var(--ledger); }
body.theme-blue .week a:hover { background: var(--hover); }
body.theme-blue .timeline li::before { background: var(--paper); border-color: var(--ledger); }
body.theme-blue .edit-box { background: var(--cell); border-top-color: var(--rule); }
body.theme-blue .confirm-tbl .grp { background: var(--cell); }
/* 按钮：主按钮深账簿蓝方角；次按钮白底 + 中蓝框 + 正文色字 */
body.theme-blue .btn { border-color: var(--rule-mid); color: var(--ink); background: var(--white); }
body.theme-blue .btn:hover { background: var(--hover); border-color: var(--ledger); color: var(--ledger); }
body.theme-blue .btn-primary, body.theme-blue .seg a.on { background: var(--ledger); border-color: var(--ledger); color: #fff; }
body.theme-blue .btn-primary:hover { background: var(--ledger-hover); border-color: var(--ledger-hover); color: #fff; }
body.theme-blue .btn-danger { color: var(--red); border-color: var(--red); }
body.theme-blue .btn-danger:hover { background: var(--red-tint); color: var(--red); border-color: var(--red); }
body.theme-blue .btn-link, body.theme-blue .btn-link:hover { color: var(--link); background: none; }
body.theme-blue input:focus, body.theme-blue select:focus, body.theme-blue textarea:focus { border-color: var(--ledger); box-shadow: inset 0 0 0 1px var(--ledger); }
body.theme-blue input[type=checkbox], body.theme-blue input[type=radio] { accent-color: var(--ledger); }
body.theme-blue .seg { border-color: var(--rule-mid); }
body.theme-blue .seg a { border-right-color: var(--rule-mid); }
body.theme-blue .bar { background: var(--rule-soft); }
body.theme-blue .bar i { background: var(--ledger); }
body.theme-blue .snip mark { background: #F5E7BE; }

/* ---------------- 登录页：摊开的账簿（左深蓝页 / 右白纸） ---------------- */
body.theme-blue.lg { background: var(--paper); }
body.theme-blue .lg-page { max-width: none; margin: 0; padding: 0; min-height: 100vh;
  display: grid; grid-template-columns: minmax(0, 62fr) minmax(0, 38fr); grid-template-rows: auto 1fr auto auto; }
body.theme-blue .lg-body { display: contents; }
body.theme-blue .lg-page::before { content: ""; grid-column: 1; grid-row: 1 / -1; background: var(--deep); order: -2; }
/* 左页内容宽度封顶 1000px、在左页里居中（1920 宽屏不把日历图例和事项表拉成长条） */
body.theme-blue .lg-mast, body.theme-blue .lg-left, body.theme-blue .lg-foot { grid-column: 1; min-width: 0;
  margin: 0 max(56px, calc((100% - 1000px) / 2)); }
body.theme-blue .lg-mast { grid-row: 1; padding-top: 44px; }
body.theme-blue .lg-left { grid-row: 2; padding: 30px 0 34px; border-right: 0; }
body.theme-blue .lg-foot { grid-row: 3; margin-bottom: 22px; }
body.theme-blue .lg-right { grid-column: 2; grid-row: 1 / 4; padding: 0 52px; border-left: 7px double var(--deep);
  display: flex; flex-direction: column; justify-content: center; }
body.theme-blue .lg-form { width: 100%; max-width: 380px; margin: 0 auto; }
body.theme-blue.lg .site-foot { grid-column: 2; grid-row: 4; border-left: 7px double var(--deep); padding: 0 16px 22px; }
body.theme-blue.lg .site-foot a { color: var(--muted); }
/* 左页（深蓝）上的字与线：全部浅色；键盘焦点框用白色 */
body.theme-blue .lg-page a:focus-visible { outline-color: var(--on-deep); }
body.theme-blue .lg-mast h1 { color: var(--on-deep); }
body.theme-blue .lg-mast h1::after { border-top-color: var(--on-deep-rule); border-bottom-color: var(--on-deep-rule); }
body.theme-blue .lg-mast-line { color: var(--on-deep2); border-bottom: 2px solid var(--on-deep-rule); }
body.theme-blue .lg-mast-line b { color: var(--on-deep); }
body.theme-blue .lg-left .lg-sec-h h2 { color: var(--on-deep); }
body.theme-blue .lg-left .lg-sec-h .no, body.theme-blue .lg-left .lg-sec-h .aside { color: var(--on-deep-muted); }
body.theme-blue table.lg-cal, body.theme-blue table.lg-stmt { border-top-color: var(--on-deep-rule); border-bottom-color: var(--on-deep-rule); }
body.theme-blue .lg-cal th, body.theme-blue .lg-stmt th { color: var(--on-deep-muted); border-bottom-color: var(--on-deep-muted); }
body.theme-blue .lg-cal td { color: var(--on-deep2); border-bottom-color: var(--on-deep-line); }
body.theme-blue .lg-cal td.out { color: var(--on-deep-muted); }
/* 申报期：深蓝页上挖出的报头蓝格、深字；截止日红字 + 红底线 */
body.theme-blue .lg-cal td.win, body.theme-blue .lg-cal td.end { background: var(--win); color: var(--ink); border-bottom-color: var(--band-line); }
body.theme-blue .lg-cal td.end { color: var(--red); box-shadow: inset 0 -3px 0 var(--red); }
body.theme-blue .lg-cal td.today span { border-color: currentColor; color: var(--on-deep); }
body.theme-blue .lg-cal td.win.today span { color: var(--ink); }
body.theme-blue .lg-legend { color: var(--on-deep2); }
body.theme-blue .lg-legend b { color: var(--on-deep); white-space: nowrap; }
body.theme-blue .lg-legend .it { border-bottom-color: var(--on-deep-line); }
body.theme-blue .lg-legend .sw.win, body.theme-blue .lg-legend .sw.end { background: var(--win); }
body.theme-blue .lg-legend .sw.end { box-shadow: inset 0 -3px 0 var(--red); }
body.theme-blue .lg-legend .sw.today { border-color: var(--on-deep); }
body.theme-blue .lg-stmt td { border-bottom-color: var(--on-deep-line); color: var(--on-deep2); }
body.theme-blue .lg-stmt .ln { color: var(--on-deep-muted); }
body.theme-blue .lg-stmt .item { color: var(--on-deep); }
body.theme-blue .lg-stmt .desc { color: var(--on-deep2); }
body.theme-blue .lg-foot { color: var(--on-deep-muted); border-top: 3px double var(--on-deep-rule); }
/* 右页白纸：登录填写栏（左列用报头蓝，和工作页报头同一颜色） */
body.theme-blue .lg-form h2 { color: var(--ledger); }
body.theme-blue .lg-form .lead, body.theme-blue .lg-form .help { color: var(--muted); }
body.theme-blue .lg-fill { border-color: var(--rule-mid); }
body.theme-blue .lg-fill .row + .row { border-top-color: var(--rule-mid); }
body.theme-blue .lg-fill label { background: var(--win); border-right-color: var(--rule-mid); color: var(--ink); }
body.theme-blue .lg-fill .row:focus-within { box-shadow: inset 0 0 0 2px var(--ledger); }

@media (max-width: 900px) {
  body.theme-blue .nav { border-top-color: var(--band-line); }
  body.theme-blue .filters { padding-left: 0; padding-right: 0; }
  /* 手机：蓝色报头（同工作页）→ 白纸登录栏 → 深蓝日历与事项 */
  body.theme-blue .lg-page { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto auto auto; }
  body.theme-blue .lg-page::before { content: none; }
  body.theme-blue .lg-page::after { content: ""; grid-column: 1; grid-row: 3 / 5; background: var(--deep); order: -2; }
  body.theme-blue .lg-left, body.theme-blue .lg-foot { margin: 0 16px; }
  body.theme-blue .lg-mast { grid-row: 1; margin: 0; padding: 22px 16px 0; background: var(--band); }
  body.theme-blue .lg-mast::after { content: ""; display: block; height: 6px; margin: 0 -16px; background: var(--paper);
    border-top: 3px solid var(--ledger); border-bottom: 1px solid var(--ledger); }
  body.theme-blue .lg-mast h1 { color: #fff; }
  body.theme-blue .lg-mast h1::after { border-top-color: var(--on-deep-rule); border-bottom-color: var(--on-deep-rule); }
  body.theme-blue .lg-mast-line { color: var(--band-text); border-bottom: 0; padding-bottom: 14px; }
  body.theme-blue .lg-mast-line b { color: #fff; }
  body.theme-blue .lg-right { grid-column: 1; grid-row: 2; order: 0; padding: 22px 16px 28px; border-left: 0; border-bottom: 0; }
  body.theme-blue .lg-left { grid-row: 3; padding: 24px 0 26px; }
  body.theme-blue .lg-foot { grid-row: 4; margin-bottom: 18px; }
  body.theme-blue.lg .site-foot { grid-column: 1; grid-row: 5; border-left: 0; padding: 14px 16px 22px; }
}

/* 月度资料收件：沿用白底报表，长文件名换行；窄屏表格在自身容器内滑动。 */
.collection-availability { display:flex;gap:8px 20px;flex-wrap:wrap;padding:0 0 20px;color:var(--muted);font-size:13px; }
.collection-availability b { color:var(--link);font-weight:600; }
.collection-upload-fields { display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px 18px; }
.collection-file-pick { margin:18px 0 10px; }
.collection-file-pick input { max-width:100%;flex:1;min-width:220px; }
.collection-filename,.collection-hash { overflow-wrap:anywhere;word-break:break-word; }
.collection-table { min-width:780px; }
.collection-table .collection-filename { max-width:330px;min-width:170px; }
.collection-bulk { border-bottom:1px solid var(--rule);padding:14px 0; }
.collection-bulk summary { cursor:pointer;color:var(--link); }
.collection-bulk form { padding-top:12px; }
.collection-review { display:block;margin:14px 0; }
.collection-fieldset { border:0;padding:0;margin:0;min-width:0; }
.collection-pager { justify-content:flex-end;margin-top:12px; }
.collection-handover { padding:0 0 20px;margin:0 0 20px;border-bottom:1px solid var(--rule); }
.collection-handover p { margin-top:8px; }
.collection-filters input[type=month] { width:160px; }
.collection-handover input:not([type=hidden]) { width:auto;flex:1;min-width:150px; }
@media(max-width:1100px) {
  .collection-upload-fields { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media(max-width:600px) {
  .collection-upload-fields { grid-template-columns:minmax(0,1fr); }
  .collection-file-pick { display:block; }
  .collection-file-pick button { margin-top:12px;width:100%;white-space:normal; }
  .collection-filters > * { max-width:100%; }
  .collection-review { line-height:1.8; }
}

/* 余额对账：数据保持白底，沿用蓝色报表标题；打印仅保留对账函。 */
.balance-bulk{display:flex;gap:12px 20px;align-items:center;flex-wrap:wrap;margin:16px 0 4px}
.balance-bulk input[type=file]{max-width:100%;width:auto}
.balance-bulk label{flex:1;min-width:240px}.balance-warning{color:var(--red)}
.balance-preview{margin-top:12px;max-height:380px;border-bottom:1px solid var(--rule)}
.balance-preview table{width:max-content;min-width:100%}.balance-preview th{position:sticky;top:0;background:var(--paper)}
.balance-preview td{min-width:100px;max-width:260px;white-space:normal;overflow-wrap:anywhere;font-size:12px}
.balance-preview th:first-child{min-width:50px}.balance-map{margin-top:18px;grid-template-columns:repeat(3,minmax(0,1fr))}
.balance-rule-title{margin:28px 0 12px;padding-top:18px;border-top:1px solid var(--rule);font-size:16px}
.balance-save{margin-top:22px;padding-top:8px;border-top:1px solid var(--rule)}
.balance-retry{margin-bottom:18px}.balance-pdf-text{white-space:pre-wrap;overflow-wrap:anywhere;max-height:400px;overflow:auto;font-size:13px;background:var(--paper);padding:12px;border:1px solid var(--rule)}
.balance-steps{display:flex;gap:10px;align-items:center;flex-wrap:wrap;color:var(--muted);font-size:13px;margin:8px 0 28px}
.balance-steps .on{color:var(--link);font-weight:600;border-bottom:2px solid currentColor;padding-bottom:5px}
.balance-letter{max-width:1200px;margin:0 auto}.balance-letter-head{text-align:center;margin:0 0 24px;padding:10px 0 20px;border-bottom:3px double var(--ledger,var(--ink))}
.balance-letter-head h2{font-size:26px;font-weight:400;margin-bottom:12px}.balance-letter-head .row{justify-content:space-between;margin-top:18px;color:var(--muted);font-size:13px}
.balance-metrics td:first-child{width:45%}.balance-metrics td:nth-child(2){width:23%}.balance-metrics summary{cursor:pointer;color:var(--link);font-size:12px}
.balance-formula{max-width:480px;overflow-wrap:anywhere;padding:8px 0}.balance-method{margin:14px 0 20px;line-height:1.8}
.balance-notes{padding:14px 18px;border-left:3px solid var(--rule-mid);margin:20px 0;line-height:1.8}.balance-notes ul{margin:4px 0;padding-left:20px}
.balance-items{min-width:840px}.balance-items td{vertical-align:top;overflow-wrap:anywhere}.balance-items .num{white-space:nowrap}.balance-feedback{min-width:150px}
.balance-sign{padding:24px 0 32px;border-top:1px solid var(--rule);line-height:2.5}
.balance-reply-form{margin:26px 0 0;padding-top:20px;border-top:1px solid var(--rule)}
.balance-reply-form h3{font-size:16px;margin-bottom:12px}.balance-preserve{white-space:pre-wrap;overflow-wrap:anywhere}.balance-current{font-weight:700;text-decoration:underline}
@media(max-width:600px){.balance-map{grid-template-columns:repeat(2,minmax(0,1fr))}.balance-bulk{display:block}.balance-bulk button{margin-top:12px;white-space:normal}.balance-letter-head .row{display:block;line-height:2}.balance-letter-head .row span{display:block}.balance-metrics td:first-child{width:45%}.balance-metrics td:nth-child(2){width:30%}.balance-metrics td{padding:9px 6px}.balance-sign{font-size:12px}.balance-steps{gap:6px;font-size:12px}}
@media print{
 body:has(.balance-letter){background:#fff!important;color:#111!important}
 body:has(.balance-letter) .topbar,body:has(.balance-letter) .site-foot,body:has(.balance-letter) .flash,body:has(.balance-letter) .no-print{display:none!important}
 body:has(.balance-letter) .page{padding:0;margin:0;max-width:none}
 .balance-letter .tbl-wrap{overflow:visible}.balance-letter table{min-width:0;width:100%;font-size:10px}.balance-letter td,.balance-letter th{padding:6px 5px}
 .balance-letter thead{display:table-header-group}.balance-letter tr{break-inside:avoid}.balance-letter .sheet{break-inside:auto}
 .balance-letter .sheet-h{break-after:avoid}.balance-letter .balance-feedback{min-width:80px;width:16%}.balance-letter-head h2{font-size:22px}
 .balance-letter .balance-metrics td:first-child{width:70%}.balance-letter .balance-metrics td:nth-child(2){width:30%}.balance-sign{break-inside:avoid}
 @page{size:A4 landscape;margin:12mm}
}
/* Accounting data remains on white report pages; wide mappings scroll within their section. */
.accounting-rule-table { min-width:760px; }
.accounting-rule-table input { min-width:64px;width:100%; }
.yqy-connection input[type=checkbox] { width:auto; }
.yqy-connection .actions { flex-wrap:wrap; }
.yqy-connection fieldset { min-width:0; }
.yqy-message { overflow-wrap:anywhere; }
@media (min-width:901px) {
  .topbar-in { flex-wrap:wrap; gap:0 20px; }
  .topbar-in .brand { min-height:46px; }
  .topbar-in .me { margin-left:auto; }
  .topbar-in .nav { order:3;flex-basis:100%;min-height:40px;border-top:1px solid var(--rule); }
  body.theme-blue .topbar-in .nav { border-top-color:var(--band-line); }
}

label.field { display:block;min-width:0; }
label.field > input, label.field > select, label.field > textarea { margin-top:4px; }
.btn:disabled { opacity:.55;cursor:not-allowed; }

.filters input:not([type]) { width:220px;max-width:100%; }

.seg { max-width:100%;overflow-x:auto; }
.seg a { flex-shrink:0;white-space:nowrap; }
section.sheet[id] { scroll-margin-top:120px; }

/* Original receipt alongside editable OCR suggestions. */
.receipt-grid{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);gap:24px;align-items:start}.receipt-grid>*{min-width:0}.receipt-image{width:100%;height:auto;display:block;border:1px solid var(--rule)}.receipt-text{white-space:pre-wrap;overflow-wrap:anywhere;font:13px/1.7 monospace;max-height:400px;overflow:auto}.receipt-pages{display:flex;gap:8px;flex-wrap:wrap;margin:16px 0}.receipt-pages a{padding:6px 10px;border:1px solid var(--rule)}.receipt-pages a.on{border-bottom:3px solid var(--accent);font-weight:600}@media(max-width:900px){.receipt-grid{grid-template-columns:1fr}.receipt-pages a{padding:8px}}

.bank-download-files{min-width:680px}.bank-download-files td:first-child{max-width:560px;overflow-wrap:anywhere}

/* Voucher originals: horizontal scrolling retains readable rows on phones. */
.voucher-lines{min-width:960px}.voucher-lines td:nth-child(2){min-width:120px;white-space:nowrap}.voucher-lines td:nth-child(3){min-width:220px;max-width:360px;overflow-wrap:anywhere}.voucher-lines td:nth-child(6){min-width:260px;overflow-wrap:anywhere}.voucher-source-table{min-width:800px}.voucher-source-table td{min-width:88px;max-width:280px;overflow-wrap:anywhere}

.voucher-scroll{max-height:28rem;overflow:auto}.voucher-scroll thead th{position:sticky;top:0;background:var(--paper,#fff);z-index:1}

/* Original evidence and official candidates remain visually separate. */
.match-sources{padding:16px 0;border-bottom:1px solid var(--rule)}
.match-entry{scroll-margin-top:90px}
.match-columns{display:grid;grid-template-columns:minmax(230px, .8fr) minmax(0,1.3fr);gap:28px}
.match-original{min-width:0;border-right:1px solid var(--rule);padding-right:24px}
.match-facts{display:grid;grid-template-columns:6em minmax(0,1fr);gap:8px 12px;margin:16px 0}
.match-facts dt{color:var(--muted)}
.match-facts dd{margin:0;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}
.match-link{padding:0 0 18px;margin:0 0 18px;border-bottom:1px solid var(--rule)}
.match-link h4{margin:0;color:var(--accent)}
.match-link p{margin:10px 0}
.match-summary{padding:10px 12px;background:#f4f6f6;overflow-wrap:anywhere}
.match-reasons{font-size:13px;line-height:1.8}
.match-reasons ul{padding-left:20px;margin:4px 0 12px}
.match-journals{padding-left:20px;font-size:13px}
.match-journals li{margin:10px 0;overflow-wrap:anywhere}
.match-unlinked{min-width:620px}
.match-provenance{margin:24px 0;overflow-wrap:anywhere}
@media(max-width:700px){.match-columns{grid-template-columns:1fr;gap:18px}.match-original{border-right:0;border-bottom:1px solid var(--rule);padding:0 0 18px}.match-entry .sheet-h{align-items:flex-start;gap:8px}.match-entry h2{font-size:17px}.match-facts{grid-template-columns:5em minmax(0,1fr)}}

/* Field evidence stays readable without widening receipt and match panels. */
.receipt-evidence{margin:16px 0;padding:12px 0;border-top:1px solid var(--line);overflow-wrap:anywhere}
.receipt-evidence dl{margin:12px 0}.receipt-evidence dt{font-weight:600;margin-top:12px}.receipt-evidence dd{margin:4px 0 0}.receipt-evidence ul{padding-left:20px;margin:6px 0}.receipt-evidence dd p{font-size:12px}

/* Official exports retain every source field; wide text stays readable in the scroll area. */
.official-source-table{min-width:1050px}.official-source-table td{white-space:nowrap}.official-source-table td.official-wrap{white-space:normal;min-width:200px;max-width:320px;overflow-wrap:anywhere}.official-totals{display:flex;flex-wrap:wrap;gap:8px 24px;padding:10px 0;font-size:13.5px}.official-totals b{font-variant-numeric:tabular-nums}

/* Source preparation uses the same paper tables; detailed source columns scroll internally. */
.prepare-list{min-width:680px}.prepare-list td:first-child{min-width:280px;max-width:680px;overflow-wrap:anywhere}.prepare-list td:last-child{min-width:180px}.prepare-invoices{min-width:980px}.prepare-invoices td:first-child{white-space:nowrap}.prepare-invoices td:nth-child(2){min-width:240px;max-width:380px}.prepare-invoices td:nth-child(4){min-width:180px}.prepare-history{min-width:850px}.prepare-history td:nth-child(2),.prepare-history td:nth-child(3){min-width:240px;max-width:400px}.prepare-fields{display:grid;grid-template-columns:10em minmax(0,1fr);gap:8px 14px}.prepare-fields dd{margin:0;overflow-wrap:anywhere}@media(max-width:600px){.prepare-fields{grid-template-columns:7em minmax(0,1fr)}}

/* Specialist workpapers: preserve the blue/white report layout and readable mobile forms. */
.ops-workspace label { display:block; margin:10px 0; line-height:1.6; }
.ops-workspace .form-grid label { margin:0; min-width:0; }
.ops-workspace label>input:not([type=checkbox]),.ops-workspace label>select,.ops-workspace label>textarea { display:block; width:100%; max-width:100%; }
.ops-workspace details { margin:12px 0; padding:10px 0; border-bottom:1px solid var(--rule); }
.ops-workspace summary { cursor:pointer; color:var(--ink); }
.ops-workspace .tabs { display:flex; flex-wrap:wrap; gap:8px 20px; margin:16px 0; }
.ops-workspace .tabs .on { font-weight:600; border-bottom:2px solid currentColor; }
.ops-workspace .tbl { min-width:640px; }
.ops-workspace .tbl td { max-width:420px; overflow-wrap:anywhere; }
@media(max-width:700px){.ops-workspace .form-grid{grid-template-columns:1fr}.ops-workspace .actions{flex-wrap:wrap}.ops-workspace .tbl-wrap{overflow-x:auto}}
@media print{.ops-workspace form,.ops-workspace .actions{display:none}.ops-workspace .tbl{min-width:0;font-size:9pt}.ops-workspace .tbl-wrap{overflow:visible}}
