/* Kaffee-App: Layout und Bausteine.
   Farben, Schriftgrößen, Abstände und Radius kommen ausschließlich aus tokens.css. */

html { -webkit-text-size-adjust: 100%; }
body { min-height: 100dvh; padding-bottom: calc(56px + env(safe-area-inset-bottom) + var(--s4)); }
a { -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; margin: 0; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- Kopf ------------------------------------------------- */
.top {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 640px; margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + var(--s2)) var(--s3) 0;
}
.brand { display: inline-flex; align-items: center; gap: var(--s2); min-height: 44px; color: var(--ink); text-decoration: none; }
.brand .mark { width: 24px; height: 24px; display: block; }
.brand .wordmark { font-size: var(--t-14); }
.top-link { display: inline-flex; align-items: center; min-height: 44px; padding-left: var(--s3); text-decoration: none; }
.top-link[aria-current="page"] { color: var(--accent); }

main { max-width: 640px; margin: 0 auto; padding: 0 var(--s3); }
main:focus { outline: none; }

/* ---- Ansichtskopf ------------------------------------------ */
.view-head { padding: var(--s3) 0; border-bottom: 1px solid var(--line); }
.view-head .chapter { display: block; }
.title {
  font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: var(--t-52); line-height: 1; letter-spacing: -.01em; margin-top: var(--s2);
}
.detail-title { font-size: var(--t-32); margin-top: var(--s2); }
.back { display: inline-flex; align-items: center; min-height: 44px; margin-top: var(--s1); text-decoration: none; }
.lede { color: var(--ink-2); margin-top: var(--s3); }
.empty { color: var(--ink-2); padding: var(--s4) 0; }
.open { color: var(--ink-3); }
.lead-action { padding: var(--s3) 0 var(--s1); }

/* ---- Listen ----------------------------------------------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li { border-bottom: 1px solid var(--line-soft); }
.list li:last-child { border-bottom: 0; }
.row { display: grid; gap: var(--s1); padding: var(--s3) 0; color: var(--ink); text-decoration: none; }
.row:hover { color: var(--ink); }
.row:active { background: var(--line-soft); }
.row-top { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); }
.row-top .spec, .row-top .price { white-space: nowrap; }
.row-name { font-weight: 600; line-height: var(--lh-tight); }
.row-sub { font-size: var(--t-14); line-height: 1.45; color: var(--ink-2); }
.row-note { font-size: var(--t-14); line-height: 1.45; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .price { font-size: var(--t-14); }
.list--muted .row-name { color: var(--ink-2); }

.day {
  font-family: var(--mono); font-weight: 500; font-size: var(--t-11); line-height: var(--lh-text);
  letter-spacing: .18em; text-transform: uppercase; color: var(--ink-3);
  padding: var(--s4) 0 var(--s2); border-bottom: 1px solid var(--line);
}

/* ---- Spec-Block ------------------------------------------- */
.specs { display: grid; grid-template-columns: max-content 1fr; gap: var(--s1) var(--s3); margin: var(--s3) 0 0; }
.specs dt, .specs dd {
  margin: 0; font-family: var(--mono); font-weight: 500; font-size: var(--t-11);
  letter-spacing: .1em; text-transform: uppercase;
}
.specs dt { color: var(--ink-3); }
.specs dd { color: var(--ink); }
.specs dd.price { color: var(--accent); }
.steps { white-space: pre-line; margin-top: var(--s2); }
.steps.open { font-family: var(--mono); font-size: var(--t-11); letter-spacing: .1em; text-transform: uppercase; }
.note { color: var(--ink-2); white-space: pre-line; margin-top: var(--s3); }

/* ---- Knöpfe ----------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px;
  padding: 0 var(--s3); border: 1px solid var(--ink); border-radius: var(--radius);
  background: var(--ink); color: var(--bg); font-family: var(--grot); font-weight: 600;
  font-size: var(--t-17); line-height: 1; text-decoration: none; cursor: pointer;
}
.btn:hover { color: var(--bg); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { color: var(--ink); border-color: var(--ink); }
.btn--block { width: 100%; }
.actions { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s4); }
.actions .btn { flex: 1 1 140px; }
.btn--quiet {
  display: inline-flex; align-items: center; min-height: 44px; margin-top: var(--s2); padding: 0;
  background: none; border: 0; color: var(--ink-3); font-size: var(--t-14);
  text-decoration: underline; text-underline-offset: .18em; cursor: pointer;
}

/* ---- Formular --------------------------------------------- */
.form { display: grid; gap: var(--s3); margin-top: var(--s3); }
.field { display: grid; gap: var(--s1); min-width: 0; }
fieldset.field { border: 0; margin: 0; padding: 0; }
.label, fieldset.field > legend {
  font-family: var(--mono); font-weight: 500; font-size: var(--t-11); line-height: var(--lh-text);
  letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2);
}
fieldset.field > legend { padding: 0; margin-bottom: var(--s1); }
.input {
  width: 100%; min-height: 48px; padding: var(--s2); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); font-size: var(--t-17); line-height: 1.3;
}
.input:focus { border-color: var(--ink); }
.input::placeholder { color: var(--ink-3); opacity: 1; }
.input.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
textarea.input { min-height: 96px; line-height: var(--lh-text); resize: vertical; }
input[type="date"].input, input[type="datetime-local"].input { -webkit-appearance: none; appearance: none; text-align: left; }
.input::-webkit-date-and-time-value { text-align: left; }
.input:user-invalid { border-color: var(--accent); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3) var(--s2); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s3) var(--s2); }
.ratio { min-height: 1.6em; margin-top: calc(-1 * var(--s2)); }

.select { position: relative; display: block; }
.select select { -webkit-appearance: none; appearance: none; padding-right: 2.4rem; }
.select::after {
  content: ""; position: absolute; right: var(--s3); top: 50%; width: 7px; height: 7px;
  border-right: 1.5px solid var(--ink-2); border-bottom: 1.5px solid var(--ink-2);
  transform: translateY(-70%) rotate(45deg); pointer-events: none;
}

/* Segmente: Art, Geschmack, Bewertung, Darstellung */
.seg { display: flex; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.seg label { flex: 1 1 0; position: relative; min-width: 0; }
.seg input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.seg span {
  display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 2px;
  border-left: 1px solid var(--line); text-align: center;
  font-family: var(--mono); font-weight: 500; font-size: var(--t-11); letter-spacing: .06em;
  text-transform: uppercase; color: var(--ink-2);
}
.seg label:first-child span { border-left: 0; }
.seg input:checked + span { background: var(--ink); color: var(--bg); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -2px; }

/* ---- Sekundärmuster: nur als Trennfläche ------------------- */
.swell { height: 25.6px; margin: var(--s5) calc(-1 * var(--s3)) 0; }
.swell svg { display: block; width: 100%; height: 100%; }

/* ---- Bereichsleiste ---------------------------------------- */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; justify-content: center;
  background: var(--bg); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabs a {
  position: relative; flex: 1 1 0; max-width: 214px; height: 56px;
  display: flex; align-items: center; justify-content: center; padding-left: .18em;
  font-family: var(--mono); font-weight: 500; font-size: var(--t-11);
  letter-spacing: .18em; text-transform: uppercase; color: var(--ink-3); text-decoration: none;
}
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--ink); }
.tabs a[aria-current="page"]::before {
  content: ""; position: absolute; top: -1px; left: 30%; right: 30%; height: 2px; background: var(--accent);
}
