/* ==========================================================================
   Vronis Schnickschnack
   Palette named after the workshop: raw clay, glaze, oxide.
   Public pages: photos first, quiet type, one memorable element (the shelf).
   Admin: same tokens, built for thumbs.
   ========================================================================== */

@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-latin-full-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-latin-full-italic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Work Sans";
  src: url("../fonts/work-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Work Sans";
  src: url("../fonts/work-sans-latin-wght-italic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

:root {
  --paper: #f6f3ee;      /* page – unglazed porcelain */
  --surface: #fffdf9;    /* cards, inputs */
  --clay: #e6ded2;       /* fills, shelf board */
  --line: #d8cec0;       /* borders */
  --ink: #2a231e;        /* text – iron brown */
  --muted: #75695f;      /* secondary text */
  --glaze: #56602f;      /* accent – olive celadon glaze */
  --glaze-dark: #414922;
  --glaze-soft: #e3e6d3;
  --oxide: #9c4a26;      /* sold, warnings, destructive */
  --oxide-soft: #f3e1d6;
  --ochre: #b8862f;      /* small marks, reserved */
  --ochre-soft: #f4e8cf;

  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans: "Work Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --step--1: 0.875rem;
  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: 1.6rem;
  --step-3: clamp(2rem, 4vw, 2.6rem);
  --step-4: clamp(2.5rem, 7vw, 4.6rem);

  --gutter: clamp(1rem, 4vw, 2.5rem);
  --maxw: 74rem;
  --radius: 6px;
  --tap: 48px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1d1916;
    --surface: #26211d;
    --clay: #332c26;
    --line: #463d35;
    --ink: #efe8de;
    --muted: #ab9e91;
    --glaze: #b3bd85;
    --glaze-dark: #c9d29c;
    --glaze-soft: #333722;
    --oxide: #e08a62;
    --oxide-soft: #3f2a20;
    --ochre: #d9ae5f;
    --ochre-soft: #3a3020;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
fieldset { min-width: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--glaze); }
:focus-visible { outline: 2px solid var(--glaze); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 450;
  font-variation-settings: "SOFT" 100, "WONK" 0;
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
}
h1 { font-size: var(--step-3); }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: var(--step--1); }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- prose (markdown content) ---------- */
.prose { max-width: 38rem; }
.prose h2 { margin-top: 1.6em; }
.prose h3 { margin-top: 1.4em; }
.prose img { border-radius: var(--radius); margin: 1.5em 0; }
.prose blockquote {
  margin: 1.5em 0; padding: 0.8em 1em; border-left: 3px solid var(--ochre);
  background: var(--ochre-soft); border-radius: 0 var(--radius) var(--radius) 0;
}
.prose blockquote p:last-child { margin: 0; }
.prose ol, .prose ul { padding-left: 1.3em; }
.prose li { margin-bottom: 0.4em; }

/* ==========================================================================
   Public layout
   ========================================================================== */
.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }

.masthead {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem 2rem;
  padding-block: 1.4rem 1rem;
}
.wordmark {
  font-family: var(--serif);
  font-size: 1.55rem;
  font-weight: 500;
  font-style: italic;
  font-variation-settings: "SOFT" 100, "WONK" 1;
  text-decoration: none;
  letter-spacing: -0.015em;
  margin-right: auto;
}
.wordmark:hover { color: var(--ink); }
.mainnav { display: flex; gap: 0.25rem 1.3rem; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.mainnav::-webkit-scrollbar { display: none; }
.mainnav a { text-decoration: none; color: var(--muted); white-space: nowrap; padding-block: 0.4rem; }
.mainnav a:hover, .mainnav a[aria-current="page"] { color: var(--ink); }
.mainnav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--glaze); text-decoration-thickness: 2px; text-underline-offset: 0.45em; }
@media (max-width: 640px) {
  .masthead { padding-block: 1rem 0.5rem; }
  .mainnav { width: 100%; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); width: calc(100% + 2 * var(--gutter)); }
}

main.page { padding-block: 1.5rem 4rem; min-height: 60vh; }

