/* ==========================================================================
   卡契 · Card Pact
   本地网页版设计系统
   ========================================================================== */

:root {
  --bg: #f2efe6;
  --bg-deep: #e9e4d7;
  --paper: #fffdf8;
  --paper-soft: #faf7ef;
  --ink: #15241d;
  --ink-soft: #334139;
  --muted: #768077;
  --muted-2: #9aa198;
  --line: #e1dbcf;
  --line-strong: #cfc7b7;
  --forest: #143b2e;
  --forest-deep: #0e2b21;
  --forest-soft: #1d5140;
  --green: #28785b;
  --mint: #d9f481;
  --mint-soft: #eff8d1;
  --lime: #d9f481;
  --orange: #d86640;
  --orange-soft: #fbece5;
  --amber: #b8802c;
  --amber-soft: #fbf2dc;
  --red: #bf4b47;
  --red-soft: #fae9e7;
  --blue: #416e91;
  --blue-soft: #e9f1f6;
  --purple: #705f95;
  --purple-soft: #f0edf6;
  --shadow-xs: 0 1px 1px rgba(21, 36, 29, .03);
  --shadow-sm: 0 4px 14px rgba(21, 36, 29, .05);
  --shadow-md: 0 18px 50px rgba(21, 36, 29, .09);
  --shadow-lg: 0 28px 80px rgba(7, 28, 20, .25);
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 26px;
  --font-sans: "Segoe UI Variable Text", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", "PingFang SC", "Microsoft YaHei UI", sans-serif;
  --font-serif: Georgia, "Times New Roman", "Songti SC", "STSong", serif;
  --font-mono: "Cascadia Code", "SFMono-Regular", "Consolas", "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  background-image:
    radial-gradient(circle at 8% 4%, rgba(217, 244, 129, .16), transparent 27rem),
    radial-gradient(circle at 93% 2%, rgba(20, 59, 46, .07), transparent 32rem);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.modal-open { overflow: hidden; }

::selection { color: var(--forest-deep); background: var(--lime); }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
svg { display: block; }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 3px solid rgba(40, 120, 91, .36);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.muted { color: var(--muted); }
.tiny { font-size: 12px; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.text-red { color: var(--red) !important; }
.text-green { color: var(--green) !important; }
.text-amber { color: var(--amber) !important; }
.text-orange { color: var(--orange) !important; }
.divider { width: 100%; height: 1px; background: var(--line); border: 0; margin: 0; }

/* --------------------------------------------------------------------------
   Boot
   -------------------------------------------------------------------------- */

.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 18px;
  background:
    radial-gradient(circle at 50% 35%, rgba(217, 244, 129, .12), transparent 20rem),
    var(--forest-deep);
  color: #f7f4e9;
  transition: opacity .35s ease, visibility .35s ease;
}
.boot-screen.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.boot-brand { display: flex; align-items: center; gap: 12px; }
.boot-brand .brand-mark { width: 50px; height: 50px; border-radius: 15px; }
.boot-brand .brand-mark svg { width: 34px; height: 34px; }
.boot-brand-word {
  font-family: var(--font-serif);
  font-size: 36px;
  letter-spacing: .08em;
}
.boot-screen p { color: #9cb3a6; font-size: 12px; letter-spacing: .12em; }
.boot-loader {
  width: 120px;
  height: 2px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, .12);
}
.boot-loader span {
  display: block;
  width: 45%;
  height: 100%;
  background: var(--lime);
  border-radius: inherit;
  animation: bootSlide 1.15s ease-in-out infinite;
}
@keyframes bootSlide {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(330%); }
}
.noscript {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   Brand + shared atoms
   -------------------------------------------------------------------------- */

.brand-mark {
  width: 40px;
  height: 40px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: var(--forest-deep);
  background: var(--lime);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35);
}
.brand-mark svg { width: 27px; height: 27px; }
.brand-lockup { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-copy { min-width: 0; }
.brand-name {
  display: block;
  font-family: var(--font-serif);
  font-size: 23px;
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: .08em;
}
.brand-caption {
  display: block;
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 8px;
  line-height: 1;
  letter-spacing: .12em;
  white-space: nowrap;
  opacity: .55;
}

.btn {
  --btn-bg: var(--paper);
  --btn-color: var(--ink);
  --btn-border: var(--line-strong);
  min-height: 42px;
  padding: 9px 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--btn-border);
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-color);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease, opacity .16s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled, .btn.is-disabled {
  cursor: not-allowed;
  opacity: .5;
  transform: none;
}
.btn .icon { width: 16px; height: 16px; }
.btn-primary {
  --btn-bg: var(--forest);
  --btn-color: #fbf9f1;
  --btn-border: var(--forest);
  box-shadow: 0 8px 18px rgba(20, 59, 46, .17);
}
.btn-primary:hover { --btn-bg: #1b4d3b; }
.btn-lime {
  --btn-bg: var(--lime);
  --btn-color: var(--forest-deep);
  --btn-border: var(--lime);
  box-shadow: 0 8px 20px rgba(217, 244, 129, .13);
}
.btn-lime:hover { --btn-bg: #e4fba3; }
.btn-ghost {
  --btn-bg: transparent;
  --btn-border: transparent;
  color: var(--muted);
}
.btn-ghost:hover { color: var(--ink); background: rgba(21, 36, 29, .045); }
.btn-outline {
  --btn-bg: transparent;
  --btn-border: var(--line-strong);
}
.btn-outline:hover { background: var(--paper); border-color: var(--ink-soft); }
.btn-soft {
  --btn-bg: var(--paper-soft);
  --btn-border: var(--line);
}
.btn-danger {
  --btn-bg: var(--red);
  --btn-color: #fff;
  --btn-border: var(--red);
}
.btn-danger-ghost {
  --btn-bg: transparent;
  --btn-color: var(--red);
  --btn-border: #ebc5c1;
}
.btn-danger-ghost:hover { background: var(--red-soft); }
.btn-sm { min-height: 34px; padding: 7px 12px; font-size: 12px; }
.btn-xs { min-height: 28px; padding: 5px 10px; font-size: 11px; }
.btn-lg { min-height: 50px; padding: 12px 24px; font-size: 14px; }
.btn-block { width: 100%; }
.btn-text {
  border: 0;
  padding: 0;
  background: none;
  color: var(--forest);
  font-weight: 700;
  font-size: 12px;
  text-underline-offset: 3px;
}
.btn-text:hover { text-decoration: underline; }

.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-xs { width: 14px; height: 14px; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 22px; height: 22px; }
.icon-xl { width: 28px; height: 28px; }

.icon-button {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink-soft);
  background: rgba(255, 253, 248, .78);
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}
.icon-button:hover { color: var(--forest); border-color: var(--line-strong); background: var(--paper); }
.icon-button .icon { width: 18px; height: 18px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  line-height: 1.25;
  font-weight: 700;
  white-space: nowrap;
  background: rgba(21, 36, 29, .06);
  color: var(--ink-soft);
}
.badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: .8;
}
.badge.no-dot::before { display: none; }
.badge-green { color: var(--green); background: #e9f5ed; }
.badge-amber { color: var(--amber); background: var(--amber-soft); }
.badge-red { color: var(--red); background: var(--red-soft); }
.badge-blue { color: var(--blue); background: var(--blue-soft); }
.badge-orange { color: var(--orange); background: var(--orange-soft); }
.badge-purple { color: var(--purple); background: var(--purple-soft); }
.badge-dark { color: #eff6e9; background: var(--forest); }
.badge-mint { color: var(--forest); background: var(--mint); }
.badge-outline { color: var(--muted); background: transparent; border: 1px solid var(--line); }
.badge-outline::before { display: none; }
.badge-local::before { display: none; }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.4;
  letter-spacing: .13em;
  text-transform: uppercase;
  font-weight: 600;
}
.eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: currentColor;
  opacity: .5;
}
.eyebrow-light { color: rgba(241, 247, 232, .52); }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 12px 0 26px;
}
.page-title {
  margin-top: 8px;
  font-family: var(--font-display);
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.14;
  letter-spacing: -.035em;
  font-weight: 760;
}
.page-desc {
  max-width: 650px;
  margin-top: 9px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}
