/* Bike DB – app styles */
:root {
  --bg: #f8f7f5;
  --surface: #ffffff;
  --surface-2: #efede9;
  --ink: #0f1939;
  --ink-2: #4a5272;
  --ink-3: #868a9b;
  --line: #e7e5e0;
  --line-strong: #d4d1ca;
  --accent: #374593;
  --accent-hover: #0f1939;
  --accent-ink: #ffffff;
  --accent-soft: #e5e9f8;
  --warm: #e3af64;
  --warm-ink: #8a5a1c;
  --warm-soft: #faebd7;
  --warn: #a16207;
  --warn-soft: #fdf3d7;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --ok: #166534;
  --ok-soft: #e4f4e8;
  --mtb: #3f6212;   --mtb-soft: #ecf3df;
  --road: #1d4ed8;  --road-soft: #e3eafc;
  --gravel: #92400e; --gravel-soft: #f6eadb;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(15, 25, 57, .05), 0 2px 8px rgba(15, 25, 57, .04);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--font);
  font-variant-numeric: tabular-nums;
}
a { color: inherit; }
code { font-family: var(--mono); font-size: .86em; }
h1, h2 { line-height: 1.2; letter-spacing: -.01em; }
[hidden] { display: none !important; } /* sonst überstimmt z. B. .btn { display: inline-flex } das Attribut */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--ink-3); }
.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------------------------------------------------------------- top bar */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 12px;
  padding: 0 max(16px, calc((100vw - 1200px) / 2));
  height: 56px;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { white-space: nowrap; font-weight: 700; text-decoration: none; letter-spacing: -.01em; }
.brand::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--warm); margin-right: 8px; vertical-align: 1px; }
.nav { display: flex; gap: 4px; margin-left: auto; overflow-x: auto; }
.nav a { text-decoration: none; padding: 6px 10px; border-radius: 8px; color: var(--ink-2); white-space: nowrap; }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a.is-active { color: var(--ink); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--surface-2); font-size: 12px; text-align: center; color: var(--ink-2); }
.count--warn { background: var(--warn-soft); color: var(--warn); }

.banner { padding: 10px 16px; text-align: center; font-size: 14px; }
.banner--warn { background: var(--warn-soft); color: var(--warn); }

/* ---------------------------------------------------------------- page */
.page { max-width: 1200px; margin: 0 auto; padding: 24px 16px 64px; }
@media (min-width: 720px) { .page { padding: 32px 24px 80px; } }

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 4px 0 24px; }
.page-head h1 { font-size: clamp(24px, 4vw, 32px); margin: 0; }
.sub { margin: 4px 0 0; color: var(--ink-2); }
.eyebrow { margin: 0 0 6px; color: var(--ink-2); font-size: 14px; display: flex; gap: 6px; align-items: center; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.backlink { display: inline-flex; align-items: center; gap: 2px; color: var(--ink-2); text-decoration: none; font-size: 14px; margin-left: -4px; }
.backlink:hover { color: var(--ink); }
.tabs { display: flex; gap: 4px; margin: 12px 0 20px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs__item { display: inline-flex; align-items: center; gap: 6px; padding: 10px 12px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--ink-2); text-decoration: none; font-size: 15px; font-weight: 550; white-space: nowrap; }
.tabs__item:hover { color: var(--ink); border-bottom-color: var(--line-strong); }
.tabs__item.is-active { color: var(--ink); border-bottom-color: var(--warm); }
.tabs__count { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.tabs__item.is-active .tabs__count { background: var(--accent-soft); color: var(--accent); }
@media (max-width: 560px) { .tabs { gap: 0; margin-right: -16px; } .tabs__item { padding: 10px 9px; font-size: 14px; } }
.tab-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 20px; }
.tab-head h1 { font-size: 22px; margin: 0; }
.stats__link { color: inherit; text-decoration: none; }
.stats__link:hover { color: var(--accent); }
.empty { padding: 40px; text-align: center; color: var(--ink-3); background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.foot-link { margin-top: 32px; font-size: 14px; color: var(--ink-3); }
.section-title { font-size: 18px; margin: 48px 0 8px; }
.muted-block { opacity: .75; }

.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; background: var(--ok-soft); color: var(--ok); }
.flash--error { background: var(--danger-soft); color: var(--danger); }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 38px; padding: 0 14px;
  border-radius: 8px; border: 1px solid transparent;
  background: var(--surface-2); color: var(--ink);
  font: inherit; font-weight: 500; text-decoration: none; cursor: pointer;
}
.btn:hover { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn--ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn--danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); background: transparent; }
.btn--danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn--small { height: 30px; padding: 0 10px; font-size: 13px; }
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; color: var(--ink-3); text-decoration: none; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------------------------------------------------------------- pills & tags */
.pill { display: inline-flex; align-items: center; gap: 3px; height: 22px; padding: 0 8px; border-radius: 11px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--ink-2); }
.pill .i { width: 13px; height: 13px; }
.pill--mtb { background: var(--mtb-soft); color: var(--mtb); }
.pill--road { background: var(--road-soft); color: var(--road); }
.pill--gravel { background: var(--gravel-soft); color: var(--gravel); }
.pill--warn { background: var(--warn-soft); color: var(--warn); }
.tag { display: inline-block; padding: 0 6px; border-radius: 4px; background: var(--surface-2); color: var(--ink-2); font-size: 12px; }
.tag--quiet { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }

/* ---------------------------------------------------------------- stats */
.stats { display: flex; flex-wrap: wrap; gap: 8px 32px; margin: 0; }
.stats div { min-width: 0; }
.stats dt { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); }
.stats dd { margin: 0; font-weight: 600; }
.stats--hero { padding: 16px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 28px; box-shadow: var(--shadow); }
.stats--hero dd { font-size: 20px; }

/* ---------------------------------------------------------------- bike grid */
.bike-grid { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.bike-card__link {
  display: flex; flex-direction: column; height: 100%;
  padding: 18px 20px; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  transition: border-color .15s, transform .15s;
}
.bike-card__link:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); transform: translateY(-1px); }
.bike-card__top { display: flex; gap: 6px; margin-bottom: 10px; }
.bike-card__name { font-size: 18px; font-weight: 650; letter-spacing: -.01em; }
.bike-card__model { color: var(--ink-2); font-size: 14px; margin-bottom: 16px; }
.bike-card .stats { gap: 4px 20px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.bike-card .stats dd { font-size: 15px; }
.bike-card__foot { margin-top: 10px; font-size: 13px; color: var(--ink-3); }
.bike-card--archived .bike-card__link { opacity: .6; }

/* Umschalter Raster / Karussell */
.list-bar { display: flex; justify-content: flex-end; margin: -12px 0 12px; }
.seg--icons a { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; }
.seg--icons .i { width: 15px; height: 15px; }

/* Karussell */
.carousel { margin-bottom: 8px; }
.carousel__stage { position: relative; }
.carousel__track {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
  scrollbar-width: none; border-radius: 14px; outline: none;
}
.carousel__track::-webkit-scrollbar { display: none; }
.carousel__track:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
.slide {
  flex: 0 0 100%; scroll-snap-align: start; scroll-snap-stop: always; min-width: 0;
  display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
}
.slide--archived { opacity: .7; }
.slide__media { position: relative; display: grid; place-items: center; min-height: 0; aspect-ratio: 16 / 10; background: #fff; border-right: 1px solid var(--line); }
.slide__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 4%; box-sizing: border-box; transition: transform .5s ease; }
.slide__media:hover img { transform: scale(1.02); }
.slide__body { display: flex; flex-direction: column; padding: 32px 32px 28px; min-width: 0; }
.slide__top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 14px; font-size: 14px; }
.slide__name { font-size: clamp(24px, 3vw, 34px); line-height: 1.1; letter-spacing: -.02em; margin: 0; }
.slide__model { margin: 6px 0 24px; color: var(--ink-2); }
.slide__stats { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; padding-top: 20px; border-top: 1px solid var(--line); margin-top: auto; }
.slide__stats dd { font-size: clamp(16px, 1.7vw, 20px); font-variant-numeric: tabular-nums; white-space: nowrap; }
.slide__cta { align-self: flex-start; margin-top: 28px; }
.carousel__btn {
  position: absolute; top: calc(50% - 22px); z-index: 2; display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 90%, transparent); color: var(--ink);
  backdrop-filter: blur(6px); box-shadow: var(--shadow); transition: transform .15s, border-color .15s;
}
.carousel__btn:hover { border-color: var(--line-strong); transform: scale(1.06); }
.carousel__btn--prev { left: -22px; }
.carousel__btn--next { right: -22px; }
.carousel__thumbs { display: flex; gap: 8px; margin-top: 14px; padding: 2px; overflow-x: auto; scrollbar-width: none; }
.carousel__thumbs::-webkit-scrollbar { display: none; }
.thumb {
  flex: 0 0 132px; width: 132px; min-width: 0; display: flex; flex-direction: column; gap: 6px; padding: 6px; cursor: pointer; text-align: left;
  font: inherit; color: var(--ink-2); background: transparent; border: 1px solid transparent; border-radius: 10px;
  opacity: .7; transition: opacity .15s, border-color .15s, background .15s;
}
.thumb:hover { opacity: 1; }
.thumb[aria-current] { opacity: 1; color: var(--ink); background: var(--surface); border-color: var(--accent); }
.thumb__img { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 10; background: #fff; border-radius: 6px; overflow: hidden; }
.thumb__img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 4px; box-sizing: border-box; }
.thumb__img .bike-ph { width: 60%; }
.thumb__name { font-size: 12.5px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1260px) {
  /* beide Pfeile auf dem Bild, nicht über den Zahlen */
  .carousel__btn--prev { left: 12px; }
  .carousel__btn--next { right: auto; left: calc(100% * 1.7 / 2.7 - 56px); }
}
@media (max-width: 760px) {
  .slide { grid-template-columns: 1fr; }
  .slide__media { border-right: 0; border-bottom: 1px solid var(--line); }
  .slide__body { padding: 20px; }
  .slide__model { margin-bottom: 18px; }
  .slide__stats dd { font-size: 17px; }
  .slide__cta { margin-top: 20px; }
  .carousel__btn { top: calc((100vw - 32px) * 5 / 16 - 20px); width: 40px; height: 40px; }
  .carousel__btn--next { left: auto; right: 12px; }
  .thumb { flex-basis: 108px; width: 108px; }
}

