/* Ausflug – Gestaltung
   Farben: Almweiß (Papier), Latschen (Tinte), Enzian (Aktion), Almsonne (Hervorhebung).
   Schrift: Bricolage Grotesque für Überschriften, Figtree für Text. Beide unter OFL, lokal eingebunden. */

@font-face {
  font-family: "Bricolage";
  src: url("/fonts/bricolage.woff") format("woff");
  font-weight: 200 800; font-stretch: 75% 100%; font-display: swap;
}
@font-face {
  font-family: "Figtree";
  src: url("/fonts/figtree.woff") format("woff");
  font-weight: 300 900; font-display: swap;
}

:root {
  --paper: #F3F6F4;
  --surface: #FFFFFF;
  --sunken: #E8EEEA;
  --ink: #13251F;
  --muted: #5B6B64;
  --line: #D9E1DC;
  --enzian: #2D44C4;
  --enzian-ink: #FFFFFF;
  --enzian-soft: #E5E9FA;
  --sun: #F0B232;
  --sun-soft: #FCF0D2;
  --pos: #1F7A4D;
  --neg: #B4412B;
  --danger: #B4412B;

  --c-sight: #2D44C4; --c-museum: #7A4CC2; --c-nature: #2F8A55; --c-food: #D2713A;
  --c-nightlife: #B83D78; --c-shopping: #C49A1E; --c-activity: #1D8C9A; --c-other: #7B8A83;

  --display: "Bricolage", ui-sans-serif, system-ui, sans-serif;
  --text: "Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --r-sm: 8px; --r-md: 14px; --r-lg: 22px;
  --shadow: 0 1px 0 rgba(19, 37, 31, .04), 0 8px 24px -12px rgba(19, 37, 31, .18);
  --wrap: 760px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0E1714; --surface: #16211D; --sunken: #1C2925; --ink: #E6EEEA; --muted: #93A39B; --line: #27352F;
    --enzian: #8A9AF6; --enzian-ink: #0E1714; --enzian-soft: #1E2648; --sun: #F3BF4F; --sun-soft: #3A2F14;
    --pos: #5CC48D; --neg: #F08A72; --danger: #F08A72;
    --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 10px 30px -14px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 16px/1.5 var(--text); font-feature-settings: "ss01", "tnum" 0;
  -webkit-font-smoothing: antialiased; min-height: 100dvh;
}
a { color: var(--enzian); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--enzian) 55%, transparent); outline-offset: 2px; border-radius: 6px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 16px; height: 16px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding-inline: 20px; }

/* ---------- Kopfzeile ---------- */
.topbar { display: flex; align-items: center; gap: 12px; padding-block: 14px; min-height: 64px; }
.wordmark {
  font: 700 22px/1 var(--display); font-stretch: 82%; letter-spacing: -.01em; color: var(--ink);
  text-decoration: none; display: inline-flex; align-items: center; gap: 9px;
}
.wordmark svg { width: 26px; height: 26px; }
.topbar .spacer { flex: 1; }
.iconbtn {
  width: 42px; height: 42px; border-radius: 50%; display: inline-grid; place-items: center;
  border: 1px solid transparent; background: transparent; color: var(--ink);
}
.iconbtn:hover { background: var(--sunken); }

.avatar {
  --h: 200; width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  background: hsl(var(--h) 55% 86%); color: hsl(var(--h) 45% 26%);
  font: 700 13px/1 var(--text); letter-spacing: .02em; border: 2px solid var(--paper);
}
@media (prefers-color-scheme: dark) { .avatar { background: hsl(var(--h) 30% 30%); color: hsl(var(--h) 60% 88%); } }
.avatars { display: inline-flex; text-decoration: none; }
.avatars .avatar { width: 30px; height: 30px; font-size: 12px; margin-left: -8px; }
.avatars .avatar:first-child { margin-left: 0; }