.page-actions { display: flex; align-items: center; gap: 9px; flex: none; flex-wrap: wrap; }

.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
}
.panel-pad { padding: 24px; }
.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px 0;
}
.panel-head h2, .panel-head h3 {
  font-size: 16px;
  line-height: 1.35;
  font-weight: 750;
  letter-spacing: -.015em;
}
.panel-sub { margin-top: 5px; color: var(--muted); font-size: 12px; }
.panel-body { padding: 18px 24px 24px; }
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.section-head h2 { font-size: 17px; font-weight: 750; letter-spacing: -.02em; }
.section-head p { color: var(--muted); font-size: 12px; margin-top: 3px; }

.panel-dark {
  color: #f4f3e9;
  background:
    radial-gradient(circle at 95% 0%, rgba(217, 244, 129, .13), transparent 16rem),
    var(--forest);
  border-color: rgba(255, 255, 255, .08);
}

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.stack { display: grid; gap: 16px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.row-wrap { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

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

.field { display: grid; gap: 7px; min-width: 0; }
.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
}
.field-label small { color: var(--muted-2); font-size: 11px; font-weight: 500; }
.field-hint { color: var(--muted); font-size: 11px; line-height: 1.55; }
.field-hint.warning { color: var(--orange); }
.input, .select, .textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--paper-soft);
  color: var(--ink);
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.input, .select { height: 44px; padding: 0 13px; }
.textarea { min-height: 100px; resize: vertical; padding: 11px 13px; line-height: 1.6; }
.input::placeholder, .textarea::placeholder { color: var(--muted-2); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--green);
  background: var(--paper);
  box-shadow: 0 0 0 3px rgba(40, 120, 91, .1);
}
.select {
  appearance: none;
  padding-right: 38px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%), linear-gradient(135deg, var(--ink-soft) 50%, transparent 50%);
  background-position: calc(100% - 18px) 19px, calc(100% - 13px) 19px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.input[type="number"] { font-variant-numeric: tabular-nums; }