.bike-info { margin: -12px 0 24px; font-size: 14px; color: var(--ink-2); }
.bike-info p { margin: 4px 0; }

/* ---------------------------------------------------------------- component table */
.group { margin-bottom: 28px; }
.group[id] { scroll-margin-top: 116px; }
@media (prefers-reduced-motion: no-preference) { html:has(.jumpbar) { scroll-behavior: smooth; } }
.jumpbar {
  position: sticky; top: 56px; z-index: 5;
  display: flex; gap: 4px; margin: 0 0 20px; padding: 8px 0; overflow-x: auto; scrollbar-width: none;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.jumpbar::-webkit-scrollbar { display: none; }
.jumpbar a { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; font-size: 13px; text-decoration: none; color: var(--ink-2); white-space: nowrap; }
.jumpbar a:hover { background: var(--surface-2); color: var(--ink); }
.jumpbar a.is-active { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: inset 0 0 0 1px var(--line); }
.jumpbar__n { font-size: 11.5px; font-variant-numeric: tabular-nums; color: var(--ink-3); }
.group-title { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin: 0 0 8px; font-weight: 600; }
.ctable { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.crow {
  display: grid; align-items: start; gap: 4px 16px;
  grid-template-columns: 170px minmax(0, 1fr) 80px 96px 96px 72px;
  padding: 12px 16px; border-top: 1px solid var(--line);
}
.crow:first-child { border-top: 0; }
.crow--head { padding-top: 8px; padding-bottom: 8px; font-size: 12px; color: var(--ink-3); background: var(--surface-2); }
.crow--child .c-cat { padding-left: 14px; position: relative; }
.crow--child .c-cat::before { content: ""; position: absolute; left: 2px; top: 3px; width: 7px; height: 9px; border-left: 1.5px solid var(--line-strong); border-bottom: 1.5px solid var(--line-strong); border-bottom-left-radius: 3px; }
.crow--review { background: color-mix(in srgb, var(--warn-soft) 55%, var(--surface)); }
.crow--muted { color: var(--ink-3); }
.num { text-align: right; white-space: nowrap; }
.c-cat { color: var(--ink-2); font-size: 14px; }
.c-main { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.c-name { text-decoration: none; overflow-wrap: anywhere; }
.c-name:hover { text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.c-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; color: var(--ink-3); }
.c-meta code { color: var(--ink-2); overflow-wrap: anywhere; }
.c-invoice { display: inline-flex; align-items: center; gap: 3px; }
.c-invoice .i { width: 13px; height: 13px; }
.c-notes { font-size: 13px; color: var(--ink-2); }
.c-review { display: inline-flex; gap: 5px; align-items: flex-start; font-size: 13px; color: var(--warn); }
.c-review .i { width: 15px; height: 15px; margin-top: 2px; }
.c-actions { display: flex; justify-content: flex-end; gap: 2px; margin: -6px -8px -6px 0; }
.c-paid em { font-style: normal; font-size: 13px; }
.ctable--compact .crow { grid-template-columns: 170px minmax(0, 1fr) 150px 80px 96px 96px 72px; }
.c-art { font-size: 13px; color: var(--ink-2); overflow-wrap: anywhere; min-width: 0; }

@media (max-width: 760px) {
  .crow--head { display: none; }
  .crow { grid-template-columns: 1fr auto; padding: 12px 14px; }
  .c-cat { grid-column: 1; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); }
  .c-actions { grid-column: 2; grid-row: 1 / span 2; margin: -4px -6px 0 0; }
  .c-main { grid-column: 1; }
  .c-weight, .c-paid, .c-msrp { grid-column: 1 / -1; display: flex; justify-content: space-between; font-size: 14px; text-align: left; }
  .c-weight { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--line); }
  .c-weight::before, .c-paid::before, .c-msrp::before { content: attr(data-label); color: var(--ink-3); }
  .ctable--compact .crow { grid-template-columns: 1fr auto; }
  .ctable--compact .c-art { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 12px; font-size: 14px; margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--line); }
  .ctable--compact .c-art::before { content: attr(data-label); color: var(--ink-3); }
  .ctable--compact .c-weight { margin-top: 0; padding-top: 0; border-top: 0; }
  .crow--child .c-cat { padding-left: 0; }
  .crow--child .c-cat::before { display: none; }
}