.footer {
  border-top: 1px solid var(--line);
  padding-block: 2.5rem 3rem;
  color: var(--muted);
  font-size: var(--step--1);
  display: grid;
  gap: 1.5rem 3rem;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
}
.footer h2 { font-size: 1.1rem; color: var(--ink); margin-bottom: 0.4rem; }
.footer p { margin: 0 0 0.3rem; }
.footer a { text-decoration: none; }
.footer a:hover { text-decoration: underline; }
.footer__links { display: flex; flex-direction: column; gap: 0.2rem; }
.withdraw-link {
  display: inline-block; margin-top: 0.6rem; padding: 0.45rem 0.9rem; border: 1px solid var(--ink);
  border-radius: 999px; color: var(--ink); text-decoration: none !important; font-weight: 500;
}

/* ---------- the shelf: the one memorable element ---------- */
.shelf { margin-block: 1rem 3rem; }
.shelf__intro { max-width: 34rem; margin-bottom: 2rem; }
.shelf__intro h1 {
  font-size: var(--step-4);
  font-weight: 380;
  font-variation-settings: "SOFT" 100, "WONK" 1, "opsz" 144;
  letter-spacing: -0.025em;
  margin-bottom: 0.35em;
}
.shelf__intro p { font-size: 1.1rem; color: var(--muted); }
.shelf__board {
  display: flex; align-items: flex-end; gap: clamp(0.75rem, 2.5vw, 2rem);
  overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: thin;
  padding: 0 var(--gutter) 0; margin-inline: calc(var(--gutter) * -1);
  position: relative;
}
.shelf__board::after {
  /* the wooden board the pieces stand on */
  content: ""; position: sticky; left: 0; flex: 0 0 0;
}
.shelf__rail { height: 14px; background: var(--clay); border-radius: 2px; margin-top: -1px; box-shadow: inset 0 -4px 0 rgb(0 0 0 / 0.06); }
.shelf__item {
  flex: 0 0 auto; scroll-snap-align: start; text-decoration: none; display: block;
}
.shelf__item img { width: auto; border-radius: 3px 3px 0 0; background: var(--clay); }
.shelf__item:nth-child(3n+1) img { height: clamp(220px, 34vw, 380px); }
.shelf__item:nth-child(3n+2) img { height: clamp(170px, 26vw, 290px); }
.shelf__item:nth-child(3n) img { height: clamp(200px, 30vw, 330px); }
.shelf__caption { display: flex; justify-content: space-between; gap: 1rem; padding-top: 1.1rem; font-size: var(--step--1); color: var(--muted); }
.shelf__caption strong { font-weight: 500; color: var(--ink); }

/* ---------- sections ---------- */
.section { margin-block: 4rem; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.4rem; flex-wrap: wrap; }
.section__head h2 { margin: 0; }
.section__head a { color: var(--muted); }
.lead { font-size: 1.15rem; max-width: 38rem; }

/* ---------- gallery / product grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
  gap: 2.2rem var(--gutter);
}
@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr 1fr; gap: 1.5rem 0.9rem; }
  .tile__meta { flex-direction: column; gap: 0; }
  .tile__title { font-size: 0.95rem; }
}
.tile { text-decoration: none; display: block; }
.tile__img { aspect-ratio: 4 / 5; overflow: hidden; background: var(--clay); border-radius: 3px; }
.tile__img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.tile:hover .tile__img img { transform: scale(1.025); }
.tile__meta { display: flex; justify-content: space-between; gap: 1rem; margin-top: 0.6rem; }
.tile__title { font-family: var(--serif); font-size: 1.05rem; line-height: 1.3; }
.tile__price { white-space: nowrap; color: var(--muted); }
.tile--sold .tile__img img { opacity: 0.55; filter: saturate(0.6); }
.tile--sold .tile__price { color: var(--oxide); }
@media (prefers-reduced-motion: reduce) { .tile__img img { transition: none; } }

.masonry { columns: 3 16rem; column-gap: var(--gutter); }
.masonry .tile { break-inside: avoid; margin-bottom: 2rem; }
.masonry .tile__img { aspect-ratio: auto; }

/* ---------- detail pages ---------- */
.detail { display: grid; gap: 2.5rem var(--gutter); grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 820px) { .detail { grid-template-columns: 1fr; } }
.detail__images { display: grid; gap: 1rem; }
.detail__images img { width: 100%; border-radius: 3px; background: var(--clay); }
.detail__info { position: sticky; top: 1.5rem; }
.detail__price { font-family: var(--serif); font-size: var(--step-2); margin-bottom: 0.2rem; }
.detail__facts { margin: 1.4rem 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.detail__facts li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.55rem 0; border-bottom: 1px solid var(--line); }
.detail__facts span:first-child { color: var(--muted); }
.ku-note { font-size: var(--step--1); color: var(--muted); }

