/* ==========================================================================
   Preet Nagar Construction Management Software - design system
   Palette: Navy #000080 (brand/actions), White #FFFFFF (surfaces), Black #000000 (text)
   All colours are defined here as custom properties; templates never hard-code colours.
   ========================================================================== */
:root {
  --navy: #000080;
  --navy-700: #00005e;
  --navy-600: #00006b;
  --navy-100: #e6e8f6;
  --navy-50: #f3f4fb;
  --white: #ffffff;
  --black: #000000;
  --text: var(--black);
  --muted: #45465a;              /* 9.3:1 on white */
  --line: #d4d7e6;
  --line-strong: #a9aecb;
  --surface: var(--white);
  --canvas: #f6f7fb;
  --success: #0b6b2e;            /* 6.6:1 */
  --success-bg: #e5f4ea;
  --warning: #7a4a00;            /* 7.4:1 */
  --warning-bg: #fdf1dc;
  --danger: #a1001d;             /* 7.9:1 */
  --danger-bg: #fbe7ea;
  --info-bg: var(--navy-50);
  --focus: var(--navy);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(0, 0, 40, .06), 0 4px 16px rgba(0, 0, 40, .06);
  --shadow-lg: 0 10px 40px rgba(0, 0, 40, .16);
  --sidebar-w: 268px;
  --font: Georgia, "Times New Roman", Times, serif;
  --chart-1: var(--navy);
  --chart-2: #5a5a6e;
  --chart-3: #9aa0c8;
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--text); background: var(--canvas); line-height: 1.5; }
h1, h2, h3, h4 { font-family: var(--font); color: var(--black); line-height: 1.25; margin: 0 0 .5rem; font-weight: 700; }
h1 { font-size: 1.65rem; letter-spacing: -.01em; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .75rem; }
a { color: var(--navy); text-underline-offset: 2px; }
a:hover { color: var(--navy-700); }
small, .small { font-size: .85rem; }
.muted { color: var(--muted); }
.ico { width: 1.15em; height: 1.15em; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.2em; flex: none; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Focus: always visible for keyboard users */
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.sidebar :focus-visible { outline-color: var(--white); }
.skip-link { position: absolute; left: .5rem; top: -3rem; background: var(--white); color: var(--navy); padding: .5rem .9rem; border-radius: var(--radius-sm); z-index: 1000; box-shadow: var(--shadow); }
.skip-link:focus { top: .5rem; }

/* ---------------- Development banner ---------------- */
.dev-banner { background: var(--warning-bg); color: var(--black); border-bottom: 3px solid var(--warning); padding: .45rem 1rem; font-size: .9rem; text-align: center; }
.dev-banner strong { color: var(--warning); letter-spacing: .06em; }

/* ---------------- Layout ---------------- */
.app { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-w); background: var(--navy); color: var(--white); position: sticky; top: 0; height: 100vh; overflow-y: auto; flex: none; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: .7rem; padding: 1.1rem 1.1rem 1rem; color: var(--white); text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.14); }
.brand:hover { color: var(--white); }
.monogram { width: 40px; height: 40px; border-radius: 10px; background: var(--white); color: var(--navy); display: grid; place-items: center; font-weight: 700; font-size: 1.05rem; letter-spacing: .02em; border: 2px solid rgba(255,255,255,.6); }
.brand-text { line-height: 1.15; }
.brand-text b { display: block; font-size: 1rem; }
.brand-text span { font-size: .78rem; opacity: .85; }
.nav { padding: .6rem .5rem 1.5rem; flex: 1; }
.nav a, .nav summary { display: flex; align-items: center; gap: .65rem; padding: .5rem .7rem; border-radius: var(--radius-sm); color: var(--white); text-decoration: none; font-size: .95rem; cursor: pointer; }
.nav summary { list-style: none; font-weight: 700; opacity: .95; margin-top: .25rem; }
.nav summary::-webkit-details-marker { display: none; }
.nav summary::after { content: ""; margin-left: auto; width: .45rem; height: .45rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .15s; }
.nav details[open] > summary::after { transform: rotate(45deg); }
.nav details a { padding-left: 2.35rem; font-size: .9rem; opacity: .92; }
.nav a:hover, .nav summary:hover { background: rgba(255,255,255,.12); }
.nav a[aria-current="page"] { background: var(--white); color: var(--navy); font-weight: 700; opacity: 1; }
.sidebar-foot { padding: .8rem 1rem 1rem; border-top: 1px solid rgba(255,255,255,.14); font-size: .8rem; opacity: .85; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; background: rgba(255,255,255,.96); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: .75rem; padding: .6rem 1.25rem; }
.topbar .search { flex: 1 1 720px; max-width: 720px; min-width: 0; position: relative; }
.topbar .search input { padding-left: 2.2rem; }
.topbar .search .ico { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.topbar .spacer { flex: 1; }
.btn.search-toggle, .btn.search-close { display: none; } /* 4.5.002: shown on phones only (Q131, Q132) */
.btn.menu-btn { display: none; } /* 4.0.003: .btn (declared later) used to override this, showing the menu button on desktop */
.content { padding: 1.5rem 1.5rem 3rem; max-width: 1440px; width: 100%; }

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.1rem; }
.page-head p { margin: .25rem 0 0; color: var(--muted); max-width: 70ch; }
.breadcrumbs { font-size: .85rem; color: var(--muted); margin-bottom: .35rem; display: flex; flex-wrap: wrap; gap: .35rem; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs span[aria-current] { color: var(--black); }
.toolbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }

