/* Stammtisch: Wirtshaus colours (dark wood, beer amber, foam cream). One narrow column, phone first. */
:root {
  --page: #f5eee0;
  --paper: #fffbf3;
  --ink: #2a1f1a;
  --muted: #7a6b5f;
  --line: #e6d8bf;
  --brand: #5a2a1a;
  --brand-ink: #fff6e4;
  --amber: #c9811a;
  --foam: #f6e7c1;
  --yes: #2f7d45;
  --maybe: #b9790f;
  --no: #b2402f;
  --focus: #e8a33a;
  --radius: 14px;
  --font-display: ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", "Nunito", system-ui, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --page: #16110e;
    --paper: #211a15;
    --ink: #f1e6d3;
    --muted: #ab9c8c;
    --line: #3a2e25;
    --brand: #3e1d12;
    --brand-ink: #fff1d6;
    --amber: #e7a446;
    --foam: #4a3a1c;
    --yes: #5cb877;
    --maybe: #e2a93c;
    --no: #e07264;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font: 16px/1.5 var(--font-body); }
a { color: var(--brand); }
@media (prefers-color-scheme: dark) { a { color: var(--amber); } }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.wrap {
  max-width: 680px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.self { font-weight: 700; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.2; text-wrap: balance; margin: 0; }
h2 { font-size: 1.3rem; }
p { margin: 0; }

/* Masthead with tabs */
.masthead {
  background: var(--brand);
  color: var(--brand-ink);
  padding-top: env(safe-area-inset-top, 0px);
  border-bottom: 4px solid var(--amber);
  margin-bottom: 24px;
}
.masthead-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding-block: 12px 8px; }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; min-width: 0; }
.brand img { width: 56px; height: 56px; flex: none; }
.brand strong { display: block; font-family: var(--font-display); font-size: 1.35rem; white-space: nowrap; }
.brand small { display: block; opacity: 0.8; font-size: 0.8rem; white-space: nowrap; }
.me { display: flex; align-items: center; gap: 10px; margin-left: auto; font-size: 0.85rem; border: 1px solid color-mix(in srgb, var(--brand-ink) 45%, transparent); border-radius: 999px; padding: 3px 12px; }
.me button.link { color: var(--brand-ink); opacity: 0.75; font-size: 0.8rem; }
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; margin: 0 -6px; padding-bottom: 6px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  flex: none;
  color: var(--brand-ink);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 6px 12px;
  border-radius: 999px;
  opacity: 0.85;
}
.tabs a[aria-current="page"] { background: color-mix(in srgb, var(--brand-ink) 20%, transparent); opacity: 1; font-weight: 600; }
@media (max-width: 440px) {
  .brand img { width: 46px; height: 46px; }
  .brand strong { font-size: 1.15rem; }
  .tabs a { padding: 6px 10px; font-size: 0.85rem; }
}

main { display: flex; flex-direction: column; gap: 18px; padding-bottom: 24px; }

/* Panels */
.panel, .card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
details.panel { display: block; }
details.panel[open] > * + * { margin-top: 12px; }
details > summary { cursor: pointer; }
.panel.narrow { max-width: 440px; }
.panel.highlight { border: 2px solid var(--amber); }
.eyebrow { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--amber); margin: 0; }
.hero { border: 2px solid var(--amber); background: color-mix(in srgb, var(--foam) 30%, var(--paper)); }
.hero h2 { font-size: 1.6rem; }
.hero.is-fixed { border-color: var(--yes); }
.where { font-size: 1.1rem; font-weight: 600; }