/* ---------------------------------------------------------------- forms */
.form { display: grid; gap: 4px; max-width: 860px; }
.form-section { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 16px 20px 20px; margin: 0 0 16px; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 14px 16px; box-shadow: var(--shadow); }
.form-section legend { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 600; padding: 0 6px; margin-left: -6px; }
.form > .field { background: var(--surface); }
.form:not(:has(.form-section)) { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field--wide { grid-column: 1 / -1; }
.field label { font-size: 13px; font-weight: 550; color: var(--ink-2); }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; color: var(--ink);
  padding: 8px 10px; min-height: 40px;
  background: var(--bg); border: 1px solid var(--line-strong); border-radius: 8px;
}
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field select:disabled { opacity: .55; }
.field--check { justify-content: flex-end; }
.field--check label { display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--ink); font-weight: 400; }
.field--check input { width: 18px; height: 18px; min-height: 0; accent-color: var(--accent); }
.hint { font-size: 12.5px; color: var(--ink-3); }
.error { color: var(--danger); font-size: 13px; }
.has-error input, .has-error select { border-color: var(--danger); }
.form-actions { grid-column: 1 / -1; display: flex; gap: 8px; margin-top: 8px; }

.danger-zone { max-width: 860px; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); }
.danger-zone h2 { font-size: 16px; margin: 0 0 8px; }
.danger-zone p { margin: 0 0 8px; color: var(--ink-2); }
.radio { display: flex; gap: 8px; align-items: center; margin: 4px 0; }
.radio input { accent-color: var(--accent); }
.danger-zone .btn { margin-top: 12px; }

.review-box { max-width: 860px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; margin-bottom: 16px; border-radius: var(--radius); background: var(--warn-soft); color: var(--warn); }
.review-box p { margin: 0; display: flex; gap: 6px; align-items: flex-start; }

/* ---------------------------------------------------------------- login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: min(100%, 380px); display: grid; gap: 14px; padding: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.login-card h1 { font-size: 20px; margin: 0 0 4px; }
.login-card p { margin: 0; }
.login-card .btn { justify-content: center; }

/* ---------------------------------------------------------------- bike images */
.bike-ph { width: 46%; height: auto; color: var(--line-strong); }
.bike-card__media {
  display: grid; place-items: center;
  aspect-ratio: 16 / 9; margin: -18px -20px 14px;
  background: #fff; border-bottom: 1px solid var(--line);
  border-radius: var(--radius) var(--radius) 0 0; overflow: hidden;
}
.bike-card__media { position: relative; }
.bike-card__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 10px; box-sizing: border-box; }
.bike-hero { margin: 8px 0 20px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: grid; place-items: center; }
.bike-hero img { display: block; width: 100%; max-height: 420px; object-fit: contain; padding: 12px; }
.image-field { border-top: 1px solid var(--line); padding-top: 14px; }
.image-field__label { font-size: 13px; font-weight: 550; color: var(--ink-2); }
.image-field__row { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); gap: 16px; margin-top: 6px; }
.image-field__preview { aspect-ratio: 16 / 10; display: grid; place-items: center; background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.image-field__preview { position: relative; }
.image-field__preview img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 6px; box-sizing: border-box; }
.image-field__inputs { display: grid; gap: 12px; align-content: start; }
.image-field input[type=file] { padding: 6px; }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; }
@media (max-width: 560px) { .image-field__row { grid-template-columns: 1fr; } }
.actions form { display: contents; }