/* ---------------- Cards & grid ---------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.15rem 1.25rem; margin-bottom: 1.1rem; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .75rem; }
.card-head h2, .card-head h3 { margin: 0; }
.grid { display: grid; gap: 1.1rem; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.col-12 { grid-column: span 12; } .col-6 { grid-column: span 6; } .col-4 { grid-column: span 4; } .col-8 { grid-column: span 8; } .col-3 { grid-column: span 3; }
.grid > .card { margin-bottom: 0; }
.kpis { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.kpi { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .8rem .9rem; background: var(--white); text-decoration: none; color: var(--black); display: block; transition: border-color .15s, box-shadow .15s; border-left: 4px solid var(--navy); }
a.kpi:hover { border-color: var(--navy); box-shadow: var(--shadow); color: var(--black); }
.kpi .label { font-size: .82rem; color: var(--muted); display: block; }
.kpi .value { font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; display: block; margin-top: .15rem; }
.kpi .value.neg { color: var(--danger); }
.stack > * + * { margin-top: .75rem; }

/* ---------------- Buttons ---------------- */
.btn { --bg: var(--white); --fg: var(--navy); --bd: var(--navy); display: inline-flex; align-items: center; gap: .45rem; justify-content: center; font-family: var(--font); font-size: .93rem; font-weight: 700; padding: .5rem .95rem; border-radius: var(--radius-sm); border: 1.5px solid var(--bd); background: var(--bg); color: var(--fg); text-decoration: none; cursor: pointer; line-height: 1.2; transition: background .15s, color .15s, box-shadow .15s; white-space: nowrap; }
.btn:hover { background: var(--navy-50); color: var(--navy-700); }
.btn:active { transform: translateY(1px); }
.btn-primary { --bg: var(--navy); --fg: var(--white); --bd: var(--navy); }
.btn-primary:hover { background: var(--navy-700); color: var(--white); }
.btn-danger { --bg: var(--white); --fg: var(--danger); --bd: var(--danger); }
.btn-danger:hover { background: var(--danger-bg); color: var(--danger); }
.btn-danger.solid { --bg: var(--danger); --fg: var(--white); }
.btn-danger.solid:hover { background: #7d0016; color: var(--white); }
.btn-ghost { --bd: transparent; --bg: transparent; }
.btn-sm { padding: .3rem .6rem; font-size: .85rem; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; pointer-events: none; }
.icon-btn { background: none; border: 0; padding: .15rem .25rem; color: var(--navy); cursor: pointer; border-radius: 6px; }
.icon-btn:hover { background: var(--navy-50); }
.btn-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
form.inline { display: inline; }

/* ---------------- Forms ---------------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem 1.2rem; }
.field { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field label, .label-text { font-weight: 700; font-size: .9rem; }
.field .req { color: var(--danger); }
.help { font-size: .82rem; color: var(--muted); }
.help ul { margin: .25rem 0 0; padding-left: 1.1rem; }
.input, .select, textarea.input { font-family: var(--font); font-size: .95rem; color: var(--black); background: var(--white); border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); padding: .5rem .65rem; width: 100%; min-height: 2.45rem; transition: border-color .15s, box-shadow .15s; }
.input:hover, .select:hover { border-color: var(--navy); }
.input:focus, .select:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(0, 0, 128, .22); }
.input:disabled, .select:disabled { background: var(--canvas); color: var(--muted); }
select[multiple].select { min-height: 8rem; }
.field.has-error .input, .field.has-error .select { border-color: var(--danger); background: #fffafa; }
.errorlist { list-style: none; padding: 0; margin: 0; color: var(--danger); font-size: .85rem; font-weight: 700; }
.check { display: flex; align-items: center; gap: .5rem; }
.check-input { width: 1.15rem; height: 1.15rem; accent-color: var(--navy); }
.form-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--line); }
fieldset { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .9rem 1rem; margin: 0 0 1rem; }
legend { font-weight: 700; padding: 0 .35rem; }
.secret-field { display: flex; gap: .4rem; align-items: center; }

/* ---------------- Alerts / messages ---------------- */
.alert { border-radius: var(--radius-sm); padding: .7rem .9rem; margin-bottom: .8rem; border: 1px solid var(--line); background: var(--info-bg); display: flex; gap: .6rem; align-items: flex-start; }
.alert-success { background: var(--success-bg); border-color: #9fd3b1; }
.alert-error, .alert-danger { background: var(--danger-bg); border-color: #e9a6b1; }
.alert-warning { background: var(--warning-bg); border-color: #e7c98f; }
.alert .ico { margin-top: .2rem; }

/* ---------------- Badges ---------------- */
.badge { display: inline-block; padding: .12rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 700; border: 1px solid transparent; white-space: nowrap; }
.badge-good { background: var(--success-bg); color: var(--success); border-color: #a9d8b8; }
.badge-warn { background: var(--warning-bg); color: var(--warning); border-color: #ebcf97; }
.badge-bad { background: var(--danger-bg); color: var(--danger); border-color: #eab0ba; }
.badge-neutral { background: var(--navy-50); color: var(--navy); border-color: var(--navy-100); }

/* ---------------- Tables ---------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--white); }
table.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { padding: .55rem .7rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.table thead th { background: var(--navy-50); color: var(--black); font-size: .82rem; text-transform: uppercase; letter-spacing: .03em; position: sticky; top: 0; white-space: nowrap; }
.table thead th a { color: var(--black); text-decoration: none; }
.table thead th a:hover { color: var(--navy); text-decoration: underline; }
.table tbody tr:hover { background: #fafbff; }
.table tbody tr:last-child td { border-bottom: 0; }
.table td.num, .table th.num, .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.neg { color: var(--danger); }
.table tfoot td { font-weight: 700; background: var(--navy-50); border-top: 2px solid var(--navy); }
.table .row-link { font-weight: 700; }
.empty { text-align: center; padding: 2.2rem 1rem; color: var(--muted); }
.empty .ico { width: 2.2rem; height: 2.2rem; color: var(--navy); margin-bottom: .4rem; }
dl.props { display: grid; grid-template-columns: minmax(150px, 34%) 1fr; gap: .45rem 1rem; margin: 0; }
dl.props dt { color: var(--muted); font-size: .88rem; }
dl.props dd { margin: 0; overflow-wrap: anywhere; }

/* Filters / list controls */
.filters { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end; }
.filters .field { min-width: 150px; flex: 1 1 150px; max-width: 240px; }
.tabs { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .9rem; }
.tabs a { padding: .35rem .8rem; border-radius: 999px; border: 1.5px solid var(--line-strong); text-decoration: none; font-size: .88rem; color: var(--black); }
.tabs a:hover { border-color: var(--navy); color: var(--navy); }
.tabs a[aria-current="true"] { background: var(--navy); color: var(--white); border-color: var(--navy); }
.dropdown { position: relative; }
.dropdown > summary { list-style: none; }
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown-panel { position: absolute; right: 0; z-index: 40; margin-top: .35rem; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: .9rem; min-width: 300px; max-height: 70vh; overflow-y: auto; }
.col-chooser li { display: flex; align-items: center; gap: .5rem; padding: .2rem 0; }
.col-chooser ul { list-style: none; padding: 0; margin: 0 0 .6rem; }
.col-chooser input[type=number] { width: 4.2rem; min-height: 2rem; padding: .2rem .4rem; }
.pagination { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; justify-content: space-between; margin-top: .9rem; font-size: .9rem; }
.pagination .pages { display: flex; gap: .3rem; }

/* Timeline / history */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: .45rem 0 .45rem 1rem; border-left: 2px solid var(--navy-100); position: relative; font-size: .9rem; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: .85rem; width: 10px; height: 10px; border-radius: 50%; background: var(--navy); }
pre.json { background: var(--navy-50); padding: .75rem; border-radius: var(--radius-sm); overflow-x: auto; font-size: .82rem; white-space: pre-wrap; }

/* ---------------- Charts ---------------- */
.chart { width: 100%; height: auto; max-height: 360px; font-family: var(--font); }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .zero { stroke: var(--black); stroke-width: 1; }
.chart .axis, .chart .label, .chart .legend { fill: var(--muted); font-size: 11px; }
.chart .bar.s1 { fill: var(--chart-1); }
.chart .bar.s2 { fill: var(--chart-2); }
.chart .bar.s3 { fill: var(--chart-3); }
.chart .bar.neg { fill: var(--danger); }
.chart .line { fill: none; stroke: var(--chart-1); stroke-width: 2.5; }
.chart .dot { fill: var(--white); stroke: var(--chart-1); stroke-width: 2; }
.gantt .act { fill: var(--navy-100); stroke: var(--navy); }
.gantt .act.late { stroke: var(--danger); stroke-width: 2; }
.gantt .prog { fill: var(--navy); }
.gantt .ms { fill: var(--black); }
.gantt .today { stroke: var(--danger); stroke-dasharray: 4 3; }
.gantt .month { stroke: var(--line); }
.gantt text { font-family: var(--font); font-size: 12px; fill: var(--black); }

/* ---------------- Auth pages ---------------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem; background: radial-gradient(1200px 600px at 10% -10%, var(--navy-100), transparent), var(--canvas); }
.auth-card { width: 100%; max-width: 440px; background: var(--white); border: 1px solid var(--line); border-top: 6px solid var(--navy); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 2rem 1.8rem; }
.auth-card.wide { max-width: 760px; }
.auth-brand { display: flex; align-items: center; gap: .75rem; margin-bottom: 1.2rem; }
.auth-brand .monogram { background: var(--navy); color: var(--white); border-color: var(--navy); }
.steps { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .5rem; }
.steps li { display: flex; gap: .6rem; align-items: center; padding: .55rem .75rem; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.steps li.done { background: var(--success-bg); border-color: #a9d8b8; }
.steps li.current { border-color: var(--navy); box-shadow: 0 0 0 2px var(--navy-100); }
.step-num { width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--navy); color: var(--white); display: grid; place-items: center; font-size: .85rem; font-weight: 700; flex: none; }
.otp-input { font-size: 1.6rem; letter-spacing: .5em; text-align: center; font-variant-numeric: tabular-nums; }

/* ---------------- Responsive ---------------- */
@media (max-width: 1100px) {
  .col-4, .col-3 { grid-column: span 6; }
}
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 60; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; }
  .scrim { display: none; position: fixed; inset: 0; background: rgba(0,0,30,.4); z-index: 50; }
  .btn.menu-btn { display: inline-flex; }
  .col-6, .col-4, .col-8, .col-3 { grid-column: span 12; }
  .content { padding: 1rem 1rem 3rem; }
  .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .table.stack-sm thead { display: none; }
  .table.stack-sm, .table.stack-sm tbody, .table.stack-sm tr, .table.stack-sm td { display: block; width: 100%; }
  .table.stack-sm tr { border-bottom: 1px solid var(--line); padding: .4rem 0; }
  .table.stack-sm td { border: 0; padding: .25rem .8rem; display: flex; justify-content: space-between; gap: 1rem; text-align: right; }
  .table.stack-sm td::before { content: attr(data-label); font-weight: 700; color: var(--muted); text-align: left; font-size: .82rem; }
  /* 4.5.002 (Q131 a): on phones the search box opens from a search icon and covers the top bar. */
  .topbar .search { display: none; }
  .btn.search-toggle { display: inline-flex; }
  body.search-open .topbar .search { display: flex; align-items: center; gap: .25rem; position: absolute; inset: 0; z-index: 35; max-width: none; padding: .5rem .75rem; background: var(--surface); }
  body.search-open .topbar .search .ico { left: 1.45rem; }
  body.search-open .btn.search-close { display: inline-flex; flex: none; }
  body.search-open .topbar .live-results { top: 100%; left: 0; right: 0; }
  dl.props { grid-template-columns: 1fr; }
  h1 { font-size: 1.35rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------------- Print ---------------- */
@media print {
  :root { --canvas: #fff; }
  .sidebar, .topbar, .toolbar, .no-print, .dev-banner, .form-actions, .pagination, .dropdown, .skip-link, .btn { display: none !important; }
  .content { padding: 0; max-width: none; }
  .card { box-shadow: none; border: 1px solid #000; break-inside: avoid; }
  .table thead th { background: #fff; border-bottom: 2px solid #000; }
  .badge { border: 1px solid #000; background: #fff !important; color: #000 !important; }
  a { color: #000; text-decoration: none; }
  .chart .bar.s1 { fill: #000; } .chart .bar.s2 { fill: #777; } .chart .bar.s3 { fill: #bbb; }
  .print-only { display: block !important; }
}
.print-only { display: none; }
@media (max-width: 640px) { .hide-sm { display: none; } }

/* ---------------- Cross-tab reports ---------------- */
:root {
  --heat-1: #eef0fa;
  --heat-2: #d3d7f0;
  --heat-3: #a9b0e0;   /* black text 9.6:1 */
  --heat-4: #3d47a6;   /* white text 8.0:1 */
  --heat-5: #000080;   /* white text 16:1 */
}
.xt th[scope="row"] { font-weight: 700; white-space: nowrap; }
.xt td a, .xt tfoot a { color: inherit; text-decoration: none; display: block; }
.xt td a:hover, .xt tfoot a:hover { text-decoration: underline; }
.xt td a:focus-visible { outline-offset: -2px; }
.xt .xt-sub th, .xt .xt-sub td { background: var(--navy-50); font-weight: 700; }
.xt .xt-total { font-weight: 700; border-left: 2px solid var(--line-strong); }
.xt .heat-1 { background: var(--heat-1); }
.xt .heat-2 { background: var(--heat-2); }
.xt .heat-3 { background: var(--heat-3); }
.xt .heat-4 { background: var(--heat-4); color: var(--white); }
.xt .heat-5 { background: var(--heat-5); color: var(--white); }
.xt .heat-4.neg, .xt .heat-5.neg { color: var(--white); text-decoration: underline; }
@media print { .xt .heat-4, .xt .heat-5 { color: #000; background: #ccc; } }

/* ---------------- Guide ---------------- */
.progress { height: .7rem; background: var(--navy-50); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.progress-bar { display: block; height: 100%; background: var(--navy); width: 0; }
.pw-0 { width: 0%; }
.pw-1 { width: 1%; }
.pw-2 { width: 2%; }
.pw-3 { width: 3%; }
.pw-4 { width: 4%; }
.pw-5 { width: 5%; }
.pw-6 { width: 6%; }
.pw-7 { width: 7%; }
.pw-8 { width: 8%; }
.pw-9 { width: 9%; }
.pw-10 { width: 10%; }
.pw-11 { width: 11%; }
.pw-12 { width: 12%; }
.pw-13 { width: 13%; }
.pw-14 { width: 14%; }
.pw-15 { width: 15%; }
.pw-16 { width: 16%; }
.pw-17 { width: 17%; }
.pw-18 { width: 18%; }
.pw-19 { width: 19%; }
.pw-20 { width: 20%; }
.pw-21 { width: 21%; }
.pw-22 { width: 22%; }
.pw-23 { width: 23%; }
.pw-24 { width: 24%; }
.pw-25 { width: 25%; }
.pw-26 { width: 26%; }
.pw-27 { width: 27%; }
.pw-28 { width: 28%; }
.pw-29 { width: 29%; }
.pw-30 { width: 30%; }
.pw-31 { width: 31%; }
.pw-32 { width: 32%; }
.pw-33 { width: 33%; }
.pw-34 { width: 34%; }
.pw-35 { width: 35%; }
.pw-36 { width: 36%; }
.pw-37 { width: 37%; }
.pw-38 { width: 38%; }
.pw-39 { width: 39%; }
.pw-40 { width: 40%; }
.pw-41 { width: 41%; }
.pw-42 { width: 42%; }
.pw-43 { width: 43%; }
.pw-44 { width: 44%; }
.pw-45 { width: 45%; }
.pw-46 { width: 46%; }
.pw-47 { width: 47%; }
.pw-48 { width: 48%; }
.pw-49 { width: 49%; }
.pw-50 { width: 50%; }
.pw-51 { width: 51%; }
.pw-52 { width: 52%; }
.pw-53 { width: 53%; }
.pw-54 { width: 54%; }
.pw-55 { width: 55%; }
.pw-56 { width: 56%; }
.pw-57 { width: 57%; }
.pw-58 { width: 58%; }
.pw-59 { width: 59%; }
.pw-60 { width: 60%; }
.pw-61 { width: 61%; }
.pw-62 { width: 62%; }
.pw-63 { width: 63%; }
.pw-64 { width: 64%; }
.pw-65 { width: 65%; }
.pw-66 { width: 66%; }
.pw-67 { width: 67%; }
.pw-68 { width: 68%; }
.pw-69 { width: 69%; }
.pw-70 { width: 70%; }
.pw-71 { width: 71%; }
.pw-72 { width: 72%; }
.pw-73 { width: 73%; }
.pw-74 { width: 74%; }
.pw-75 { width: 75%; }
.pw-76 { width: 76%; }
.pw-77 { width: 77%; }
.pw-78 { width: 78%; }
.pw-79 { width: 79%; }
.pw-80 { width: 80%; }
.pw-81 { width: 81%; }
.pw-82 { width: 82%; }
.pw-83 { width: 83%; }
.pw-84 { width: 84%; }
.pw-85 { width: 85%; }
.pw-86 { width: 86%; }
.pw-87 { width: 87%; }
.pw-88 { width: 88%; }
.pw-89 { width: 89%; }
.pw-90 { width: 90%; }
.pw-91 { width: 91%; }
.pw-92 { width: 92%; }
.pw-93 { width: 93%; }
.pw-94 { width: 94%; }
.pw-95 { width: 95%; }
.pw-96 { width: 96%; }
.pw-97 { width: 97%; }
.pw-98 { width: 98%; }
.pw-99 { width: 99%; }
.pw-100 { width: 100%; }
.guide-steps li { align-items: flex-start; }
.guide-steps h3 { margin-top: .1rem; }
.btn-row .spacer { flex: 1; }

/* ==========================================================================
   Release 3: settings hub, report studio, guide reference, history, footer
   ========================================================================== */
.app-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; padding: .9rem 1.5rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; background: var(--white); margin-top: auto; }
.credit-note { color: var(--navy); font-weight: 700; }
.credit-small { font-size: .74rem; opacity: .9; }
.help-q span[aria-hidden] { display: inline-grid; place-items: center; width: 1.35rem; height: 1.35rem; border-radius: 50%; border: 2px solid currentColor; font-weight: 700; font-size: .8rem; line-height: 1; }

/* Settings hub */
.settings-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 1.1rem; align-items: start; }
.settings-tabs { position: sticky; top: 4.2rem; display: flex; flex-direction: column; gap: .2rem; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: .5rem; box-shadow: var(--shadow); }
.settings-tabs a { display: flex; align-items: center; gap: .55rem; padding: .5rem .65rem; border-radius: var(--radius-sm); text-decoration: none; color: var(--black); font-size: .93rem; }
.settings-tabs a:hover { background: var(--navy-50); color: var(--navy); }
.settings-tabs a[aria-current="page"] { background: var(--navy); color: var(--white); font-weight: 700; }
.settings-panel > h2 { font-size: 1.35rem; margin-bottom: .8rem; }
.tile-grid { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); margin-bottom: 1.1rem; }
.tile { display: flex; flex-direction: column; gap: .3rem; padding: .95rem 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); text-decoration: none; color: var(--black); box-shadow: var(--shadow); border-top: 4px solid var(--navy); transition: box-shadow .15s, border-color .15s; }
.tile:hover { border-color: var(--navy); box-shadow: var(--shadow-lg); color: var(--black); }
.tile .ico { color: var(--navy); width: 1.5rem; height: 1.5rem; }
.tile span { color: var(--muted); font-size: .88rem; }
.rule-group { padding-top: .4rem; }
.rule-group legend { font-size: 1.05rem; color: var(--navy); }
.rule-row { padding: .45rem 0; border-bottom: 1px dashed var(--line); }
.rule-row:last-child { border-bottom: 0; }
.chip-list { display: flex; flex-wrap: wrap; gap: .45rem; }
.chip { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .75rem; border: 1.5px solid var(--line-strong); border-radius: 999px; text-decoration: none; color: var(--black); font-size: .88rem; background: var(--white); }
.chip:hover { border-color: var(--navy); color: var(--navy); }
.about-card { text-align: center; padding: 2rem 1.5rem; }
.about-card .monogram { margin: 0 auto .8rem; width: 64px; height: 64px; font-size: 1.5rem; background: var(--navy); color: var(--white); }

/* Change history */
.history li { padding-bottom: .7rem; }
.history .h-automatic::before { background: var(--warning); }
.h-head { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.h-changes { list-style: none; padding: .25rem 0 0; margin: 0; font-size: .88rem; }
.h-field { color: var(--muted); margin-right: .3rem; }
.h-before { text-decoration: line-through; color: var(--muted); }
.h-after { font-weight: 700; }

/* Report Studio */
.studio .stepbar { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .4rem; padding: 0; margin: 0 0 1rem; counter-reset: st; }
.studio .stepbar li { counter-increment: st; padding: .55rem .75rem; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--white); font-size: .9rem; color: var(--muted); }
.studio .stepbar li::before { content: counter(st); display: inline-grid; place-items: center; width: 1.45rem; height: 1.45rem; margin-right: .45rem; border-radius: 50%; background: var(--navy-100); color: var(--navy); font-weight: 700; font-size: .8rem; }
.studio .stepbar li.current { border-color: var(--navy); color: var(--black); font-weight: 700; box-shadow: 0 0 0 2px var(--navy-100); }
.studio .stepbar li.done { background: var(--success-bg); color: var(--success); border-color: #a9d8b8; }
.studio .stepbar li.done::before { content: "\2713"; background: var(--success); color: var(--white); }
.studio-top { display: grid; grid-template-columns: 1fr 2fr 1fr; gap: .9rem; }
.studio-body { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 1.1rem; align-items: start; }
.palette { position: sticky; top: 4.2rem; max-height: calc(100vh - 6rem); overflow-y: auto; }
.pal-group summary { font-weight: 700; cursor: pointer; padding: .35rem 0; }
.pal-item { display: flex; align-items: center; gap: .3rem; padding: .2rem .25rem; border-radius: var(--radius-sm); cursor: grab; }
.pal-item:hover { background: var(--navy-50); }
.pal-add { flex: 1; text-align: left; background: none; border: 0; font-family: var(--font); font-size: .9rem; color: var(--black); cursor: pointer; padding: .25rem; }
.pal-add:hover { color: var(--navy); text-decoration: underline; }
.pal-kind { font-size: .7rem; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 .25rem; }
.pal-mini { background: var(--white); border: 1px solid var(--line-strong); border-radius: 6px; font-family: var(--font); font-size: .72rem; padding: .1rem .35rem; cursor: pointer; color: var(--navy); }
.pal-mini:hover { border-color: var(--navy); background: var(--navy-50); }
.zones { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; margin-bottom: 1.1rem; }
.zones .zone { margin: 0; border: 2px dashed var(--line-strong); box-shadow: none; min-height: 7.5rem; }
.zones .zone h2 { font-size: 1rem; margin-bottom: .2rem; }
.zone.drop-ok { border-color: var(--navy); background: var(--navy-50); }
.zone-items { display: flex; flex-direction: column; gap: .4rem; margin-top: .5rem; }
.chip-item { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; padding: .35rem .5rem; background: var(--navy-50); border: 1px solid var(--navy-100); border-radius: var(--radius-sm); }
.chip-label { font-weight: 700; flex: 1 1 8rem; font-size: .9rem; }
.chip-x { background: none; border: 0; font-size: 1.15rem; line-height: 1; color: var(--danger); cursor: pointer; padding: 0 .2rem; }
.select-sm, .input-sm { min-height: 2rem; padding: .2rem .4rem; font-size: .85rem; width: auto; max-width: 12rem; }
.drop-hint { border: 1px dashed var(--line); border-radius: var(--radius-sm); padding: .5rem; text-align: center; margin: 0; }
.form-grid.compact { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.preview { min-height: 10rem; }
.studio-cta { border-left: 5px solid var(--navy); }

/* Guide reference & workflows */
.explain .lead { font-size: 1.08rem; }
.field-doc { padding: .8rem 0; border-bottom: 1px solid var(--line); }
.field-doc:last-of-type { border-bottom: 0; }
.field-doc h3 { margin-bottom: .25rem; }
.opt-list { display: grid; grid-template-columns: minmax(140px, 30%) 1fr; gap: .3rem .9rem; margin: .5rem 0 0; }
.opt-list dt { font-weight: 700; }
.opt-list dd { margin: 0; color: var(--muted); }
.options summary { cursor: pointer; color: var(--navy); font-weight: 700; font-size: .9rem; }
.def-list li { margin-bottom: .35rem; }
.flow-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--canvas); padding: .5rem; margin: .5rem 0 1rem; }
.flow { width: 100%; min-width: 640px; height: auto; font-family: var(--font); }
.flow-box { fill: var(--white); stroke: var(--navy); stroke-width: 1.5; }
.flow-num { font-size: 12px; font-weight: 700; fill: var(--navy); }
.flow-text { font-size: 11.5px; fill: var(--black); }
.flow-rule { font-size: 10.5px; font-weight: 700; fill: var(--warning); }
.flow-line { stroke: var(--navy); stroke-width: 1.6; }
.flow-arrowhead { fill: var(--navy); }
.wf-steps li { margin-bottom: .35rem; }
.rule-chip { display: inline-block; margin-left: .35rem; padding: .05rem .45rem; border-radius: 999px; background: var(--warning-bg); color: var(--warning); border: 1px solid #ebcf97; font-size: .76rem; font-weight: 700; }

@media (max-width: 1100px) {
  .studio-body { grid-template-columns: 1fr; }
  .palette { position: static; max-height: 22rem; }
}
@media (max-width: 900px) {
  .settings-layout { grid-template-columns: 1fr; }
  .settings-tabs { position: static; flex-direction: row; overflow-x: auto; }
  .settings-tabs a { white-space: nowrap; }
  .studio-top, .zones { grid-template-columns: 1fr; }
  .studio .stepbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media print { .app-footer, .settings-tabs, .palette { display: none !important; } }

/* ==========================================================================
   Release 4: live search, group pages, custom flows, keyboard shortcuts, manual
   ========================================================================== */
.topbar .search { position: relative; }
.live-results { position: absolute; left: 0; right: 0; top: calc(100% + .35rem); z-index: 70; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); max-height: 70vh; overflow-y: auto; padding: .35rem; }
.live-group + .live-group { border-top: 1px solid var(--line); margin-top: .25rem; padding-top: .25rem; }
.live-head { margin: .35rem .5rem .15rem; font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.live-option { display: flex; justify-content: space-between; gap: .75rem; padding: .45rem .6rem; border-radius: var(--radius-sm); color: var(--black); text-decoration: none; font-size: .92rem; }
.live-option:hover, .live-option[aria-selected="true"] { background: var(--navy); color: var(--white); }
.live-option[aria-selected="true"] .live-extra, .live-option:hover .live-extra { color: var(--white); }
.live-extra { font-size: .78rem; color: var(--muted); white-space: nowrap; }
.live-all { border-top: 1px dashed var(--line); margin-top: .25rem; font-weight: 700; color: var(--navy); }
.live-empty { margin: .5rem .6rem; color: var(--muted); }
.search-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.search-list li { padding: .3rem 0; border-bottom: 1px dashed var(--line); }
.search-list li:last-child { border-bottom: 0; }
kbd { font-family: var(--font); font-size: .82rem; font-weight: 700; padding: .1rem .45rem; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 6px; background: var(--navy-50); color: var(--black); white-space: nowrap; }
.shortcut-panel { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 90; width: min(460px, calc(100vw - 2rem)); max-height: 75vh; overflow-y: auto; background: var(--white); border: 1px solid var(--line); border-top: 5px solid var(--navy); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 1rem 1.1rem; }
.shortcut-panel h2 { font-size: 1.05rem; }
.shortcut-panel .btn { margin-top: .7rem; margin-right: .4rem; }
.shortcut-toast { position: fixed; left: 50%; bottom: 1.25rem; transform: translateX(-50%); z-index: 95; background: var(--navy); color: var(--white); padding: .55rem 1rem; border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); font-size: .92rem; }
.action-row { margin-bottom: .8rem; }
.rule-copy { list-style: none; padding: 0; margin: 0 0 1rem; }
.rule-copy li { padding: .45rem 0; border-bottom: 1px dashed var(--line); }
.rule-copy li form { margin-left: .4rem; }
/* Manual */
.manual-toc ol { padding-left: 1.2rem; }
.manual-toc li { margin-bottom: .3rem; }
.manual-section h2 { margin-top: 1.4rem; }
.manual-section p { max-width: 82ch; }
.manual-section .formula { font-family: var(--font); background: var(--navy-50); border-left: 4px solid var(--navy); padding: .6rem .8rem; border-radius: var(--radius-sm); margin: .6rem 0; }
.manual-example { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .8rem 1rem; margin: .8rem 0; background: var(--canvas); }
.manual-example h3 { margin-top: 0; }
.control-list li { margin-bottom: .3rem; }
.glossary dt { font-weight: 700; margin-top: .6rem; }
.glossary dd { margin: .15rem 0 0; max-width: 82ch; }
@media print { .shortcut-panel, .shortcut-toast, .live-results { display: none !important; } }

/* ==========================================================================
   Release 4.0.001: worked examples, notes toggle, visibility, overview, PDF form
   ========================================================================== */
.worked-example { border-left: 5px solid var(--navy); background: var(--white); }
.example-steps { padding-left: 1.2rem; }
.example-steps > li { margin-bottom: 1rem; }
.ex-inputs { width: auto; min-width: 18rem; margin: .35rem 0; font-size: .9rem; }
.ex-inputs td, .ex-inputs th { padding: .3rem .6rem; }
.ex-action { margin: .3rem 0; }
.ex-result { margin: .3rem 0; padding: .45rem .7rem; background: var(--success-bg); border-radius: var(--radius-sm); color: var(--black); }
.notes-block { margin-top: 1rem; padding-top: .8rem; border-top: 1px dashed var(--line); }
.notes-box { margin-top: .5rem; }
.field[hidden], [data-field][hidden] { display: none !important; }
.field-revealed { animation: field-in .25s ease-out; }
@keyframes field-in { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .field-revealed { animation: none; } }
.field-dimmed { color: var(--muted); }
.field-type { display: block; margin-top: .2rem; }
.value-pick { margin-top: .3rem; max-width: 100%; }
.pdf-export fieldset { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .5rem .7rem; margin: .4rem 0 0; }
.pdf-export legend { font-weight: 700; font-size: .9rem; }
.pdf-export .check { margin: .25rem 0; }
.saved-next a { margin-left: .4rem; }
.overview-panel .card-head h2 { margin-bottom: 0; }
.app-version { color: var(--muted); }
.load-fields { align-self: end; }

/* ---------------------------------------------------------------- release 4.0.002 */
/* Searchable drop-down (picker) */
.picker { position: relative; display: inline-block; min-width: min(14rem, 100%); max-width: 100%; }
.picker-btn { display: flex; align-items: center; justify-content: space-between; gap: .5rem; text-align: left; cursor: pointer; padding-right: 2rem; background-image: linear-gradient(45deg, transparent 50%, var(--navy) 50%), linear-gradient(135deg, var(--navy) 50%, transparent 50%); background-position: calc(100% - 15px) 55%, calc(100% - 10px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
.picker-empty .picker-text { color: var(--muted); }
.picker-hint { font-size: .75rem; color: var(--muted); white-space: nowrap; }
.picker-panel { position: absolute; z-index: 60; left: 0; top: calc(100% + .25rem); min-width: 100%; width: max-content; max-width: min(32rem, 90vw); background: var(--white); border: 1.5px solid var(--navy); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); padding: .45rem; }
.picker-search { width: 100%; max-width: none; margin-bottom: .35rem; }
.picker-list { max-height: 18rem; overflow-y: auto; }
.picker-group { margin: .45rem .25rem .15rem; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--navy); }
.picker-option { display: flex; justify-content: space-between; gap: 1rem; padding: .35rem .5rem; border-radius: 6px; cursor: pointer; }
.picker-option:hover, .picker-option.active { background: var(--navy-50); }
.picker-option[aria-selected="true"] { font-weight: 700; }
.picker-option-hint { color: var(--muted); font-size: .78rem; }
.picker-none { padding: .4rem; }

/* Condition builder */
.cond-builder { display: flex; flex-direction: column; gap: .5rem; }
.cond-group { border: 1px solid var(--line); border-left: 4px solid var(--navy); border-radius: var(--radius-sm); padding: .55rem .65rem; background: var(--white); }
.cond-group .cond-group { background: var(--navy-50); }
.cond-head { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-bottom: .4rem; }
.cond-children { display: flex; flex-direction: column; gap: .4rem; }
.cond-leaf { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.cond-value, .cond-cmp, .date-editor { display: inline-flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
.cond-related { border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); padding: .45rem; background: var(--canvas); }
.cond-where { margin-top: .35rem; padding-left: .8rem; }
.cond-summary { margin: .3rem 0 0; font-style: italic; color: var(--navy-700); }
.cond-errors { margin: 0; padding-left: 1.2rem; color: var(--danger); font-size: .88rem; }
.check-grid { display: inline-flex; flex-wrap: wrap; gap: .25rem .7rem; border: 0; padding: 0; margin: 0; }
.num-sm { width: 5.5rem !important; }

/* Flow builder */
.step-card h2 { display: flex; align-items: center; gap: .55rem; }
.step-no { display: inline-grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: 50%; background: var(--navy); color: var(--white); font-size: .95rem; }
.action-row { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .6rem .8rem; margin-bottom: .6rem; }
.only-if { margin-top: .45rem; }
.flow-summary { background: var(--navy-50); border-radius: var(--radius-sm); padding: .6rem .8rem; }

/* Report Studio reordering */
.chip-item[draggable="true"] { cursor: grab; }
.chip-item.dragging { opacity: .45; }
.chip-handle { color: var(--muted); font-size: .85rem; }
.chip-move { color: var(--navy); font-size: .95rem; }
.summary-maker { border: 1.5px solid var(--navy); }

/* Bulk actions */
.bulk-bar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; padding: .55rem .8rem; }
.bulk-col { width: 2.2rem; }
.adv-filter summary { cursor: pointer; }
.saved-filters { margin: .5rem 0; align-items: center; }

/* Next steps */
.next-steps { border-top: 4px solid var(--navy); }
.next-list { list-style: none; margin: 0 0 .5rem; padding: 0; display: flex; flex-direction: column; gap: .45rem; }
.next-list .btn { white-space: normal; text-align: left; }
@media print { .next-steps, .bulk-col, .bulk-bar, .adv-filter { display: none !important; } }

/* ---------------------------------------------------------------- release 4.1.000 */
.multipicker { border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); padding: .35rem; background: var(--white); position: relative; }
.multipicker:focus-within { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(0, 0, 128, .22); }
.mp-chips { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: .3rem; }
.mp-chip { display: inline-flex; align-items: center; gap: .25rem; background: var(--navy-50); border: 1px solid var(--navy-100); border-radius: 999px; padding: .1rem .2rem .1rem .6rem; font-size: .85rem; }
.mp-x { background: none; border: 0; color: var(--danger); font-size: 1rem; cursor: pointer; padding: 0 .3rem; line-height: 1; }
.mp-search { width: 100%; max-width: none; }
.mp-list { position: absolute; left: 0; right: 0; top: 100%; z-index: 60; background: var(--white); border: 1.5px solid var(--navy); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); max-height: 16rem; overflow-y: auto; padding: .25rem; }
.mp-option { padding: .35rem .5rem; border-radius: 6px; cursor: pointer; }
.mp-option:hover { background: var(--navy-50); }
.link-list { list-style: none; margin: 0 0 .6rem; padding: 0; display: flex; flex-direction: column; gap: .3rem; }
.link-list li { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.link-add { display: flex; flex-direction: column; gap: .4rem; max-width: 40rem; }
.link-add label { font-weight: 700; font-size: .9rem; }
.info-panel.panel-warn { border-left: 5px solid var(--warning); background: var(--warning-bg); }
.info-panel.panel-good { border-left: 5px solid var(--success); }
.gantt rect.crit { stroke: var(--danger); stroke-width: 2.5; }
.achieve-table td, .achieve-table th { vertical-align: top; }
.coa-tree { list-style: none; padding-left: 0; margin: 0; }
.coa-tree ul { list-style: none; padding-left: 1.4rem; margin: .2rem 0; border-left: 2px dotted var(--line); }
.coa-node { display: flex; align-items: center; gap: .4rem; padding: .25rem .4rem; border-radius: 6px; }
.coa-node[draggable="true"] { cursor: grab; }
.coa-node.drop-target { background: var(--navy-50); outline: 2px dashed var(--navy); }
.coa-node.dragging { opacity: .4; }
.coa-group > .coa-node { font-weight: 700; }
.coa-node .coa-code { font-family: ui-monospace, monospace; color: var(--muted); }
.fin-table td.num, .fin-table th.num { text-align: right; white-space: nowrap; }
.fin-table tr.fin-group td { font-weight: 700; background: var(--navy-50); }
.fin-table tr.fin-total td { font-weight: 700; border-top: 2px solid var(--navy); }
.fin-indent-1 td:first-child { padding-left: 1.4rem; }
.fin-indent-2 td:first-child { padding-left: 2.6rem; }
.fin-indent-3 td:first-child { padding-left: 3.8rem; }
.fin-indent-4 td:first-child { padding-left: 5rem; }
.alloc-rows .alloc-row { display: flex; gap: .5rem; align-items: end; flex-wrap: wrap; margin-bottom: .4rem; }

/* ---------------------------------------------------------------- release 4.2.000 */
.nav details.nav-sub { margin: 0 0 .1rem 1.4rem; }
.nav details.nav-sub > summary { font-weight: 600; font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; opacity: .75; padding: .35rem .7rem; margin-top: .1rem; }
.nav details.nav-sub a { padding-left: 1.2rem; font-size: .88rem; }
select.picker-native { position: absolute !important; width: 1px !important; height: 1px !important; min-height: 0 !important; padding: 0 !important; margin: 0 !important; border: 0 !important; opacity: 0; pointer-events: none; overflow: hidden; }
[data-field], .field, .filters .field { position: relative; }
.statement .st-label { white-space: nowrap; }
.statement tr.depth-0 .st-label { padding-left: 0.60rem; }
.statement tr.depth-1 .st-label { padding-left: 1.85rem; }
.statement tr.depth-2 .st-label { padding-left: 3.10rem; }
.statement tr.depth-3 .st-label { padding-left: 4.35rem; }
.statement tr.depth-4 .st-label { padding-left: 5.60rem; }
.statement tr.depth-5 .st-label { padding-left: 6.85rem; }
.statement tr.depth-6 .st-label { padding-left: 8.10rem; }
.statement tr.depth-7 .st-label { padding-left: 9.35rem; }
.statement tr.depth-8 .st-label { padding-left: 10.60rem; }
.statement tr.fin-group td { background: var(--navy-50); font-weight: 700; }
.statement tr.fin-group.depth-0 td { background: var(--navy-100); }
.st-toggle { background: none; border: 0; cursor: pointer; padding: 0 .3rem 0 0; color: var(--navy); vertical-align: middle; }
.st-toggle .ico { width: .9rem; height: .9rem; transition: transform .15s; transform: rotate(90deg); }
.st-toggle[aria-expanded="false"] .ico { transform: rotate(0deg); }
.st-spacer { display: inline-block; width: 1.2rem; }
.st-amount { color: inherit; text-decoration: none; border-bottom: 1px dotted var(--line-strong); }
.st-amount:hover { color: var(--navy); border-bottom-color: var(--navy); }
.tb-closing-only .tb-opt { display: none; }
.st-tools { margin-bottom: .6rem; align-items: center; }
@media print { .statement tr[hidden] { display: none; } .st-toggle { display: none; } .st-amount { border: 0; } }
.coa-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(16rem, 1fr); gap: 1rem; align-items: start; }
@media (max-width: 900px) { .coa-layout { grid-template-columns: minmax(0, 1fr); } }
.coa-detail { position: sticky; top: 1rem; }
.coa-tools { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .6rem; }
.coa-tools .input { flex: 1; min-width: 12rem; max-width: none; }
.coa-tree ul { border-left: 1px solid var(--line); margin-left: .55rem; padding-left: .9rem; }
.coa-node { border: 1px solid transparent; }
.coa-node:hover { background: var(--navy-50); }
.coa-node.selected { background: var(--navy-50); border-color: var(--navy); }
.coa-node.coa-hidden .coa-name { opacity: .55; }
.coa-name { color: var(--ink); text-decoration: none; display: inline-flex; gap: .4rem; align-items: center; flex: 1; min-width: 0; }
.coa-name:hover { color: var(--navy); }
.coa-meta { display: inline-flex; gap: .45rem; align-items: center; margin-left: auto; }
.coa-amt { font-variant-numeric: tabular-nums; min-width: 7rem; text-align: right; font-weight: 600; }
.coa-arrows { opacity: .35; }
.coa-node:hover .coa-arrows, .coa-node:focus-within .coa-arrows { opacity: 1; }
.coa-fold { background: none; border: 0; padding: 0; cursor: pointer; color: var(--navy); display: inline-flex; }
.coa-fold .ico { width: .9rem; height: .9rem; transform: rotate(90deg); transition: transform .15s; }
.coa-fold[aria-expanded="false"] .ico { transform: rotate(0deg); }
.coa-fold-spacer { display: inline-block; width: .9rem; }
.nature { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: .1rem .45rem; border-radius: 999px; color: #fff; }
.nature-asset { background: #1f6f43; } .nature-liability { background: #9a3412; } .nature-equity { background: #3d47a6; } .nature-income { background: #0f766e; } .nature-expense { background: #7c2d12; }
.coa-legend { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.report-actions { margin-bottom: .8rem; }
.kpi.kpi-bad { border-left-color: var(--danger); }
meter.bar { width: 6rem; height: .6rem; vertical-align: middle; }
/* 4.2.000: pickers replacing form and filter drop-downs fill their field and never widen the page on phones. */
.field > .picker, .filters .picker, [data-field] > .picker { display: block; width: 100%; min-width: 0; }
.picker-btn { max-width: 100%; overflow: hidden; }
.picker-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* Release 4.2.003: Configuration impact screen, next steps after a save (4.2.004: the ⓘ beside form labels was removed) */
.impact-tree, .impact-tree ul { list-style: none; margin: 0; padding-left: 1.1rem; border-left: 2px solid var(--line); }
.impact-tree { padding-left: .4rem; }
.impact-tree li { margin: .35rem 0; }
.impact-tree .how { color: var(--muted); font-size: .85rem; }
.impact-tree .kind { font-size: .75rem; }
.impact-diff-added { color: var(--success); }
.impact-diff-removed { color: var(--danger); }
.next-steps.just-saved { border-color: var(--navy); box-shadow: 0 0 0 2px var(--navy-100); }
.create-row .select { max-width: 14rem; }
.guide-clips { display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: .75rem; margin: .5rem 0 1rem; }
.guide-clips figure { margin: 0; border: 1px solid var(--line); border-radius: .4rem; background: var(--white); padding: .35rem; }
.guide-clips img { width: 100%; height: auto; display: block; }
.guide-clips figcaption { font-size: .85rem; color: var(--muted); margin-top: .3rem; }
/* 4.2.003 (B14): an element with the hidden attribute stays hidden even when its class sets a display (an .alert is
   flex), so notes such as "More conditions than the limit (0)" no longer show on every condition builder. */
[hidden] { display: none !important; }

/* Release 4.2.004: your logo, grouped settings, wider search, fields button, report exports, chart of accounts */
.brand-logo { width: 40px; height: 40px; object-fit: contain; border-radius: 8px; background: var(--white); flex: none; }
.brand-preview { display: flex; align-items: center; gap: .6rem; padding: .6rem .8rem; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); margin: .5rem 0 1rem; max-width: 26rem; }
.brand-preview .brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-preview .brand-text span { font-size: .8rem; color: var(--muted); }
.settings-group-label { margin: .7rem .65rem .2rem; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.settings-home-link { border-bottom: 1px solid var(--line); margin-bottom: .2rem; }
.settings-overview { display: grid; grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr)); gap: 1rem; }
.settings-group h2 { font-size: 1.05rem; margin: 0 0 .5rem; }
.settings-group-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .25rem; }
.settings-group-list a { display: flex; gap: .6rem; align-items: flex-start; padding: .5rem; border-radius: var(--radius-sm); text-decoration: none; color: var(--black); }
.settings-group-list a:hover, .settings-group-list a:focus { background: var(--navy-50); color: var(--navy); }
.settings-group-list a > span { display: flex; flex-direction: column; }
.page-fields-btn { position: fixed; right: 1.1rem; bottom: 1.1rem; z-index: 40; box-shadow: var(--shadow); }
.report-export { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: flex-end; margin: 0 0 .6rem; }
.coa-table td.num, .coa-table th.num { text-align: right; white-space: nowrap; }
.coa-table .lvl-1 td:first-child { padding-left: 1.4rem; }
.coa-table .lvl-2 td:first-child { padding-left: 2.6rem; }
.coa-table .lvl-3 td:first-child { padding-left: 3.8rem; }
.coa-table .lvl-4 td:first-child, .coa-table .lvl-5 td:first-child, .coa-table .lvl-6 td:first-child { padding-left: 5rem; }
.coa-table td:nth-child(2) { min-width: 14rem; }
.view-switch { display: flex; gap: .4rem; margin: 0 0 .75rem; }
.coa-node .coa-name { flex: 1 1 auto; min-width: 0; }
.coa-meta { display: flex; align-items: center; gap: .5rem; margin-left: auto; }
.coa-badges { display: inline-flex; gap: .25rem; justify-content: flex-end; }
.coa-count { width: 4.5rem; text-align: right; }
.coa-amt { width: 8.5rem; text-align: right; font-variant-numeric: tabular-nums; }
.coa-arrows { width: 3.6rem; display: inline-flex; justify-content: flex-end; }
.coa-meta, .coa-badges, .coa-count, .coa-amt, .coa-arrows { flex: none; }
.coa-node .coa-name { overflow-wrap: anywhere; }
.coa-head { display: grid; grid-template-columns: 1fr 4.5rem 8.5rem 3.6rem; gap: .5rem; padding: .3rem .4rem .3rem 1.9rem; border-bottom: 1px solid var(--line); font-size: .78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.coa-head .num { text-align: right; }
.sa-table td { vertical-align: middle; }
.sa-table .sa-current code { margin-right: .35rem; }
.sa-form { position: relative; display: grid; grid-template-columns: minmax(12rem, 1fr) 9.5rem auto; gap: .4rem; align-items: center; }
.coa-table tr.is-group td { font-weight: 700; background: var(--navy-50); }
.coa-table code { font-size: .85rem; }
@media print { .page-fields-btn, .report-export { display: none !important; } }
@media (max-width: 700px) { /* 4.2.004: the chart fits a phone */
  .coa-head, .coa-count { display: none; }
  .coa-badges { min-width: 0; }
  .coa-amt { width: auto; min-width: 0; }
  .coa-arrows { width: auto; }
  .coa-node { flex-wrap: wrap; }
}

/* 4.3.000: Email Centre and Template Studio */
.studio-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 320px); gap: 16px; align-items: start; }
.studio-layout > * { min-width: 0; }
.block-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 10px; }
.block-item { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px; background: var(--surface); cursor: grab; }
.block-item:focus { outline: 3px solid var(--focus); outline-offset: 2px; }
.block-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.placeholder-panel { position: sticky; top: 12px; max-height: 80vh; overflow: auto; }
.ph-list { list-style: none; margin: 8px 0 0; padding: 0; }
.ph-group { font-weight: bold; margin: 10px 0 4px; color: var(--navy); }
.ph-btn { display: block; width: 100%; text-align: left; white-space: normal; overflow-wrap: anywhere; }
.rec-role { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px; margin: 0 0 8px; min-width: 0; }
.rec-rule { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.rec-rule > * { min-width: 0; max-width: 100%; }
.email-preview { width: 100%; min-height: 480px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--white); margin-top: 12px; }
.email-text { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--canvas); padding: 12px; border-radius: var(--radius-sm); }
.secret-once { font-size: 1.2em; user-select: all; }
.inline-pw { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
@media (max-width: 900px) { .studio-layout { grid-template-columns: minmax(0, 1fr); } .placeholder-panel { position: static; max-height: none; } }
.provider-card code, .provider-card .help { overflow-wrap: anywhere; word-break: break-word; }
.provider-card select { max-width: 100%; }

/* Release 4.4.000: my dashboards, charts, comparisons, reconciliation, scheduler, health */
:root { --chart-4: #2f6f9f; --chart-5: #7a4a00; --chart-6: #0b6b2e; --chart-7: #6b2fa0; --chart-8: #a1001d; --heat-0: #ffffff; }
.fill-s1, .chart .bar.fill-s1, .chart .slice.fill-s1, .chart .tile.fill-s1, .chart .area.fill-s1, .chart .point.fill-s1, .swatch.fill-s1 { fill: var(--chart-1); background: var(--chart-1); }
.chart .stroke-s1 { stroke: var(--chart-1); }
.fill-s2, .chart .bar.fill-s2, .chart .slice.fill-s2, .chart .tile.fill-s2, .chart .area.fill-s2, .chart .point.fill-s2, .swatch.fill-s2 { fill: var(--chart-2); background: var(--chart-2); }
.chart .stroke-s2 { stroke: var(--chart-2); }
.fill-s3, .chart .bar.fill-s3, .chart .slice.fill-s3, .chart .tile.fill-s3, .chart .area.fill-s3, .chart .point.fill-s3, .swatch.fill-s3 { fill: var(--chart-3); background: var(--chart-3); }
.chart .stroke-s3 { stroke: var(--chart-3); }
.fill-s4, .chart .bar.fill-s4, .chart .slice.fill-s4, .chart .tile.fill-s4, .chart .area.fill-s4, .chart .point.fill-s4, .swatch.fill-s4 { fill: var(--chart-4); background: var(--chart-4); }
.chart .stroke-s4 { stroke: var(--chart-4); }
.fill-s5, .chart .bar.fill-s5, .chart .slice.fill-s5, .chart .tile.fill-s5, .chart .area.fill-s5, .chart .point.fill-s5, .swatch.fill-s5 { fill: var(--chart-5); background: var(--chart-5); }
.chart .stroke-s5 { stroke: var(--chart-5); }
.fill-s6, .chart .bar.fill-s6, .chart .slice.fill-s6, .chart .tile.fill-s6, .chart .area.fill-s6, .chart .point.fill-s6, .swatch.fill-s6 { fill: var(--chart-6); background: var(--chart-6); }
.chart .stroke-s6 { stroke: var(--chart-6); }
.fill-s7, .chart .bar.fill-s7, .chart .slice.fill-s7, .chart .tile.fill-s7, .chart .area.fill-s7, .chart .point.fill-s7, .swatch.fill-s7 { fill: var(--chart-7); background: var(--chart-7); }
.chart .stroke-s7 { stroke: var(--chart-7); }
.fill-s8, .chart .bar.fill-s8, .chart .slice.fill-s8, .chart .tile.fill-s8, .chart .area.fill-s8, .chart .point.fill-s8, .swatch.fill-s8 { fill: var(--chart-8); background: var(--chart-8); }
.chart .stroke-s8 { stroke: var(--chart-8); }
.chart .area { opacity: .25; stroke: none; }
.chart .slice, .chart .tile { stroke: var(--white); stroke-width: 1.5; }
.chart .bar-up { fill: var(--success); } .chart .bar-down { fill: var(--danger); }
.chart .gauge-track { fill: var(--line); }
.chart .on-bar { fill: var(--white); font-size: 11px; }
.chart .kpi-small { fill: var(--navy); font-size: 22px; font-weight: 700; }
.chart a:focus-visible > * { outline: 2px solid var(--focus); }
.chart-legend { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem 1rem; padding: 0; margin: .4rem 0 0; font-size: .85rem; }
.chart-legend .swatch { display: inline-block; width: .8rem; height: .8rem; border-radius: 2px; margin-right: .35rem; vertical-align: middle; }
.kpi-row { display: flex; flex-wrap: wrap; gap: .75rem; }
.kpi-link { text-decoration: none; color: inherit; }
.kpi .kpi-value { font-size: 1.8rem; font-weight: 700; color: var(--navy); } .kpi .kpi-label { color: var(--muted); }
.kpi-delta.up { color: var(--success); } .kpi-delta.down { color: var(--danger); }
.progress-list { list-style: none; padding: 0; } .progress-list li { display: grid; grid-template-columns: 10rem 1fr 3rem; gap: .5rem; align-items: center; }
.progress-list progress { width: 100%; accent-color: var(--navy); }
.heat-0 { background: color-mix(in srgb, var(--navy) 0%, var(--white));  }
.heat-1 { background: color-mix(in srgb, var(--navy) 14%, var(--white));  }
.heat-2 { background: color-mix(in srgb, var(--navy) 28%, var(--white));  }
.heat-3 { background: color-mix(in srgb, var(--navy) 42%, var(--white));  }
.heat-4 { background: color-mix(in srgb, var(--navy) 56%, var(--white)); color: var(--white); }
.heat-5 { background: color-mix(in srgb, var(--navy) 70%, var(--white)); color: var(--white); }
.dash-grid { display: grid; grid-template-columns: repeat(12, 1fr); grid-auto-rows: 48px; gap: .75rem; }
.dash-w { overflow: auto; position: relative; margin: 0; }
.dash-grid.editing .dash-handle { cursor: move; } .dash-w.dragging { box-shadow: var(--shadow-lg); opacity: .9; }
.dash-resize { position: absolute; right: 2px; bottom: 2px; width: 14px; height: 14px; cursor: nwse-resize; border-right: 3px solid var(--navy); border-bottom: 3px solid var(--navy); }
.gc-1 { grid-column-start: 1; } .gw-1 { grid-column-end: span 1; }
.gc-2 { grid-column-start: 2; } .gw-2 { grid-column-end: span 2; }
.gc-3 { grid-column-start: 3; } .gw-3 { grid-column-end: span 3; }
.gc-4 { grid-column-start: 4; } .gw-4 { grid-column-end: span 4; }
.gc-5 { grid-column-start: 5; } .gw-5 { grid-column-end: span 5; }
.gc-6 { grid-column-start: 6; } .gw-6 { grid-column-end: span 6; }
.gc-7 { grid-column-start: 7; } .gw-7 { grid-column-end: span 7; }
.gc-8 { grid-column-start: 8; } .gw-8 { grid-column-end: span 8; }
.gc-9 { grid-column-start: 9; } .gw-9 { grid-column-end: span 9; }
.gc-10 { grid-column-start: 10; } .gw-10 { grid-column-end: span 10; }
.gc-11 { grid-column-start: 11; } .gw-11 { grid-column-end: span 11; }
.gc-12 { grid-column-start: 12; } .gw-12 { grid-column-end: span 12; }
.gr-1 { grid-row-start: 1; }
.gr-2 { grid-row-start: 2; }
.gr-3 { grid-row-start: 3; }
.gr-4 { grid-row-start: 4; }
.gr-5 { grid-row-start: 5; }
.gr-6 { grid-row-start: 6; }
.gr-7 { grid-row-start: 7; }
.gr-8 { grid-row-start: 8; }
.gr-9 { grid-row-start: 9; }
.gr-10 { grid-row-start: 10; }
.gr-11 { grid-row-start: 11; }
.gr-12 { grid-row-start: 12; }
.gr-13 { grid-row-start: 13; }
.gr-14 { grid-row-start: 14; }
.gr-15 { grid-row-start: 15; }
.gr-16 { grid-row-start: 16; }
.gr-17 { grid-row-start: 17; }
.gr-18 { grid-row-start: 18; }
.gr-19 { grid-row-start: 19; }
.gr-20 { grid-row-start: 20; }
.gr-21 { grid-row-start: 21; }
.gr-22 { grid-row-start: 22; }
.gr-23 { grid-row-start: 23; }
.gr-24 { grid-row-start: 24; }
.gr-25 { grid-row-start: 25; }
.gr-26 { grid-row-start: 26; }
.gr-27 { grid-row-start: 27; }
.gr-28 { grid-row-start: 28; }
.gr-29 { grid-row-start: 29; }
.gr-30 { grid-row-start: 30; }
.gr-31 { grid-row-start: 31; }
.gr-32 { grid-row-start: 32; }
.gr-33 { grid-row-start: 33; }
.gr-34 { grid-row-start: 34; }
.gr-35 { grid-row-start: 35; }
.gr-36 { grid-row-start: 36; }
.gr-37 { grid-row-start: 37; }
.gr-38 { grid-row-start: 38; }
.gr-39 { grid-row-start: 39; }
.gr-40 { grid-row-start: 40; }
.gr-41 { grid-row-start: 41; }
.gr-42 { grid-row-start: 42; }
.gr-43 { grid-row-start: 43; }
.gr-44 { grid-row-start: 44; }
.gr-45 { grid-row-start: 45; }
.gr-46 { grid-row-start: 46; }
.gr-47 { grid-row-start: 47; }
.gr-48 { grid-row-start: 48; }
.gr-49 { grid-row-start: 49; }
.gr-50 { grid-row-start: 50; }
.gr-51 { grid-row-start: 51; }
.gr-52 { grid-row-start: 52; }
.gr-53 { grid-row-start: 53; }
.gr-54 { grid-row-start: 54; }
.gr-55 { grid-row-start: 55; }
.gr-56 { grid-row-start: 56; }
.gr-57 { grid-row-start: 57; }
.gr-58 { grid-row-start: 58; }
.gr-59 { grid-row-start: 59; }
.gr-60 { grid-row-start: 60; }
.gh-1 { grid-row-end: span 1; }
.gh-2 { grid-row-end: span 2; }
.gh-3 { grid-row-end: span 3; }
.gh-4 { grid-row-end: span 4; }
.gh-5 { grid-row-end: span 5; }
.gh-6 { grid-row-end: span 6; }
.gh-7 { grid-row-end: span 7; }
.gh-8 { grid-row-end: span 8; }
.gh-9 { grid-row-end: span 9; }
.gh-10 { grid-row-end: span 10; }
.gh-11 { grid-row-end: span 11; }
.gh-12 { grid-row-end: span 12; }
.gh-13 { grid-row-end: span 13; }
.gh-14 { grid-row-end: span 14; }
.gh-15 { grid-row-end: span 15; }
.gh-16 { grid-row-end: span 16; }
.gh-17 { grid-row-end: span 17; }
.gh-18 { grid-row-end: span 18; }
.gh-19 { grid-row-end: span 19; }
.gh-20 { grid-row-end: span 20; }
.gh-21 { grid-row-end: span 21; }
.gh-22 { grid-row-end: span 22; }
.gh-23 { grid-row-end: span 23; }
.gh-24 { grid-row-end: span 24; }
@media (max-width: 900px) { .dash-grid { display: block; } .dash-w { margin-bottom: .75rem; min-height: 200px; } }
.tabs { display: flex; flex-wrap: wrap; gap: .25rem; margin: .5rem 0 1rem; border-bottom: 1px solid var(--line); }
.tabs .tab { padding: .45rem .9rem; text-decoration: none; color: var(--navy); border-bottom: 3px solid transparent; }
.tabs .tab.active { border-bottom-color: var(--navy); font-weight: 700; }
.filters-bar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.table.compare tr.differs th { color: var(--warning); } .table.compare td.best { font-weight: 700; color: var(--success); }
.row-best { background: var(--success-bg); }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: .25rem 1rem; max-height: 24rem; overflow: auto; }
.card.sub { border: 1px solid var(--line); box-shadow: none; }
.cols-3 { columns: 3 16rem; }
.health-ok { color: var(--success); } .health-warn { color: var(--warning); } .health-bad { color: var(--danger); }
@media print { .dash-grid { display: block; } .dash-resize, .filters-bar { display: none; } }

/* 4.5.000: drag-and-drop order on lists */
.reorder-col { white-space: nowrap; width: 1%; }
.drag-handle { cursor: grab; color: var(--muted); padding: 0 .25rem; user-select: none; }
tr.dragging { opacity: .5; }
.error-text { font-weight: 700; }

/* 4.5.000 (Q32): larger guide pictures that open full screen with zoom and pan */
.guide-clips { grid-template-columns: 1fr; }
.guide-clips img.zoomable { cursor: zoom-in; }
.zoom-view { position: fixed; inset: 0; z-index: 1000; background: var(--white); display: flex; flex-direction: column; }
.zoom-view[hidden] { display: none; }
.zoom-bar { display: flex; gap: .4rem; align-items: center; padding: .5rem 1rem; border-bottom: 1px solid var(--line); }
.zoom-level { margin-left: auto; color: var(--muted); }
.zoom-caption { margin: .25rem 1rem; color: var(--muted); }
.zoom-stage { flex: 1; overflow: hidden; display: flex; align-items: center; justify-content: center; cursor: grab; touch-action: none; }
.zoom-stage img { max-width: none; transform-origin: center center; user-select: none; }
body.zoom-open { overflow: hidden; }

/* 4.5.000: formula editor */
.formula-tools { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .35rem; }
.formula-tools .field { min-width: 16rem; flex: 1; }
tr.row-changed td { background: var(--navy-50); }

/* 4.5.000 (Q51): status colours chosen in Status lists */
.badge-info { background: var(--navy-50); color: var(--navy-700); border-color: var(--line-strong); }
.badge-muted { background: var(--white); color: var(--muted); border-color: var(--line); }

/* 4.5.000 (Q23): several lines on one screen */
.lines-table td { vertical-align: top; min-width: 8rem; }
.lines-table td .input, .lines-table td .select { width: 100%; }

/* 4.5.000 instalment 3: formulas in any field */
.fx-suggest { position: absolute; z-index: 900; margin: 0; padding: .25rem 0; list-style: none; background: var(--white); border: 1px solid var(--line-strong); border-radius: .3rem; max-height: 18rem; overflow-y: auto; box-shadow: 0 4px 14px rgba(0, 0, 0, .12); }
.fx-suggest li { padding: .3rem .6rem; cursor: pointer; }
.fx-suggest li span { color: var(--muted); font-size: .85rem; }
.fx-suggest li.on { background: var(--navy-50); }
.quick-dialog { max-width: 52rem; width: 92vw; border: 1px solid var(--line-strong); border-radius: .5rem; padding: 1rem; }
.quick-dialog::backdrop { background: rgba(0, 0, 0, .35); }
.code-piece { display: flex; flex-wrap: wrap; gap: .5rem; align-items: end; padding: .5rem; border: 1px solid var(--line); border-radius: .35rem; margin-bottom: .4rem; background: var(--white); }
.code-piece .field { min-width: 10rem; }

/* 4.5.000 instalment 3 (Q65): visual JSON */
.json-builder .json-node { display: flex; flex-wrap: wrap; gap: .35rem; align-items: flex-start; }
.json-builder .json-children { width: 100%; padding-left: 1rem; border-left: 2px solid var(--navy-100); margin: .25rem 0; }
.json-row { display: flex; flex-wrap: wrap; gap: .35rem; align-items: flex-start; margin: .2rem 0; }
.json-key { max-width: 12rem; }
.json-raw { background: var(--navy-50); padding: .5rem; border-radius: .3rem; max-height: 16rem; overflow: auto; font-size: .85rem; }
.json-value { display: inline-flex; gap: .35rem; flex-wrap: wrap; }
.input-sm { padding: .25rem .4rem; font-size: .9rem; }
.step-bar ol { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; padding: 0; margin: 0 0 .75rem; }
.step-bar a { display: inline-block; padding: .3rem .7rem; border: 1px solid var(--line-strong); border-radius: 1rem; text-decoration: none; }
.rpt-group th { background: var(--navy-50); text-align: left; }
.rpt-l1 th { padding-left: 1.5rem; }
.rpt-l2 th { padding-left: 2.5rem; }
th.band { text-align: center; border-bottom: 2px solid var(--navy-100); }

/* 4.5.000 final: Fields & formulas panel */
dialog.field-ref { width: min(64rem, 94vw); max-height: 86vh; border: 1px solid var(--line-strong); border-radius: .5rem; padding: 1rem; }
dialog.field-ref::backdrop { background: rgba(0, 0, 0, .35); }
.field-ref-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.nowrap { white-space: nowrap; }
.qr-box svg { width: 14rem; height: 14rem; background: #fff; padding: .5rem; }
.recovery-codes { columns: 2; font-size: 1.1rem; }
/* 4.5.000: inbox */
.mail-text { white-space: pre-wrap; font-family: inherit; max-height: 60vh; overflow: auto; }
.mail-frame { width: 100%; height: 60vh; border: 1px solid var(--line); }
tr.row-unread td { font-weight: 700; }
ul.plain { list-style: none; padding: 0; }

/* 4.5.000 (Q116): progress overlay while the sample project loads or is removed */
.sample-overlay { position: fixed; inset: 0; z-index: 2000; background: rgba(0, 0, 40, .55); display: flex; align-items: center; justify-content: center; }
.sample-overlay-box { background: var(--white); border-radius: .6rem; padding: 1.5rem 2rem; width: min(34rem, 92vw); box-shadow: 0 10px 30px rgba(0, 0, 0, .3); }
.sample-bar { height: .8rem; background: var(--navy-50); border-radius: .4rem; overflow: hidden; margin: .8rem 0 .4rem; }
.sample-bar span { display: block; height: 100%; width: 0; background: var(--navy); transition: width .6s ease; }
@media (prefers-reduced-motion: reduce) { .sample-bar span { transition: none; } }

/* 4.5.001: Compose - address suggestions and the formatted body */
.addr-wrap { position: relative; }
.addr-list { position: absolute; z-index: 30; left: 0; right: 0; margin: 2px 0 0; padding: 4px 0; list-style: none; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); box-shadow: 0 4px 12px var(--line); max-height: 18rem; overflow-y: auto; }
.addr-list li { padding: 6px 10px; cursor: pointer; }
.addr-list li[aria-selected="true"], .addr-list li:hover { background: var(--canvas); }
.addr-list .addr-src { font-size: .85em; color: var(--muted); }
.rte-bar { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 4px; }
.rte { min-height: 14rem; padding: 10px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); overflow-wrap: anywhere; }
.rte:focus { outline: 2px solid var(--navy); outline-offset: 1px; }
