/* Bond Issuance Planner — design system
 * Layout language blended from Artem's two templates (NOT 1:1, re-skinned):
 *  - Subly: light dashboard, white rounded cards, black vertical icon rail,
 *    top pill nav, big KPI numbers with green delta, gradient bar/donut charts.
 *  - Finor: dark navy page background, light cards, top ticker strip,
 *    line chart with tooltip, profits donut, distribution bars, asset lists.
 * Palette: Erthiox prestige dark #111622 / gold #C5A880 / #B89047,
 * blue accent #1a73e8, plan navy #0B1F3A, syndicate blue #143A6B.
 * No native <select>, no native alert/confirm, no default scrollbars anywhere.
 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Outfit:wght@500;600;700;800&display=swap');

:root {
  --navy: #0B1F3A;
  --navy-2: #111622;
  --blue: #143A6B;
  --accent: #1a73e8;
  --accent-dark: #0d47a1;
  --gold: #C5A880;
  --gold-dark: #B89047;
  --cream: #FCFBF9;
  --bg: #F7F8FA;
  --surface: #FFFFFF;
  --ink: #1A2332;
  --muted: #44536A;
  --slate: #5A606C;
  --border: #B9C2CF;
  --border-soft: #E8E5DF;
  --divider: #F1EFEA;
  --green: #1E7A46;
  --green-bg: #E7F4EC;
  --red: #B3261E;
  --red-bg: #FBEAEA;
  --amber: #9A6B1F;
  --amber-bg: #FBF3E2;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-1: 0 4px 20px rgba(17, 22, 34, .04), 0 1px 3px rgba(17, 22, 34, .05);
  --shadow-2: 0 10px 30px rgba(17, 22, 34, .07), 0 2px 8px rgba(17, 22, 34, .04);
  --header-h: 64px;
  --rail-w: 76px;
  --font-base: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-head: 'Outfit', 'Inter', sans-serif;
  --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-base);
  background: var(--navy);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 700; line-height: 1.2; letter-spacing: -.01em; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; cursor: pointer; }
input, textarea { font-family: inherit; font-size: 15px; }
img { max-width: 100%; }
.num, .kpi-value, td.money, .mono { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); font-size: .92em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---- custom scrollbars (rule 2) ---- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--divider); }
::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 8px; border: 2px solid var(--divider); }
::-webkit-scrollbar-thumb:hover { background: var(--gold-dark); }
* { scrollbar-width: thin; scrollbar-color: var(--gold) var(--divider); }

/* ============ APP SHELL (Finor dark-navy frame + Subly rail) ============ */
#app-shell { display: none; min-height: 100vh; background: var(--navy); }
#app-shell.on { display: flex; }
.rail {
  width: var(--rail-w); flex: 0 0 var(--rail-w);
  background: var(--navy-2); display: flex; flex-direction: column; align-items: center;
  padding: 14px 0; gap: 6px; position: sticky; top: 0; height: 100vh; z-index: 40;
}
.rail-logo { width: 44px; height: 44px; border-radius: 12px; background: #fff; display: grid; place-items: center; margin-bottom: 10px; padding: 5px; }
.rail-logo img { width: 100%; height: 100%; object-fit: contain; }
.rail-btn {
  width: 52px; height: 52px; border: 0; border-radius: 14px; background: transparent;
  color: #9AA5B8; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; font-size: 10px; font-weight: 600; letter-spacing: .02em;
}
.rail-btn svg { width: 21px; height: 21px; }
.rail-btn:hover { background: rgba(255,255,255,.08); color: #fff; }
.rail-btn.active { background: var(--gold-dark); color: #fff; }
.rail-spacer { flex: 1; }
.rail-user { width: 40px; height: 40px; border-radius: 50%; background: var(--gold); color: var(--navy-2); border: 0; font-weight: 800; font-size: 14px; display: grid; place-items: center; }

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg); border-radius: 24px 0 0 0; overflow: hidden; }
.app-topbar {
  height: var(--header-h); background: var(--surface); border-bottom: 1px solid var(--border-soft);
  display: flex; align-items: center; gap: 14px; padding: 0 22px; position: sticky; top: 0; z-index: 30;
}
.app-topbar .brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-head); font-weight: 800; font-size: 17px; color: var(--navy-2); white-space: nowrap; }
.app-topbar .brand img { width: 34px; height: 34px; }
.app-topbar .brand small { display: block; font-family: var(--font-base); font-weight: 600; font-size: 11px; color: var(--slate); }
.pill-nav { display: flex; gap: 4px; background: var(--bg); border: 1px solid var(--border-soft); border-radius: 999px; padding: 4px; margin: 0 auto; }
.pill-nav button { border: 0; background: transparent; padding: 7px 16px; border-radius: 999px; font-weight: 600; font-size: 13.5px; color: var(--muted); white-space: nowrap; }
.pill-nav button:hover { color: var(--ink); }
.pill-nav button.active { background: var(--navy-2); color: #fff; }
.top-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.icon-btn { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border-soft); background: #fff; color: var(--muted); display: grid; place-items: center; position: relative; }
.icon-btn:hover { border-color: var(--gold); color: var(--ink); }
.icon-btn .dot { position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); border: 2px solid #fff; }

/* Finor-style ticker strip */
.ticker { background: var(--navy-2); color: #C7D0DE; display: flex; align-items: center; gap: 0; overflow-x: auto; padding: 0 18px; height: 40px; font-size: 12.5px; white-space: nowrap; }
.ticker .tick-label { color: var(--gold); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: 11px; margin-right: 14px; flex: 0 0 auto; }
.tick { display: inline-flex; align-items: center; gap: 6px; padding: 0 16px; border-right: 1px solid rgba(255,255,255,.12); flex: 0 0 auto; }
.tick b { color: #fff; font-weight: 700; }
.tick .up { color: #4ADE80; } .tick .down { color: #F87171; }
.tick .src { color: #7C8AA0; font-size: 11px; }

.view { padding: 22px; max-width: 1440px; width: 100%; margin: 0 auto; }
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.view-head h1 { font-size: 26px; color: var(--navy-2); }
.view-head p { color: var(--muted); margin-top: 4px; max-width: 640px; }
.kicker { font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-dark); }

/* ---- Subly-style cards & KPI grid ---- */
.grid { display: grid; gap: 16px; }
.grid.kpi4 { grid-template-columns: repeat(4, 1fr); }
.grid.kpi3 { grid-template-columns: repeat(3, 1fr); }
.grid.c2 { grid-template-columns: repeat(2, 1fr); }
.grid.c3 { grid-template-columns: repeat(3, 1fr); }
.grid.main-side { grid-template-columns: 1fr 340px; }
.grid.side-main { grid-template-columns: 340px 1fr; }
.card { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius); box-shadow: var(--shadow-1); padding: 20px; min-width: 0; }
.card h3 { font-size: 16px; margin-bottom: 4px; }
.card .sub { color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-head h3 { margin-bottom: 2px; }
.kpi-label { font-size: 12.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.kpi-value { font-family: var(--font-head); font-size: 32px; font-weight: 800; color: var(--navy-2); line-height: 1.15; margin: 4px 0 2px; }
.kpi-delta { font-size: 13px; font-weight: 600; }
.kpi-delta.up { color: var(--green); } .kpi-delta.down { color: var(--red); }
.kpi-note { font-size: 12.5px; color: var(--slate); }

/* ---- buttons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 999px; border: 1px solid transparent; padding: 10px 20px; font-weight: 700; font-size: 14px; background: var(--navy-2); color: #fff; transition: transform .05s, box-shadow .15s; }
.btn:hover { box-shadow: var(--shadow-2); }
.btn:active { transform: translateY(1px); }
.btn.gold { background: var(--gold-dark); color: #fff; }
.btn.ghost { background: #fff; color: var(--navy-2); border-color: var(--border); }
.btn.soft { background: var(--bg); color: var(--navy-2); border-color: var(--border-soft); }
.btn.danger { background: var(--red); color: #fff; }
.btn.sm { padding: 7px 14px; font-size: 13px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn-link { background: none; border: 0; color: var(--blue); font-weight: 600; font-size: 13.5px; padding: 4px 6px; }
.btn-link:hover { text-decoration: underline; }

/* ---- forms ---- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.field .hint { font-size: 12px; color: var(--slate); margin-top: 5px; }
.field .err { font-size: 12.5px; color: var(--red); margin-top: 5px; display: none; font-weight: 600; }
.field.invalid input, .field.invalid textarea { border-color: var(--red); background: var(--red-bg); }
.field.invalid .err { display: block; }
input[type=text], input[type=number], input[type=date], input[type=email], input[type=password], textarea {
  width: 100%; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px;
  background: #fff; color: var(--ink); outline: none;
}
input:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(26,115,232,.15); }
input[type=number]::-webkit-outer-spin-button, input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; }
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
.input-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.input-row.c3 { grid-template-columns: repeat(3, 1fr); }
.input-row.c4 { grid-template-columns: repeat(4, 1fr); }
.check-row { display: flex; align-items: center; gap: 8px; font-size: 13.5px; margin: 8px 0; }
.check-row input { width: 18px; height: 18px; accent-color: var(--gold-dark); }

/* custom dropdown (replaces native <select>) */
.dd { position: relative; }
.dd-btn { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; background: #fff; font-size: 15px; color: var(--ink); text-align: left; }
.dd-btn:hover { border-color: var(--gold); }
.dd-btn .caret { color: var(--slate); font-size: 11px; flex: 0 0 auto; }
.dd-list { position: absolute; z-index: 60; top: calc(100% + 6px); left: 0; right: 0; background: #fff; border: 1px solid var(--border-soft); border-radius: 12px; box-shadow: var(--shadow-2); max-height: 260px; overflow-y: auto; display: none; padding: 6px; }
.dd.open .dd-list { display: block; }
.dd-opt { padding: 9px 12px; border-radius: 8px; font-size: 14px; cursor: pointer; display: flex; justify-content: space-between; gap: 8px; }
.dd-opt:hover, .dd-opt.hl { background: var(--bg); }
.dd-opt.sel { background: var(--amber-bg); font-weight: 700; color: var(--navy-2); }
.dd-opt small { color: var(--slate); }

/* ---- tables ---- */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--border-soft); border-radius: 12px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 560px; }
.tbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--bg); padding: 10px 12px; border-bottom: 1px solid var(--border-soft); white-space: nowrap; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--divider); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: #FBFAF7; }
.tbl td.r, .tbl th.r { text-align: right; }
.tbl .best { background: var(--green-bg); font-weight: 700; }

/* ---- badges / pills ---- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge.green { background: var(--green-bg); color: var(--green); }
.badge.red { background: var(--red-bg); color: var(--red); }
.badge.amber { background: var(--amber-bg); color: var(--amber); }
.badge.navy { background: #E8EDF5; color: var(--navy); }
.badge.gold { background: #F6EEDD; color: #7A5C1E; }
.badge.grey { background: var(--bg); color: var(--muted); }
.dot-live { width: 8px; height: 8px; border-radius: 50%; background: var(--green); display: inline-block; }

/* ---- tabs ---- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border-soft); margin-bottom: 18px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 10px 16px; font-weight: 600; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button:hover { color: var(--ink); }
.tabs button.active { color: var(--navy-2); border-bottom-color: var(--gold-dark); }

/* ---- wizard ---- */
.wiz-steps { display: flex; gap: 0; margin-bottom: 20px; overflow-x: auto; }
.wiz-step { flex: 1; min-width: 120px; padding: 12px 10px; border-top: 3px solid var(--border-soft); font-size: 13px; font-weight: 600; color: var(--muted); }
.wiz-step b { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--slate); }
.wiz-step.done { border-top-color: var(--green); color: var(--green); }
.wiz-step.now { border-top-color: var(--gold-dark); color: var(--navy-2); }

/* ---- Finor-style lists ---- */
.asset-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--divider); }
.asset-row:last-child { border-bottom: 0; }
.asset-ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: 13px; color: #fff; flex: 0 0 auto; }
.asset-row .grow { flex: 1; min-width: 0; }
.asset-row .t { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asset-row .s { font-size: 12.5px; color: var(--slate); }
.dist-bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--divider); margin: 10px 0 14px; }
.dist-bar span { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* ---- charts (hand-rolled SVG) ---- */
.chart-box { width: 100%; }
.chart-box svg { display: block; width: 100%; height: auto; }
.chart-tip { position: absolute; pointer-events: none; background: var(--navy-2); color: #fff; font-size: 12px; padding: 6px 10px; border-radius: 8px; opacity: 0; transition: opacity .1s; z-index: 5; white-space: nowrap; }
.chart-wrap { position: relative; }

/* ---- empty / error states ---- */
.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty .big { font-size: 40px; margin-bottom: 8px; }
.empty h3 { color: var(--navy-2); margin-bottom: 6px; }
.notice { border-radius: 12px; padding: 12px 16px; font-size: 13.5px; margin-bottom: 16px; display: flex; gap: 10px; align-items: flex-start; }
.notice.amber { background: var(--amber-bg); color: #6B4A12; border: 1px solid #EBD9A8; }
.notice.red { background: var(--red-bg); color: #7A1B15; border: 1px solid #F0C4C0; }
.notice.green { background: var(--green-bg); color: #14532B; border: 1px solid #BFE3CB; }
.notice.blue { background: #E8F0FE; color: #174EA6; border: 1px solid #C2D7F8; }
.notice b { font-weight: 700; }

/* ---- modal / toast (custom, no alert/confirm) ---- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(11, 31, 58, .55); display: none; align-items: center; justify-content: center; z-index: 100; padding: 18px; }
.modal-backdrop.on { display: flex; }
.modal { background: #fff; border-radius: 20px; box-shadow: var(--shadow-2); width: 100%; max-width: 520px; max-height: 88vh; overflow-y: auto; padding: 26px; }
.modal.wide { max-width: 720px; }
.modal h2 { font-size: 20px; margin-bottom: 6px; }
.modal .sub { color: var(--muted); font-size: 14px; margin-bottom: 16px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }
#toasts { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; max-width: min(92vw, 380px); }
.toast { background: var(--navy-2); color: #fff; border-radius: 12px; padding: 13px 16px; font-size: 14px; box-shadow: var(--shadow-2); border-left: 4px solid var(--gold); animation: toast-in .2s ease; }
.toast.err { border-left-color: var(--red); }
.toast.ok { border-left-color: var(--green); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---- auth screen ---- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--cream); }
.auth-hero { background: var(--navy); color: #fff; padding: 48px; display: flex; flex-direction: column; gap: 18px; }
.auth-hero h1 { font-size: 34px; }
.auth-hero p { color: #C7D0DE; max-width: 440px; }
.auth-hero .mark { width: 64px; height: 64px; background: #fff; border-radius: 16px; padding: 8px; }
.auth-form { padding: 48px; display: flex; flex-direction: column; justify-content: center; max-width: 520px; width: 100%; margin: 0 auto; }
.auth-tabs { display: flex; gap: 4px; background: var(--bg); border: 1px solid var(--border-soft); border-radius: 999px; padding: 4px; margin-bottom: 20px; width: fit-content; }
.auth-tabs button { border: 0; background: transparent; padding: 8px 22px; border-radius: 999px; font-weight: 700; font-size: 14px; color: var(--muted); }
.auth-tabs button.active { background: var(--navy-2); color: #fff; }

/* ---- landing page ---- */
#landing { background: var(--cream); }
.land-top { display: flex; align-items: center; gap: 18px; padding: 0 28px; height: var(--header-h); background: #fff; border-bottom: 1px solid var(--border-soft); position: sticky; top: 0; z-index: 30; }
.land-top .brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-head); font-weight: 800; font-size: 17px; color: var(--navy-2); }
.land-top .brand img { width: 36px; height: 36px; }
.land-top nav { display: flex; gap: 4px; margin: 0 auto; }
.land-top nav a { padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: 14px; color: var(--muted); }
.land-top nav a:hover { background: var(--bg); color: var(--ink); text-decoration: none; }
.land-hero { max-width: 1180px; margin: 0 auto; padding: 64px 28px 40px; display: grid; grid-template-columns: 1.05fr .95fr; gap: 40px; align-items: center; }
.land-hero h1 { font-size: clamp(34px, 4.6vw, 56px); color: var(--navy-2); }
.land-hero h1 em { font-style: normal; color: var(--gold-dark); }
.land-hero p.lede { font-size: 18px; color: var(--muted); margin: 18px 0 26px; max-width: 560px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-proof { display: flex; gap: 26px; margin-top: 30px; flex-wrap: wrap; }
.hero-proof b { font-family: var(--font-head); font-size: 22px; display: block; color: var(--navy-2); }
.hero-proof span { font-size: 12.5px; color: var(--slate); }
.hero-card { background: #fff; border: 1px solid var(--border-soft); border-radius: 20px; box-shadow: var(--shadow-2); padding: 22px; }
.land-section { max-width: 1180px; margin: 0 auto; padding: 34px 28px; }
.land-section h2 { font-size: 26px; color: var(--navy-2); margin-bottom: 6px; }
.land-section .lede { color: var(--muted); margin-bottom: 20px; max-width: 720px; }
.feat { display: flex; gap: 14px; }
.feat .ico { width: 46px; height: 46px; border-radius: 12px; background: #F6EEDD; color: var(--gold-dark); display: grid; place-items: center; flex: 0 0 auto; font-size: 20px; font-weight: 800; }
.feat h4 { font-size: 15.5px; margin-bottom: 3px; }
.feat p { font-size: 13.5px; color: var(--muted); }
.land-foot { background: var(--navy-2); color: #9AA5B8; padding: 34px 28px; margin-top: 30px; }
.land-foot .inner { max-width: 1180px; margin: 0 auto; display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; font-size: 13.5px; }
.land-foot a { color: #D7DEE8; }
.kofi-btn { display: inline-flex; align-items: center; gap: 9px; background: var(--gold-dark); color: #090d16; font-weight: 800; border-radius: 999px; padding: 11px 22px; border: 0; font-size: 14.5px; }
.kofi-btn:hover { text-decoration: none; filter: brightness(1.06); }
.support-strip { background: var(--navy); color: #fff; border-radius: 20px; padding: 28px; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.support-strip h3 { color: #fff; font-size: 20px; }
.support-strip p { color: #C7D0DE; font-size: 14px; max-width: 560px; }

/* ---- pricing sheet (print) ---- */
.sheet { background: #fff; border: 1px solid var(--border-soft); border-radius: 12px; padding: 32px; max-width: 820px; margin: 0 auto; }
.sheet h1 { font-size: 24px; }
.sheet .sheet-meta { color: var(--muted); font-size: 13px; margin: 6px 0 20px; }
.sheet table { width: 100%; border-collapse: collapse; font-size: 14px; margin-bottom: 18px; }
.sheet td, .sheet th { padding: 8px 10px; border-bottom: 1px solid var(--divider); text-align: left; }
.sheet td:last-child, .sheet th:last-child { text-align: right; }
.sheet .audit { font-family: var(--font-mono); font-size: 11.5px; color: var(--slate); background: var(--bg); border-radius: 8px; padding: 12px; white-space: pre-wrap; word-break: break-all; }

/* ---- misc ---- */
.progress { height: 8px; border-radius: 999px; background: var(--divider); overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-dark)); border-radius: 999px; }
.progress.blue > span { background: linear-gradient(90deg, var(--accent), var(--blue)); }
.tag { font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 6px; background: var(--bg); color: var(--muted); }
.footer-note { text-align: center; color: var(--slate); font-size: 12.5px; padding: 26px 10px 40px; }
.offline-bar { background: var(--amber-bg); color: #6B4A12; font-size: 13px; font-weight: 600; padding: 8px 22px; border-bottom: 1px solid #EBD9A8; display: none; }
.offline-bar.on { display: block; }
.hidden { display: none !important; }

/* ============ RESPONSIVE ============ */
@media (max-width: 1180px) {
  .grid.kpi4 { grid-template-columns: repeat(2, 1fr); }
  .grid.c3 { grid-template-columns: repeat(2, 1fr); }
  .grid.main-side, .grid.side-main { grid-template-columns: 1fr; }
  .land-hero { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .rail { width: 60px; flex-basis: 60px; }
  .app-topbar .brand { font-size: 15px; }
  .app-topbar .brand small { display: none; }
  .rail-btn { width: 46px; height: 46px; font-size: 0; gap: 0; }
  .rail-btn svg { width: 22px; height: 22px; }
  .pill-nav { display: none; }
  .app-topbar { padding: 0 14px; }
  .view { padding: 14px; }
  .grid.kpi3, .grid.c2, .grid.c3 { grid-template-columns: 1fr; }
  .input-row, .input-row.c3, .input-row.c4 { grid-template-columns: 1fr; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-hero { padding: 28px; }
  .auth-form { padding: 28px 20px; }
  .land-top nav { display: none; }
  .kpi-value { font-size: 26px; }
  .modal { padding: 20px; }
  #toasts { bottom: 12px; right: 12px; left: 12px; max-width: none; }
}
@media (max-width: 480px) {
  .grid.kpi4 { grid-template-columns: repeat(2, 1fr); }
  .card { padding: 16px; }
  .view-head h1 { font-size: 21px; }
  .btn { padding: 10px 16px; }
}