/* ---------- Knöpfe ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font-weight: 600; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: color-mix(in srgb, var(--ink) 30%, var(--line)); }
.btn-primary { background: var(--enzian); border-color: var(--enzian); color: var(--enzian-ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--enzian) 88%, #000); border-color: transparent; }
.btn-quiet { background: transparent; border-color: transparent; color: var(--enzian); padding: 0 12px; }
.btn-quiet:hover { background: var(--enzian-soft); }
.btn-danger { color: var(--danger); background: transparent; border-color: transparent; }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 10%, transparent); }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn[disabled] { opacity: .55; cursor: default; }
.btn-block { width: 100%; }

/* ---------- Anmelden ---------- */
.auth { min-height: 100dvh; display: grid; align-content: center; padding: 40px 20px; }
.auth-inner { width: 100%; max-width: 420px; margin: 0 auto; }
.auth-hero {
  font: 800 clamp(64px, 19vw, 112px)/.86 var(--display); font-stretch: 78%; letter-spacing: -.035em; margin: 0 0 18px;
}
.auth-hero .trail { display: block; height: 18px; margin: 14px 0 0; color: var(--enzian); }
.auth-lead { font-size: 18px; color: var(--muted); margin: 0 0 32px; max-width: 30ch; }
.invite-card { background: var(--enzian-soft); border-radius: var(--r-md); padding: 16px 18px; margin: 0 0 24px; }
.invite-card strong { font: 700 22px/1.15 var(--display); font-stretch: 85%; display: block; margin-top: 2px; }
.switch-auth { text-align: center; margin-top: 18px; color: var(--muted); }
.switch-auth button { background: none; border: 0; color: var(--enzian); font-weight: 600; padding: 4px; }

/* ---------- Formulare ---------- */
.form { display: grid; gap: 16px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > span { font-size: 14px; font-weight: 600; }
.field .hint { font-size: 13px; color: var(--muted); font-weight: 400; }
.input, .field input:not([type=checkbox]):not([type=radio]), .field select, .field textarea {
  width: 100%; min-height: 48px; padding: 11px 14px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--surface); outline: none; appearance: none;
}
.field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235B6B64' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; padding-right: 40px; }
.field textarea { min-height: 96px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--enzian); box-shadow: 0 0 0 3px color-mix(in srgb, var(--enzian) 22%, transparent); }
.field input[disabled], .field select[disabled], .field textarea[disabled] { background: var(--sunken); color: var(--ink); opacity: 1; -webkit-text-fill-color: var(--ink); }
.inline { display: flex; gap: 8px; }
.inline > input { flex: 1; min-width: 0; }
.form-error { color: var(--danger); font-weight: 600; margin: 0; min-height: 0; }
.form-error:empty { display: none; }

.segmented { display: flex; padding: 4px; gap: 4px; background: var(--sunken); border-radius: 12px; }
.segmented label { flex: 1; position: relative; }
.segmented input { position: absolute; opacity: 0; inset: 0; }
.segmented span { display: block; text-align: center; padding: 9px 6px; border-radius: 9px; font-weight: 600; font-size: 14px; color: var(--muted); }
.segmented input:checked + span { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.segmented input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--enzian) 55%, transparent); }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.check { position: relative; }
.check input { position: absolute; opacity: 0; inset: 0; }
.check span { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); font-weight: 600; font-size: 14px; background: var(--surface); }
.check input:checked + span { background: var(--enzian-soft); border-color: var(--enzian); color: var(--enzian); }
.check input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--enzian) 55%, transparent); }

/* ---------- Startseite ---------- */
.page-title { font: 750 40px/1 var(--display); font-stretch: 80%; letter-spacing: -.025em; margin: 18px 0 6px; }
.page-sub { color: var(--muted); margin: 0 0 26px; }
.trip-list { list-style: none; padding: 0; margin: 0 0 28px; display: grid; gap: 12px; }
.trip-row {
  display: grid; grid-template-columns: 76px 1fr; gap: 16px; align-items: center; padding: 14px 18px 14px 14px;
  background: var(--surface); border-radius: var(--r-lg); text-decoration: none; color: inherit; box-shadow: var(--shadow);
}
.trip-row:hover { outline: 1px solid var(--line); }
.datestamp {
  height: 76px; border-radius: 16px; background: var(--enzian); color: var(--enzian-ink);
  display: grid; place-content: center; text-align: center; gap: 4px;
}
.datestamp b { font: 800 30px/.9 var(--display); font-stretch: 78%; }
.datestamp small { font-size: 12px; font-weight: 600; opacity: .85; }
.datestamp.past { background: var(--sunken); color: var(--muted); }
.datestamp.none { background: var(--sunken); color: var(--muted); }
.trip-row h2 { font: 700 21px/1.15 var(--display); font-stretch: 86%; margin: 0 0 3px; }
.trip-row p { margin: 0; color: var(--muted); font-size: 14px; }
.trip-row .foot { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 13px; color: var(--muted); }
.list-label { font: 600 15px/1 var(--text); color: var(--muted); margin: 30px 0 12px; }