.input-prefix-amount { position: relative; }
.input-prefix-amount::before {
  content: "¥";
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-weight: 700;
  pointer-events: none;
}
.input-prefix-amount .input { padding-left: 32px; font-size: 18px; font-weight: 700; }
.input-group { display: flex; gap: 8px; }
.input-group .input { flex: 1; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .field-full { grid-column: 1 / -1; }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; padding-top: 6px; flex-wrap: wrap; }
.form-error {
  display: none;
  padding: 10px 12px;
  border: 1px solid #efc7c2;
  border-radius: 10px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 12px;
  line-height: 1.5;
}
.form-error.is-visible { display: block; }

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.55;
  cursor: pointer;
}
.checkbox-label input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--forest); }
.check-grid { display: grid; gap: 10px; }
.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.choice-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper-soft);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.choice-card:has(input:checked) { border-color: var(--forest); background: var(--mint-soft); }
.choice-card input { margin-top: 2px; accent-color: var(--forest); }
.choice-card strong { display: block; font-size: 12px; }
.choice-card span { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.switch-copy strong { display: block; font-size: 14px; }
.switch-copy span { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.switch {
  position: relative;
  flex: none;
  width: 46px;
  height: 26px;
  border: 0;
  padding: 0;
  border-radius: 99px;
  background: #d4d0c6;
  transition: background .18s ease;
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .18);
  transition: transform .18s ease;
}
.switch[aria-checked="true"] { background: var(--forest); }
.switch[aria-checked="true"]::after { transform: translateX(20px); }
.switch:disabled { opacity: .5; cursor: not-allowed; }

/* --------------------------------------------------------------------------
   Auth
   -------------------------------------------------------------------------- */

.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(460px, .92fr);
  background: var(--bg);
}
.auth-story {
  position: relative;
  min-height: 100vh;
  padding: clamp(32px, 5vw, 62px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: #f4f4e8;
  background:
    radial-gradient(circle at 88% 8%, rgba(217, 244, 129, .19), transparent 23rem),
    radial-gradient(circle at 8% 95%, rgba(79, 138, 111, .3), transparent 25rem),
    var(--forest-deep);
}
.auth-story::before {
  content: "";
  position: absolute;
  top: -190px;
  right: -160px;
  width: 520px;
  height: 520px;
  border: 1px solid rgba(217, 244, 129, .16);
  border-radius: 50%;
  box-shadow: 0 0 0 90px rgba(217, 244, 129, .025), 0 0 0 180px rgba(217, 244, 129, .018);
  pointer-events: none;
}
.auth-story::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .16;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.16'/%3E%3C/svg%3E");
  pointer-events: none;
}
.auth-story-inner { position: relative; z-index: 2; display: flex; flex-direction: column; height: 100%; flex: 1; }
.auth-brand { display: flex; align-items: center; gap: 13px; }
.auth-brand .brand-mark { width: 46px; height: 46px; border-radius: 14px; }
.auth-brand .brand-name { font-size: 26px; }
.auth-brand .brand-caption { color: #dce8dc; opacity: .55; }
.auth-hero { max-width: 660px; margin: auto 0; padding: 52px 0; }
.auth-kicker { display: flex; align-items: center; gap: 10px; color: var(--lime); font-family: var(--font-mono); font-size: 10px; letter-spacing: .18em; font-weight: 600; text-transform: uppercase; }
.auth-kicker::before { content: ""; width: 28px; height: 1px; background: var(--lime); opacity: .65; }
.auth-hero h1 {
  margin-top: 25px;
  max-width: 640px;
  font-family: var(--font-display);
  font-size: clamp(42px, 5vw, 74px);
  line-height: 1.07;
  letter-spacing: -.055em;
  font-weight: 700;
}
.auth-hero h1 em {
  display: block;
  color: var(--lime);
  font-family: var(--font-serif);
  font-weight: 400;
  letter-spacing: -.02em;
}
.auth-hero-desc {
  max-width: 480px;
  margin-top: 24px;
  color: rgba(235, 243, 232, .66);
  font-size: 14px;
  line-height: 1.85;
}
.auth-points {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  max-width: 580px;
  margin-top: 38px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 15px;
  overflow: hidden;
  background: rgba(255, 255, 255, .08);
}
.auth-point {
  min-height: 96px;
  padding: 18px;
  background: rgba(10, 35, 26, .48);
}
.auth-point .icon { color: var(--lime); width: 18px; height: 18px; }
.auth-point strong { display: block; margin-top: 13px; font-size: 12px; color: #f4f4e6; }
.auth-point span { display: block; margin-top: 4px; color: rgba(228, 238, 227, .47); font-size: 10px; line-height: 1.45; }
.auth-story-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-top: 20px;
  color: rgba(228, 238, 227, .38);
  font-size: 10px;
  letter-spacing: .04em;
}
.auth-story-foot .mono { letter-spacing: .13em; }

.auth-panel {
  position: relative;
  min-height: 100vh;
  padding: 34px clamp(24px, 5vw, 76px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
}
.auth-panel::before {
  content: "";
  position: absolute;
  inset: 24px;
  border: 1px solid rgba(21, 36, 29, .07);
  border-radius: 30px;
  pointer-events: none;
}
.auth-form-wrap { position: relative; z-index: 2; width: min(100%, 410px); padding: 24px 0; }
.auth-mobile-brand { display: none; margin-bottom: 34px; }
.auth-form-head { margin-bottom: 24px; }
.auth-form-head h2 {
  margin-top: 11px;
  font-family: var(--font-display);
  font-size: 34px;
  line-height: 1.18;
  letter-spacing: -.04em;
}
.auth-form-head p { margin-top: 8px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  margin-bottom: 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 253, 248, .52);
}
.auth-tab {
  min-height: 38px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  transition: .16s ease;
}
.auth-tab.is-active { color: var(--forest); background: var(--paper); box-shadow: var(--shadow-xs); }
.auth-form { display: grid; gap: 15px; }
.auth-form .input { height: 47px; background: rgba(255, 253, 248, .65); }
.auth-submit { width: 100%; min-height: 48px; margin-top: 4px; }
.auth-assurance { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 13px; color: var(--muted-2); font-size: 10px; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 24px 0 16px; color: var(--muted-2); font-size: 10px; white-space: nowrap; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.demo-accounts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.demo-account {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 253, 248, .54);
  text-align: left;
  transition: border-color .16s, background .16s, transform .16s;
}
.demo-account:hover { border-color: var(--line-strong); background: var(--paper); transform: translateY(-1px); }
.demo-avatar {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 750;
  color: var(--forest);
  background: var(--mint-soft);
}
.demo-account:nth-child(2) .demo-avatar { color: var(--blue); background: var(--blue-soft); }
.demo-account-copy { min-width: 0; }
.demo-account-copy strong { display: block; font-size: 11px; line-height: 1.4; }
.demo-account-copy span { display: block; color: var(--muted); font-family: var(--font-mono); font-size: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auth-admin-hint {
  margin-top: 14px;
  padding: 11px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 11px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}
.auth-admin-hint strong { color: var(--ink-soft); font-family: var(--font-mono); font-weight: 600; }
.auth-footnote { margin-top: 28px; color: var(--muted-2); font-size: 10px; line-height: 1.75; }
.auth-footnote a { color: var(--ink-soft); text-decoration: underline; text-underline-offset: 3px; }
.auth-form-error { display: none; padding: 10px 12px; border-radius: 10px; color: var(--red); background: var(--red-soft); border: 1px solid #efc7c2; font-size: 11px; }
.auth-form-error.is-visible { display: block; }

/* --------------------------------------------------------------------------
   App shell / sidebar
   -------------------------------------------------------------------------- */

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
}
.sidebar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 28px 18px 20px;
  color: #edf3e8;
  background:
    radial-gradient(circle at 50% -20%, rgba(217, 244, 129, .11), transparent 24rem),
    var(--forest-deep);
  border-right: 1px solid rgba(255, 255, 255, .04);
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.1) transparent;
}
.sidebar-top { padding: 0 8px; }
.sidebar .brand-name { color: #f4f2e7; }
.sidebar .brand-caption { color: #dcebdc; }
.sidebar-role {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 15px;
  padding: 4px 8px;
  border: 1px solid rgba(217, 244, 129, .16);
  border-radius: 99px;
  color: var(--lime);
  background: rgba(217, 244, 129, .055);
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1.3;
  letter-spacing: .06em;
}
.side-nav { margin-top: 35px; }
.nav-label {
  padding: 0 11px;
  margin-bottom: 10px;
  color: rgba(235, 241, 230, .3);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.nav-list { display: grid; gap: 4px; }
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 44px;
  padding: 8px 11px;
  border-radius: 11px;
  color: rgba(233, 241, 229, .62);
  font-size: 12px;
  font-weight: 600;
  transition: color .16s, background .16s, transform .16s;
}
.nav-item:hover { color: #f7f8ed; background: rgba(255, 255, 255, .055); }
.nav-item.is-active {
  color: var(--forest-deep);
  background: var(--lime);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .14);
}
.nav-item .icon { width: 17px; height: 17px; opacity: .9; }
.nav-item.is-active .icon { opacity: 1; }
.nav-badge {
  margin-left: auto;
  min-width: 19px;
  height: 19px;
  padding: 0 6px;
  display: inline-grid;
  place-items: center;
  border-radius: 99px;
  background: rgba(255, 255, 255, .12);
  color: inherit;
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1;
}
.nav-item.is-active .nav-badge { background: rgba(20, 59, 46, .14); }
.sidebar-rules {
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 14px;
  background: rgba(255, 255, 255, .035);
}
.rules-head {
  display: flex;
  align-items: center;
  gap: 7px;
  color: rgba(243, 247, 236, .78);
  font-size: 10px;
  font-weight: 650;
}
.rules-head .icon { width: 13px; height: 13px; color: var(--lime); }
.rule-list { display: grid; gap: 9px; margin-top: 13px; }
.rule-row { display: flex; align-items: flex-start; gap: 8px; color: rgba(235, 243, 231, .45); font-size: 9px; line-height: 1.55; }
.rule-row i { width: 5px; height: 5px; flex: none; margin-top: 4px; border-radius: 50%; background: rgba(217, 244, 129, .5); }
.rule-row b { color: rgba(246, 248, 240, .86); font-weight: 600; }
.sidebar-foot { margin-top: 14px; padding: 0 4px; display: flex; align-items: center; justify-content: space-between; gap: 8px; color: rgba(235, 241, 230, .28); font-family: var(--font-mono); font-size: 8px; letter-spacing: .06em; }
.local-pill { display: inline-flex; align-items: center; gap: 4px; }
.local-pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--lime); opacity: .7; }

