/* ============================================================
   Tax Portal — Up2uTax styling
   Change the brand colors here; everything else follows.
   ============================================================ */
:root {
  --primary: #0A78BF;        /* Up2uTax blue */
  --primary-dark: #075E96;
  --primary-50: #EAF4FB;
  --primary-100: #D3E8F6;
  --teal: #61B5C0;           /* secondary (confirm exact hex) */
  --teal-50: #E8F5F7;
  --navy: #0F1B3D;           /* headings, logo outline, divider */
  --orange: #F28C1B;         /* links / highlight, as in "Contact support" */
  --canvas: #F3F3F3;
  --card: #FFFFFF;
  --border: #E4E7EC;
  --border-strong: #D0D5DD;
  --text: #1D2433;
  --muted: #667085;
  --success: #12805C; --success-50: #E3F6EE;
  --warning: #B54708; --warning-50: #FEF0E1;
  --danger:  #C0362C; --danger-50:  #FDECEA;
  --info:    var(--primary); --info-50: var(--primary-50);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.06);
  --shadow-lg: 0 12px 32px rgba(15,27,61,.14);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Arial, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  --font-display: "Archivo", "Inter", system-ui, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  --on-primary: #FFFFFF;
  --accent-text: #C2650A;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--canvas); color: var(--text);
  font: 15px/1.5 var(--font);
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--font-display); color: var(--navy); margin: 0; letter-spacing: -.01em; }
h1 { font-size: 28px; font-weight: 800; }
h2 { font-size: 18px; font-weight: 700; }
.sr, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip:focus { position: fixed; top: 8px; left: 8px; z-index: 100; background: #fff; padding: 8px 12px; border-radius: 6px; }
:focus-visible { outline: 3px solid var(--primary-100); outline-offset: 2px; }

/* ---------- Brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 8px; }
.brand-name { font-family: var(--font-display); font-weight: 800; font-size: 24px; color: var(--navy); letter-spacing: -.02em; line-height: 1; }
.brand-accent { color: var(--primary); }
.brand-link:hover { text-decoration: none; }

/* ---------- Top bar ---------- */
.topbar { background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; box-shadow: inset 0 3px 0 var(--navy); }
.topbar-inner { max-width: 1440px; margin: 0 auto; padding: 10px 24px; display: flex; align-items: center; gap: 24px; min-height: 64px; }
.primary-nav { flex: 1; }
.nav-list { list-style: none; margin: 0; padding: 0; display: flex; gap: 2px; }
.nav-list > li { position: relative; }
.nav-link {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 8px;
  font: 600 14px var(--font); color: var(--text); background: none; border: 0; cursor: pointer;
}
.nav-link:hover { background: var(--canvas); text-decoration: none; }
.nav-link.active { color: var(--primary); background: var(--primary-50); }
.has-menu { position: relative; }
.menu {
  display: none; position: absolute; top: calc(100% + 6px); left: 0; z-index: 30;
  min-width: 260px; max-height: 70vh; overflow: auto;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px;
}
.menu ul { list-style: none; margin: 0; padding: 0; }
.menu a { display: block; padding: 7px 10px; border-radius: 6px; color: var(--text); font-size: 14px; }
.menu a:hover { background: var(--primary-50); color: var(--primary); text-decoration: none; }
.menu-group { padding: 10px 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.has-menu.open > .menu { display: block; }
.menu-right { left: auto; right: 0; }

.user-chip { display: flex; align-items: center; gap: 10px; background: none; border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px 4px 4px; cursor: pointer; font: inherit; color: inherit; }
.user-chip:hover { border-color: var(--border-strong); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--primary-dark), var(--primary)); color: #fff; font-weight: 700; font-size: 13px; }
.user-text { display: flex; flex-direction: column; text-align: left; line-height: 1.2; }
.user-text strong { font-size: 13px; }
.user-text small { font-size: 11px; color: var(--muted); }
.menu-card { padding: 10px; width: 280px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0 0 12px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; text-align: right; }
.support-mini { border-top: 1px solid var(--border); padding: 10px 0; margin-bottom: 8px; font-size: 13px; }
.support-mini > div { display: flex; justify-content: space-between; padding: 2px 0; }
.support-mini a { color: var(--accent-text); font-weight: 600; }
.eyebrow { display: block; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }

.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--border); border-radius: 8px; width: 40px; height: 40px; padding: 10px 9px; cursor: pointer; flex-direction: column; justify-content: space-between; }
.nav-toggle span:not(.sr) { display: block; height: 2px; background: var(--navy); border-radius: 2px; }

/* ---------- Page ---------- */
.page { flex: 1; width: 100%; max-width: 1440px; margin: 0 auto; padding: 28px 24px 48px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 20px; }
.page > .card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.empty { padding: 48px 24px; text-align: center; }
.empty p { color: var(--muted); }

/* ---------- Forms ---------- */
.search-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: 13px; font-weight: 600; color: var(--navy); }
.field .hint { font-size: 12px; color: var(--muted); }
.field .error { font-size: 12px; color: var(--danger); }
input[type=text], input[type=email], input[type=password], input[type=search], select, textarea {
  width: 100%; height: 40px; padding: 8px 12px; font: 14px var(--font); color: var(--text);
  background: #fff; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
}
select { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 10 10'%3E%3Cpath d='M2 3.5l3 3 3-3' fill='none' stroke='%23667085' stroke-width='1.6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-100); }
input:disabled, select:disabled { background: var(--canvas); color: var(--muted); }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; cursor: pointer; padding-top: 26px; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 18px;
  font: 600 14px var(--font); border-radius: var(--radius-sm); border: 1px solid transparent; cursor: pointer; white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: #fff; color: var(--navy); border-color: var(--border-strong); }
