/* Bedienung mit feuchten Händen am Handy: große Ziele, hoher Kontrast, wenig Zierde. */
:root {
  --paper: #f6f4ee;
  --ink: #23231f;
  --muted: #6d6a62;
  --line: #d9d5cb;
  --smoke: #e9e6de;
  --blood: #8a2b2b;   /* Akzent: einmal pro Ansicht */
  --blood-dark: #6c2020;
  --radius: 6px;
  --font: "Atkinson Hyperlegible", "Segoe UI", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html { font: 17px/1.5 var(--font); color: var(--ink); background: var(--paper); }
body { margin: 0; min-height: 100vh; }
a { color: inherit; }
h1 { font-size: 1.7rem; line-height: 1.2; margin: 0 0 .5rem; font-weight: 700; }
h2 { font-size: 1.25rem; margin: 1.5rem 0 .5rem; }
p { margin: 0 0 1rem; }
.lead { color: var(--muted); max-width: 40ch; }
.hint { color: var(--muted); font-size: .9rem; margin-top: 2rem; }

.topbar {
  display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; align-items: center;
  padding: .75rem 1rem; background: var(--ink); color: var(--paper);
}
.brand { font-weight: 700; text-decoration: none; margin-right: auto; }
.nav { display: flex; gap: .25rem; flex-wrap: wrap; }
.nav a {
  text-decoration: none; padding: .45rem .7rem; border-radius: var(--radius);
  color: var(--paper); opacity: .8;
}
.nav a:hover, .nav a:focus-visible { opacity: 1; background: rgba(255,255,255,.1); }
.nav a[aria-current="page"] { opacity: 1; box-shadow: inset 0 -3px 0 var(--blood); }
.logout { display: flex; gap: .5rem; align-items: center; margin: 0; font-size: .9rem; }
.logout button { background: none; border: 1px solid rgba(255,255,255,.4); color: inherit; }

.page { max-width: 64rem; margin: 0 auto; padding: 1.5rem 1rem 4rem; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: .75rem; }
.tile {
  display: flex; flex-direction: column; gap: .2rem; text-decoration: none;
  padding: 1rem 1.1rem; background: var(--smoke); border-left: 4px solid var(--line);
  border-radius: 0 var(--radius) var(--radius) 0; min-height: 5.5rem;
}
.tile:hover, .tile:focus-visible { border-left-color: var(--blood); background: #e2ded4; }
.tile strong { font-size: 1.15rem; }
.tile span { color: var(--muted); font-size: .92rem; }

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; }
.login { max-width: 22rem; margin: 3rem auto; display: flex; flex-direction: column; gap: .9rem; }
label { display: flex; flex-direction: column; gap: .3rem; font-weight: 600; font-size: .95rem; }
input, select, textarea {
  font: inherit; padding: .6rem .7rem; border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff; min-height: 2.8rem;
}
input:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid var(--blood); outline-offset: 2px; }
button {
  font: inherit; font-weight: 600; padding: .6rem 1rem; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--smoke); color: var(--ink); cursor: pointer; min-height: 2.8rem;
}
button.primary { background: var(--blood); border-color: var(--blood); color: #fff; }
button.primary:hover { background: var(--blood-dark); }
.error { color: var(--blood); font-weight: 600; margin: 0; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .85rem; color: var(--muted); font-weight: 600; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: no-preference) {
  .tile, .nav a, button { transition: background .12s, border-color .12s; }
}

/* Listen mit Inline-Bearbeitung */
.head { display: flex; flex-wrap: wrap; gap: .75rem; align-items: baseline; justify-content: space-between; }
.actions { display: flex; gap: .5rem; }
a.button { display: inline-flex; align-items: center; text-decoration: none; padding: .6rem 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--smoke); font-weight: 600; min-height: 2.8rem; }
.filter { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; margin: .75rem 0 1rem; }
.filter input[type=search] { flex: 1 1 14rem; }
label.inline { flex-direction: row; align-items: center; gap: .5rem; font-weight: 500; }
label.inline input { min-height: auto; width: 1.2rem; height: 1.2rem; }
tr.inactive td { color: var(--muted); }
tr.inactive td:first-child { text-decoration: line-through; }
td .note { color: var(--muted); font-size: .85rem; }
td.empty { color: var(--muted); padding: 2rem .6rem; }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions button { padding: .35rem .6rem; min-height: 2.2rem; font-size: .9rem; font-weight: 500; }
tr.edit td { background: var(--smoke); border-left: 4px solid var(--blood); }
.inline-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: .6rem .9rem; align-items: end; }
.inline-form .wide { grid-column: 1 / -1; }
.form-actions { grid-column: 1 / -1; display: flex; gap: .5rem; }
.ok { color: #2b6b3a; font-weight: 600; }
.errors { color: var(--blood); }
code { background: var(--smoke); padding: .1rem .35rem; border-radius: 3px; font-size: .9em; }
@media (max-width: 40rem) {
  table, thead, tbody, tr, td { display: block; }
  thead { display: none; }
  tr { border-bottom: 2px solid var(--line); padding: .5rem 0; }
  td { border: 0; padding: .2rem .4rem; }
  td:empty { display: none; }
  td.num { text-align: left; }
  .row-actions { text-align: left; }
}

/* Rezepte */
.tile.inactive { opacity: .55; }
.tag { font-size: .7em; font-weight: 500; color: var(--muted); }
.facts { display: flex; flex-wrap: wrap; gap: 1.5rem; margin: .5rem 0 1rem; }
.facts div { display: flex; flex-direction: column; }
.facts span { font-size: .85rem; color: var(--muted); }
.facts strong { font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.calc { background: var(--smoke); padding: 1rem; border-radius: var(--radius); margin: 1rem 0; }
table.compact + table.compact { margin-top: 1rem; }
table.compact td, table.compact th { padding: .4rem .5rem; }
.steps { padding-left: 1.4rem; } .steps li { margin: .35rem 0; }
.pre { white-space: pre-wrap; }
.recipe-form h2 { margin-top: 1.75rem; }
.recipe-form textarea { width: 100%; }
.recipe-form > button { margin-top: .5rem; }
.recipe-form .form-actions { margin-top: 1.5rem; }
.footer-action { margin-top: 3rem; }
.actions form { display: inline; }
@media (max-width: 40rem) {
  table.compact td.num, table.compact th.num { text-align: left; }
  .recipe-form table, .recipe-form tbody, .recipe-form tr, .recipe-form td { display: revert; }
  .recipe-form thead { display: revert; }
  .recipe-form td { border-bottom: 1px solid var(--line); }
}

/* Planung */
.tabs { display: flex; flex-wrap: wrap; gap: .25rem; border-bottom: 2px solid var(--line); margin: .5rem 0 1.25rem; }
.tabs a { text-decoration: none; padding: .5rem .9rem; margin-bottom: -2px; border-bottom: 3px solid transparent; font-weight: 600; color: var(--muted); }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--blood); }
.scroll { overflow-x: auto; }
table.matrix th, table.matrix td { white-space: nowrap; }
tfoot th { border-top: 2px solid var(--ink); border-bottom: 0; color: var(--ink); }
.checks { display: flex; flex-wrap: wrap; gap: .5rem 1rem; border: 1px solid var(--line); border-radius: var(--radius); padding: .5rem .75rem; }
.checks legend { font-size: .85rem; color: var(--muted); }
h3 { font-size: 1.05rem; margin: 1.25rem 0 .4rem; }
@media print {
  .topbar, .tabs, .no-print, .head .actions { display: none !important; }
  .page { padding: 0; max-width: none; }
  input, select { border: 0; background: none; padding: 0; min-height: auto; font-size: 12pt; }
  select { appearance: none; }
}
@media (max-width: 40rem) {
  table.matrix, table.matrix thead, table.matrix tbody, table.matrix tr, table.matrix td, table.matrix th { display: revert; }
}
.row-actions a.button { padding: .35rem .6rem; min-height: 2.2rem; font-size: .9rem; font-weight: 500; }

/* Feldbreiten (statt style="…" im HTML -- die CSP erlaubt keine Inline-Styles) */
.w-4 { width: 4.5rem; }
.w-6 { width: 6rem; }
.w-8 { width: 8rem; }
.w-full { width: 100%; }
.grow-10 { flex: 1 1 10rem; }
.grow-12 { flex: 1 1 12rem; }
.grow-14 { flex: 1 1 14rem; }

/* Fußzeile mit Impressum-Link (auf jeder Seite, auch vor dem Login) */
.site-footer { max-width: 64rem; margin: 0 auto; padding: 1rem 1rem 2rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
.site-footer a { color: inherit; }
.impressum address { font-style: normal; margin-bottom: 1rem; }
.impressum dt { font-weight: 700; margin-top: .75rem; }
.impressum dd { margin: 0; }
.datenschutz h2 { font-size: 1.1rem; margin: 1.5rem 0 .5rem; }
.datenschutz ul { padding-left: 1.25rem; }
.datenschutz li { margin-bottom: .4rem; }