.main-shell {
  min-width: 0;
  padding: 0 clamp(20px, 3.4vw, 50px) 32px;
  display: flex;
  flex-direction: column;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: linear-gradient(to bottom, rgba(242, 239, 230, .97) 55%, rgba(242, 239, 230, .76) 80%, transparent);
  backdrop-filter: blur(10px);
}
.topbar-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .08em;
}
.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4e9c75;
  box-shadow: 0 0 0 4px rgba(78, 156, 117, .1);
}
.mobile-brand { display: none; align-items: center; gap: 9px; }
.mobile-brand .brand-mark { width: 32px; height: 32px; border-radius: 9px; }
.mobile-brand .brand-mark svg { width: 21px; height: 21px; }
.mobile-brand .brand-name { font-size: 19px; }
.top-actions { display: flex; align-items: center; gap: 9px; flex: none; }
.balance-pill {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 12px 6px 8px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: rgba(255, 253, 248, .68);
  transition: background .16s, border-color .16s;
}
.balance-pill:hover { background: var(--paper); border-color: var(--line-strong); }
.balance-pill-icon {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--forest);
  background: var(--mint-soft);
}
.balance-pill-icon .icon { width: 14px; height: 14px; }
.balance-pill-copy { display: grid; }
.balance-pill-copy span { color: var(--muted); font-size: 8px; line-height: 1.2; }
.balance-pill-copy strong { margin-top: 1px; font-family: var(--font-mono); font-size: 12px; line-height: 1.2; letter-spacing: -.02em; }
.admin-mode-pill { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 13px; border: 1px solid rgba(20,59,46,.12); border-radius: 99px; background: var(--mint-soft); color: var(--forest); font-size: 11px; font-weight: 700; }
.notification-button { position: relative; }
.notification-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  border: 2px solid var(--bg);
  border-radius: 99px;
  color: #fff;
  background: var(--orange);
  font-family: var(--font-mono);
  font-size: 8px;
  line-height: 1;
}
.user-menu-wrap { position: relative; }
.avatar-button {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 40px;
  padding: 3px 3px 3px 4px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: rgba(255, 253, 248, .68);
}
.avatar-button:hover { background: var(--paper); }
.avatar {
  width: 32px;
  height: 32px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #f6f8ed;
  background: var(--forest);
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 700;
}
.avatar-lg { width: 50px; height: 50px; font-size: 20px; }
.avatar-xs { width: 22px; height: 22px; font-size: 9px; }
.avatar-button > .icon { width: 13px; height: 13px; color: var(--muted); margin-right: 3px; }
.user-popover {
  position: absolute;
  z-index: 60;
  top: calc(100% + 9px);
  right: 0;
  width: 220px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .16s, visibility .16s, transform .16s;
}
.user-popover.is-open { opacity: 1; visibility: visible; transform: translateY(0); }
.user-popover-head { display: flex; align-items: center; gap: 10px; padding: 9px 9px 12px; border-bottom: 1px solid var(--line); }
.user-popover-head strong { display: block; font-size: 12px; }
.user-popover-head span { display: block; color: var(--muted); font-size: 9px; font-family: var(--font-mono); }
.user-popover-link { display: flex; align-items: center; gap: 9px; width: 100%; padding: 9px; border: 0; border-radius: 8px; background: none; text-align: left; color: var(--ink-soft); font-size: 11px; }
.user-popover-link:hover { background: var(--paper-soft); color: var(--forest); }
.user-popover-link .icon { width: 15px; height: 15px; color: var(--muted); }
.user-popover-sep { height: 1px; margin: 4px 0; background: var(--line); }
.user-popover-link.danger { color: var(--red); }
.user-popover-link.danger .icon { color: var(--red); }

