:root {
  --bg: #f5f5f7;
  --card: #ffffff;
  --card-2: #fbfbfd;
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #86868b;
  --sep: rgba(0, 0, 0, 0.08);
  --fill: rgba(118, 118, 128, 0.12);
  --fill-2: rgba(118, 118, 128, 0.2);
  --blue: #0071e3;
  --blue-soft: rgba(0, 113, 227, 0.1);
  --green: #28a745;
  --green-soft: rgba(52, 199, 89, 0.14);
  --red: #e30000;
  --red-soft: rgba(255, 59, 48, 0.1);
  --orange: #c45500;
  --orange-soft: rgba(255, 149, 0, 0.14);
  --nav: rgba(245, 245, 247, 0.78);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.12);
  --radius: 18px;
  --radius-sm: 12px;
  --disabled: #f2f2f4;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --card: #1c1c1e;
    --card-2: #232325;
    --text: #f5f5f7;
    --text-2: #a1a1a6;
    --text-3: #8e8e93;
    --sep: rgba(255, 255, 255, 0.1);
    --fill: rgba(118, 118, 128, 0.24);
    --fill-2: rgba(118, 118, 128, 0.34);
    --blue: #2997ff;
    --blue-soft: rgba(41, 151, 255, 0.16);
    --green: #30d158;
    --green-soft: rgba(48, 209, 88, 0.16);
    --red: #ff453a;
    --red-soft: rgba(255, 69, 58, 0.16);
    --orange: #ff9f0a;
    --orange-soft: rgba(255, 159, 10, 0.16);
    --nav: rgba(22, 22, 23, 0.78);
    --shadow: none;
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.6);
    --disabled: #2c2c2e;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter", "Segoe UI Variable", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.47;
  letter-spacing: -0.022em;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
