html {
  color-scheme: light dark;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

:root,
html[data-theme="light"] {
  --bg: #f4efe6;
  --bg-2: #ebe4d6;
  --ink: #1b1814;
  --ink-2: #2a261f;
  --paper: #1b1814;
  --paper-2: #4a453c;
  --muted: #6f685c;
  --card: rgba(255, 252, 246, .78);
  --card-solid: #fffdf8;
  --card-strong: #f7f1e6;
  --brass: #8d6a24;
  --brass-2: #6f5218;
  --seal: #9a3b32;
  --moss: #3f5d48;
  --late: #b4534a;
  --line: rgba(80, 64, 32, .12);
  --field: #fffdf8;
  --shadow: 0 10px 40px rgba(40, 32, 16, .06);
  --header: rgba(244, 239, 230, .84);
  --knob: #fffdf8;
  --glow: rgba(141, 106, 36, .18);
  --theme-meta: #f4efe6;
}

html[data-theme="dark"] {
  --bg: #12151a;
  --bg-2: #1a1f27;
  --ink: #12151a;
  --ink-2: #1a1f27;
  --paper: #ece7db;
  --paper-2: #c9c2b2;
  --muted: #8d8678;
  --card: rgba(26, 31, 39, .78);
  --card-solid: #1a1f27;
  --card-strong: #161b22;
  --brass: #c9a45a;
  --brass-2: #e4d0a0;
  --seal: #c56b62;
  --moss: #7ea48a;
  --late: #e07a71;
  --line: rgba(212, 184, 120, .16);
  --field: #10141a;
  --shadow: 0 12px 40px rgba(0, 0, 0, .28);
  --header: rgba(18, 21, 26, .82);
  --knob: #ece7db;
  --glow: rgba(201, 164, 90, .22);
  --theme-meta: #12151a;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: Figtree, system-ui, sans-serif;
  background:
    radial-gradient(1100px 520px at 8% -8%, var(--glow), transparent 55%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  color: var(--paper);
  letter-spacing: .01em;
  overflow-x: hidden;
  transition: background .45s ease, color .35s ease;
}
.grain {
  pointer-events: none;
  position: fixed; inset: 0;
  opacity: .045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.8' /%3E%3C/filter%3E%3Crect width='80' height='80' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
  z-index: 0;
}
html[data-theme="light"] .grain { opacity: .03; }

.adminbar, .top, main, .foot { position: relative; z-index: 1; }

.adminbar {
  display: flex; gap: 14px; align-items: center; flex-wrap: nowrap;
  overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
  padding: 8px 5vw;
  background: color-mix(in srgb, var(--ink-2) 88%, black);
  color: #f3ead6;
  font-size: .82rem;
}
.adminbar::-webkit-scrollbar { display: none; }
.adminbar a { color: #e8dcc0; text-decoration: none; white-space: nowrap; }
.adminbar .grow { margin-left: auto; }

.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; flex-wrap: wrap;
  padding: 12px 5vw;
  border-bottom: 1px solid var(--line);
  background: var(--header);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.brand {
  display: flex; align-items: center; gap: 10px;
  color: var(--brass-2); text-decoration: none;
  font-family: Fraunces, serif; font-size: 1.35rem; font-weight: 700;
}
.brand small { font-family: Figtree, sans-serif; font-size: .68rem; font-weight: 500; color: var(--muted); letter-spacing: .04em; }
.lantern {
  width: 16px; height: 16px; border-radius: 50%;
  background: radial-gradient(circle, #ffe7a3, var(--brass) 55%, transparent 70%);
  box-shadow: 0 0 14px var(--glow);
}
.top-tools { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; justify-content: flex-end; }
.nav-scroll {
  display: flex; gap: 4px; align-items: center;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none; max-width: 100%;
  mask-image: linear-gradient(90deg, transparent, #000 12px, #000 calc(100% - 12px), transparent);
}
.nav-scroll::-webkit-scrollbar { display: none; }
.nav-scroll a, nav a {
  color: var(--paper-2); text-decoration: none; font-size: .9rem; white-space: nowrap;
  padding: .45rem .75rem; border-radius: 99px;
  display: inline-flex; align-items: center; min-height: 38px;
}
.nav-scroll a:hover, nav a:hover { color: var(--brass); }
.nav-scroll a.on {
  color: var(--ink); background: var(--brass);
}
.nav-scroll a.nav-quiet { opacity: .72; }
.nav-scroll a.btn, .nav-scroll a.btn-tiny {
  color: var(--ink);
  background: var(--brass);
  padding: .4rem .85rem;
}
.langs { display: flex; gap: 6px; padding-left: 8px; border-left: 1px solid var(--line); }
.langs a { opacity: .45; font-size: .75rem; letter-spacing: .06em; }
.langs a.on { opacity: 1; color: var(--brass); }

.theme-switch {
  --w: 46px;
  width: var(--w); height: 26px; border-radius: 99px;
  border: 1px solid var(--line); background: var(--field);
  position: relative; cursor: pointer; padding: 0; flex-shrink: 0;
}
.theme-switch .knob {
  position: absolute; top: 2px; left: 2px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--brass); box-shadow: var(--shadow);
  transition: transform .28s ease;
}
html[data-theme="dark"] .theme-switch .knob { transform: translateX(20px); }

main { padding: 28px 5vw 72px; max-width: 1120px; margin: 0 auto; }
.foot { padding: 24px 5vw 40px; color: var(--muted); font-size: .85rem; border-top: 1px solid var(--line); }
h1, h2, h3 { font-family: Fraunces, serif; font-weight: 700; line-height: 1.15; color: var(--paper); }
h1 { font-size: clamp(2rem, 4.4vw, 3.3rem); margin: 0 0 .4em; }
.is-app h1 { font-size: clamp(1.5rem, 2.8vw, 2.1rem); letter-spacing: -.01em; }
.eyebrow { text-transform: uppercase; letter-spacing: .22em; color: var(--brass); font-size: .72rem; margin: 0 0 8px; }
.lead { font-size: 1.12rem; line-height: 1.55; max-width: 38rem; color: var(--paper-2); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.btn, button.btn {
  display: inline-block; background: var(--brass); color: var(--ink);
  border: 0; padding: .8rem 1.2rem; font-weight: 700; text-decoration: none; cursor: pointer;
  font-family: inherit; font-size: 1rem; border-radius: 12px;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease, background-color .2s ease;
}
.btn:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--brass); border: 1px solid color-mix(in srgb, var(--brass) 55%, transparent); }
.btn-tiny { padding: .45rem .8rem; font-size: .9rem; }
.danger { color: var(--late); border-color: var(--seal); }
.hero { padding: 5vh 0 6vh; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 22px 0; }
.pills { display: flex; gap: 8px; flex-wrap: nowrap; padding: 0 0 6px; list-style: none; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.pills::-webkit-scrollbar { display: none; }
.pills li { border: 1px solid var(--line); padding: .35rem .7rem; color: var(--brass); font-size: .85rem; white-space: nowrap; border-radius: 99px; }
.grid-3, .grid-2 { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin: 18px 0 40px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin: 18px 0; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  padding: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  border-radius: 18px;
}
.card.ink { background: var(--card-strong); }
.strip { margin: 20px 0 10px; }
.brief { display: flex; justify-content: space-between; gap: 16px; align-items: end; flex-wrap: wrap; margin-bottom: 22px; }
.privacy { font-size: .9rem; color: var(--muted); max-width: 40rem; margin: 0 0 18px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 22px; }
.stat { border: 1px solid var(--line); padding: 16px 18px; background: var(--card); border-radius: 16px; }
.stat b { display: block; font-family: Fraunces, serif; font-size: 2rem; }
.stat.warn b { color: var(--brass); }
.stat.late b { color: var(--late); }
.toast {
  position: sticky; top: 64px; z-index: 15;
  margin: 12px 5vw 0; padding: 12px 16px;
  border: 1px solid var(--line); background: var(--card-solid);
  border-radius: 4px; transition: opacity .4s ease;
}
.toast.ok { border-color: var(--moss); color: var(--moss); }
.toast.err { border-color: var(--seal); color: var(--late); }
label { display: block; margin: 12px 0; font-size: .92rem; }
input, select, textarea {
  width: 100%; margin-top: 6px; padding: .8rem .85rem;
  background: var(--field); color: var(--paper);
  border: 1px solid var(--line); font: inherit; border-radius: 10px;
}
input:focus, select:focus, textarea:focus, .btn:focus-visible, .theme-switch:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 2px;
}
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; gap: 8px; align-items: center; }
.check input { width: auto; }
.drop {
  position: relative;
  border: 1.5px dashed color-mix(in srgb, var(--brass) 55%, transparent);
  padding: 28px 20px; text-align: center; display: grid; gap: 8px; place-items: center;
  border-radius: 16px; background: color-mix(in srgb, var(--card-strong) 70%, transparent);
  transition: border-color .2s ease, background .2s ease;
}
.drop strong { font-size: 1.05rem; }
.drop span { color: var(--muted); font-size: .9rem; max-width: 28rem; }
.drop:hover, .drop.hover { border-color: var(--brass); background: var(--card-strong); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.scan-pick {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
  margin-top: 10px; width: 100%; max-width: 28rem;
}
.scan-pick .btn { flex: 1 1 180px; min-height: 44px; }
.preview-wrap {
  width: 100%;
  margin: 4px 0 0;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.preview-wrap img, .doc-img {
  display: block;
  width: 100%;
  max-width: 100%;
  max-height: min(70vh, 560px);
  height: auto;
  object-fit: contain;
  background: var(--field);
  border: 0;
  border-radius: 0;
}
.doc-img {
  border-radius: 12px;
  border: 1px solid var(--line);
}
.scan-tape-hint {
  display: block;
  margin-top: .35rem;
  color: var(--muted);
  font-size: .86rem;
  max-width: 28rem;
}
.tape-previews {
  display: grid;
  gap: 8px;
}
.tape-slot {
  position: relative;
  background: var(--field);
}
.tape-slot img {
  max-height: min(42vh, 340px);
}
.tape-slot .tape-label {
  position: absolute;
  left: 8px;
  top: 8px;
  margin: 0;
  padding: .2rem .5rem;
  font-size: .75rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--card) 86%, transparent);
  color: var(--paper);
}
.tape-slot .tape-x {
  position: absolute;
  right: 8px;
  top: 8px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--card) 86%, transparent);
  color: var(--paper);
  cursor: pointer;
}
.doc-photos {
  display: grid;
  gap: 12px;
}
.doc-photos figure { margin: 0; }
.doc-photos figcaption {
  margin-top: 6px;
  font-size: .85rem;
  color: var(--muted);
}
.doc-photos .doc-img {
  max-height: min(70vh, 640px);
}
#preview.hidden { display: none; }
.scan-filename {
  margin: 0;
  padding: .65rem .85rem;
  font-size: .9rem;
  color: var(--paper);
  background: var(--card-strong);
}
.photo-upload { margin-top: 12px; }
.photo-pick input { display: none; }
.vault-thumb {
  display: inline-block;
  width: 92px;
  height: 118px;
  margin-right: 10px;
  vertical-align: top;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--field);
  flex: 0 0 92px;
}
.vault-thumb img {
  width: 92px;
  height: 118px;
  object-fit: contain;
  display: block;
  background: var(--field);
}
.shots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.shot {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  background: var(--card-solid, var(--card));
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.shot:hover { border-color: var(--brass); }
.shot-pic {
  display: block;
  aspect-ratio: 3 / 4;
  background: var(--field);
  overflow: hidden;
}
.shot-pic img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: var(--field);
  pointer-events: none;
}
.shot-empty {
  display: grid;
  place-items: center;
  height: 100%;
  min-height: 140px;
  padding: 12px;
  color: var(--muted);
  text-align: center;
  font-size: .9rem;
}
.shot-meta {
  display: grid;
  gap: 4px;
  padding: 10px 12px 12px;
}
.shot-meta strong {
  font-size: .95rem;
  color: var(--paper);
  line-height: 1.25;
}
.shot-meta small {
  color: var(--brass);
  font-size: .82rem;
  line-height: 1.35;
}
.remind-row {
  display: flex;
  gap: 12px;
  align-items: center;
}
.remind-row > div { min-width: 0; }
.radar a { display: flex; gap: 10px; align-items: center; text-decoration: none; }
.radar-shot {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  flex: 0 0 56px;
}
@media (min-width: 720px) {
  .shots { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}
.progress { margin: 12px 0; }
.bar { height: 6px; width: 0; background: var(--brass); transition: width .2s; border-radius: 99px; }
.hidden { display: none !important; }
.fields { margin-top: 8px; }
.why { color: var(--muted); font-size: .9rem; }
.rights { color: var(--brass); }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); align-items: baseline; flex-wrap: wrap; }
.timeline time { color: var(--brass); min-width: 6.5rem; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: .55rem .3rem; border-bottom: 1px solid var(--line); vertical-align: top; }
a { color: var(--brass); }
.tag { display: inline-block; font-size: .75rem; padding: .15rem .45rem; border: 1px solid var(--line); border-radius: 99px; }
.filters { display: flex; gap: 8px; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 8px; }
.filters::-webkit-scrollbar { display: none; }
.filters a { border: 1px solid var(--line); padding: .35rem .7rem; text-decoration: none; white-space: nowrap; border-radius: 99px; color: var(--paper-2); }
.filters a.on { background: var(--brass); color: var(--ink); border-color: transparent; }
.auth-wrap { display: grid; place-items: start center; padding-top: 4vh; }
.auth-card { max-width: 420px; width: 100%; }
.cal-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.cal-head, .cal { display: grid; grid-template-columns: repeat(7, minmax(92px, 1fr)); gap: 6px; min-width: 680px; }
.cal-head { color: var(--muted); font-size: .8rem; margin-bottom: 8px; }
.cal-day { min-height: 88px; border: 1px solid var(--line); padding: 6px; font-size: .78rem; background: var(--card); }
.cal-day.empty { opacity: .3; }
.cal-day.today { outline: 1px solid var(--brass); }
.cal-day a { display: block; margin-top: 4px; }
.radar { list-style: none; padding: 0; }
.radar li { display: flex; gap: 14px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.risk {
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
  border: 3px solid color-mix(in srgb, var(--late) calc(var(--p) * 1%), var(--moss));
  font-family: Fraunces, serif;
}
.ocr, .code { white-space: pre-wrap; font-size: .8rem; background: var(--field); padding: 12px; overflow: auto; -webkit-overflow-scrolling: touch; }
.ok-line { color: var(--moss); }
.warn-line { color: var(--brass); }
.linkish { background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; }
.guess { padding: 10px 12px; border-left: 3px solid var(--brass); background: var(--card-strong); }
.wp-content { line-height: 1.65; max-width: 42rem; }
.wp-content img { max-width: 100%; height: auto; }
.posts { display: grid; gap: 16px; }
.post-tease h2 { font-size: 1.35rem; margin: 0 0 .3em; }
.admin-shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.admin-side {
  background: var(--card-strong); border-right: 1px solid var(--line);
  padding: 22px 16px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.admin-side a { display: block; padding: .45rem 0; color: var(--paper-2); text-decoration: none; }
.admin-side a:hover, .admin-side a.on { color: var(--brass); }
.admin-main { padding: 28px 32px 64px; overflow-x: auto; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.media-grid img { width: 100%; height: 110px; object-fit: cover; border: 1px solid var(--line); }

.spend-card { margin: 18px 0; }
.spend-toolbar { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; margin-bottom: .8rem; }
.spend-toolbar h2 { margin: 0; }
.spend-periods { display: flex; gap: 6px; flex-wrap: wrap; }
.spend-periods a {
  border: 1px solid var(--line); padding: .35rem .75rem; text-decoration: none; border-radius: 99px;
  color: var(--paper); font-size: .9rem;
}
.spend-periods a.on { background: var(--brass); color: var(--ink); border-color: transparent; }
.spend-shift { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 0 0 1rem; }
.spend-shift strong { font-family: Fraunces, serif; min-width: 8rem; text-align: center; }
.spend-lead { margin: 0 0 1.1rem; }
.spend-chart {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 28px;
  align-items: center;
}
.spend-donut-wrap { position: relative; width: 180px; height: 180px; margin: 0 auto; }
.spend-donut {
  width: 180px; height: 180px; border-radius: 50%;
  box-shadow: var(--shadow);
}
.spend-donut-wrap::after {
  content: "";
  position: absolute; inset: 42px;
  background: var(--card-solid);
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px var(--line);
}
.spend-donut-center {
  position: absolute; inset: 42px; z-index: 1;
  display: grid; place-content: center; text-align: center; gap: 2px;
}
.spend-donut-center strong { font-family: Fraunces, serif; font-size: 1.05rem; }
.spend-donut-center span { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.spend-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.spend-bars li { display: grid; grid-template-columns: 1.6rem 1fr auto; gap: 10px; align-items: center; }
.spend-rank {
  font-family: Fraunces, serif; color: var(--brass); font-size: 1.05rem; text-align: center;
}
.spend-meta { min-width: 0; }
.spend-name { display: block; font-weight: 600; }
.spend-sub { display: block; font-size: .78rem; color: var(--muted); margin: .1rem 0 .35rem; }
.spend-track {
  display: block; height: 8px; border-radius: 99px; background: var(--line); overflow: hidden;
}
.spend-fill {
  display: block; height: 100%; border-radius: 99px;
  transform-origin: left center;
  animation: spend-grow .7s ease both;
}
.spend-amt { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
.spend-netnote { margin: -.4rem 0 1rem; font-size: .88rem; }
.cheap-wrap { margin-top: 1.4rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.cheap-wrap h3 { margin: 0 0 .35rem; }
.cheap-cat { margin: 1rem 0 .4rem; font-size: .82rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.cheap-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cheap-item {
  display: flex; flex-direction: column; gap: 2px;
  padding: .7rem .85rem; border: 1px solid var(--line); border-radius: 12px;
  text-decoration: none; color: inherit; background: var(--field);
}
.cheap-item:hover { border-color: var(--brass); }
.cheap-item strong { color: var(--paper); }
.cheap-item span { color: var(--brass); font-size: .88rem; }
.basket-card { margin-top: 12px; }
.basket-sums, .basket-lines { list-style: none; margin: 0; padding: 0; }
.basket-sums { display: flex; flex-wrap: wrap; gap: 8px; margin: .6rem 0 1rem; }
.basket-sums li {
  display: flex; gap: 8px; align-items: baseline;
  border: 1px solid var(--line); border-radius: 99px; padding: .25rem .7rem;
}
.basket-lines li {
  display: grid; grid-template-columns: 1fr auto auto; gap: 10px;
  padding: .45rem 0; border-bottom: 1px solid var(--line); align-items: baseline;
}
.basket-lines li > a { min-width: 0; }
.basket-name { color: var(--paper); }
.basket-name small { display: block; color: var(--muted); font-size: .8rem; font-weight: 500; margin-top: 2px; }
.basket-cmp { text-decoration: none; min-width: 0; }
.basket-cmp .basket-name { color: var(--paper); }
.basket-deal { color: var(--brass) !important; }
.basket-cmp:hover .basket-name { color: var(--brass); }
.basket-cat { color: var(--muted); font-size: .8rem; }
.basket-scan { margin: 12px 0; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--card-strong); }
.basket-scan h3 { margin: 0 0 .6rem; font-size: 1rem; }
#wydatki { scroll-margin-top: 88px; }
#pisemne { scroll-margin-top: 96px; }
@keyframes spend-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

@media (max-width: 860px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { position: relative; height: auto; display: flex; gap: 12px; overflow-x: auto; padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .admin-side a { white-space: nowrap; padding: .35rem .2rem; }
  .admin-main { padding: 18px 16px 48px; }
  .top { padding: 10px 4vw; }
  main { padding: 18px 4vw 56px; }
  .row2 { grid-template-columns: 1fr; }
  .hero { padding: 3vh 0 4vh; }
  .spend-chart { grid-template-columns: 1fr; }
  .spend-donut-wrap { margin-bottom: 8px; }
}
@supports (padding: max(0px)) {
  .top, .foot, main, .adminbar { padding-left: max(5vw, env(safe-area-inset-left)); padding-right: max(5vw, env(safe-area-inset-right)); }
}

@media (display-mode: standalone) {
  .top { padding-top: max(12px, env(safe-area-inset-top)); }
  .foot { padding-bottom: max(28px, env(safe-area-inset-bottom)); }
}

.skip {
  position: absolute; left: -999px; top: 8px; z-index: 80;
  background: var(--brass); color: var(--ink); padding: .55rem .9rem; border-radius: 10px;
  font-weight: 700; text-decoration: none;
}
.skip:focus { left: 12px; }

.lang-menu { position: relative; flex-shrink: 0; }
.lang-menu summary {
  list-style: none; cursor: pointer;
  border: 1px solid var(--line); border-radius: 99px;
  padding: .35rem .7rem; font-size: .78rem; letter-spacing: .08em; font-weight: 600;
  color: var(--paper-2); background: var(--field);
}
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary::marker { content: ""; }
.lang-menu > div {
  position: absolute; right: 0; top: calc(100% + 8px);
  background: var(--card-solid); border: 1px solid var(--line);
  border-radius: 12px; padding: 6px; min-width: 4.8rem;
  box-shadow: var(--shadow); z-index: 40; display: grid; gap: 2px;
}
.lang-menu a {
  display: block; padding: .4rem .55rem; text-decoration: none; border-radius: 8px;
  color: var(--paper); font-size: .85rem; letter-spacing: .04em;
}
.lang-menu a.on { background: var(--brass); color: var(--ink); }

.btn-block { display: block; width: 100%; text-align: center; }
.btn-ghost.danger { color: var(--late); border-color: color-mix(in srgb, var(--late) 50%, transparent); }

.empty {
  text-align: center; padding: 1.6rem 1rem 1.2rem;
}
.empty p { color: var(--muted); margin: 0 0 1rem; line-height: 1.5; }

.card.step { padding-top: 22px; }
.step-n {
  display: inline-grid; place-items: center;
  width: 2rem; height: 2rem; border-radius: 50%;
  background: var(--brass); color: var(--ink);
  font-weight: 700; margin-bottom: .7rem; font-family: Fraunces, serif;
}
.card.step h2 { font-size: 1.25rem; margin: 0 0 .45em; }
.card.step p { margin: 0; color: var(--paper-2); line-height: 1.5; }

.card-more { margin: 14px 0 0; text-align: right; }
.auth-alt { margin: 1.1rem 0 .4rem; }
.auth-back { font-size: .9rem; margin: 0; }
.auth-card h1 { font-size: clamp(1.6rem, 3vw, 2rem); }
.auth-wrap .btn-block { margin-top: .4rem; }

.form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.actions-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.stack { display: grid; gap: .35rem; }
.scan-layout { max-width: 640px; }
.scan-or { display: flex; align-items: center; gap: 12px; margin: 14px 0; color: var(--muted); font-size: .85rem; }
.scan-or::before, .scan-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

table tbody tr:hover { background: color-mix(in srgb, var(--brass) 8%, transparent); }
.timeline li:last-child, .radar li:last-child { border-bottom: 0; }
.privacy { line-height: 1.45; }
.prose-card { max-width: 720px; margin: 0 auto; }
.cal-nav { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.spend-empty { margin: 0; }

html[data-theme="dark"] .nav-scroll a.on { color: #12151a; }

@media (max-width: 720px) {
  .top { align-items: flex-start; }
  .top-tools { width: 100%; justify-content: space-between; }
  .nav-scroll { mask-image: none; flex: 1; }
  .brief { align-items: stretch; }
  .brief .hero-actions { width: 100%; }
  .brief .hero-actions .btn { flex: 1; text-align: center; }
  .hero-actions { gap: 10px; }
  .hero-actions .btn { flex: 1 1 auto; text-align: center; }
}