.page { flex: 1; width: 100%; max-width: 1420px; margin: 0 auto; animation: pageIn .32s ease both; }
@keyframes pageIn {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: none; }
}
.app-footer {
  width: 100%;
  max-width: 1420px;
  margin: 28px auto 0;
  padding-top: 16px;
  border-top: 1px solid rgba(21, 36, 29, .07);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted-2);
  font-size: 9px;
  line-height: 1.5;
}
.app-footer .mono { letter-spacing: .06em; }

.mobile-nav { display: none; }

/* --------------------------------------------------------------------------
   Tabs / page-level filters
   -------------------------------------------------------------------------- */

.page-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
  max-width: 100%;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 253, 248, .52);
  overflow-x: auto;
  scrollbar-width: none;
}
.page-tabs::-webkit-scrollbar { display: none; }
.page-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 7px 13px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  transition: .16s;
}
.page-tab:hover { color: var(--ink); }
.page-tab.is-active { color: var(--forest); background: var(--paper); box-shadow: var(--shadow-xs); }
.page-tab .count {
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  display: inline-grid;
  place-items: center;
  border-radius: 99px;
  background: rgba(21, 36, 29, .06);
  font-family: var(--font-mono);
  font-size: 8px;
  line-height: 1;
}
.page-tab.is-active .count { background: var(--mint-soft); }