.choice { display: grid; gap: 0.5rem; margin: 1rem 0; }
.choice label {
  display: flex; gap: 0.75rem; align-items: flex-start; padding: 0.8rem 1rem; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--surface); cursor: pointer;
}
.choice input { margin-top: 0.3rem; accent-color: var(--glaze); }
.choice label:has(input:checked) { border-color: var(--glaze); box-shadow: inset 0 0 0 1px var(--glaze); }
.choice small { display: block; color: var(--muted); }

/* ---------- courses ---------- */
.courses { display: grid; gap: 3rem; }
.course { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 1.5rem var(--gutter); align-items: start; }
@media (max-width: 760px) { .course { grid-template-columns: 1fr; } }
.course img { border-radius: 3px; width: 100%; aspect-ratio: 4/3; object-fit: cover; background: var(--clay); }
.dates { list-style: none; margin: 1rem 0 0; padding: 0; border-top: 1px solid var(--line); }
.dates li { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; align-items: center; justify-content: space-between; padding: 0.7rem 0; border-bottom: 1px solid var(--line); }
.seats { font-size: var(--step--1); color: var(--glaze); }
.seats--few { color: var(--ochre); }
.seats--none { color: var(--oxide); }

/* calendar list ("Wo ist Vroni") */
.agenda { list-style: none; padding: 0; margin: 0; }
.agenda li { display: grid; grid-template-columns: 5.5rem 1fr; gap: 1rem; padding: 1.1rem 0; border-bottom: 1px solid var(--line); }
.agenda__date { font-family: var(--serif); line-height: 1.15; }
.agenda__date b { display: block; font-size: 1.9rem; font-weight: 400; }
.agenda__kind { font-size: var(--step--1); color: var(--muted); }

