/* ---------------------------------------------------------------------------
   Emeron Ledger
   A bookkeeping instrument, not a SaaS marketing page. Bone paper, navy ink,
   hairline rules, and tabular monospace for every figure so columns of money
   line up the way they do in a real cash book.

   Ink and accent are taken from the Emeron Infospace mark: #00246C for the
   wordmark navy, #18B4E4 for the highlight in the E. Green and red are held
   back for income and expense, where the colour carries meaning rather than
   branding — a loss should read as a loss even to someone who has never seen
   the logo.
   --------------------------------------------------------------------------- */

:root {
  --ink: #0c2144;
  --ink-70: rgba(12, 33, 68, 0.7);
  --paper: #f5f5f1;
  --surface: #ffffff;
  --rule: #e1e1da;
  --rule-strong: #c7c7be;

  --brand: #00246c;
  --brand-bright: #18b4e4;
  --brand-link: #00489c;

  --pine: #0d6e5f;
  --pine-soft: #e2efeb;
  --rust: #a8402c;
  --rust-soft: #f7e8e4;
  --brass: #8d662a;
  --brass-soft: #f8f0dd;
  --muted: #636a78;

  --radius: 10px;
  --shadow: 0 1px 2px rgba(12, 33, 68, 0.05), 0 14px 30px -24px rgba(12, 33, 68, 0.5);

  --display: "Bricolage Grotesque", "Inter", system-ui, sans-serif;
  --body: "Inter", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

/* --- Shell ---------------------------------------------------------------- */

.shell { display: grid; grid-template-columns: 228px 1fr; min-height: 100vh; }

.rail {
  background: var(--ink);
  color: #d6dceb;
  padding: 22px 16px 28px;
  display: flex;
  flex-direction: column;
  gap: 26px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.rail__mark {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding-left: 8px;
  text-decoration: none;
}

.rail__logo { width: 146px; height: auto; display: block; }

.rail__mark span {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(214, 222, 235, 0.5);
}

.rail__group { display: flex; flex-direction: column; gap: 2px; }

.rail__label {
  font-size: 10px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: rgba(214, 222, 235, 0.42);
  padding: 0 8px 6px;
}

.rail a {
  display: block;
  padding: 8px 10px;
  border-radius: 7px;
  text-decoration: none;
  color: rgba(214, 222, 235, 0.82);
  font-size: 13.5px;
  transition: background 0.15s, color 0.15s;
}

.rail a:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }

.rail a[aria-current="page"] {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-weight: 500;
}

.rail__foot { margin-top: auto; padding: 0 8px; font-size: 11px; color: rgba(214, 222, 235, 0.4); }

.main { padding: 30px 34px 60px; max-width: 1320px; }

/* --- Page header ---------------------------------------------------------- */

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
}

.page-head h1 {
  font-family: var(--display);
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 0;
}

.page-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }

.eyebrow {
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

/* --- Cards ---------------------------------------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card__head {
  padding: 15px 18px;
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card__head h2 {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}

.card__body { padding: 18px; }

.card__body--flush { padding: 0; }

.grid { display: grid; gap: 18px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--wide { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }

/* --- Figures -------------------------------------------------------------- */

.money { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 0.95em; white-space: nowrap; }
.money .cur { color: var(--muted); font-size: 0.78em; margin-right: 3px; letter-spacing: 0.02em; }
.money.pos { color: var(--pine); }
.money.neg { color: var(--rust); }

.stat { display: flex; flex-direction: column; gap: 5px; }
.stat__label { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }

.stat__value {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 25px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.stat__value .cur { font-size: 13px; color: var(--muted); margin-right: 4px; }
.stat__note { font-size: 12px; color: var(--muted); }

.delta { font-family: var(--mono); font-size: 11.5px; font-weight: 500; }
.delta.up { color: var(--rust); }
.delta.down { color: var(--pine); }
.delta.flat { color: var(--muted); }

/* --- The month bar: where this month's money went ------------------------- */

.monthbar { display: flex; flex-direction: column; gap: 12px; }

.monthbar__track {
  display: flex;
  height: 46px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--rule);
}

.monthbar__seg {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 2px;
  color: #fff;
  font-family: var(--mono);
  font-size: 11px;
  overflow: hidden;
  transition: filter 0.15s;
}

.monthbar__seg:hover { filter: brightness(1.12); }
.monthbar__seg span { padding: 0 6px; white-space: nowrap; }

.monthbar__key { display: flex; flex-wrap: wrap; gap: 4px 18px; }

.monthbar__key-item { display: flex; align-items: center; gap: 7px; font-size: 12px; }

.swatch { display: inline-block; width: 9px; height: 9px; border-radius: 2px; flex: none; }

.monthbar__key-item b { font-weight: 500; }
.monthbar__key-item em { font-style: normal; color: var(--muted); font-family: var(--mono); font-size: 11px; }

/* --- Twelve-month chart (inline SVG) -------------------------------------- */

.chart { width: 100%; height: auto; display: block; }
.chart text { font-family: var(--mono); font-size: 9px; fill: var(--muted); }
.chart .grid-line { stroke: var(--rule); stroke-width: 1; }
.chart .zero-line { stroke: var(--rule-strong); stroke-width: 1; }
.chart .bar-income { fill: var(--pine); }
.chart .bar-expense { fill: var(--rust); }
.chart .net-line { fill: none; stroke: var(--ink); stroke-width: 1.6; }
.chart .net-dot { fill: var(--surface); stroke: var(--ink); stroke-width: 1.4; }

.legend { display: flex; gap: 18px; font-size: 12px; color: var(--muted); }
.legend span { display: flex; align-items: center; gap: 6px; }

/* --- Tables --------------------------------------------------------------- */

.table { width: 100%; border-collapse: collapse; font-size: 13px; }

.table th {
  text-align: left;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  padding: 10px 14px;
  border-bottom: 1px solid var(--rule);
  background: #fbfaf6;
  white-space: nowrap;
}

.table td { padding: 10px 14px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fbfaf6; }
.table .num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .date { font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: nowrap; }
.table tfoot td { padding: 12px 14px; border-top: 2px solid var(--ink); font-weight: 600; background: #fbfaf6; }
.table--compact td, .table--compact th { padding: 7px 12px; }

.table-wrap { overflow-x: auto; }

.subtle { color: var(--muted); font-size: 12px; }

/* --- The running-balance spine (cash book) -------------------------------- */

.cashbook td.balance {
  border-left: 2px solid var(--ink);
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
  font-weight: 500;
  background: #fbfaf6;
  white-space: nowrap;
}

.cashbook tr.opening td,
.cashbook tr.closing td {
  background: var(--ink);
  color: #fff;
  font-weight: 500;
}

.cashbook tr.opening td.balance,
.cashbook tr.closing td.balance {
  background: var(--ink);
  color: #fff;
  border-left-color: rgba(255, 255, 255, 0.35);
}

.cashbook tr.opening:hover td,
.cashbook tr.closing:hover td { background: var(--ink); }

/* --- Pills and tags ------------------------------------------------------- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.pill--income { background: var(--pine-soft); color: var(--pine); }
.pill--expense { background: var(--rust-soft); color: var(--rust); }
.pill--transfer { background: #eceff1; color: #4a5b62; }
.pill--fixed { background: var(--brass-soft); color: var(--brass); }

/* --- Notes and alerts ----------------------------------------------------- */

.note {
  display: flex;
  gap: 12px;
  padding: 13px 15px;
  border-radius: 8px;
  border: 1px solid var(--rule);
  background: var(--surface);
}

.note + .note { margin-top: 10px; }
.note__bar { width: 3px; border-radius: 3px; flex: none; background: var(--muted); }
.note h3 { margin: 0 0 3px; font-size: 13.5px; font-weight: 600; }
.note p { margin: 0; font-size: 12.5px; color: var(--muted); }
.note--alert { background: var(--rust-soft); border-color: #ecd2cb; }
.note--alert .note__bar { background: var(--rust); }
.note--warn { background: var(--brass-soft); border-color: #ecdcbb; }
.note--warn .note__bar { background: var(--brass); }
.note--info .note__bar { background: var(--pine); }

.flash {
  padding: 11px 15px;
  border-radius: 8px;
  background: var(--pine-soft);
  color: var(--pine);
  border: 1px solid #c9e0d9;
  margin-bottom: 20px;
  font-size: 13px;
}

.flash--error { background: var(--rust-soft); color: var(--rust); border-color: #ecd2cb; }

.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--ink); font-weight: 600; margin-bottom: 4px; font-size: 14px; }

/* --- Forms ---------------------------------------------------------------- */

.field { display: flex; flex-direction: column; gap: 5px; }

.field label { font-size: 11.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }

.field input,
.field select,
.field textarea {
  font-family: var(--body);
  font-size: 13.5px;
  padding: 8px 10px;
  border: 1px solid var(--rule-strong);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  width: 100%;
}

.field input[type="number"],
.field input[type="date"] { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.field input:focus,
.field select:focus,
.field textarea:focus { outline: 2px solid var(--brand-link); outline-offset: 1px; border-color: var(--brand-link); }

.field__error { color: var(--rust); font-size: 12px; }

.field--check { flex-direction: row; align-items: center; gap: 8px; }
.field--check label { text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--ink); font-weight: 400; }
.field--check input { width: auto; }

.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-3 { grid-column: span 3; }

.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 20px; }

.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.filters .field { min-width: 130px; }

/* --- Buttons -------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 7px;
  border: 1px solid var(--rule-strong);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}

.btn:hover { background: var(--paper); border-color: var(--ink); }
.btn--primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn--primary:hover { background: #16345f; }
.btn--danger { color: var(--rust); border-color: #e2c5bd; background: transparent; }
.btn--danger:hover { background: var(--rust-soft); border-color: var(--rust); }
.btn--sm { padding: 5px 10px; font-size: 12px; }
.btn:focus-visible { outline: 2px solid var(--brand-link); outline-offset: 2px; }

.link { color: var(--brand-link); text-decoration: none; font-weight: 500; }
.link:hover { text-decoration: underline; }

/* --- Bar rows (category breakdown) ---------------------------------------- */

.barrow { display: grid; grid-template-columns: 1fr auto; gap: 3px 14px; padding: 9px 0; border-bottom: 1px solid var(--rule); }
.barrow:last-child { border-bottom: 0; }
.barrow__name { font-size: 13px; display: flex; align-items: center; gap: 7px; }
.barrow__value { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 13px; text-align: right; }
.barrow__track { grid-column: 1 / -1; height: 4px; border-radius: 4px; background: var(--paper); overflow: hidden; }
.barrow__fill { height: 100%; border-radius: 4px; background: var(--rust); }
.barrow__fill--income { background: var(--pine); }
.barrow__share { font-family: var(--mono); font-size: 11px; color: var(--muted); }

/* --- Pagination ----------------------------------------------------------- */

.pagination-wrap { padding: 14px 18px; border-top: 1px solid var(--rule); }
.pagination-wrap svg { width: 14px; height: 14px; }

/* --- Responsive ----------------------------------------------------------- */

@media (max-width: 1100px) {
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--wide, .grid--3 { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; flex-direction: column; gap: 16px; }
  .rail__group { flex-direction: row; flex-wrap: wrap; }
  .rail__label { display: none; }
  .rail__foot { display: none; }
  .main { padding: 22px 18px 50px; }
  .grid--2, .grid--4 { grid-template-columns: minmax(0, 1fr); }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .form-grid .span-2, .form-grid .span-3 { grid-column: span 1; }
  .page-head h1 { font-size: 23px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

@media print {
  .rail, .btn, .filters, .pagination-wrap { display: none; }
  .shell { grid-template-columns: 1fr; }
  body { background: #fff; }
  .card { box-shadow: none; }
}

/* --- Sign-in screen -------------------------------------------------------- */

body.signin {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  min-height: 100vh;
}

.signin__panel {
  background: var(--ink);
  color: #d6dceb;
  padding: 46px 44px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.signin__mark { display: flex; flex-direction: column; gap: 10px; }
.signin__logo { width: 236px; max-width: 60%; height: auto; display: block; }

.signin__mark span {
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(214, 222, 235, 0.5);
}

.signin__blurb {
  margin: auto 0 0;
  font-family: var(--display);
  font-size: 27px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.025em;
  color: #fff;
  max-width: 22ch;
}

.signin__rule { height: 1px; background: rgba(255, 255, 255, 0.14); }
.signin__foot { margin: 0; font-size: 12.5px; color: rgba(214, 222, 235, 0.5); }

.signin__form { display: flex; align-items: center; justify-content: center; padding: 40px 28px; }
.signin__box { width: 100%; max-width: 360px; }

.signin__box h1 {
  font-family: var(--display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 4px 0 0;
}

@media (max-width: 780px) {
  body.signin { grid-template-columns: minmax(0, 1fr); }
  .signin__panel { padding: 30px 24px; gap: 14px; }
  .signin__blurb { font-size: 21px; margin-top: 8px; }
}

/* --- Rail footer: who is signed in ---------------------------------------- */

.rail__foot {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11px;
  color: rgba(214, 222, 235, 0.4);
}

.rail__user { padding: 0 10px 8px; }
.rail__user-name { font-size: 13px; font-weight: 500; color: #fff; }
.rail__user-role { font-size: 10.5px; letter-spacing: 0.09em; text-transform: uppercase; color: rgba(214, 222, 235, 0.45); }

.rail__signout {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: rgba(214, 222, 235, 0.82);
  font-family: var(--body);
  font-size: 13.5px;
  cursor: pointer;
}

.rail__signout:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.rail__signout:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }

@media (max-width: 820px) {
  .rail__foot { display: flex; flex-direction: row; align-items: center; gap: 10px; border-top: 0; padding-top: 0; }
  .rail__user { padding: 0; }
}

/* --- Dashboard section dividers ------------------------------------------- */

.section-break {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 30px 0 16px;
}

.section-break h2 {
  font-family: var(--display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
  white-space: nowrap;
}

.section-break::after { content: ""; flex: 1; height: 1px; background: var(--rule); }

/* --- Budget meters --------------------------------------------------------- */

.meter { height: 6px; border-radius: 6px; background: var(--paper); overflow: hidden; }
.meter__fill { height: 100%; border-radius: 6px; background: var(--pine); }
.meter__fill--close { background: var(--brass); }
.meter__fill--over { background: var(--rust); }

/* --- Split bar (fixed vs variable) ---------------------------------------- */

.splitbar { display: flex; height: 34px; border-radius: 6px; overflow: hidden; border: 1px solid var(--rule); }

.splitbar div {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: var(--mono);
  font-size: 11px;
  min-width: 2px;
}

/* --- Report tabs ----------------------------------------------------------- */

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 20px;
}

.tab {
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}

.tab:hover { color: var(--ink); background: #fbfaf6; }
.tab--on { color: var(--ink); border-bottom-color: var(--ink); }

/* --- Period presets -------------------------------------------------------- */

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
}

.preset {
  padding: 4px 11px;
  border-radius: 100px;
  border: 1px solid var(--rule-strong);
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}

.preset:hover { border-color: var(--ink); color: var(--ink); }
.preset--on { background: var(--ink); border-color: var(--ink); color: #fff; }

/* --- Report grids ---------------------------------------------------------- */

.report-table th:first-child,
.report-table td:first-child {
  position: sticky;
  left: 0;
  background: var(--surface);
  z-index: 1;
  border-right: 1px solid var(--rule);
}

.report-table thead th:first-child { background: #fbfaf6; z-index: 2; }
.report-table tbody tr:hover td:first-child { background: #fbfaf6; }
.report-table tfoot td:first-child { background: #fbfaf6; }

.band td {
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 11px;
}

.band--income td { background: var(--pine-soft); color: var(--pine); }
.band--expense td { background: var(--rust-soft); color: var(--rust); }
.row-total td { font-weight: 600; background: #fbfaf6; }

/* Faint shading so a heavier month stands out without reading the numbers. */
.heat { position: relative; }
.heat::before {
  content: "";
  position: absolute;
  inset: 2px 3px;
  border-radius: 3px;
  background: var(--rust);
  opacity: calc(var(--w) * 0.16);
}
.heat--income::before { background: var(--pine); }
.heat span { position: relative; }

/* --- Sparkline ------------------------------------------------------------- */

.spark { width: 100%; height: auto; display: block; }
.spark .in { fill: var(--pine); }
.spark .out { fill: var(--rust); }
.spark .axis { stroke: var(--rule-strong); stroke-width: 1; }

@media print {
  .tabs, .period { display: none; }
  .report-table th:first-child, .report-table td:first-child { position: static; }
}

.report-link { display: block; text-decoration: none; color: inherit; transition: border-color .15s, transform .15s; }
.report-link:hover { border-color: var(--ink); transform: translateY(-1px); }

/* --- Printed statement header ---------------------------------------------
   Hidden on screen, shown at the top of every printed page. Customer
   statements and reports get sent to clients, so a print needs to carry the
   company mark and the date it was produced.
   ------------------------------------------------------------------------- */

.print-head { display: none; }

@media print {
  .print-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 12px;
    margin-bottom: 20px;
    border-bottom: 1.5px solid var(--ink);
  }

  .print-head__logo { width: 168px; height: auto; }
  .print-head__meta { text-align: right; font-size: 10px; color: var(--muted); line-height: 1.5; }
  .print-head__meta strong { display: block; font-size: 13px; color: var(--ink); }
}

/* --- Install prompt -------------------------------------------------------- */

.rail__install {
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 7px;
  margin-bottom: 4px;
}

.rail__install:hover { background: rgba(255, 255, 255, 0.1); }

/* --- Offline page ---------------------------------------------------------- */

.offline-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 28px;
  background: var(--ink);
}

.offline-card {
  max-width: 420px;
  width: 100%;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 34px 30px;
  box-shadow: 0 24px 60px -30px rgba(0, 0, 0, 0.6);
}

.offline-logo { width: 190px; max-width: 70%; height: auto; display: block; margin-bottom: 24px; }

.offline-card h1 {
  font-family: var(--display);
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 0 0 12px;
}

.offline-card p { margin: 0 0 14px; color: var(--muted); font-size: 13.5px; }

.offline-note {
  border-left: 2px solid var(--rule-strong);
  padding-left: 12px;
  font-size: 12.5px;
}

.offline-status {
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--pine);
}

/* iOS standalone mode draws under the notch; keep the rail clear of it. */
@media (display-mode: standalone) {
  .rail { padding-top: max(22px, env(safe-area-inset-top)); }
  .main { padding-bottom: max(60px, env(safe-area-inset-bottom)); }
}