a { color: var(--blue); text-decoration: none; }
.hidden { display: none !important; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  background: var(--nav);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid var(--sep);
  padding-top: env(safe-area-inset-top);
}
.nav-inner {
  max-width: 980px; margin: 0 auto; height: 52px; padding: 0 20px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px;
}
.nav-title { font-weight: 600; font-size: 17px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 50vw; }
.nav-left { justify-self: start; display: flex; align-items: center; min-width: 0; }
.nav-right { justify-self: end; display: flex; align-items: center; gap: 4px; }
.nav-btn {
  background: none; border: 0; color: var(--blue); cursor: pointer; padding: 6px 8px; border-radius: 8px;
  display: inline-flex; align-items: center; gap: 2px; font-size: 17px; white-space: nowrap;
}
.nav-btn:hover { background: var(--fill); }
.nav-btn svg { width: 20px; height: 20px; }
.brand { font-weight: 600; font-size: 17px; display: flex; align-items: center; gap: 8px; color: var(--text); }
.brand-mark { width: 26px; height: 26px; border-radius: 7px; background: linear-gradient(135deg, #ff9f0a, #ff375f); display: grid; place-items: center; }
.brand-mark svg { width: 16px; height: 16px; color: #fff; }

/* ---------- Layout ---------- */
.page { max-width: 980px; margin: 0 auto; padding: 28px 20px calc(80px + env(safe-area-inset-bottom)); }
.page.narrow { max-width: 680px; }
.large-title { font-size: 40px; line-height: 1.1; font-weight: 700; letter-spacing: -0.03em; margin: 8px 0 6px; }
.subtitle { color: var(--text-2); font-size: 19px; margin: 0 0 28px; letter-spacing: -0.01em; }
.section-title { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; margin: 36px 0 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.group-label { font-size: 13px; text-transform: uppercase; letter-spacing: 0.02em; color: var(--text-2); margin: 28px 16px 8px; font-weight: 500; }
.footnote { font-size: 13px; color: var(--text-2); margin: 8px 16px 0; letter-spacing: -0.005em; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn {
  border: 0; border-radius: 980px; padding: 10px 20px; cursor: pointer; font-size: 17px; font-weight: 400;
  background: var(--blue); color: #fff; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: filter .15s, transform .1s, opacity .15s; white-space: nowrap;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: .4; cursor: default; }
.btn svg { width: 18px; height: 18px; }
.btn.secondary { background: var(--fill); color: var(--blue); }
.btn.danger { background: var(--red-soft); color: var(--red); }
.btn.plain { background: none; color: var(--blue); padding: 8px 10px; }
.btn.block { width: 100%; padding: 14px 20px; border-radius: 12px; font-weight: 500; }
.btn.small { font-size: 15px; padding: 7px 14px; }
.icon-btn { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--fill); color: var(--text-2); display: grid; place-items: center; cursor: pointer; flex: none; }
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:hover { background: var(--fill-2); }

/* ---------- Cards / lists ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.card.pad { padding: 22px; }
.list { background: var(--card); border-radius: var(--radius-sm); box-shadow: var(--shadow); overflow: hidden; }
.list-row {
  display: flex; align-items: center; gap: 14px; padding: 12px 16px; min-height: 52px; position: relative; width: 100%;
  background: none; border: 0; text-align: left; cursor: default;
}
button.list-row, a.list-row { cursor: pointer; color: inherit; }
button.list-row:hover, a.list-row:hover { background: var(--card-2); }
.list-row + .list-row::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: 0.5px solid var(--sep); }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .title { font-size: 17px; overflow: hidden; text-overflow: ellipsis; }
.list-row .meta { font-size: 14px; color: var(--text-2); margin-top: 1px; }
.list-row .value { color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.chev { width: 14px; height: 14px; color: var(--text-3); flex: none; }
.empty { text-align: center; color: var(--text-2); padding: 48px 24px; }
.empty svg { width: 44px; height: 44px; color: var(--text-3); margin-bottom: 10px; }
.empty h3 { color: var(--text); font-size: 20px; margin: 0 0 4px; font-weight: 600; }
.empty p { margin: 0 0 18px; }

/* ---------- Plans grid ---------- */
.plans-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.plan-card { display: block; color: inherit; padding: 22px; transition: transform .2s ease, box-shadow .2s ease; }
.plan-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.plan-card .date { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: var(--orange); }
.plan-card h3 { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; margin: 6px 0 14px; line-height: 1.2; }
.plan-card .foot { display: flex; justify-content: space-between; align-items: center; color: var(--text-2); font-size: 15px; }
.pill-past { color: var(--text-3) !important; }

/* ---------- Plan hero & tiles ---------- */
.hero { padding: 26px; margin-bottom: 22px; }
.hero .date { font-size: 15px; font-weight: 600; color: var(--orange); }
.hero h1 { font-size: 40px; font-weight: 700; letter-spacing: -0.03em; margin: 2px 0 14px; line-height: 1.1; }
.hero .facts { display: flex; flex-wrap: wrap; gap: 18px; color: var(--text-2); font-size: 15px; margin-bottom: 18px; }
.avatars { display: flex; flex-wrap: wrap; gap: 6px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  font-size: 13px; font-weight: 600; color: #fff; letter-spacing: 0;
}
.avatar.sm { width: 24px; height: 24px; font-size: 11px; }
.avatar.lg { width: 40px; height: 40px; font-size: 15px; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.tile {
  display: flex; flex-direction: column; justify-content: space-between; min-height: 220px; padding: 24px; color: inherit;
  transition: transform .25s ease, box-shadow .25s ease;
}
.tile:hover { transform: translateY(-3px) scale(1.005); box-shadow: var(--shadow-lg); }
.tile-icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; color: #fff; }
.tile-icon svg { width: 28px; height: 28px; }
.tile h2 { font-size: 24px; font-weight: 600; margin: 18px 0 4px; letter-spacing: -0.02em; }
.tile p { margin: 0; color: var(--text-2); font-size: 15px; }
.tile .stat { font-size: 15px; color: var(--text-2); margin-top: 16px; display: flex; justify-content: space-between; align-items: center; }
.tile .stat b { color: var(--text); font-weight: 600; }
.g-blue { background: linear-gradient(135deg, #2997ff, #0058d6); }
.g-green { background: linear-gradient(135deg, #34c759, #1a9e45); }
.g-purple { background: linear-gradient(135deg, #bf5af2, #7d3cff); }
.g-orange { background: linear-gradient(135deg, #ff9f0a, #ff6b00); }
.g-gray { background: linear-gradient(135deg, #8e8e93, #636366); }

/* ---------- Segmented control ---------- */
.segmented { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--fill); border-radius: 9px; padding: 2px; gap: 2px; width: 100%; }
.segmented button {
  border: 0; background: none; border-radius: 7px; padding: 6px 12px; font-size: 14px; font-weight: 500; cursor: pointer; color: var(--text);
  transition: background .2s, box-shadow .2s; white-space: nowrap;
}
.segmented button.on { background: var(--card); box-shadow: 0 3px 8px rgba(0,0,0,.12), 0 3px 1px rgba(0,0,0,.04); }
@media (prefers-color-scheme: dark) { .segmented button.on { background: #636366; } }
.segmented.inline { width: auto; }

/* ---------- Forms ---------- */
.form-group { background: var(--card); border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--shadow); }
.field { display: flex; align-items: center; gap: 12px; padding: 0 16px; min-height: 50px; position: relative; }
.field + .field::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: 0.5px solid var(--sep); }
.field label, .field .label { flex: none; width: 112px; font-size: 17px; color: var(--text); }
.field input, .field select, .field textarea {
  flex: 1; min-width: 0; border: 0; background: none; outline: none; padding: 13px 0; font-size: 17px; text-align: right;
}
.field textarea { text-align: left; resize: vertical; min-height: 76px; }
.field.stack { flex-direction: column; align-items: stretch; gap: 0; padding-top: 10px; }
.field.stack label { width: auto; font-size: 13px; color: var(--text-2); }
.field.stack input, .field.stack textarea, .field.stack select { text-align: left; padding: 6px 0 12px; }
.field select { appearance: none; -webkit-appearance: none; color: var(--text-2); cursor: pointer; direction: rtl; }
.field select option { direction: ltr; }
.field input::placeholder, .field textarea::placeholder { color: var(--text-3); }
.field.locked { background: var(--disabled); }
.field.locked input, .field.locked .value { color: var(--text-3); cursor: not-allowed; }
.field .lock { width: 14px; height: 14px; color: var(--text-3); flex: none; }
.input {
  width: 100%; border: 0; background: var(--fill); border-radius: 12px; padding: 13px 16px; font-size: 17px; outline: none;
  transition: box-shadow .15s;
}
.input:focus { box-shadow: 0 0 0 3px var(--blue-soft), 0 0 0 1px var(--blue) inset; }
.stack-gap > * + * { margin-top: 12px; }
.error-text { color: var(--red); font-size: 14px; margin: 10px 4px 0; min-height: 1px; }

/* Stepper */
.stepper { display: inline-flex; align-items: center; background: var(--fill); border-radius: 9px; overflow: hidden; flex: none; }
.stepper button { border: 0; background: none; width: 36px; height: 32px; cursor: pointer; font-size: 20px; line-height: 1; color: var(--text); }
.stepper button:hover { background: var(--fill); }
.stepper input { width: 52px; border: 0; background: none; text-align: center; font-size: 16px; font-variant-numeric: tabular-nums; outline: none; padding: 0; -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.stepper .div { width: 0.5px; height: 18px; background: var(--sep); }

/* Check */
.check { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--text-3); display: grid; place-items: center; flex: none; transition: all .15s; }
.check svg { width: 14px; height: 14px; color: #fff; opacity: 0; }
.on > .check, .check.on { background: var(--blue); border-color: var(--blue); }
.on > .check svg, .check.on svg { opacity: 1; }

/* Toggle */
.toggle { position: relative; width: 51px; height: 31px; flex: none; }
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle span { position: absolute; inset: 0; background: var(--fill-2); border-radius: 31px; transition: background .2s; cursor: pointer; }
.toggle span::after { content: ""; position: absolute; width: 27px; height: 27px; left: 2px; top: 2px; background: #fff; border-radius: 50%; box-shadow: 0 3px 8px rgba(0,0,0,.15); transition: transform .2s; }
.toggle input:checked + span { background: #34c759; }
.toggle input:checked + span::after { transform: translateX(20px); }

/* Chips / pills */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 3px; background: var(--fill); border-radius: 980px; font-size: 14px; white-space: nowrap; }
.chip.noav { padding: 3px 10px; }
.chip b { font-weight: 600; font-variant-numeric: tabular-nums; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 980px; font-size: 12px; font-weight: 600; letter-spacing: 0; white-space: nowrap; }
.pill.blue { background: var(--blue-soft); color: var(--blue); }
.pill.green { background: var(--green-soft); color: var(--green); }
.pill.orange { background: var(--orange-soft); color: var(--orange); }
.pill.red { background: var(--red-soft); color: var(--red); }
.pill.gray { background: var(--fill); color: var(--text-2); }

/* People picker */
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.person {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 0; background: var(--card);
  box-shadow: inset 0 0 0 1px var(--sep); cursor: pointer; text-align: left; transition: box-shadow .15s, background .15s;
}
.person.on { box-shadow: inset 0 0 0 2px var(--blue); background: var(--blue-soft); }
.person .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }

/* ---------- Items ---------- */
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.toolbar .segmented { max-width: 360px; }
.item-row { align-items: flex-start; }
.item-row .qty { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; min-width: 38px; height: 38px; border-radius: 10px; background: var(--fill); display: grid; place-items: center; flex: none; padding: 0 6px; }
.item-row .chips { margin-top: 8px; }
.progress { height: 4px; border-radius: 4px; background: var(--fill); overflow: hidden; margin-top: 8px; max-width: 220px; }
.progress > div { height: 100%; background: var(--green); border-radius: 4px; transition: width .3s; }
.progress.partial > div { background: var(--orange); }

/* ---------- Bills ---------- */
.paid-by { display: flex; justify-content: center; margin-bottom: 18px; }
.paid-by .box {
  display: inline-flex; align-items: center; gap: 10px; background: var(--disabled); color: var(--text-3); border-radius: 980px;
  padding: 6px 16px 6px 6px; cursor: not-allowed; user-select: none; box-shadow: inset 0 0 0 1px var(--sep);
}
.paid-by .box .lbl { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.paid-by .box .nm { font-weight: 600; font-size: 16px; }
.paid-by .box .avatar { filter: grayscale(1); opacity: .55; }
.photo-drop {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; cursor: pointer; min-height: 50px;
}
.photo-drop .thumb { width: 54px; height: 54px; border-radius: 10px; object-fit: cover; background: var(--fill); flex: none; }
.photo-drop svg { width: 22px; height: 22px; color: var(--blue); }
.amount-input { font-size: 40px !important; font-weight: 600; text-align: left !important; padding: 14px 0 !important; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; width: auto !important; flex: 0 1 200px; min-width: 0; -moz-appearance: textfield; }
.amount-input::-webkit-inner-spin-button, .amount-input::-webkit-outer-spin-button { -webkit-appearance: none; }
.amount-input:focus { box-shadow: none !important; }
.amount-wrap { display: flex; align-items: center; justify-content: center; gap: 4px; padding: 0 16px; }
.amount-wrap .cur { font-size: 40px; font-weight: 600; color: var(--text-3); }
.custom-row { display: flex; align-items: center; gap: 12px; padding: 8px 16px; position: relative; min-height: 52px; }
.custom-row + .custom-row::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: 0.5px solid var(--sep); }
.custom-row .name { flex: 1; }
.custom-row input { width: 120px; text-align: right; border: 0; background: var(--fill); border-radius: 8px; padding: 7px 10px; outline: none; font-variant-numeric: tabular-nums; }
.split-summary { display: flex; justify-content: space-between; padding: 12px 16px; font-size: 15px; color: var(--text-2); border-top: 0.5px solid var(--sep); }
.split-summary b { color: var(--text); font-variant-numeric: tabular-nums; }
.split-summary.bad b { color: var(--red); }
.split-summary.good b { color: var(--green); }
.bill-thumb { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; flex: none; cursor: zoom-in; }
.bill-icon { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; flex: none; color: #fff; }
.bill-icon svg { width: 22px; height: 22px; }
.amount { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.two-col { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 28px; align-items: start; }

/* ---------- Reports ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.stat-card { padding: 20px 22px; }
.stat-card .k { font-size: 13px; color: var(--text-2); font-weight: 500; }
.stat-card .v { font-size: 32px; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; margin-top: 2px; line-height: 1.15; }
.table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.table th { font-size: 13px; color: var(--text-2); font-weight: 500; text-align: right; padding: 12px 16px; border-bottom: 0.5px solid var(--sep); }
.table td { padding: 12px 16px; text-align: right; border-bottom: 0.5px solid var(--sep); font-size: 16px; }
.table tr:last-child td { border-bottom: 0; }
.table th:first-child, .table td:first-child { text-align: left; }
.table tfoot td { font-weight: 600; border-top: 0.5px solid var(--sep); }
.table .who { display: flex; align-items: center; gap: 10px; }
.pos { color: var(--green); }
.neg { color: var(--red); }
.table-wrap { overflow-x: auto; }
.bar-row { display: grid; grid-template-columns: 150px 1fr auto; gap: 14px; align-items: center; padding: 10px 16px; font-size: 15px; }
.bar { height: 10px; border-radius: 10px; background: var(--fill); overflow: hidden; }
.bar > div { height: 100%; border-radius: 10px; background: var(--blue); }
.settle-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; position: relative; }
.settle-row + .settle-row::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: 0.5px solid var(--sep); }
.settle-row .arrow { color: var(--text-3); display: flex; align-items: center; flex-direction: column; font-size: 12px; }
.settle-row .arrow svg { width: 22px; height: 22px; }
.settle-row .amount { margin-left: auto; font-size: 19px; }
.settled { display: flex; align-items: center; gap: 12px; padding: 18px; color: var(--green); font-weight: 500; }
.settled svg { width: 26px; height: 26px; }

/* ---------- Sheet (modal) ---------- */
.sheet-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.32); z-index: 50; display: flex; align-items: center; justify-content: center;
  animation: fade .2s ease; padding: 20px;
}
.sheet {
  background: var(--bg); width: 100%; max-width: 560px; max-height: calc(100vh - 40px); border-radius: 16px;
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: up .32s cubic-bezier(.2,.9,.3,1);
}
.sheet-head {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 14px 12px; border-bottom: 0.5px solid var(--sep); flex: none;
}
.sheet-head h3 { margin: 0; font-size: 17px; font-weight: 600; text-align: center; }
.sheet-head .l { justify-self: start; }
.sheet-head .r { justify-self: end; }
.sheet-head .r .nav-btn { font-weight: 600; }
.sheet-body { overflow-y: auto; padding: 6px 16px 24px; -webkit-overflow-scrolling: touch; }
.sheet-body .group-label { margin-left: 16px; }
.viewer { max-width: 92vw; max-height: 86vh; border-radius: 12px; box-shadow: var(--shadow-lg); }
@keyframes fade { from { opacity: 0 } }
@keyframes up { from { transform: translateY(40px); opacity: 0 } }
@media (max-width: 640px) {
  .sheet-backdrop { align-items: flex-end; padding: 0; }
  .sheet { max-width: none; border-radius: 14px 14px 0 0; max-height: 94vh; padding-bottom: env(safe-area-inset-bottom); }
}

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: 100%; max-width: 400px; text-align: center; }
.auth-card .mark { width: 72px; height: 72px; border-radius: 18px; margin: 0 auto 20px; background: linear-gradient(135deg, #ff9f0a, #ff375f); display: grid; place-items: center; box-shadow: 0 10px 30px rgba(255, 55, 95, .3); }
.auth-card .mark svg { width: 38px; height: 38px; color: #fff; }
.auth-card h1 { font-size: 32px; font-weight: 700; letter-spacing: -0.03em; margin: 0 0 6px; }
.auth-card p { color: var(--text-2); margin: 0 0 28px; }
.auth-card .input { margin-bottom: 10px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(28px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 100;
  background: rgba(30,30,32,.92); color: #fff; padding: 12px 20px; border-radius: 980px; font-size: 15px;
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); box-shadow: var(--shadow-lg); animation: up .3s ease; max-width: 90vw;
}
.toast.err { background: rgba(215, 0, 21, .94); }

.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--fill-2); border-top-color: var(--text-2); animation: spin .8s linear infinite; margin: 80px auto; }
@keyframes spin { to { transform: rotate(360deg) } }

@media (max-width: 820px) {
  .tiles { grid-template-columns: 1fr; }
  .tile { min-height: 0; flex-direction: row; align-items: center; gap: 16px; padding: 18px; }
  .tile > div:first-child { display: flex; align-items: center; gap: 16px; }
  .tile h2 { margin: 0 0 2px; font-size: 20px; }
  .tile .stat { display: none; }
  .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .page { padding: 18px 16px calc(60px + env(safe-area-inset-bottom)); }
  .nav-inner { padding: 0 8px; }
  .large-title, .hero h1 { font-size: 32px; }
  .hero { padding: 20px; }
  .field label, .field .label { width: 96px; }
  .bar-row { grid-template-columns: 96px 1fr auto; }
  .table th, .table td { padding: 10px 10px; font-size: 15px; }
  .nav-btn .txt { display: none; }
}
@media print {
  .nav, .no-print, .toast { display: none !important; }
  body { background: #fff; }
  .card, .list { box-shadow: none; border: 1px solid #ddd; }
}