/* ---------- forms (shared) ---------- */
.form { display: grid; gap: 1.1rem; max-width: 36rem; }
.field { display: grid; gap: 0.35rem; }
.field > label, .field > .label { font-weight: 500; font-size: 0.95rem; }
.field small, .hint { color: var(--muted); font-size: var(--step--1); }
input:not([type]), input[type=text], input[type=email], input[type=tel], input[type=password], input[type=number], input[type=date],
input[type=time], input[type=datetime-local], input[type=search], input[type=url], select, textarea {
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0.65rem 0.8rem; min-height: var(--tap); width: 100%;
}
textarea { min-height: 8rem; resize: vertical; line-height: 1.5; }
textarea.md { min-height: 22rem; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.92rem; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--glaze); outline-offset: 0; border-color: transparent; }
input[type=checkbox], input[type=radio] { width: 1.2rem; height: 1.2rem; accent-color: var(--glaze); }
.check { display: flex; gap: 0.6rem; align-items: flex-start; }
.check input { margin-top: 0.25rem; flex: none; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
.row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.8rem; }
@media (max-width: 480px) { .row-3 { grid-template-columns: 1fr 1fr; } }
.honey { position: absolute; left: -10000px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  font: inherit; font-weight: 500; min-height: var(--tap); padding: 0.6rem 1.25rem;
  border-radius: var(--radius); border: 1px solid var(--ink); background: transparent; color: var(--ink);
  cursor: pointer; text-decoration: none; text-align: center; line-height: 1.2;
}
.btn:hover { background: var(--clay); color: var(--ink); }
.btn--primary { background: var(--glaze); border-color: var(--glaze); color: #fff; }
.btn--primary:hover { background: var(--glaze-dark); border-color: var(--glaze-dark); color: #fff; }
@media (prefers-color-scheme: dark) { .btn--primary, .btn--primary:hover { color: #1d1916; } }
.btn--ghost { border-color: var(--line); }
.btn--danger { border-color: var(--oxide); color: var(--oxide); }
.btn--danger:hover { background: var(--oxide-soft); color: var(--oxide); }
.btn--small { min-height: 36px; padding: 0.35rem 0.8rem; font-size: 0.9rem; }
.btn--wide { width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }

.alert { padding: 0.85rem 1rem; border-radius: var(--radius); background: var(--glaze-soft); margin-bottom: 1.2rem; }
.alert--error { background: var(--oxide-soft); color: var(--ink); border-left: 3px solid var(--oxide); }
.alert--warn { background: var(--ochre-soft); border-left: 3px solid var(--ochre); }
.alert p:last-child { margin: 0; }
.validation-summary-valid { display: none; }
.field-validation-error, .error-text { color: var(--oxide); font-size: var(--step--1); }

.notice-test {
  background: var(--ochre-soft); text-align: center; font-size: var(--step--1); padding: 0.35rem 1rem;
}

/* ---------- photo input (shared with admin) ---------- */
.photo-input { display: grid; gap: 0.6rem; }
.photo-input__buttons { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.btn--photo { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn--photo:hover { background: var(--glaze-dark); color: #fff; }
.photo-input__previews { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.photo-thumb { position: relative; width: 104px; }
.photo-thumb img { width: 104px; height: 104px; object-fit: cover; border-radius: var(--radius); background: var(--clay); }
.photo-thumb__pdf { width: 104px; height: 104px; display: grid; place-items: center; background: var(--clay); border-radius: var(--radius); font-weight: 600; }
.photo-thumb__tools { display: flex; gap: 2px; margin-top: 4px; }
.photo-thumb__tools button {
  flex: 1; min-height: 34px; border: 1px solid var(--line); background: var(--surface); border-radius: 4px;
  font: inherit; font-size: 0.85rem; cursor: pointer; color: var(--ink);
}
.photo-thumb__size { font-size: 0.72rem; color: var(--muted); }
.photo-input--doc .photo-thumb { width: 140px; }
.photo-input--doc .photo-thumb img { width: 140px; height: 180px; object-fit: contain; background: var(--surface); border: 1px solid var(--line); }

.cropper { position: fixed; inset: 0; z-index: 100; background: rgb(20 16 13 / 0.92); display: grid; grid-template-rows: 1fr auto; touch-action: none; }
.cropper__stage { position: relative; display: grid; place-items: center; overflow: hidden; padding: 1rem; }
.cropper__stage canvas { max-width: 100%; max-height: 100%; touch-action: none; }
.cropper__bar { display: flex; gap: 0.6rem; justify-content: center; padding: 1rem; flex-wrap: wrap; background: #000; }
.cropper__bar .btn { color: #fff; border-color: #fff; }
.cropper__bar .btn--primary { background: var(--glaze); border-color: var(--glaze); }
.cropper__hint { color: #ddd; width: 100%; text-align: center; font-size: 0.9rem; }

/* ==========================================================================
   Admin
   ========================================================================== */
.admin { background: var(--paper); }
.admin-shell { min-height: 100vh; padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
.admin-top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 0.5rem;
  padding: 0.55rem var(--gutter); padding-top: calc(0.55rem + env(safe-area-inset-top));
  background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); min-height: 56px;
}
.admin-top__back { text-decoration: none; font-size: 1.5rem; line-height: 1; padding: 0.3rem 0.6rem 0.3rem 0; color: var(--muted); }
.admin-top h1 { font-size: 1.25rem; margin: 0; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-main { max-width: 64rem; margin-inline: auto; padding: 1.1rem var(--gutter) 2rem; }

.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 0.5rem 0.2rem 0.45rem;
  text-decoration: none; color: var(--muted); font-size: 0.72rem; min-height: 60px; justify-content: center;
}
.tabbar svg { width: 24px; height: 24px; }
.tabbar a[aria-current="page"] { color: var(--glaze); }
.tabbar__plus span:first-child {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--glaze); color: #fff;
  margin-top: -14px; box-shadow: 0 2px 8px rgb(0 0 0 / 0.18); font-size: 1.7rem; line-height: 1; font-weight: 300;
}
@media (prefers-color-scheme: dark) { .tabbar__plus span:first-child { color: #1d1916; } }

@media (min-width: 960px) {
  .admin-shell { padding-bottom: 0; padding-left: 15rem; }
  .tabbar { inset: 0 auto 0 0; width: 15rem; grid-template-columns: 1fr; align-content: start; border-top: 0; border-right: 1px solid var(--line); padding: 1.2rem 0.75rem; gap: 2px; overflow-y: auto; }
  .tabbar a { flex-direction: row; justify-content: flex-start; gap: 0.75rem; font-size: 0.95rem; min-height: 42px; padding: 0.45rem 0.75rem; border-radius: var(--radius); }
  .tabbar a:hover { background: var(--clay); color: var(--ink); }
  .tabbar a[aria-current="page"] { background: var(--glaze-soft); }
  .tabbar svg { width: 20px; height: 20px; }
  .tabbar__plus span:first-child { width: 20px; height: 20px; margin: 0; box-shadow: none; font-size: 0.9rem; }
  .tabbar__brand { display: block !important; font-family: var(--serif); font-style: italic; font-size: 1.15rem; padding: 0 0.75rem 1rem; }
  .tabbar__desktop { display: flex !important; }
  .tabbar__sep { display: block !important; height: 1px; background: var(--line); margin: 0.6rem 0.75rem; }
}
.tabbar__brand, .tabbar__desktop, .tabbar__sep { display: none !important; }

/* quick actions on the dashboard */
.quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: 0.6rem; margin-bottom: 1.6rem; }
.quick a {
  display: flex; flex-direction: column; gap: 0.25rem; justify-content: flex-end; min-height: 92px;
  padding: 0.85rem; border-radius: 10px; background: var(--surface); border: 1px solid var(--line);
  text-decoration: none; font-weight: 500; line-height: 1.25;
}
.quick a:first-child { background: var(--glaze); color: #fff; border-color: var(--glaze); }
@media (prefers-color-scheme: dark) { .quick a:first-child { color: #1d1916; } }
.quick small { font-weight: 400; opacity: 0.8; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 1rem; margin-bottom: 1rem; }
.panel > h2 { font-family: var(--sans); font-size: 1rem; font-weight: 600; margin-bottom: 0.7rem; }
.panel--flush { padding: 0; overflow: hidden; }
.panel--flush > h2 { padding: 1rem 1rem 0; }

.list { list-style: none; margin: 0; padding: 0; }
.list > li, .list > a { border-top: 1px solid var(--line); }
.list > li:first-child, .list > a:first-child { border-top: 0; }
.list-row {
  display: flex; align-items: center; gap: 0.8rem; padding: 0.8rem 1rem; min-height: 60px;
  text-decoration: none; color: var(--ink);
}
a.list-row:hover { background: var(--paper); color: var(--ink); }
.list-row__main { flex: 1; min-width: 0; }
.list-row__title { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row__sub { display: block; font-size: 0.85rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row__end { text-align: right; white-space: nowrap; }
.list-row__thumb { width: 46px; height: 46px; border-radius: 6px; object-fit: cover; background: var(--clay); flex: none; }
.list-row--cancelled .list-row__title, .list-row--cancelled .amount { text-decoration: line-through; color: var(--muted); }
.amount { font-variant-numeric: tabular-nums; font-weight: 500; }
.amount--in { color: var(--glaze); }
.amount--out { color: var(--ink); }

.badge { display: inline-block; font-size: 0.75rem; font-weight: 500; padding: 0.12rem 0.5rem; border-radius: 999px; background: var(--clay); color: var(--ink); white-space: nowrap; }
.badge--ok { background: var(--glaze-soft); color: var(--glaze-dark); }
.badge--warn { background: var(--ochre-soft); color: #7a5512; }
.badge--bad { background: var(--oxide-soft); color: var(--oxide); }
@media (prefers-color-scheme: dark) { .badge--warn { color: var(--ochre); } }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--clay); border-radius: 10px; padding: 3px; gap: 3px; }
.seg label { position: relative; display: grid; place-items: center; min-height: 44px; border-radius: 8px; cursor: pointer; font-weight: 500; font-size: 0.95rem; text-align: center; padding: 0 0.3rem; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { background: var(--surface); box-shadow: 0 1px 3px rgb(0 0 0 / 0.12); }
.seg label:has(input:focus-visible) { outline: 2px solid var(--glaze); }
.seg--kind label:has(input[value="Einnahme"]:checked) { color: var(--glaze); }

.amount-input { font-size: 2rem !important; font-weight: 500; font-variant-numeric: tabular-nums; text-align: right; padding-right: 2.2rem !important; }
.amount-wrap { position: relative; }
.amount-wrap::after { content: "€"; position: absolute; right: 0.9rem; top: 50%; transform: translateY(-50%); font-size: 1.4rem; color: var(--muted); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 0.6rem; margin-bottom: 1rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 0.8rem 0.9rem; }
.stat b { display: block; font-size: 1.35rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.stat span { font-size: 0.82rem; color: var(--muted); }

.table-wrap { overflow-x: auto; }
table.table { border-collapse: collapse; width: 100%; font-size: 0.93rem; }
.table th, .table td { text-align: left; padding: 0.55rem 0.6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-weight: 600; color: var(--muted); font-size: 0.82rem; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tfoot td { font-weight: 600; border-bottom: 0; }

.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; align-items: center; }
.filters select, .filters input { width: auto; min-height: 40px; padding-block: 0.4rem; }
.chips { display: flex; gap: 0.4rem; overflow-x: auto; scrollbar-width: none; margin-bottom: 1rem; }
.chips a { flex: none; padding: 0.4rem 0.85rem; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; font-size: 0.9rem; background: var(--surface); }
.chips a[aria-current="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.details-block { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); margin-bottom: 1rem; }
.details-block > summary { padding: 0.9rem 1rem; cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; }
.details-block > summary::after { content: "+"; color: var(--muted); font-weight: 400; }
.details-block[open] > summary::after { content: "–"; }
.details-block > div { padding: 0 1rem 1rem; }

.receipt-preview img { max-height: 70vh; width: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.thumbs { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.thumbs img { width: 96px; height: 96px; object-fit: cover; border-radius: 6px; background: var(--clay); }
.thumbs label { position: relative; }
.thumbs label input { position: absolute; top: 6px; left: 6px; }

.sticky-actions {
  position: sticky; bottom: calc(64px + env(safe-area-inset-bottom)); z-index: 10; margin-top: 1rem;
  padding: 0.7rem 0; background: linear-gradient(to top, var(--paper) 70%, transparent);
}
@media (min-width: 960px) { .sticky-actions { bottom: 0; } }

.md-editor { display: grid; gap: 0.75rem; }
.md-preview { border: 1px dashed var(--line); border-radius: var(--radius); padding: 1rem; background: var(--surface); min-height: 6rem; }
.copy-box { white-space: pre-wrap; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.9rem; font-size: 0.95rem; }

.login { max-width: 22rem; margin: 12vh auto 0; padding: var(--gutter); }
.login .wordmark { display: block; margin-bottom: 1.5rem; }
.empty { padding: 2rem 1rem; text-align: center; color: var(--muted); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1rem; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.toast { position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 0.6rem 1rem; border-radius: 8px; z-index: 50; font-size: 0.95rem; }
@media (min-width: 960px) { .toast { bottom: 1.5rem; } }