.subtabs { display: flex; align-items: center; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.subtab {
  position: relative;
  border: 0;
  background: none;
  padding: 10px 14px 13px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.subtab::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: -1px; height: 2px; background: transparent; border-radius: 2px; }
.subtab.is-active { color: var(--forest); }
.subtab.is-active::after { background: var(--forest); }

/* --------------------------------------------------------------------------
   Stats
   -------------------------------------------------------------------------- */

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat-card {
  position: relative;
  min-height: 137px;
  padding: 19px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: var(--shadow-xs);
}
.stat-card::after {
  content: "";
  position: absolute;
  right: -40px;
  bottom: -55px;
  width: 130px;
  height: 130px;
  border: 1px solid rgba(21, 36, 29, .045);
  border-radius: 50%;
}
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stat-label { color: var(--muted); font-size: 10px; font-weight: 600; letter-spacing: .02em; }
.stat-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; color: var(--forest); background: var(--mint-soft); }
.stat-icon .icon { width: 15px; height: 15px; }
.stat-icon.amber { color: var(--amber); background: var(--amber-soft); }
.stat-icon.blue { color: var(--blue); background: var(--blue-soft); }
.stat-icon.orange { color: var(--orange); background: var(--orange-soft); }
.stat-icon.red { color: var(--red); background: var(--red-soft); }
.stat-value {
  margin-top: 15px;
  font-family: var(--font-mono);
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.1;
  letter-spacing: -.045em;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.stat-value .unit { margin-left: 2px; font-family: var(--font-sans); font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.stat-foot { position: relative; z-index: 1; margin-top: 8px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.stat-card--dark {
  color: #f6f5e9;
  border-color: rgba(255, 255, 255, .07);
  background:
    radial-gradient(circle at 100% 0, rgba(217, 244, 129, .14), transparent 10rem),
    var(--forest);
}
.stat-card--dark::after { border-color: rgba(255, 255, 255, .07); }
.stat-card--dark .stat-label, .stat-card--dark .stat-foot { color: rgba(238, 243, 231, .5); }
.stat-card--dark .stat-value { color: var(--lime); }
.stat-card--dark .stat-icon { color: var(--forest-deep); background: var(--lime); }
.stat-card--lime {
  color: var(--forest-deep);
  border-color: #c7e074;
  background: var(--lime);
}
.stat-card--lime::after { border-color: rgba(20, 59, 46, .1); }
.stat-card--lime .stat-label, .stat-card--lime .stat-foot { color: rgba(20, 59, 46, .58); }
.stat-card--lime .stat-icon { color: var(--lime); background: var(--forest); }

/* --------------------------------------------------------------------------
   Empty / alerts
   -------------------------------------------------------------------------- */

.empty-state {
  min-height: 240px;
  padding: 38px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, .42);
}
.empty-icon { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 15px; color: var(--muted); background: var(--bg-deep); }
.empty-icon .icon { width: 23px; height: 23px; }
.empty-state h3 { margin-top: 14px; font-size: 14px; font-weight: 750; }
.empty-state p { max-width: 340px; margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.empty-state .btn { margin-top: 16px; }
.inline-empty { padding: 22px; text-align: center; color: var(--muted); font-size: 11px; border: 1px dashed var(--line); border-radius: 12px; }

.inline-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper-soft);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}
.inline-alert .icon { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.inline-alert strong { color: var(--ink-soft); }
.inline-alert.warn { border-color: #ebd6ac; background: var(--amber-soft); color: #846225; }
.inline-alert.danger { border-color: #edcac5; background: var(--red-soft); color: #91423e; }
.inline-alert.success { border-color: #cce3d1; background: #edf7ef; color: #3d7454; }
.inline-alert.info { border-color: #cbdde9; background: var(--blue-soft); color: #446c86; }

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

.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.data-table th {
  padding: 10px 12px;
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 600;
  text-align: left;
  letter-spacing: .04em;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
}
.data-table td { padding: 13px 12px; border-bottom: 1px solid rgba(225, 219, 207, .7); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background .15s; }
.data-table tbody tr:hover { background: rgba(250, 247, 239, .8); }
.table-user { display: flex; align-items: center; gap: 9px; min-width: 130px; }
.table-user strong { display: block; font-size: 11px; }
.table-user span { display: block; color: var(--muted); font-family: var(--font-mono); font-size: 8px; }
.money { font-family: var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 650; letter-spacing: -.02em; }
.money.positive { color: var(--green); }
.money.negative { color: var(--orange); }

/* --------------------------------------------------------------------------
   Modal / toast
   -------------------------------------------------------------------------- */

#modal-root { position: relative; z-index: 100; }
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(9, 25, 18, .54);
  backdrop-filter: blur(7px);
  opacity: 0;
  animation: backdropIn .2s ease forwards;
}
@keyframes backdropIn { to { opacity: 1; } }
.modal-card {
  width: min(100%, 560px);
  max-height: min(90vh, 860px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 22px;
  background: var(--paper);
  box-shadow: var(--shadow-lg);
  transform: translateY(12px) scale(.99);
  animation: modalIn .24s cubic-bezier(.22, .9, .26, 1) forwards;
}
@keyframes modalIn { to { transform: none; } }
.modal-card.modal-wide { width: min(100%, 760px); }
.modal-card.modal-narrow { width: min(100%, 420px); }
.modal-head {
  position: relative;
  flex: none;
  padding: 22px 24px 17px;
  border-bottom: 1px solid var(--line);
}
.modal-head .eyebrow { font-size: 9px; }
.modal-head h2 { margin-top: 7px; font-size: 20px; line-height: 1.3; letter-spacing: -.025em; }
.modal-head p { margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.modal-close {
  position: absolute;
  top: 17px;
  right: 17px;
  width: 32px;
  height: 32px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  background: var(--paper);
}
.modal-close:hover { color: var(--ink); background: var(--paper-soft); }
.modal-close .icon { width: 15px; height: 15px; }
.modal-body { overflow-y: auto; padding: 22px 24px; }
.modal-foot {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  padding: 16px 24px calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(250, 247, 239, .75);
}
.modal-note { margin-top: 14px; padding: 11px 12px; border-radius: 10px; background: var(--paper-soft); color: var(--muted); font-size: 10px; line-height: 1.65; }
.modal-note strong { color: var(--ink-soft); }
.modal-summary { display: grid; gap: 9px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper-soft); }
.summary-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; font-size: 11px; }
.summary-row span { color: var(--muted); }
.summary-row strong { text-align: right; font-weight: 650; }
.summary-row.total { padding-top: 9px; border-top: 1px dashed var(--line); font-size: 13px; }
.summary-row.total strong { color: var(--forest); font-family: var(--font-mono); font-size: 18px; }
.modal-actions-stack { display: grid; gap: 8px; width: 100%; }
.modal-actions-row { display: flex; gap: 8px; width: 100%; }
.modal-actions-row .btn { flex: 1; }

.confirm-visual { width: 52px; height: 52px; margin: 2px auto 14px; display: grid; place-items: center; border-radius: 15px; color: var(--orange); background: var(--orange-soft); }
.confirm-visual.danger { color: var(--red); background: var(--red-soft); }
.confirm-visual .icon { width: 23px; height: 23px; }
.confirm-copy { text-align: center; }
.confirm-copy h2 { font-size: 19px; letter-spacing: -.02em; }
.confirm-copy p { margin-top: 7px; color: var(--muted); font-size: 12px; line-height: 1.7; }

.toast-root {
  position: fixed;
  z-index: 300;
  right: 22px;
  bottom: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 12px;
  color: #f5f5e9;
  background: rgba(20, 59, 46, .96);
  box-shadow: var(--shadow-md);
  font-size: 11px;
  line-height: 1.55;
  opacity: 0;
  transform: translateY(7px);
  animation: toastIn .22s ease forwards;
  pointer-events: auto;
}
.toast.is-leaving { animation: toastOut .2s ease forwards; }
.toast .icon { width: 16px; height: 16px; flex: none; margin-top: 1px; color: var(--lime); }
.toast.error { background: #702f2d; border-color: rgba(255,255,255,.08); }
.toast.error .icon { color: #ffc1b8; }
.toast.info .icon { color: #b8d6ff; }
@keyframes toastIn { to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(6px); } }
.toast-content { flex: 1; }
.toast-title { font-weight: 700; }
.toast-message { color: rgba(246, 247, 239, .72); margin-top: 2px; }

/* Loading */
.loading-block { min-height: 280px; display: grid; place-items: center; }
.spinner {
  width: 22px;
  height: 22px;
  border: 2px solid rgba(20, 59, 46, .18);
  border-top-color: var(--forest);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.btn .spinner { width: 14px; height: 14px; border-color: rgba(255,255,255,.35); border-top-color: currentColor; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { border-radius: 8px; background: linear-gradient(90deg, rgba(21,36,29,.05) 25%, rgba(21,36,29,.09) 50%, rgba(21,36,29,.05) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* --------------------------------------------------------------------------
   Misc content primitives
   -------------------------------------------------------------------------- */

.local-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
}
.local-note .icon { width: 13px; height: 13px; flex: none; margin-top: 2px; }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--muted);
  background: var(--paper-soft);
  font-size: 9px;
  line-height: 1.3;
  white-space: nowrap;
}
.tag .icon { width: 11px; height: 11px; }
.kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border: 1px solid var(--line);
  border-bottom-color: var(--line-strong);
  border-radius: 5px;
  background: var(--paper);
  font-family: var(--font-mono);
  font-size: 9px;
}
.progress-track { width: 100%; height: 5px; overflow: hidden; border-radius: 99px; background: var(--bg-deep); }
.progress-fill { height: 100%; border-radius: inherit; background: var(--forest); }