.empty {
  border: 1.5px dashed var(--line); border-radius: var(--r-lg); padding: 28px 22px; text-align: center; color: var(--muted);
}
.empty h3 { color: var(--ink); font: 700 20px/1.2 var(--display); font-stretch: 86%; margin: 0 0 6px; }
.empty p { margin: 0 auto 16px; max-width: 42ch; }

/* ---------- Reise ---------- */
.trip-head { padding-block: 6px 18px; }
.trip-title {
  font: 800 clamp(40px, 11vw, 68px)/.92 var(--display); font-stretch: 76%; letter-spacing: -.03em; margin: 8px 0 12px;
  overflow-wrap: anywhere;
}
.trip-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; color: var(--muted); font-size: 15px; }
.trip-meta span { display: inline-flex; align-items: center; gap: 6px; }
.countdown { display: inline-flex; align-items: center; gap: 6px; background: var(--sun-soft); color: var(--ink); font-weight: 650; padding: 5px 11px; border-radius: 999px; font-size: 14px; }
.countdown::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--sun); }

.tabs {
  position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line);
}
.tabs nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.tabs nav::-webkit-scrollbar { display: none; }
.tabs a {
  display: inline-flex; align-items: center; gap: 6px; padding: 14px 10px 13px; text-decoration: none; color: var(--muted);
  font-weight: 600; font-size: 15px; white-space: nowrap; border-bottom: 2.5px solid transparent; margin-bottom: -1px;
}
.tabs a[aria-current="page"] { color: var(--ink); border-color: var(--enzian); }
.tabs a .icon { width: 18px; height: 18px; }

.section { padding-block: 22px 120px; }
.section-head { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; }
.section-head h2 { font: 750 28px/1.05 var(--display); font-stretch: 82%; letter-spacing: -.015em; margin: 0; flex: 1; }
.notice { background: var(--sun-soft); border-radius: var(--r-md); padding: 12px 16px; margin: 0 0 18px; font-size: 15px; }
.notice b { font-weight: 700; }

.fab {
  position: fixed; right: max(20px, calc((100vw - var(--wrap)) / 2 + 20px)); bottom: calc(22px + var(--safe-b)); z-index: 6;
  min-height: 56px; padding: 0 22px; box-shadow: 0 10px 30px -8px color-mix(in srgb, var(--enzian) 60%, transparent);
}

/* Tageswahl */
.daybar { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 6px; margin: 0 0 8px; scrollbar-width: none; }
.daybar::-webkit-scrollbar { display: none; }
.daychip {
  flex: none; display: grid; justify-items: center; gap: 2px; width: 58px; padding: 9px 0 8px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink);
}
.daychip small { font-size: 12px; color: var(--muted); font-weight: 600; }
.daychip b { font: 750 22px/1 var(--display); font-stretch: 80%; }
.daychip.has::after { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--enzian); }
.daychip.today { border-color: var(--sun); box-shadow: inset 0 0 0 1px var(--sun); }

/* ---------- Tagesplan als Route ---------- */
.day { margin: 0 0 34px; scroll-margin-top: 64px; }
.day-head { display: grid; grid-template-columns: 52px 1fr auto; align-items: end; gap: 0 4px; margin: 0 0 10px; }
.day-no { font: 800 46px/.8 var(--display); font-stretch: 75%; color: var(--enzian); letter-spacing: -.03em; text-align: center; }
.day-head h3 { font: 700 20px/1.1 var(--display); font-stretch: 88%; margin: 0; }
.day-head p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }

.route { list-style: none; margin: 0; padding: 0; position: relative; }
.route > li { position: relative; display: grid; grid-template-columns: 52px 1fr; }
.route > li::before {
  content: ""; position: absolute; left: 25px; top: 0; bottom: 0; width: 2px; background: var(--line);
}
.route > li:first-child::before { top: 22px; }
.route > li:last-child::before { bottom: calc(100% - 22px); }
.route > li:only-child::before { display: none; }