/* Buttons */
button, .button {
  font: 600 0.95rem/1.2 var(--font-body);
  border-radius: 10px;
  padding: 10px 14px;
  border: 1.5px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
}
.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.secondary { background: transparent; }
.ghost-danger { background: transparent; color: var(--no); border-color: color-mix(in srgb, var(--no) 40%, var(--line)); }
button.link { background: none; border: none; padding: 0; min-height: 0; color: var(--brand); text-decoration: underline; font-weight: 400; }
@media (prefers-color-scheme: dark) {
  .primary { background: #8a3f22; border-color: #8a3f22; }
  button.link { color: var(--amber); }
}

/* Feedback */
.flash, .warn, .error { border-radius: 10px; padding: 10px 14px; font-size: 0.95rem; }
.flash { background: color-mix(in srgb, var(--yes) 15%, var(--paper)); border: 1px solid color-mix(in srgb, var(--yes) 40%, var(--line)); margin-bottom: 4px; }
.error { background: color-mix(in srgb, var(--no) 14%, var(--paper)); border: 1px solid color-mix(in srgb, var(--no) 45%, var(--line)); }
.code { background: var(--page); border: 1px solid var(--line); border-radius: 8px; padding: 10px; overflow-x: auto; }

/* Forms */
input, select, textarea {
  font: inherit;
  color: var(--ink);
  background: var(--page);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 9px 12px;
  min-height: 44px;
  min-width: 0;
  max-width: 100%;
}
textarea { width: 100%; resize: vertical; }
input[type="checkbox"], input[type="radio"] { min-height: 0; width: 22px; height: 22px; accent-color: var(--brand); flex: none; }
.num-input { width: 5.5em; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.stack.tight { gap: 4px; }
.inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inline > input:not([type]), .inline > input[name="lokal"], .inline > input[name="grund"], .inline > input[name="name"] { flex: 1 1 180px; }
.grow { flex: 1 1 auto; min-width: 0; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Rows */
.rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.row:first-child { border-top: none; }
.row-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; min-width: 0; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.days .row { flex-wrap: nowrap; }
.days input[type="time"] { width: 7.5em; flex: none; }
.count {
  flex: none;
  min-width: 2.2em;
  text-align: center;
  font: 700 1rem/1 var(--font-display);
  font-variant-numeric: tabular-nums;
  background: color-mix(in srgb, var(--amber) 18%, transparent);
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 8px;
}
.count.big { font-size: 1.2rem; }
.count.hot { background: var(--no); color: #fff; }
.badge { font-size: 0.75rem; font-weight: 700; border-radius: 999px; padding: 2px 10px; white-space: nowrap; }
.badge.yes { background: color-mix(in srgb, var(--yes) 18%, transparent); color: var(--yes); }
.badge.maybe { background: color-mix(in srgb, var(--maybe) 20%, transparent); color: var(--maybe); }
.badge.no { background: color-mix(in srgb, var(--no) 16%, transparent); color: var(--no); }
.organizer { border-top: 1px dashed var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }

/* Fahrplan */
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.step { display: flex; align-items: center; gap: 12px; padding: 8px 0; position: relative; }
.step-dot { flex: none; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--muted); background: var(--paper); }
.step .state { flex: none; color: var(--muted); text-align: right; }
.step.ok .step-dot { background: var(--yes); border-color: var(--yes); }
.step.ok .state { color: var(--yes); }
.step.late .step-dot { background: var(--maybe); border-color: var(--maybe); }
.step.late .state { color: var(--maybe); font-weight: 600; }
.step.overdue .step-dot { border-color: var(--no); }
.step.overdue .state { color: var(--no); font-weight: 600; }
.step.skip { opacity: 0.5; }
.step.open .state { color: var(--ink); }

/* Strafrunden */
.penalty-row { padding: 6px 0; }
.penalty-row summary { display: flex; align-items: center; gap: 10px; list-style: none; padding: 4px 0; }
.penalty-row summary::-webkit-details-marker { display: none; }
.penalty-row details[open] { display: flex; flex-direction: column; gap: 10px; padding-bottom: 8px; }
.history-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.history-list li { display: flex; gap: 10px; align-items: baseline; }
.history-list li.is-reversed .grow { text-decoration: line-through; opacity: 0.7; }
.delta { flex: none; font-weight: 700; font-variant-numeric: tabular-nums; width: 2.4em; }
.delta.plus { color: var(--no); }
.delta.minus { color: var(--yes); }
.admin-box { border-top: 1px dashed var(--line); padding-top: 10px; }
.admin-box summary { color: var(--muted); }
.admin-box[open] > .stack, .admin-box[open] > form { margin-top: 10px; }

/* Titel */
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { display: inline-flex; align-items: center; gap: 6px; background: color-mix(in srgb, var(--amber) 16%, transparent); border-radius: 999px; padding: 3px 12px; font-size: 0.9rem; }
.chips button.link { text-decoration: none; font-size: 1.1rem; line-height: 1; }

/* Protokolle */
.resolutions { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 12px; }

/* Aufgaben */
.task.is-late strong { color: var(--no); }

/* Admin */
.members .row { flex-wrap: wrap; }
.hidden-members summary { color: var(--muted); }

.footer { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: center; padding-block: 8px 32px; font-size: 0.85rem; color: var(--muted); }
.footer a, .footer button.link { color: var(--muted); font-size: inherit; }