.btn-outline:hover { background: var(--canvas); }
.btn-ghost { background: none; color: var(--primary); padding: 0 10px; }
.btn-ghost:hover { background: var(--primary-50); }
.btn-danger { background: #fff; color: var(--danger); border-color: #F3C3BE; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-block { width: 100%; }

.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 14px; border: 1px solid; }
.alert-success { background: var(--success-50); border-color: #B7E4CF; color: var(--success); }
.alert-error { background: var(--danger-50); border-color: #F3C3BE; color: var(--danger); }
.alert-info { background: var(--primary-50); border-color: var(--primary-100); color: var(--primary-dark); }
.alert-warning { background: var(--warning-50); border-color: #F7C99A; color: var(--warning); }

/* ---------- Results table ---------- */
.results-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.count { font-size: 14px; color: var(--muted); }
.count strong { color: var(--navy); font-size: 16px; }
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th {
  position: sticky; top: 0; background: #FAFBFC; text-align: left; white-space: nowrap;
  font-size: 12px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--muted);
  padding: 10px 14px; border-bottom: 1px solid var(--border);
}
table.data th a { color: inherit; }
table.data th a:hover { color: var(--primary); text-decoration: none; }
table.data th a.sorted { color: var(--primary); }
table.data th .arrow { font-size: 11px; }
table.data td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; white-space: nowrap; }
table.data tbody tr:hover { background: #F8FBFE; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.mono { font-variant-numeric: tabular-nums; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13px; }
.neg { color: var(--danger); }
.id-link { font-weight: 700; }
.muted { color: var(--muted); }
.dash { color: #C0C5CE; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-success { background: var(--success-50); color: var(--success); }
.badge-warning { background: var(--warning-50); color: var(--warning); }
.badge-danger  { background: var(--danger-50); color: var(--danger); }
.badge-info    { background: var(--primary-50); color: var(--primary-dark); }
.badge-neutral { background: #F2F4F7; color: #475467; }

.pager { display: flex; justify-content: center; gap: 4px; padding: 14px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.pager a, .pager span { min-width: 36px; height: 36px; padding: 0 10px; display: inline-grid; place-items: center; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--text); }
.pager a:hover { background: var(--primary-50); color: var(--primary); text-decoration: none; }
.pager .current { background: var(--primary); color: var(--on-primary); }
.pager .disabled { color: #C0C5CE; }
.pager .gap { min-width: 20px; color: var(--muted); }

/* ---------- Collapsible add panel ---------- */
details.panel > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; }
details.panel > summary::-webkit-details-marker { display: none; }
details.panel > summary .chev { flex: none; width: 16px; height: 16px; color: var(--muted); transition: transform .2s; }
details.panel[open] > summary { border-bottom: 1px solid var(--border); }
details.panel[open] > summary .chev { transform: rotate(180deg); }
details.panel .panel-body { padding: 20px; }

/* ---------- Home tiles (portal-card style) ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.tile { display: flex; gap: 14px; align-items: flex-start; padding: 18px; color: inherit; transition: border-color .15s, box-shadow .15s, transform .15s; }
.tile:hover { text-decoration: none; border-color: var(--primary-100); box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.tile > span:not(.tile-icon) { flex: 1; min-width: 0; }
.tile h3 { font-size: 16px; margin-bottom: 2px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.tile h3 small { font: 600 10px var(--font); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.tile p { margin: 0; font-size: 13px; color: var(--muted); }
.tile-icon { flex: none; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; color: #fff; }
.tile-icon svg { width: 20px; height: 20px; }
.ti-blue { background: linear-gradient(135deg, var(--primary-dark), var(--primary)); }
.ti-sky { background: linear-gradient(135deg, var(--primary), var(--teal)); }
.ti-teal { background: linear-gradient(135deg, var(--navy), var(--teal)); }
.ti-navy { background: linear-gradient(135deg, var(--navy), var(--primary-dark)); }
.tile .chev { margin-left: auto; align-self: center; color: #C0C5CE; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat { padding: 18px 20px; }
.stat .label { font-size: 13px; color: var(--muted); font-weight: 500; }
.stat .value { font-family: var(--font-display); font-size: 28px; font-weight: 800; color: var(--navy); margin-top: 2px; font-variant-numeric: tabular-nums; }
.section-title { margin: 28px 0 12px; }

/* ---------- Login ---------- */
.login-body { flex-direction: row; background: var(--canvas); }
.login-hero { flex: 1; padding: 40px 56px; display: flex; flex-direction: column; }
.login-hero-inner { margin: auto; max-width: 760px; text-align: center; }
.login-hero h1 { font-size: 34px; font-weight: 900; }
.login-hero .lead { color: #3D4555; margin: 10px auto 32px; max-width: 620px; font-size: 16px; }
.feature-row { display: grid; grid-template-columns: 1fr 1.3fr; gap: 32px; text-align: left; align-items: center; }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { padding: 5px 0 5px 24px; position: relative; font-size: 15px; }
.checklist li::before { content: "✓"; position: absolute; left: 0; color: var(--primary); font-weight: 700; }
.mock { background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow-lg); display: grid; grid-template-columns: 56px 1fr; overflow: hidden; height: 260px; }
.mock-side { border-right: 1px solid var(--border); padding: 18px 8px; display: flex; flex-direction: column; gap: 9px; }
.mock-side i { height: 5px; border-radius: 3px; background: #E7EAEE; }
.mock-main { padding: 12px; display: grid; grid-template-rows: auto auto 1fr; gap: 8px; }
.mock-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.mock-tiles i { height: 34px; border-radius: 4px; background: var(--primary-50); border: 1px solid var(--primary-100); }
.mock-bottom { display: grid; grid-template-columns: 2fr 1fr; gap: 8px; }
.mock-panel { border: 1px solid var(--border); border-radius: 4px; display: flex; align-items: flex-end; justify-content: center; gap: 14px; padding: 10px; }
.mock-panel b { width: 26px; border-radius: 2px 2px 0 0; background: linear-gradient(var(--primary), var(--teal)); }
.donut { width: 62px; height: 62px; border-radius: 50%; background: conic-gradient(var(--orange) 0 22%, var(--primary) 22% 100%); -webkit-mask: radial-gradient(circle, transparent 18px, #000 19px); mask: radial-gradient(circle, transparent 18px, #000 19px); align-self: center; }
.login-panel { width: 420px; flex: none; background: #F7F7F8; border-left: 4px solid var(--navy); display: flex; flex-direction: column; justify-content: center; padding: 40px 32px; }
.login-panel .brand { justify-content: center; margin-bottom: 36px; }
.login-panel .brand-name { font-size: 34px; }
.login-panel h2 { text-align: center; font-size: 24px; font-weight: 800; }
.login-panel .sub { text-align: center; color: var(--muted); margin: 6px 0 24px; font-size: 14px; }
.login-card { padding: 22px; display: grid; gap: 14px; }
.login-help { text-align: center; color: var(--muted); font-size: 13px; margin-top: 18px; }
.login-help a { color: var(--accent-text); font-weight: 600; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; background: rgba(15,27,61,.45); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal[hidden] { display: none; }
.modal-box { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 24px; max-width: 420px; width: 100%; }
.modal-box p { color: var(--muted); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }

.site-footer { max-width: 1440px; width: 100%; margin: 0 auto; padding: 16px 24px 28px; display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.site-footer a { color: var(--accent-text); font-weight: 600; }

/* ---------- Language menu ---------- */
.lang-btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px; border: 1px solid var(--border); border-radius: 999px; background: #fff; color: var(--text); font: 600 13px var(--font); cursor: pointer; }
.lang-btn:hover { border-color: var(--border-strong); }
.lang-menu .menu { min-width: 170px; }
.menu form { margin: 0; }
.menu li > button { display: block; width: 100%; text-align: left; padding: 7px 10px; border: 0; border-radius: 6px; background: none; font: 14px var(--font); color: var(--text); cursor: pointer; }
.menu li > button:hover { background: var(--primary-50); color: var(--primary); }
.menu li > button.current { font-weight: 700; color: var(--primary); }
.login-panel { position: relative; }
.login-lang { position: absolute; top: 20px; right: 20px; }
.brand-logo { display: block; max-width: 240px; object-fit: contain; }
.pre { white-space: pre-line; color: var(--text); }

/* ---------- Tenants ---------- */
.tree-name { display: inline-flex; align-items: center; gap: 8px; padding-left: calc(var(--lvl) * 22px); position: relative; }
.tree-name::before { content: ""; display: var(--branch, none); }
table.tree tr td:first-child .tree-name[style*="--lvl:0"] strong { font-size: 15px; }
.swatch { width: 12px; height: 12px; border-radius: 4px; flex: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,.1); }
.type-pill { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; background: #F2F4F7; color: #475467; white-space: nowrap; }
.type-platform { background: var(--navy); color: #fff; }
.type-super_sb { background: var(--primary-50); color: var(--primary-dark); }
.type-reseller { background: var(--teal-50); color: #1F6F7A; }
.type-service_bureau { background: #FEF3E7; color: #9A4C07; }
td.actions { text-align: right; }

.edit-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.edit-main > .card + .card { margin-top: 16px; }
.edit-side { position: sticky; top: 88px; }
.card-title { margin-bottom: 14px; }
.sub-title { font-size: 14px; font-weight: 700; margin: 22px 0 10px; color: var(--navy); }
.small { font-size: 13px; margin: -6px 0 6px; }
.span-2 { grid-column: span 2; }
textarea { width: 100%; min-height: 80px; padding: 10px 12px; font: 14px var(--font); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); resize: vertical; }
textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-100); }
input[type=url] { width: 100%; height: 40px; padding: 8px 12px; font: 14px var(--font); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); }
input[type=file] { font: 13px var(--font); }
.check.inline { padding-top: 6px; font-size: 13px; }
.logo-row { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 8px; flex-wrap: wrap; }
.logo-current { min-width: 200px; padding: 14px 16px; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); background: #FAFBFC; }
.grow { flex: 1; min-width: 240px; }
.color-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.color-field { display: flex; flex-direction: column; gap: 6px; }
.color-field > label:first-child { font-size: 13px; font-weight: 600; color: var(--navy); }
.color-input { display: flex; gap: 8px; }
.color-input input[type=color] { width: 44px; height: 40px; padding: 2px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: #fff; cursor: pointer; }
.color-input input[type=text] { font-family: ui-monospace, Menlo, Consolas, monospace; text-transform: uppercase; }
.contrast-warn { margin: 12px 0 0; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--warning-50); color: var(--warning); font-size: 13px; }
.radio-row { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 10px; }
.lang-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.lang-chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--border-strong); border-radius: 999px; cursor: pointer; font-size: 14px; }
.lang-chip:has(input:checked) { border-color: var(--primary); background: var(--primary-50); }
.lang-chip:has(input:disabled) { opacity: .6; cursor: default; }
.lang-chip input { accent-color: var(--primary); }
.sticky-actions { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--canvas) 30%); padding: 18px 0 8px; margin-top: 8px; }

.preview { overflow: hidden; }
.preview-label { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--border); }
.pv-bar { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--border); box-shadow: inset 0 3px 0 var(--d); }
.pv-logo { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-display); font-size: 17px; letter-spacing: -.02em; }
.pv-mark { width: 18px; height: 16px; border: 2.5px solid var(--d); border-radius: 3px; margin-right: 4px; background: linear-gradient(to top, var(--s) 0 35%, transparent 35%) 3px 100%/3px 100% no-repeat, linear-gradient(to top, var(--p) 0 60%, transparent 60%) 8px 100%/3px 100% no-repeat; }
.pv-first { color: var(--d); }
.pv-second { color: var(--p); margin-left: -4px; }
.pv-nav { display: flex; gap: 6px; }
.pv-nav i { width: 22px; height: 8px; border-radius: 4px; background: #E7EAEE; }
.pv-nav i.on { background: var(--p); opacity: .35; }
.pv-body { padding: 16px; display: grid; gap: 10px; background: #F7F7F8; }
.pv-h { font-family: var(--font-display); font-weight: 800; color: var(--d); font-size: 17px; text-align: center; }
.pv-input { height: 30px; border: 1px solid var(--border-strong); border-radius: 6px; background: #fff; }
.pv-btn { height: 34px; border-radius: 6px; background: var(--p); color: #fff; font-weight: 600; font-size: 13px; display: grid; place-items: center; }
.pv-row { display: flex; justify-content: space-between; align-items: center; font-size: 12px; }
.pv-badge { padding: 2px 8px; border-radius: 999px; background: var(--success-50); color: var(--success); font-weight: 600; }
.pv-link { color: var(--a); font-weight: 700; }
.pv-bars { display: flex; align-items: flex-end; gap: 8px; height: 60px; padding: 8px; background: #fff; border: 1px solid var(--border); border-radius: 6px; }
.pv-bars b { flex: 1; border-radius: 2px 2px 0 0; background: var(--p); }
.pv-bars b:nth-child(even) { background: var(--s); }

/* ---------- Responsive ---------- */
@media (max-width: 1240px) {
  .nav-toggle { display: flex; }
  .topbar-inner { flex-wrap: wrap; gap: 12px; }
  .primary-nav { display: none; order: 3; flex-basis: 100%; }
  .primary-nav.open { display: block; }
  .nav-list { flex-direction: column; }
  .nav-link { width: 100%; justify-content: space-between; }
  .nav-list .menu { position: static; box-shadow: none; border: 0; max-height: none; padding-left: 12px; }
  .user-menu { order: 2; }
  .user-text { display: none; }
  .user-chip { padding: 2px; }
  .login-hero { display: none; }
  .login-panel { width: 100%; border-left: 0; border-top: 4px solid var(--navy); }
  .edit-layout { grid-template-columns: 1fr; }
  .edit-side { position: static; order: -1; }
  .lang-btn span { display: none; }
}
@media (max-width: 640px) {
  .page { padding: 20px 16px 40px; }
  .topbar-inner { padding: 8px 16px; }
  .brand-name { font-size: 20px; }
  h1 { font-size: 24px; }
  .form-actions .btn { flex: 1; }
  .login-panel { padding: 32px 16px; }
  .span-2 { grid-column: auto; }
}

/* ---------- Stage 1: admin pages ---------- */
[hidden] { display: none !important; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.head-actions form { margin: 0; }
.forgot-link { justify-self: center; font-size: 13px; font-weight: 600; }
.btn.danger, .btn-ghost.danger { color: var(--danger); }
.btn-ghost.danger:hover { background: var(--danger-50); }
input[type=date], input[type=tel], input[type=search] { width: 100%; height: 40px; padding: 8px 12px; font: 14px var(--font); color: var(--text); background: #fff; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); }
input[type=date]:focus, input[type=tel]:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-100); }
.results-bar h2 { font-size: 16px; }
table.data.wrap td { white-space: normal; }
td.actions form { display: inline; margin: 0; }

.detail-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
.detail-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.kv-grid { display: grid; grid-template-columns: minmax(120px, auto) 1fr; gap: 8px 16px; margin: 0; font-size: 14px; }
.kv-grid dt { color: var(--muted); }
.kv-grid dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }

.comment-form textarea { min-height: 70px; }
.timeline { list-style: none; margin: 16px 0 0; padding: 0; }
.timeline li { padding: 12px 0 12px 16px; border-left: 2px solid var(--primary-100); position: relative; }
.timeline li::before { content: ""; position: absolute; left: -5px; top: 17px; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }
.tl-meta { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.tl-body { font-size: 14px; overflow-wrap: anywhere; }

.tabs { display: flex; gap: 4px; margin-bottom: -1px; overflow-x: auto; }
.tabs a { padding: 10px 16px; border: 1px solid transparent; border-bottom: 0; border-radius: 10px 10px 0 0; font-weight: 600; font-size: 14px; color: var(--muted); white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; background: rgba(255,255,255,.6); }
.tabs a.active { background: #fff; border-color: var(--border); color: var(--primary); }
.tabs + .card { border-top-left-radius: 0; }
.tab-count { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--canvas); font-size: 11px; color: var(--muted); text-align: center; }
.inline-search { display: flex; gap: 8px; align-items: center; flex: 1; max-width: 460px; }
.inline-search input { height: 34px; }
.code-admin { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; justify-content: space-between; padding: 12px 20px; border-bottom: 1px solid var(--border); background: #FAFBFC; }
.code-add { display: flex; gap: 8px; flex: 1; min-width: 280px; }
.code-add input[name=code] { max-width: 140px; height: 34px; }
.code-add input[name=description] { height: 34px; }
.code-import { display: flex; gap: 8px; align-items: center; margin: 0; }
.file-btn { cursor: pointer; }

.file-list { list-style: none; margin: 0; padding: 0; }
.file-list li { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--border); }
.file-list li:last-child { border-bottom: 0; }
.file-list form { margin: 0; }
.file-icon { flex: none; width: 40px; height: 44px; border-radius: 6px; display: grid; place-items: center; font-size: 10px; font-weight: 800; letter-spacing: .04em; color: var(--primary-dark); background: var(--primary-50); border: 1px solid var(--primary-100); }
.file-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.file-title { font-weight: 600; overflow-wrap: anywhere; }
.file-main small { color: var(--muted); font-size: 12px; }

details.payload { border-top: 1px solid var(--border); }
details.payload > summary { cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 20px; font-size: 14px; }
details.payload > summary:hover { background: #F8FBFE; }
pre.code { margin: 0; padding: 16px 20px; max-height: 520px; overflow: auto; background: #0F1B3D; color: #E4E7EC; font: 12px/1.5 ui-monospace, "SF Mono", Menlo, Consolas, monospace; white-space: pre; }

@media (max-width: 900px) {
  .detail-grid { grid-template-columns: 1fr; }
  .file-list li { flex-wrap: wrap; }
}

/* ---------- Stage 2: reports ---------- */
.crumb { display: inline-block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.report-tiles .tile h3 { font-size: 15px; }
.col-picker { border: 0; padding: 0; margin: 16px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.col-picker legend { font-size: 13px; font-weight: 600; color: var(--navy); margin-bottom: 8px; padding: 0; }
.col-picker .lang-chip { padding: 6px 10px; font-size: 13px; }
table.data tfoot td { font-weight: 700; background: #FAFBFC; border-top: 2px solid var(--border-strong); padding: 11px 14px; white-space: nowrap; }

.print-body { background: #fff; display: block; padding: 24px; }
.print-toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 20px; }
.print-head { display: flex; gap: 20px; align-items: center; border-bottom: 3px solid var(--navy); padding-bottom: 12px; margin-bottom: 16px; }
.print-head h1 { font-size: 20px; }
.print-head p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
table.data.print-table { font-size: 10px; width: 100%; }
table.data.print-table th { position: static; font-size: 9px; padding: 5px 6px; white-space: normal; }
table.data.print-table td { padding: 3px 6px; white-space: normal; }
table.data.print-table tfoot td { padding: 5px 6px; }
.print-table .badge { padding: 0; background: none; font-size: 11px; }
.print-table .badge::before { display: none; }

/* Avery 5160 / 8160: 3 x 10 labels, 2.625in x 1in */
.label-sheet { display: grid; grid-template-columns: repeat(3, 2.625in); grid-auto-rows: 1in; column-gap: .125in; }
.label { padding: .12in .15in; font: 11pt/1.25 Arial, sans-serif; overflow: hidden; }
@media screen { .label-sheet { width: 8.125in; } .label { outline: 1px dashed #D0D5DD; } }

@media print {
  .no-print { display: none !important; }
  .print-body { padding: 0; }
  .print-table th { background: #EEF0F3 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .print-table tr { break-inside: avoid; }
  @page { margin: .5in; }
  .labels-body { padding: 0; }
  .labels-body .label-sheet { margin: .5in 0 0 .1875in; }
}
@media print { @page :first { margin: .5in; } }
@media print {
  .labels-body .label-sheet { page: labels; margin: 0; padding: .5in 0 0 .1875in; }
  @page labels { margin: 0; size: letter; }
}
table.data.print-table td.mono, table.data.print-table td.num { white-space: nowrap; }
table.data.print-table td.mono { font-size: 9px; }

/* ---------- Stage 3: bank enrollment ---------- */
input[type=tel], input[type=date], input[type=number] {
  width: 100%; height: 40px; padding: 8px 12px; font: 14px var(--font); color: var(--text);
  background: #fff; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
}
input[aria-invalid=true], select[aria-invalid=true] { border-color: var(--danger); }
.fine { font-size: 13px; }
p.fine { margin: 8px 0 0; }
.nowrap { white-space: nowrap; }
.req { color: var(--danger); }
.badge-xs { font-size: 10px; padding: 1px 6px; vertical-align: middle; }
.inline-form { display: inline; margin: 0; }
.bar-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.field-wide { grid-column: 1 / -1; }
.field .ro-label { font-size: 13px; font-weight: 600; color: var(--navy); }
.ro { min-height: 40px; padding: 9px 12px; background: var(--canvas); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 14px; overflow-wrap: anywhere; }
.input-prefix { display: flex; align-items: stretch; }
.input-prefix span { display: flex; align-items: center; padding: 0 10px; background: var(--canvas); border: 1px solid var(--border-strong); border-right: 0; border-radius: var(--radius-sm) 0 0 var(--radius-sm); color: var(--muted); font-size: 14px; }
.input-prefix input { border-top-left-radius: 0 !important; border-bottom-left-radius: 0 !important; }
.tabs .tab-count { font-weight: 500; }
.enroll-top { margin-bottom: 16px; }
.enroll-top .intro { margin: 0 0 12px; color: var(--muted); }
.enroll-top .kv-grid + .status-form, .enroll-top .intro + .status-form { margin-top: 16px; }
.status-form { border-top: 1px solid var(--border); padding-top: 16px; margin-top: 16px; }
.fine-title { font-size: 15px; }
.section-nav { position: sticky; top: 0; z-index: 5; display: flex; gap: 4px; overflow-x: auto; padding: 8px; margin-bottom: 16px; background: rgba(255,255,255,.92); backdrop-filter: blur(6px); border: 1px solid var(--border); border-radius: var(--radius); }
.section-nav a { padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.section-nav a:hover { text-decoration: none; color: var(--text); background: var(--canvas); }
.section-nav a.active { color: var(--primary); background: var(--primary-50); }
.enroll-section { margin-bottom: 16px; scroll-margin-top: 72px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.section-head h2 { margin: 0; font-size: 17px; }
.section-head form { margin: 0; }
.enroll-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); align-items: start; }
.enroll-grid .check.inline { padding-top: 0; }
.agreements { margin-top: 8px; display: flex; flex-direction: column; gap: 10px; }
.agreement-frame { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.agreement-bar { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; background: var(--canvas); border-bottom: 1px solid var(--border); font-size: 14px; flex-wrap: wrap; }
.agreement-frame iframe { display: block; width: 100%; height: 420px; border: 0; background: #fff; }
.fee-summary { max-width: 420px; }
.fee-summary caption { text-align: left; font-weight: 600; padding: 4px 0 8px; color: var(--navy); }
.agree { align-items: flex-start; line-height: 1.4; }
.agree input { margin-top: 1px; flex: none; }
.agreements .error { color: var(--danger); font-size: 12px; margin-top: -6px; }
.enroll-actions { position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: flex-end; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 16px; background: rgba(255,255,255,.95); backdrop-filter: blur(6px); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.enroll-actions .fine { margin-right: auto; }
.stat-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat-pill { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 14px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); font-size: 13px; }
.stat-pill strong { font-size: 18px; color: var(--navy); }
.stat-pill:hover { text-decoration: none; border-color: var(--primary); }
.stat-pill.active { border-color: var(--primary); background: var(--primary-50); }
.office-enroll { display: inline-flex; }
.office-enroll .start { font-size: 12px; font-weight: 600; }
.fee-table td input { max-width: 160px; }
.fee-table .inherit { font-size: 12px; color: var(--muted); }
@media print { .section-nav, .enroll-actions { display: none; } }

/* ---------- FOIA data search ---------- */
.progress { height: 10px; background: var(--canvas); border-radius: 999px; overflow: hidden; margin: 6px 0 10px; border: 1px solid var(--border); }
.progress span { display: block; height: 100%; background: var(--primary); transition: width .3s; }
.foia-job { margin-bottom: 16px; border-color: var(--primary-100); }
.source-pick { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 16px; margin: 16px 0 0; display: flex; flex-direction: column; gap: 6px; }
.source-pick legend { font-size: 13px; font-weight: 600; color: var(--navy); padding: 0 6px; }
.source-pick .check.inline { padding-top: 4px; }
.source-pick .field { margin-left: 26px; }
.foia-help { margin-top: 14px; }
.foia-help summary { cursor: pointer; font-weight: 600; color: var(--primary); }
.foia-help p { overflow-wrap: anywhere; }
tr.muted td { color: var(--muted); }
.card-head h2 { margin: 0; font-size: 16px; }
.source-pick .hint { font-size: 12px; color: var(--muted); margin-left: 26px; }
.source-pick .field .hint { margin-left: 0; }
table.data td .error { white-space: normal; max-width: 460px; overflow-wrap: anywhere; color: var(--danger); }

/* ---------- Two-factor sign-in and My account ---------- */
.auth-solo { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; background: var(--canvas); }
.auth-card { width: 100%; max-width: 460px; padding: 28px; }
.auth-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.auth-top .login-lang { position: static; }
.auth-card h1 { font-size: 24px; margin: 0 0 6px; }
.auth-card .sub { color: var(--muted); margin: 0 0 16px; }
.code-form { display: flex; flex-direction: column; gap: 14px; }
.code-input { font: 600 26px/1 var(--font) !important; letter-spacing: 8px; text-align: center; height: 56px !important; }
.auth-links { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 18px; font-size: 14px; align-items: center; }
.auth-links form { margin: 0; }
.link-btn { background: none; border: 0; padding: 0; color: var(--primary); font: inherit; font-size: 14px; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.link-btn.danger { color: var(--danger); }
.setup-steps { padding-left: 20px; margin: 0 0 16px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.qr-wrap { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.qr-wrap #qr { width: 168px; height: 168px; background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 4px; }
.qr-wrap #qr svg { width: 100%; height: 100%; display: block; }
.qr-wrap .hint { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
code.secret { display: inline-block; font-size: 15px; letter-spacing: 1px; background: var(--canvas); padding: 6px 10px; border-radius: 6px; user-select: all; overflow-wrap: anywhere; }
.mfa-status { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin: 4px 0 16px; font-size: 14px; }
.method-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.method-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; margin: 0; }
.method-row + .method-row { border-top: 1px solid var(--border); }
.method-row > div { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.mfa-off { margin-top: 14px; }
.app-setup { border: 1px solid var(--primary-100); background: var(--primary-50); border-radius: var(--radius-sm); padding: 16px; }
.inline-code { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 8px; }
.inline-code .field { max-width: 220px; }
.menu-card .btn-block + form { margin-top: 8px; }
.nav-link { white-space: nowrap; }
@media (min-width: 1241px) {
  .nav-link { padding-left: 9px; padding-right: 9px; font-size: 13.5px; }
  .user-text small { display: none; }
}
#profile .muted.fine { margin: 6px 0 14px; }
/* When the menu doesn't fit on one line (long languages, many items), app.js adds .nav-compact and the hamburger menu is used. */
.nav-compact .nav-toggle { display: flex; }
.nav-compact .topbar-inner { flex-wrap: wrap; gap: 12px; }
.nav-compact .primary-nav { display: none; order: 3; flex-basis: 100%; }
.nav-compact .primary-nav.open { display: block; }
.nav-compact .nav-list { flex-direction: column; }
.nav-compact .nav-link { width: 100%; justify-content: space-between; }
.nav-compact .nav-list .menu { position: static; box-shadow: none; border: 0; max-height: none; padding-left: 12px; }
.nav-compact .user-menu { order: 2; }
.nav-compact .user-text { display: none; }
.nav-compact .user-chip { padding: 2px; }
.nav-compact .lang-btn span { display: none; }
.lang-btn span, .user-text strong { white-space: nowrap; }

/* ---------- Office and return pages ---------- */
.kpi-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.kpi span { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.kpi strong { font: 700 24px var(--font-head, var(--font)); color: var(--navy); }
.kpi small { font-size: 12px; color: var(--muted); }
.kpi .neg, strong.neg { color: var(--danger); }
.detail-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.year-pick select { height: 40px; width: auto; min-width: 96px; }
.bank-list { list-style: none; margin: 0; padding: 0; }
.bank-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; }
.bank-list li + li { border-top: 1px solid var(--border); }
.credit-form { display: grid; grid-template-columns: 110px 1fr auto; gap: 10px; align-items: end; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.credit-form .hint { grid-column: 1 / -1; font-size: 12px; color: var(--muted); }
.credit-form input[type=number] { height: 32px; }
.credit-form input[type=text] { height: 32px; }
.note-form textarea { height: auto; min-height: 76px; resize: vertical; }
.note-form .form-actions { margin-top: 8px; }
.notes .timeline li.sys strong { color: var(--muted); }
.note-body { margin-top: 4px; font-size: 14px; white-space: normal; overflow-wrap: anywhere; }
.milestones { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.milestones li { display: flex; flex-direction: column; gap: 4px; font-size: 13px; position: relative; padding-top: 18px; }
.milestones .dot { position: absolute; top: 0; left: 0; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--border-strong); background: #fff; }
.milestones li::before { content: ""; position: absolute; top: 5px; left: 14px; right: -6px; height: 2px; background: var(--border); }
.milestones li:last-child::before { display: none; }
.milestones li.done .dot { background: var(--success); border-color: var(--success); }
.milestones li.done::before { background: var(--success); }
@media (max-width: 640px) { .milestones { grid-template-columns: 1fr 1fr; } .credit-form { grid-template-columns: 1fr; } }

/* ---------- Support, knowledge base, downloads, checklist, admin tools ---------- */
textarea { width: 100%; padding: 10px 12px; font: 14px/1.5 var(--font); color: var(--text); background: #fff; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); resize: vertical; }
.mono-area { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.new-ticket > summary { cursor: pointer; list-style: none; margin: 0; }
.new-ticket > summary::-webkit-details-marker { display: none; }
.new-ticket > summary::before { content: '+ '; color: var(--primary); }
.new-ticket[open] > summary { margin-bottom: 14px; }
.thread { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.msg { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; max-width: 92%; }
.msg.staff { margin-left: auto; background: var(--primary-50); border-color: var(--primary-100); }
.msg.internal { background: #FFF8E6; border-color: #F5D58A; border-style: dashed; }
.msg-head { font-size: 13px; margin-bottom: 6px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.msg-body { font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.msg-file { display: inline-block; margin-top: 8px; font-size: 13px; }
.reply-form textarea { margin: 6px 0 10px; }
.reply-row { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; }
.reply-row .btn { margin-left: auto; }
.reply-row .check.inline { padding-top: 0; }
.inline-select { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; }
.inline-select select { height: 32px; width: auto; }
.kb-search { display: flex; gap: 10px; flex-wrap: wrap; }
.kb-search input[type=search] { flex: 1; min-width: 220px; height: 44px; font-size: 15px; }
.kb-search select { width: auto; height: 44px; }
.kb-group { margin-top: 20px; }
.kb-group > h2 { font-size: 15px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 0 0 10px; }
.kb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.kb-card { display: flex; flex-direction: column; gap: 6px; padding: 16px; color: inherit; transition: border-color .15s, box-shadow .15s; }
.kb-card:hover { text-decoration: none; border-color: var(--primary-100); box-shadow: var(--shadow-lg); }
.article { font-size: 15px; line-height: 1.65; }
.article h2 { font-size: 20px; margin: 24px 0 8px; } .article h3 { font-size: 17px; margin: 20px 0 6px; } .article h4 { font-size: 15px; margin: 16px 0 4px; }
.article :first-child { margin-top: 0; }
.article code { background: var(--canvas); padding: 1px 5px; border-radius: 4px; font-size: 13px; }
.article ul, .article ol { padding-left: 22px; }
.link-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.dl-list { padding: 0; }
.dl-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 18px; flex-wrap: wrap; }
.dl-row + .dl-row { border-top: 1px solid var(--border); }
.dl-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.dl-main > strong { display: inline; }
.dl-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.check-progress { display: flex; flex-direction: column; gap: 4px; }
.check-group + .check-group { margin-top: 16px; }
.check-list { list-style: none; margin: 0; padding: 0; }
.check-list li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 20px; }
.check-list li + li { border-top: 1px solid var(--border); }
.check-list li.done .check-text strong { text-decoration: line-through; color: var(--muted); }
.check-list li.late { background: #FFF6F5; }
.check-list .tick { margin: 2px 0 0; }
.check-list .tick input { width: 20px; height: 20px; accent-color: var(--success); cursor: pointer; }
.check-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.due-row { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 10px; }
.due-row input[type=number] { height: 40px; width: 100%; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); }
.new-key { border-color: var(--success); background: var(--success-50); margin-bottom: 16px; }
.key-box { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.key-box code { background: #fff; padding: 10px 12px; border-radius: 6px; border: 1px solid var(--border); font-size: 14px; user-select: all; overflow-wrap: anywhere; }
.scope-pick { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; margin: 12px 0 0; display: flex; flex-direction: column; gap: 4px; }
.scope-pick legend { font-size: 13px; font-weight: 600; color: var(--navy); padding: 0 4px; }
.scope-pick .check.inline { padding-top: 2px; }
pre.code.fine { font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.filter-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filter-row select { width: auto; }
.exc-msg { font-weight: 500; }
.exc-body { padding: 0 20px 16px; }
.bank-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.bank-card { border-top: 4px solid var(--success); }
.bank-card.status-slow { border-top-color: var(--warning, #F28C1B); }
.bank-card.status-down { border-top-color: var(--danger); }
.bank-msg { font-weight: 500; margin: 0 0 6px; }
.bank-post { display: grid; grid-template-columns: 110px 1fr auto; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.bank-post select, .bank-post input { height: 34px; }
.bank-alert a { margin-left: 6px; }
tr.selected td { background: var(--primary-50); }
@media (max-width: 640px) { .bank-post { grid-template-columns: 1fr; } .msg { max-width: 100%; } }

/* Bank files and 2026 enrollment */
.field-check { justify-content: flex-end; }
.field-check .check { min-height: 40px; display: flex; align-items: center; }
.problem-list { margin: 0; padding-left: 18px; font-size: 13px; }
.problem-list li + li { margin-top: 2px; }
.bank-response { margin-top: 10px; font-size: 13px; }
.bank-response summary { cursor: pointer; color: var(--primary); font-weight: 600; }
.bank-response .kv-grid { margin-top: 8px; }
.enroll-window { margin-bottom: 12px; }
.inline-note { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 4px 0 12px; }
#build .search-grid { align-items: end; }
#settings > p.fine { margin-bottom: 12px; }

/* ---------- Billing ---------- */
.btn-danger-text { color: var(--danger); }
.btn-danger-text:hover { border-color: var(--danger); }
.narrow-form { max-width: 460px; }
.input-sm { max-width: 120px; display: inline-flex; }
.input-sm input { height: 32px; }
.copy-code { background: var(--canvas); padding: 2px 6px; border-radius: 4px; word-break: break-all; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.action-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.record-payment { border-top: 1px solid var(--border); padding-top: 16px; align-items: end; }
pre.remit { white-space: pre-wrap; font: inherit; font-size: 14px; background: var(--canvas); padding: 10px 12px; border-radius: var(--radius-sm); margin: 6px 0 0; }
.pay-box { margin-bottom: 16px; border-color: var(--primary-100); }
.pay-box .inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pay-box select { width: auto; min-width: 200px; }
.card-list li { flex-wrap: wrap; }
.add-sub { margin-top: 12px; }
.add-sub > summary { list-style: none; display: inline-flex; align-items: center; cursor: pointer; }
.add-sub > summary::-webkit-details-marker { display: none; }
.add-sub[open] > summary { margin-bottom: 12px; }
.invoice-doc { padding: 32px 36px; position: relative; }
.inv-head { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 24px; }
.inv-logo { max-height: 56px; max-width: 220px; display: block; margin-bottom: 10px; }
.inv-brand { font: 800 22px var(--font-head, var(--font)); color: var(--navy); margin-bottom: 8px; }
.inv-from { font-size: 14px; line-height: 1.5; color: var(--text); }
.inv-meta { text-align: right; }
.inv-title { font: 800 28px var(--font-head, var(--font)); color: var(--navy); letter-spacing: .02em; text-transform: uppercase; margin-bottom: 8px; }
.inv-meta dl { display: grid; grid-template-columns: auto auto; gap: 2px 14px; margin: 0; font-size: 14px; justify-content: end; }
.inv-meta dt { color: var(--muted); }
.inv-meta dd { margin: 0; text-align: right; }
.inv-to { margin-bottom: 20px; font-size: 14px; line-height: 1.5; }
.inv-lines tfoot td { border-top: 1px solid var(--border); font-weight: 600; }
.inv-lines tr.inv-total td { font-size: 16px; color: var(--navy); }
.inv-notes, .inv-remit { margin-top: 18px; font-size: 14px; }
.inv-stamp { position: absolute; top: 120px; right: 40px; transform: rotate(-8deg); border: 3px solid var(--success); color: var(--success); font: 800 20px var(--font-head, var(--font));
  padding: 6px 14px; border-radius: 8px; text-transform: uppercase; opacity: .8; }
.inv-edit input { min-width: 80px; }
.inv-edit td:first-child input { min-width: 260px; }
@media (max-width: 700px) {
  .invoice-doc { padding: 20px 16px; }
  .inv-meta { text-align: left; }
  .inv-meta dl { justify-content: start; }
  .inv-stamp { position: static; display: inline-block; margin-top: 12px; }
}
@media print {
  .topbar, .site-footer, .tabs, .flash, .alert { display: none !important; }
  .page { padding: 0 !important; max-width: none !important; }
  .invoice-doc { border: 0 !important; box-shadow: none !important; padding: 0; }
  .inv-lines th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- Taxpayer bank applications ---------- */
.fieldno { font: 500 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); margin-left: 4px; }
.bankapp-links { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; }
.rpin-box { margin-top: 16px; border: 1px solid var(--orange); border-left-width: 4px; border-radius: 10px; padding: 16px 18px; background: #FFF8F0; }
.rpin-box h3 { margin: 0 0 8px; font-size: 16px; }
.rpin-points { margin: 0 0 12px 18px; padding: 0; }
.rpin-points li { margin: 4px 0; }
.rpin-next { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; margin-bottom: 12px; }
.rpin-next p { margin: 4px 0 0; }
.rpin-disclosure { max-height: 220px; overflow-y: auto; background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; font-size: 13px; line-height: 1.5; }
.rpin-disclosure p { margin: 0; }

/* ---------- Go-live check ---------- */
.golive-list { list-style: none; margin: 0; padding: 0; }
.golive-list li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 20px; border-top: 1px solid var(--border); }
.golive-list li:first-child { border-top: 0; }
.golive-list .badge { min-width: 24px; justify-content: center; font-weight: 700; }

/* ---------- Old-data import ---------- */
.import-map select, .import-map input { width: 100%; min-width: 140px; }
.import-steps { margin: 0 0 12px 18px; padding: 0; }

/* ---------- Pay per return ---------- */
.credit-prices { max-width: 420px; margin-bottom: 16px; }
.credit-total { font-size: 20px; font-weight: 700; }
.tier-table { max-width: 420px; }
.tier-table input { width: 100%; }
.plain-list { list-style: none; padding: 0; margin: 8px 0; }
.plain-list li { display: flex; gap: 12px; align-items: center; padding: 4px 0; }

/* ---------- Bank certification ---------- */
.cert-how { margin: 8px 0 0 20px; display: grid; gap: 6px; }
.cert-list { margin: 0; padding-left: 18px; }
.cert-list li { margin: 2px 0; }
ol.cert-list { list-style: none; padding-left: 0; }
.cert-box { font-size: 13px; margin-right: 2px; }
.cert-problems { margin: 6px 0 0; padding-left: 18px; }
.input-efin { width: 8em; font-family: var(--mono, monospace); }
.my-ip { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin: 0 0 12px; }
.cert-sheet td { vertical-align: top; font-size: 11px; }
.cert-sheet td:first-child { width: 16%; } .cert-sheet td:nth-child(3) { width: 12%; white-space: nowrap; } .cert-sheet td:last-child { width: 14%; }
#remove .inline-form input, #demo .inline-form input { max-width: 14em; }
/* Rows-per-page picker in a results bar */
.per-page { display: flex; align-items: center; gap: 8px; margin: 0; }
.per-page label { margin: 0; font-size: 13px; color: var(--muted, #5b6472); font-weight: 500; white-space: nowrap; }
.per-page select { width: auto; min-width: 72px; height: 32px; padding: 4px 28px 4px 10px; }
/* Full-width pages (Data Search results) */
.page.page-wide { max-width: none; }
/* From / to number boxes */
.field .label-like { font-size: 13px; font-weight: 600; color: var(--navy); }
.range-pair { display: flex; align-items: center; gap: 6px; }
.range-pair input { min-width: 0; flex: 1; }
/* Results text size */
.text-size { display: flex; align-items: center; gap: 2px; }
.text-size .fine { margin-right: 6px; white-space: nowrap; }
.text-size a { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border: 1px solid var(--border-strong); background: #fff; color: var(--navy); font-weight: 600; line-height: 1; }
.text-size a:first-of-type { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.text-size a:last-of-type { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.text-size a + a { margin-left: -1px; }
.text-size a:hover { text-decoration: none; background: #F3F6FA; }
.text-size a.active { background: var(--primary); border-color: var(--primary); color: #fff; position: relative; }
.text-size .ts-m { font-size: 16px; } .text-size .ts-s { font-size: 14px; } .text-size .ts-xs { font-size: 12px; } .text-size .ts-xxs { font-size: 10px; }
table.data.results-fs-s { font-size: 13px; } table.data.results-fs-s td { padding: 8px 10px; } table.data.results-fs-s th { padding: 8px 10px; }
table.data.results-fs-xs { font-size: 12px; } table.data.results-fs-xs td { padding: 6px 8px; } table.data.results-fs-xs th { padding: 6px 8px; font-size: 10.5px; }
table.data.results-fs-xxs { font-size: 11px; } table.data.results-fs-xxs td { padding: 4px 6px; } table.data.results-fs-xxs th { padding: 5px 6px; font-size: 10px; }
.results-bar .head-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
/* At the smaller sizes long text wraps inside its column, so more columns fit across the screen */
table.data.results-fs-xs td, table.data.results-fs-xxs td { white-space: normal; overflow-wrap: anywhere; max-width: 15em; line-height: 1.3; }
table.data.results-fs-xxs td { max-width: 12em; }
table.data.results-fs-xs td.num, table.data.results-fs-xxs td.num, table.data td .nowrap { white-space: nowrap; overflow-wrap: normal; }
table.data.results-fs-xs th, table.data.results-fs-xxs th { white-space: normal; letter-spacing: 0; }