.marker {
  position: relative; z-index: 1; justify-self: center; margin-top: 8px; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; background: var(--surface); border: 2.5px solid var(--cat, var(--enzian)); color: var(--ink);
  font: 750 13px/1 var(--text);
}
.marker.hotel { border-radius: 9px; background: var(--ink); border-color: var(--ink); color: var(--paper); }
.marker.hotel .icon { width: 15px; height: 15px; }
.marker.done { background: var(--cat, var(--enzian)); color: #fff; }

.stop-card {
  margin: 4px 0 8px; padding: 10px 14px; border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow);
  display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: start; text-align: left; border: 0; width: 100%; color: inherit;
}
button.stop-card:hover { outline: 1px solid var(--line); }
.stop-card .t { font-weight: 700; font-size: 16px; line-height: 1.3; }
.stop-card .s { color: var(--muted); font-size: 14px; grid-column: 1; }
.stop-card .time { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 14px; color: var(--ink); grid-row: 1; grid-column: 2; }
.stop-hotel { padding: 9px 0 9px; font-size: 15px; color: var(--muted); align-self: center; }
.stop-hotel b { color: var(--ink); font-weight: 650; }

/* Wege zwischen den Stopps: Linienstil zeigt das Verkehrsmittel */
.route > li.leg::before { background: none; border-left: 2px dashed var(--muted); width: 0; left: 25px; }
.route > li.leg.solid::before { border-left: 3px solid var(--ink); left: 24.5px; }
.leg-icon { position: relative; z-index: 1; justify-self: center; align-self: center; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--paper); color: var(--ink); }
.leg-body {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 0; border: 0; background: none; text-align: left; color: inherit; width: 100%;
}
.leg-body .t { font-weight: 650; font-size: 15px; }
.leg-body .s { color: var(--muted); font-size: 14px; }
.route .add-row { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 0 0; }
.day-empty { color: var(--muted); font-size: 15px; padding: 10px 0; }

/* ---------- Listen ---------- */
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.item {
  display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 14px 16px;
  background: var(--surface); border-radius: var(--r-md); box-shadow: var(--shadow);
}
.item-main { border: 0; background: none; padding: 0; text-align: left; min-width: 0; color: inherit; }
.item-main .t { font-weight: 700; font-size: 16px; line-height: 1.3; display: block; }
.item-main .s { color: var(--muted); font-size: 14px; display: block; margin-top: 2px; }
.item-main .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 650; padding: 3px 9px; border-radius: 999px; background: var(--sunken); color: var(--muted); }
.tag.planned { background: var(--enzian-soft); color: var(--enzian); }
.tag.must { background: var(--sun-soft); color: var(--ink); }
.catdot { width: 12px; height: 12px; border-radius: 50%; background: var(--cat, var(--c-other)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--cat, var(--c-other)) 18%, transparent); margin: 0 4px; }
.item-side { display: flex; align-items: center; gap: 4px; }

.vote {
  display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums;
}
.vote.on { background: var(--sun-soft); border-color: var(--sun); }
.vote.on .icon { fill: var(--sun); stroke: var(--ink); }