/* ---------------------------------------------------------------- invoices */
.c-invoice--link { color: var(--ink-2); text-decoration: none; border-radius: 4px; }
.c-invoice--link:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.c-invoice--link .i { color: var(--accent); }
.input-with-action { display: flex; gap: 8px; align-items: center; }
.input-with-action input { flex: 1; min-width: 0; }
.input-with-action .btn { flex: none; height: 40px; }

/* ---------------------------------------------------------------- type colours */
.pill--neutral { background: var(--surface-2); color: var(--ink-2); }
.pill--green { background: var(--mtb-soft); color: var(--mtb); }
.pill--blue { background: var(--road-soft); color: var(--road); }
.pill--brown { background: var(--gravel-soft); color: var(--gravel); }
.pill--red { background: #fde4e1; color: #b42318; }
.pill--purple { background: #efe6fb; color: #6b3fb3; }
.pill--teal { background: #dff3f1; color: #0f6b63; }
.pill--orange { background: var(--warm-soft); color: var(--warm-ink); }

/* ---------------------------------------------------------------- lookup field */
.lookup__new { font-size: 13px; }
.lookup__new summary { cursor: pointer; color: var(--ink-3); list-style: none; padding: 2px 0; }
.lookup__new summary::-webkit-details-marker { display: none; }
.lookup__new summary:hover { color: var(--accent); }
.lookup__new[open] summary { color: var(--ink-2); margin-bottom: 6px; }

/* ---------------------------------------------------------------- admin */
.admin-quality {
  display: grid; gap: 2px; padding: 18px 20px; margin-bottom: 8px; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.admin-quality:hover { border-color: var(--line-strong); border-left-color: var(--accent); }
.admin-quality__label { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 600; }
.admin-quality__value { font-size: 20px; font-weight: 650; }
.admin-quality__hint { font-size: 13px; color: var(--ink-2); }
.admin-grid { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.admin-card { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; height: 100%; padding: 16px 18px; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.admin-card:hover { border-color: var(--line-strong); }
.admin-card__title { font-weight: 650; }
.admin-card__count { font-weight: 600; color: var(--ink-3); }
.admin-card__intro { grid-column: 1 / -1; font-size: 13px; color: var(--ink-2); }
.section-title--first { margin-top: 0; }

.admin-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.admin-search { flex: 1; max-width: 360px; font: inherit; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--ink); }
.arow { display: grid; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)) 120px 40px; gap: 12px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--line); text-decoration: none; }
.arow:first-child { border-top: 0; }
.arow > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.arow--head { font-size: 12px; color: var(--ink-3); background: var(--surface-2); padding-top: 8px; padding-bottom: 8px; }
.arow--group { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; color: var(--ink-3); background: color-mix(in srgb, var(--surface-2) 50%, var(--surface)); padding-top: 6px; padding-bottom: 6px; }
a.arow:hover { background: var(--surface-2); }
.arow__go { color: var(--ink-3); display: flex; justify-content: flex-end; }
@media (max-width: 700px) {
  .arow { grid-template-columns: 1fr auto; }
  .arow--head { display: none; }
  .arow > span:not(:first-child):not(.num):not(.arow__go) { display: none; }
  .arow__go { display: none; }
}

.notice { padding: 14px 18px; border-radius: var(--radius); margin-bottom: 20px; }
.notice h2 { font-size: 15px; margin: 0 0 8px; }
.notice--warn { background: var(--warn-soft); color: var(--ink); }
.dup-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.dup-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.dup-list a:not(.btn) { display: inline-flex; align-items: center; gap: 4px; }
.dup-list .i { width: 15px; height: 15px; }

.color-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.color-pick__opt { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.color-pick__opt input { accent-color: var(--accent); }
.merge-form { margin-bottom: 20px; }
.merge-form select { font: inherit; padding: 8px 10px; min-height: 40px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--bg); color: var(--ink); max-width: 100%; }

/* ---------------------------------------------------------------- quality */
.qcheck-list { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.qcheck a { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.qcheck a:hover { border-color: var(--line-strong); }
.qcheck__count { font-weight: 700; font-size: 18px; }
.qcheck--warn a { border-left: 4px solid var(--warn); }
.qcheck--warn .qcheck__count { color: var(--warn); }
.qcheck--info .qcheck__count { color: var(--ink-2); }
.qcheck--ok a { color: var(--ink-3); }
.qcheck--ok .qcheck__count { color: var(--ok); }
.quality-cols { display: grid; gap: 0 40px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); }

/* ---------------------------------------------------------------- filters */
.filters { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); margin-bottom: 24px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.filters input[type=search] { grid-column: 1 / -1; }
.filters input, .filters select { font: inherit; padding: 8px 10px; min-height: 40px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--bg); color: var(--ink); min-width: 0; }
.filters__actions { display: flex; gap: 8px; }

/* ---------------------------------------------------------------- export */
.export-list { margin-bottom: 8px; }
.xrow { display: grid; grid-template-columns: minmax(0, 1fr) 110px 110px 130px; gap: 12px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--line); cursor: pointer; }
.xrow:first-child { border-top: 0; }
.xrow--head { cursor: default; font-size: 12px; color: var(--ink-3); background: var(--surface-2); padding-top: 8px; padding-bottom: 8px; }
label.xrow:hover { background: var(--surface-2); }
.xrow--archived { color: var(--ink-3); }
.xrow__bike { display: flex; align-items: center; gap: 10px; min-width: 0; }
.xrow__bike input { width: 17px; height: 17px; accent-color: var(--accent); flex: none; }
.xrow .c-review { font-size: 12.5px; }
@media (max-width: 700px) {
  .xrow { grid-template-columns: minmax(0, 1fr) auto; }
  .xrow > span:nth-child(2), .xrow > span:nth-child(3) { display: none; }
}

/* ---------------------------------------------------------------- documents */
.docs-toolbar { flex-wrap: wrap; }
.docs-select { flex: 0 0 auto; max-width: 220px; }
.drow__file { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.drow__thumb { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.drow__thumb img { width: 64px; height: 44px; object-fit: contain; background: var(--surface-2); border-radius: 6px; flex: none; }
.drow__thumb span { overflow-wrap: anywhere; }
.drow__thumb:hover span { text-decoration: underline; text-underline-offset: 3px; }
.doc-preview { max-width: min(100%, 420px); max-height: 260px; object-fit: contain; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.drow { display: grid; grid-template-columns: 90px minmax(0, 1fr) minmax(0, 1.4fr) 80px 96px 36px; gap: 12px; align-items: start; padding: 10px 16px; border-top: 1px solid var(--line); }
.drow:first-child { border-top: 0; }
.drow[hidden] { display: none; }
.drow--head { font-size: 12px; color: var(--ink-3); background: var(--surface-2); padding-top: 8px; padding-bottom: 8px; }
.drow__file { min-width: 0; overflow-wrap: anywhere; font-size: 14px; }
.drow__links { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: 14px; }
.drow__links a { text-decoration: none; overflow-wrap: anywhere; }
.drow__links a:hover { text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.drow__links .tag { margin-right: 4px; }
.drow__links .pill { align-self: flex-start; }
.drow__actions { display: flex; justify-content: flex-end; margin: -6px -8px -6px 0; }
.drow__actions .icon-btn:hover { color: var(--danger); }
.doc-links { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 6px; }
.doc-links .tag { margin-right: 6px; }
@media (max-width: 700px) {
  .drow { grid-template-columns: minmax(0, 1fr) auto; }
  .drow--head { display: none; }
  .drow__kind { grid-column: 1 / -1; grid-row: 1; }
  .drow__file { grid-column: 1; grid-row: 2; }
  .drow__actions { grid-column: 2; grid-row: 2; }
  .drow__links { grid-column: 1 / -1; grid-row: 3; }
  .drow > .num { display: none; }
}

/* ---------------------------------------------------------------- backups */
.brow { display: grid; grid-template-columns: 140px minmax(0, 1fr) 150px 90px 72px; gap: 12px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 14px; }
.brow:first-child { border-top: 0; }
.brow--head { font-size: 12px; color: var(--ink-3); background: var(--surface-2); padding-top: 8px; padding-bottom: 8px; }
.brow__file { min-width: 0; overflow-wrap: anywhere; }
.brow__actions { display: flex; justify-content: flex-end; margin: -6px -8px -6px 0; }
.brow__actions .icon-btn { border: 0; background: transparent; cursor: pointer; font: inherit; }
.brow__actions .icon-btn:hover { background: var(--surface-2); color: var(--danger); }
.brow__actions .icon-btn--restore:hover { color: var(--accent); }
.brow__origin { min-width: 0; overflow-wrap: anywhere; }
.backups-hint { margin-top: 16px; max-width: 760px; }
@media (max-width: 700px) {
  .brow { grid-template-columns: minmax(0, 1fr) auto; }
  .brow--head { display: none; }
  .brow > span:first-child, .brow > .num, .brow > .brow__origin { display: none; }
}

/* ---------------------------------------------------------------- herstellerdokumentation */
.docs-box { margin: 0 0 28px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.docs-box--form { max-width: 860px; margin-top: 24px; }
.docs-box__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.docs-box__head .group-title { margin: 0; }
.docs-box p { margin: 0; font-size: 14px; }
.doc-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.doc-list li { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 14px; }
.c-doc { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; overflow-wrap: anywhere; }
.c-doc .i { width: 15px; height: 15px; color: var(--accent); }
a.c-doc:hover { text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.c-docs { display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 13px; }
.mrow { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--line); }
.mrow:first-child { border-top: 0; }
.mrow__edit { display: flex; gap: 8px; align-items: center; min-width: 0; }
.mrow__edit input { flex: 1; min-width: 0; }
.mrow__edit input, .mrow__edit select { font: inherit; font-size: 14px; padding: 6px 8px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--bg); color: var(--ink); }
.mrow__edit select { max-width: 190px; }
.mrow__file { min-width: 0; font-size: 13px; }
@media (max-width: 760px) {
  .mrow { grid-template-columns: 1fr; }
  .mrow__edit { flex-wrap: wrap; }
}

/* ---------------------------------------------------------------- strava */
:root { --strava: #fc4c02; }
.panel, .section-title[id] { scroll-margin-top: 72px; }
.panel { margin: 0 0 28px; padding: 14px 16px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-bottom: 10px; }
.panel__head .group-title { margin: 0; }
.panel > p { margin: 0 0 8px; font-size: 14px; }
.panel .stats { margin-bottom: 12px; }
.panel__actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 10px; }
.panel__actions form { display: contents; }
.panel__note { margin: 0 0 12px; font-size: 14px; }
.btn--strava { background: var(--strava); border-color: var(--strava); color: #fff; }
.btn--strava:hover { filter: brightness(1.06); border-color: var(--strava); }
a.strava-link { color: var(--strava); text-decoration: none; font-weight: 550; }
a.strava-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.strava-powered { margin: 12px 0 0; }
.section-sub { margin: -4px 0 12px; font-size: 14px; }
.steps { margin: 0; padding-left: 20px; font-size: 14px; color: var(--ink-2); display: grid; gap: 4px; }
.steps code { color: var(--ink); background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.tag--new { background: var(--ok-soft); color: var(--ok); }

/* Strava-Bikes zuordnen */
.grow { display: grid; grid-template-columns: minmax(0, 1fr) 100px 90px minmax(0, 260px); gap: 12px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 14px; }
.grow:first-child { border-top: 0; }
.grow--head { font-size: 12px; color: var(--ink-3); background: var(--surface-2); padding-top: 8px; padding-bottom: 8px; }
.grow--retired .grow__name > a { color: var(--ink-3); }
.grow__name { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.grow__name > a { text-decoration: none; overflow-wrap: anywhere; }
.grow__name > a:hover { text-decoration: underline; text-underline-offset: 3px; }
.grow__bike select { width: 100%; font: inherit; padding: 6px 8px; min-height: 36px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--bg); color: var(--ink); }
.gear-form .form-actions { margin: 12px 0 0; }
.gear-form .hint { display: block; margin-top: 8px; }

/* Verlauf */
.srow { display: grid; grid-template-columns: 130px 120px minmax(0, 1fr) 190px 24px; gap: 12px; align-items: start; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 14px; text-decoration: none; }
.srow:first-child { border-top: 0; }
.srow--head { font-size: 12px; color: var(--ink-3); background: var(--surface-2); padding-top: 8px; padding-bottom: 8px; }
a.srow:hover { background: var(--surface-2); }
.srow__result { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-width: 0; }
.srow__msg { flex-basis: 100%; font-size: 13px; color: var(--ink-2); overflow-wrap: anywhere; }

/* Nutzung auf der Bike-Seite */
.usage__stats dd { font-size: 20px; }
.usage__meta { margin: 0 0 4px; font-size: 13px; color: var(--ink-3); }
.usage__title { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 600; margin: 20px 0 8px; }
.usage__more { margin: 10px 0 0; }
.usage__titlebar { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; margin: 20px 0 8px; scroll-margin-top: 72px; }
.usage__titlebar .usage__title { margin: 0; }
.usage__toggle { font-size: 13px; color: var(--ink-2); }
.usage__toggle:hover { color: var(--accent); }
.usage .ctable { box-shadow: none; }
.seg { display: flex; flex-wrap: wrap; gap: 2px; padding: 2px; background: var(--surface-2); border-radius: 8px; }
.seg a { padding: 3px 10px; border-radius: 6px; font-size: 13px; text-decoration: none; color: var(--ink-2); }
.seg a:hover { color: var(--ink); }
.seg a.is-active { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 0 0 1px var(--line); }
.region-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.region { display: grid; gap: 2px; height: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; min-width: 0; text-decoration: none; color: inherit; }
a.region:hover { border-color: var(--line-strong); background: var(--surface-2); }
a.region.is-active { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-soft); }
.region__name { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.region__name .i { width: 15px; height: 15px; color: var(--accent); }
.region__nums { color: var(--ink-2); font-size: 13px; }
.rrow { display: grid; grid-template-columns: 96px minmax(0, 1fr) 84px 76px 64px 64px; gap: 12px; align-items: start; padding: 9px 16px; border-top: 1px solid var(--line); font-size: 14px; }
.rrow:first-child { border-top: 0; }
.rrow--head { font-size: 12px; color: var(--ink-3); background: var(--surface-2); padding-top: 8px; padding-bottom: 8px; }
.rrow--log { grid-template-columns: 96px 96px minmax(0, 1fr) minmax(0, 200px) 84px; }
.rrow__name { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .grow { grid-template-columns: minmax(0, 1fr) auto; }
  .grow--head { display: none; }
  .grow__name { grid-column: 1 / -1; }
  .grow > .num { text-align: left; font-size: 13px; color: var(--ink-3); }
  .grow > .num::before { content: attr(data-label) " "; }
  .grow__bike { grid-column: 1 / -1; }
  .srow { grid-template-columns: minmax(0, 1fr) auto; }
  .srow--head { display: none; }
  .srow > span:nth-child(2) { text-align: right; color: var(--ink-3); }
  .srow__result { grid-column: 1 / -1; }
  .srow > span:nth-child(4) { grid-column: 1 / -1; font-size: 13px; }
  .srow .arow__go { display: none; }
  .rrow, .rrow--log { grid-template-columns: minmax(0, 1fr) auto auto; gap: 2px 12px; padding: 10px 14px; }
  .rrow--head { display: none; }
  .rrow__date { grid-column: 1 / -1; font-size: 12px; color: var(--ink-3); }
  .rrow__name { grid-column: 1 / -1; }
  .rrow > .num { text-align: left; font-size: 13px; color: var(--ink-2); }
  .rrow:not(.rrow--log) { grid-template-columns: repeat(2, minmax(0, max-content)); justify-content: start; column-gap: 20px; }
  .rrow__t::before { content: attr(data-label) " "; color: var(--ink-3); }
  .rrow--log > span:first-child { grid-column: 1 / -1; }
}

/* Filter der Ausfahrten-Liste */
.ride-filters { margin-bottom: 10px; background: var(--surface-2); border-color: transparent; align-items: end; }
.ride-filters input[type=search], .ride-filters select { background: var(--surface); }
.ride-filters .filters__actions { align-self: end; }
.ride-hits { margin: 0 0 10px; }
.ride-filters__check { align-self: end; min-height: 40px; }
.tag--race { background: var(--warm-soft); color: var(--warm-ink); font-weight: 600; }

/* Doppelregler (range_field) */
.range { display: grid; gap: 2px; min-width: 0; }
.range__head { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--ink-2); }
.range__out { font-weight: 600; color: var(--ink); white-space: nowrap; }
.range__slider { --thumb: 18px; position: relative; height: 26px; }
.range__slider::before, .range__fill { content: ""; position: absolute; top: 50%; height: 4px; margin-top: -2px; border-radius: 2px; }
.range__slider::before { left: calc(var(--thumb) / 2); right: calc(var(--thumb) / 2); background: var(--line-strong); }
.range__fill { left: calc(var(--thumb) / 2 + (100% - var(--thumb)) * var(--a)); right: calc(var(--thumb) / 2 + (100% - var(--thumb)) * (1 - var(--b))); background: var(--accent); }
.range input[type=range] { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; min-height: 0; background: none; border: 0; pointer-events: none; -webkit-appearance: none; appearance: none; }
.range input[type=range]::-webkit-slider-runnable-track { height: 100%; background: none; }
.range input[type=range]::-moz-range-track { background: none; }
.range input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; pointer-events: auto; width: var(--thumb); height: var(--thumb); margin-top: 4px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); box-shadow: 0 1px 3px rgba(0, 0, 0, .25); cursor: grab; }
.range input[type=range]::-moz-range-thumb { pointer-events: auto; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); box-shadow: 0 1px 3px rgba(0, 0, 0, .25); cursor: grab; }
.range input[type=range]:active::-webkit-slider-thumb { cursor: grabbing; transform: scale(1.1); }
.range input[type=range]:focus { outline: none; }
.range input[type=range]:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--accent); outline-offset: 2px; }
.range input[type=range]:focus-visible::-moz-range-thumb { outline: 2px solid var(--accent); outline-offset: 2px; }