.filters { display: flex; gap: 8px; overflow-x: auto; margin: 0 0 16px; padding-bottom: 2px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; font-size: 14px; color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* Unterkünfte */
.stay {
  background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden;
  display: grid; grid-template-columns: 92px 1fr; border: 0; padding: 0; text-align: left; width: 100%; color: inherit;
}
.stay-dates { background: var(--ink); color: var(--paper); display: grid; place-content: center; text-align: center; padding: 14px 6px; gap: 6px; }
.stay-dates b { font: 800 24px/.95 var(--display); font-stretch: 78%; display: block; }
.stay-dates small { font-size: 12px; opacity: .75; font-weight: 600; }
.stay-body { padding: 14px 16px; min-width: 0; }
.stay-body .t { font: 700 19px/1.2 var(--display); font-stretch: 88%; margin: 0 0 3px; }
.stay-body .s { color: var(--muted); font-size: 14px; margin: 0; }
.stay-body .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

/* ---------- Kosten ---------- */
.totals { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 20px; margin: 0 0 22px; }
.totals-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.big-money { font: 800 44px/1 var(--display); font-stretch: 78%; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.totals-top .muted { font-size: 15px; }
.budgetbar { height: 12px; border-radius: 99px; background: var(--sunken); overflow: hidden; display: flex; margin: 16px 0 10px; }
.budgetbar i { display: block; height: 100%; }
.budgetbar i.planned { background: repeating-linear-gradient(-45deg, var(--muted) 0 3px, transparent 3px 6px); opacity: .55; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted); margin: 0; padding: 0; list-style: none; }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.stats3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.stats3 b { display: block; font: 750 20px/1.1 var(--display); font-stretch: 85%; font-variant-numeric: tabular-nums; }
.stats3 small { color: var(--muted); font-size: 13px; }

.balances { display: grid; gap: 8px; margin: 0 0 12px; }
.bal { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; }
.bal .bar { height: 8px; border-radius: 99px; background: var(--sunken); position: relative; overflow: hidden; }
.bal .bar i { position: absolute; top: 0; bottom: 0; border-radius: 99px; }
.bal .amt { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 92px; text-align: right; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.settle { list-style: none; margin: 0 0 26px; padding: 14px 16px; border-radius: var(--r-md); background: var(--enzian-soft); display: grid; gap: 8px; }
.settle li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 15px; }
.settle b { font-variant-numeric: tabular-nums; }
.h3 { font: 700 19px/1.2 var(--display); font-stretch: 88%; margin: 26px 0 12px; }

.money { font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.money small { display: block; font-weight: 600; font-size: 12px; color: var(--muted); }

/* ---------- Gruppe ---------- */
.panel { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 18px; margin: 0 0 18px; }
.panel h3 { font: 700 19px/1.2 var(--display); font-stretch: 88%; margin: 0 0 4px; }
.panel > p { margin: 0 0 14px; color: var(--muted); font-size: 15px; }
.member { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.member:first-of-type { border-top: 0; }
.member > div { min-width: 0; }
.member .t { font-weight: 650; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member .s { color: var(--muted); font-size: 13px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member select { max-width: 150px; min-height: 38px; padding: 6px 30px 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); appearance: none; font-size: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235B6B64' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; background-size: 16px; }
.role { font-size: 13px; color: var(--muted); font-weight: 600; }
.linkbox { display: flex; gap: 8px; align-items: center; background: var(--sunken); border-radius: var(--r-sm); padding: 6px 6px 6px 12px; margin: 0 0 12px; }
.linkbox code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 500 14px/1.4 var(--text); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Sheet (Dialog) ---------- */
dialog#sheet {
  border: 0; padding: 0; background: var(--paper); color: var(--ink); width: min(560px, 100vw); max-width: 100vw;
  max-height: min(92dvh, 900px); border-radius: var(--r-lg); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .45);
}
dialog#sheet::backdrop { background: rgba(10, 22, 18, .42); }
dialog#sheet[open] { display: flex; flex-direction: column; animation: sheet-in .22s cubic-bezier(.2, .8, .2, 1); }
@keyframes sheet-in { from { transform: translateY(16px); opacity: 0; } }
@media (max-width: 640px) {
  dialog#sheet { margin: auto 0 0; width: 100vw; border-radius: var(--r-lg) var(--r-lg) 0 0; max-height: 94dvh; }
  dialog#sheet[open] { animation-name: sheet-up; }
  @keyframes sheet-up { from { transform: translateY(40%); } }
}
.sheet-head { display: flex; align-items: center; gap: 8px; padding: 16px 12px 8px 20px; }
.sheet-head h2 { flex: 1; margin: 0; font: 750 24px/1.1 var(--display); font-stretch: 84%; letter-spacing: -.01em; }
.sheet-body { padding: 6px 20px 20px; overflow-y: auto; }
.sheet-foot { display: flex; gap: 8px; align-items: center; padding: 12px 20px calc(14px + var(--safe-b)); border-top: 1px solid var(--line); background: var(--paper); }
.sheet-foot .spacer { flex: 1; }
.sheet-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.linked { background: var(--surface); border-radius: var(--r-md); padding: 12px 14px; margin: 0 0 18px; display: grid; gap: 6px; }
.linked .row { display: flex; justify-content: space-between; gap: 10px; font-size: 15px; }
.pick-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pick-list button { width: 100%; text-align: left; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); }
.pick-list button:hover { border-color: var(--enzian); }
.pick-list .t { font-weight: 650; flex: 1; }

/* ---------- Toast ---------- */
#toast {
  position: fixed; left: 50%; bottom: calc(92px + var(--safe-b)); transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--paper); padding: 11px 18px; border-radius: 999px; font-weight: 600; font-size: 15px;
  transition: opacity .18s, transform .18s; z-index: 50; max-width: calc(100vw - 40px); text-align: center;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.err { background: var(--danger); color: #fff; }

.loading { padding: 80px 0; text-align: center; color: var(--muted); }

@media (min-width: 720px) {
  .wrap { padding-inline: 28px; }
  .section-head h2 { font-size: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
