/* ==========================================================================
   TRAIL – ein Pfad mit Wegmarken.
   Die einzige Farbe ist das Gelb der Wegmarkierung (Blaze): Es markiert,
   wo das Projekt gerade steht. Alles andere bleibt ruhig in Graugrün.
   ========================================================================== */

:root {
  /* Dunkel ist Standard */
  --paper: #121614;
  --surface: #1a1f1d;
  --ink: #e4e8e6;
  --ink-2: #a1aaa5;
  --ink-3: #7a837e;
  --line: #2f3633;
  --line-soft: #232927;
  --blaze: #f0b82a;
  --blaze-tint: #3a3118;
  --ok: #7cc39c;
  --ok-tint: #1c2b23;
  --danger: #f2877b;
  --danger-tint: #3a1f1c;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --r-s: 4px;
  --r-m: 8px;
  --gutter: 1.25rem;
  --col: 46rem;

  color-scheme: dark;
}

:root[data-theme="light"] {
  --paper: #f2f3f1;
  --surface: #ffffff;
  --ink: #1b211f;
  --ink-2: #5d6762;
  --ink-3: #8a938e;
  --line: #d5dad7;
  --line-soft: #e5e8e6;
  --blaze: #e8ae14;
  --blaze-tint: #fbf1d3;
  --ok: #2f6b4f;
  --ok-tint: #e3efe8;
  --danger: #b42318;
  --danger-tint: #fbe9e7;
  color-scheme: light;
}

/* --- Basis ---------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.55 var(--font);
  font-feature-settings: "tnum" 0;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-color: var(--blaze); }

code {
  font-family: var(--mono);
  font-size: 0.875em;
  background: var(--line-soft);
  padding: 0.1em 0.35em;
  border-radius: var(--r-s);
  overflow-wrap: anywhere;
}

small { font-size: 0.8125rem; color: var(--ink-3); font-weight: 400; }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  border-radius: var(--r-s);
}

.vh {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; margin: -1px; padding: 0; border: 0;
}

/* --- Kopfzeile ------------------------------------------------------------ */

.bar { border-bottom: 1px solid var(--line); }

.bar-in {
  max-width: calc(var(--col) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.mark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 0.9375rem;
  letter-spacing: 0.16em;
  text-decoration: none;
}

.mark-blaze {
  display: inline-block;
  width: 6px;
  height: 14px;
  border-radius: 1.5px;
  background: var(--blaze);
}

.owner {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
}

.nav { display: flex; align-items: center; gap: 1.25rem; font-size: 0.9375rem; }
.nav a { text-decoration: none; color: var(--ink-2); }
.nav a:hover, .nav a[aria-current] { color: var(--ink); }
.nav a[aria-current] { box-shadow: inset 0 -2px 0 var(--blaze); padding-bottom: 2px; }
.nav form { display: contents; }

.page {
  width: 100%;
  max-width: calc(var(--col) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 2.5rem var(--gutter) 5rem;
  flex: 1;
}

.foot {
  text-align: center;
  font-size: 0.8125rem;
  color: var(--ink-3);
  padding: 2rem var(--gutter) 2.5rem;
}

/* --- Bedienelemente ------------------------------------------------------- */

button, input, select, textarea { font: inherit; color: inherit; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.5rem;
  padding: 0.45rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 500;
  font-size: 0.9375rem;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { border-color: var(--ink-3); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn.primary:hover { background: color-mix(in srgb, var(--ink) 86%, var(--paper)); }
.btn.danger { color: var(--danger); }
.btn[disabled], .btn.is-busy { opacity: 0.55; cursor: progress; }

.linklike {
  background: none;
  border: 0;
  padding: 0;
  color: var(--ink-2);
  font-size: 0.875rem;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 0.2em;
}
.linklike:hover { color: var(--ink); text-decoration-color: currentColor; }
.linklike.danger:hover { color: var(--danger); }

.field { display: grid; gap: 0.35rem; }
.field > span { font-size: 0.875rem; font-weight: 500; color: var(--ink-2); }

.field input, .field select, .access-url {
  width: 100%;
  min-height: 2.6rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}
.field input:focus, .field select:focus, .access-url:focus {
  outline: none;
  border-color: var(--ink-2);
  box-shadow: 0 0 0 3px var(--line-soft);
}

.check { display: flex; gap: 0.6rem; align-items: baseline; font-size: 0.9375rem; }
.check input { accent-color: var(--ink); }

.stack { display: grid; gap: 1rem; }
.narrow { max-width: 26rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.hint { font-size: 0.8125rem; color: var(--ink-3); }
.empty { color: var(--ink-2); max-width: 32rem; margin-top: 2rem; }

.pill {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: var(--line-soft);
  color: var(--ink-2);
  vertical-align: 0.1em;
}
.pill-open { background: var(--blaze-tint); color: var(--ink); }
.pill-paid { background: var(--ok-tint); color: var(--ok); }

/* --- Hinweise ------------------------------------------------------------- */

.notice {
  border-left: 3px solid var(--ink-3);
  background: var(--surface);
  padding: 0.75rem 1rem;
  border-radius: 0 var(--r-m) var(--r-m) 0;
  margin-bottom: 1.5rem;
  font-size: 0.9375rem;
}
.notice-ok { border-color: var(--ok); }
.notice-error { border-color: var(--danger); background: var(--danger-tint); }
.notice-access { border-color: var(--blaze); display: grid; gap: 0.85rem; justify-items: start; }

.creds { display: grid; gap: 0.4rem; width: 100%; }
.creds div { display: grid; grid-template-columns: 5.5rem 1fr; gap: 0.75rem; align-items: baseline; }
.creds dt { font-size: 0.8125rem; color: var(--ink-2); }
.creds .pw { font-size: 1.05rem; letter-spacing: 0.04em; background: var(--blaze-tint); }

/* --- Login / Einrichtung -------------------------------------------------- */

.gate {
  width: 100%;
  max-width: 25rem;
  margin: 0 auto;
  padding: 14vh var(--gutter) 4rem;
}
.gate .mark { margin-bottom: 3rem; }
.gate-title { font-size: 1.75rem; line-height: 1.2; font-weight: 600; letter-spacing: -0.015em; margin-bottom: 0.6rem; }
.gate-intro { color: var(--ink-2); margin-bottom: 2rem; }
.gate .btn { width: 100%; }

/* --- Seitenkopf ----------------------------------------------------------- */

.head-row { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 1.5rem; }
.head-row h1 { font-size: 1.75rem; font-weight: 600; letter-spacing: -0.015em; }

.crumb { font-size: 0.875rem; margin-bottom: 1.25rem; }
.crumb a { color: var(--ink-2); }

.phead { margin-bottom: 2rem; }
.phead h1 {
  font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.5rem);
  line-height: 1.12;
  font-weight: 650;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.phead-sub { color: var(--ink-2); margin-top: 0.5rem; }

/* --- Phasen --------------------------------------------------------------- */

.phases {
  display: grid;
  grid-template-columns: repeat(var(--n, 5), 1fr);
  gap: 4px;
  margin-top: 1.5rem;
}
.phases-3 { --n: 3; } .phases-4 { --n: 4; } .phases-5 { --n: 5; }
.phases-6 { --n: 6; } .phases-7 { --n: 7; } .phases-8 { --n: 8; }

.phases li, .phases button { display: grid; gap: 0.45rem; min-width: 0; }
.phases button {
  background: none; border: 0; padding: 0 0 0.25rem; text-align: left; cursor: pointer;
}
.phases button[disabled] { cursor: default; }
.ph-bar { height: 4px; border-radius: 2px; background: var(--line); }
.ph-name {
  font-size: 0.8125rem;
  color: var(--ink-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.phases .is-done .ph-bar { background: var(--ink-2); }
.phases .is-done .ph-name { color: var(--ink-2); }
.phases .is-now .ph-bar { background: var(--blaze); }
.phases .is-now .ph-name { color: var(--ink); font-weight: 600; }
.phases button:not([disabled]):hover .ph-bar { background: var(--ink-3); }
.phases button:not([disabled]):hover .ph-name { color: var(--ink); }

.phases.is-compact { width: 6.5rem; margin: 0; gap: 3px; }
.phases.is-compact .ph-bar { height: 3px; }
.phases.is-compact .ph-name { display: none; }

/* --- Projektliste --------------------------------------------------------- */

.plist { border-bottom: 1px solid var(--line); }
.plist li { border-top: 1px solid var(--line); }

.prow {
  display: grid;
  grid-template-columns: 1fr 9.5rem 8.5rem;
  gap: 1.5rem;
  align-items: center;
  padding: 1rem 0;
  text-decoration: none;
}
.prow-main { display: grid; min-width: 0; }
.prow-title { font-weight: 600; font-size: 1.0625rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow:hover .prow-title { text-decoration: underline; text-decoration-color: var(--blaze); text-underline-offset: 0.2em; }
.prow-client { color: var(--ink-2); font-size: 0.875rem; }
.prow-phase { display: grid; gap: 0.35rem; }
.prow-phase-name { font-size: 0.8125rem; color: var(--ink-2); }
.prow-when { font-size: 0.875rem; color: var(--ink-3); text-align: right; font-variant-numeric: tabular-nums; }

.dot-new { color: var(--ink); font-weight: 600; display: inline-flex; align-items: center; gap: 0.4rem; }
.dot-new::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--blaze); }

.archive { margin-top: 2.5rem; }
.archive summary { cursor: pointer; color: var(--ink-2); margin-bottom: 0.75rem; }

/* Kunden */
.clist { border-bottom: 1px solid var(--line); }
.clist > li { border-top: 1px solid var(--line); }
.crow summary {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "name count" "sub count";
  column-gap: 1rem;
  padding: 0.9rem 0;
  cursor: pointer;
  list-style: none;
}
.crow summary::-webkit-details-marker { display: none; }
.crow-name { grid-area: name; font-weight: 600; }
.crow-sub { grid-area: sub; font-size: 0.875rem; color: var(--ink-2); }
.crow-count { grid-area: count; align-self: center; font-size: 0.875rem; color: var(--ink-3); }
.crow[open] .drawer-body { padding-bottom: 1.5rem; display: grid; gap: 1rem; justify-items: start; }
.crow[open] .drawer-body > form.stack { width: 100%; }

/* Aufklappbereiche */
.drawer { margin-bottom: 2rem; }
.drawer > summary { list-style: none; display: inline-flex; }
.drawer > summary::-webkit-details-marker { display: none; }
.drawer[open] > summary.btn { display: none; }
.drawer-body { padding-top: 0.25rem; }
.drawer > .drawer-body {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.25rem;
}
.drawer-settings { margin: 3rem 0 0 calc(4.5rem + 1.75rem + 1.5rem); }
.drawer-settings[open] > summary { margin-bottom: 1rem; }
.danger-zone {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}

/* Kunde: „Neuen Kunden anlegen“ nur bei Bedarf */
.client-pick { display: grid; gap: 1rem; }
.client-new { display: none; grid-template-columns: 1fr 1fr; gap: 1rem; }
.client-pick:has(option[value="new"]:checked) .client-new { display: grid; }

/* --- Kundenzugang --------------------------------------------------------- */

.access {
  margin-bottom: 2rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.access-line { display: flex; align-items: center; gap: 0.75rem; }
.access-label { font-size: 0.875rem; color: var(--ink-2); white-space: nowrap; }
.access-url {
  flex: 1;
  min-width: 0;
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--ink-2);
  background: transparent;
}
.access-off { color: var(--danger); font-size: 0.9375rem; }
.access-more summary { font-size: 0.8125rem; color: var(--ink-3); cursor: pointer; margin-top: 0.5rem; width: max-content; }
.access-more[open] summary { margin-bottom: 0.75rem; }
.access-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.6rem; }

/* --- Composer (neuer Eintrag / Kunden-Upload) ----------------------------- */

.composer {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem 1.1rem 0.9rem;
  margin: 0 0 3rem calc(4.5rem + 1.75rem + 1.5rem);
  display: grid;
  gap: 0.6rem;
}

.kinds { border: 0; padding: 0; margin: 0 0 0.25rem; display: flex; flex-wrap: wrap; gap: 0.35rem; }
.kinds label { position: relative; }
.kinds input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.kinds span {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink-2);
}
.kinds input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.kinds input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }

.composer-title, .composer textarea {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0.2rem 0;
  resize: vertical;
}
.composer-title { font-size: 1.125rem; font-weight: 600; }
.composer-title:focus, .composer textarea:focus { outline: none; }
.composer textarea { min-height: 3.2rem; line-height: 1.5; }
.composer :is(.composer-title, textarea)::placeholder { color: var(--ink-3); font-weight: 400; }
.composer:focus-within { border-color: var(--ink-3); }

.invoice-fields { display: none; grid-template-columns: 1fr 1fr 1fr; gap: 0.75rem; padding: 0.25rem 0 0.5rem; }
.composer:has(input[name="type"][value="invoice"]:checked) .invoice-fields { display: grid; }

.when-note { display: none; }
.composer:has(input[name="type"][value="note"]:checked) .when-note { display: inline; }
.composer:has(input[name="type"][value="note"]:checked) .when-public { display: none; }
.composer:has(input[name="type"][value="note"]:checked) {
  background: repeating-linear-gradient(135deg, var(--surface) 0 10px, var(--line-soft) 10px 11px);
}

.drop {
  display: grid;
  gap: 0.6rem;
  padding: 0.85rem 1rem;
  border: 1.5px dashed var(--line);
  border-radius: var(--r-m);
  color: var(--ink-2);
  font-size: 0.9375rem;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}
.drop:hover { border-color: var(--ink-3); }
.drop:focus-within { border-color: var(--ink-2); }
.drop.is-over { border-color: var(--blaze); background: var(--blaze-tint); color: var(--ink); }
.drop input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop u { text-decoration-color: var(--blaze); text-decoration-thickness: 2px; text-underline-offset: 0.2em; }
.drop-large { padding: 2.25rem 1rem; text-align: center; font-size: 1rem; }
.drop-large .drop-list { text-align: left; }

.drop-list:empty { display: none; }
.drop-list { display: grid; gap: 0.25rem; font-size: 0.875rem; color: var(--ink); }
.drop-list li { display: flex; justify-content: space-between; gap: 1rem; }
.drop-list li span:last-child { color: var(--ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.drop-list li.is-bad { color: var(--danger); }

.composer-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: 0.25rem; }
.composer-foot .hint.is-error { color: var(--danger); }

.progress { height: 3px; background: var(--line-soft); border-radius: 2px; overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: var(--blaze); transition: width 0.2s linear; }

.composer.is-client { margin-left: calc(4.5rem + 1.75rem + 1.5rem); }

/* ==========================================================================
   Der Zeitstrahl
   Spalten: Datum | Wegmarke auf der Linie | Inhalt. Neueste Station oben.
   ========================================================================== */

.trail { --when: 4.5rem; --mark: 1.75rem; }

.stop {
  display: grid;
  grid-template-columns: var(--when) var(--mark) minmax(0, 1fr);
  column-gap: 0.75rem;
}

.stop-when {
  text-align: right;
  font-size: 0.8125rem;
  line-height: 1.35;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  padding-top: 0.15rem;
}
.stop-when time { display: block; color: var(--ink); font-weight: 500; }
.stop-when span { color: var(--ink-3); }

/* Linie */
.stop-mark { position: relative; display: flex; justify-content: center; }
.stop-mark::before {
  content: "";
  position: absolute;
  left: calc(50% - 1px);
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--line);
}
.stop:first-child .stop-mark::before { top: 0.35rem; }
.stop:last-child .stop-mark::before { bottom: auto; height: 0.4rem; }

/* Wegmarken: Form = Art des Eintrags, Gelb = aktueller Stand */
.blaze {
  position: relative;
  z-index: 1;
  display: block;
  width: 10px;
  height: 18px;
  margin-top: 0.2rem;
  border-radius: 2px;
  background: var(--ink-3);
  box-shadow: 0 0 0 4px var(--paper);
}
/* Meilenstein: doppelte Markierung, wie an Wanderwegen */
.kind-milestone .blaze { height: 8px; box-shadow: 0 0 0 4px var(--paper), 0 11px 0 var(--ink-3), 0 11px 0 4px var(--paper); margin-bottom: 11px; }
/* Phasenwechsel: hohle Markierung */
.kind-phase .blaze, .kind-start .blaze { background: var(--paper); border: 2px solid var(--ink-3); }
.kind-start .blaze { width: 10px; height: 10px; border-radius: 50%; }
/* Rechnung & Zahlung: quadratisch */
.kind-invoice .blaze, .kind-paid .blaze { width: 14px; height: 14px; }
.kind-paid .blaze { background: var(--ok); }
/* Notiz: gestrichelt */
.kind-note .blaze { background: var(--paper); border: 2px dashed var(--ink-3); }
/* Kunde: runde Marke, andere Hand */
.by-client .blaze { width: 14px; height: 14px; border-radius: 50%; background: var(--paper); border: 2.5px solid var(--ink); }

/* Aktueller Stand */
.is-latest .blaze { background: var(--blaze); border-color: var(--blaze); }
.is-latest.kind-milestone .blaze { box-shadow: 0 0 0 4px var(--paper), 0 11px 0 var(--blaze), 0 11px 0 4px var(--paper); }
.is-latest.by-client .blaze { background: var(--blaze); border-color: var(--ink); }

@media (prefers-reduced-motion: no-preference) {
  .is-latest .blaze { animation: blaze-in 0.9s cubic-bezier(.2,.7,.2,1) 0.15s both; }
  @keyframes blaze-in {
    from { transform: scaleY(0.2); opacity: 0; }
    to { transform: none; opacity: 1; }
  }
}

/* Inhalt */
.stop-body { padding-bottom: 2.5rem; min-width: 0; }
.stop-title {
  font-size: 1.0625rem;
  line-height: 1.35;
  font-weight: 600;
  letter-spacing: -0.005em;
  overflow-wrap: anywhere;
}
.is-latest .stop-title { font-size: 1.375rem; line-height: 1.25; letter-spacing: -0.015em; }
.kind-phase .stop-title, .kind-start .stop-title { font-weight: 500; color: var(--ink-2); font-size: 0.9375rem; }
.is-latest.kind-phase .stop-title, .is-latest.kind-start .stop-title { color: var(--ink); font-size: 1.375rem; font-weight: 600; }

.stop-meta { font-size: 0.8125rem; color: var(--ink-2); margin-top: 0.15rem; }
.is-internal .stop-meta { color: var(--ink); }

.stop-text {
  margin-top: 0.5rem;
  max-width: 36rem;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.stop-text p + p { margin-top: 0.7em; }
.is-internal .stop-text { color: var(--ink-2); }

.invoice {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  margin-top: 0.75rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.invoice dt { font-size: 0.75rem; color: var(--ink-3); }
.invoice dd { font-weight: 500; }
.invoice .num { font-variant-numeric: tabular-nums; font-size: 1.125rem; font-weight: 650; }

.thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
  gap: 0.5rem;
  margin-top: 0.85rem;
  max-width: 36rem;
}
.thumbs a { display: block; }
.thumbs img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--r-s);
  border: 1px solid var(--line);
  background: var(--line-soft);
}
.is-latest .thumbs { grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); }
.thumbs a { text-decoration: none; }
.thumb-cap { display: flex; justify-content: space-between; gap: 0.5rem; margin-top: 0.3rem; font-size: 0.8125rem; min-width: 0; }
.thumb-cap .file-name { min-width: 0; }
.thumb-cap .file-size { flex: none; color: var(--ink-3); }
.thumbs a:hover .file-name { text-decoration: underline; text-decoration-color: var(--blaze); text-underline-offset: 0.2em; }

.files { margin-top: 0.75rem; max-width: 36rem; }
.files li + li { border-top: 1px solid var(--line-soft); }
.files a {
  display: grid;
  grid-template-columns: 3.25rem minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.45rem 0;
  text-decoration: none;
  font-size: 0.9375rem;
}
.file-ext {
  font-size: 0.6875rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-align: center;
  padding: 0.2rem 0;
  border-radius: 3px;
  border: 1px solid var(--line);
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.files a:hover .file-name { text-decoration: underline; text-decoration-color: var(--blaze); text-underline-offset: 0.2em; }
.file-size { font-size: 0.8125rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.stop-actions { display: flex; gap: 1.25rem; margin-top: 0.75rem; }

.stop-actions form { display: contents; }
.stop-actions .linklike { font-size: 0.8125rem; color: var(--ink-3); }

/* --- Design-Umschalter --------------------------------------------------- */

.bar-tools { display: flex; align-items: center; gap: 1rem; }
.bar-tools form { display: contents; }
.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  margin-right: -0.5rem;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--ink-2);
  cursor: pointer;
}
.theme-toggle:hover { color: var(--ink); background: var(--line-soft); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .i-moon { display: none; }
:root[data-theme="light"] .theme-toggle .i-sun { display: none; }
:root[data-theme="light"] .theme-toggle .i-moon { display: block; }
.gate-tools { position: absolute; top: 0.75rem; right: 1.25rem; }

/* --- Logos ---------------------------------------------------------------- */

/* Kundenlogos sitzen auf einer hellen Plakette, damit dunkle Logos auch
   im dunklen Design lesbar bleiben. */
.logo-plate {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  background: #fff;
  border-radius: var(--r-m);
  box-shadow: inset 0 0 0 1px rgba(27, 33, 31, 0.08);
  overflow: hidden;
}
.logo-plate img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-l { height: 3.25rem; max-width: 12rem; padding: 0.5rem 0.75rem; }
.logo-s { width: 2.25rem; height: 2.25rem; padding: 0.25rem; border-radius: 6px; }
.logo-plate.is-initials {
  background: var(--line-soft);
  box-shadow: none;
  color: var(--ink-2);
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.02em;
}
.phead-logo { margin-bottom: 1.25rem; }
.gate-logo { margin-bottom: 1.5rem; }

.logo-field-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-btn:focus-within { outline: 2px solid var(--ink); outline-offset: 2px; }
.btn.small { min-height: 2.1rem; padding: 0.3rem 0.8rem; font-size: 0.875rem; }

.prow { grid-template-columns: 2.25rem minmax(0, 1fr) 9.5rem 8.5rem; }
.crow summary {
  grid-template-columns: 2.25rem 1fr auto;
  grid-template-areas: "logo name count" "logo sub count";
}
.crow summary > .logo-plate { grid-area: logo; align-self: center; }

/* --- Projekt-Reiter ------------------------------------------------------- */

.phead { margin-bottom: 1.75rem; }
.ptabs {
  display: flex;
  gap: 1.75rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 2rem;
}
.ptabs a {
  padding: 0.55rem 0;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  color: var(--ink-2);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9375rem;
}
.ptabs a:hover { color: var(--ink); }
.ptabs a[aria-current] { color: var(--ink); border-bottom-color: var(--blaze); }
.ptabs .count { margin-left: 0.4rem; color: var(--ink-3); font-weight: 400; font-variant-numeric: tabular-nums; }
.ptabs + .access { border-top: 0; padding-top: 0; margin-top: -0.75rem; }

/* --- Aktionen pro Eintrag ------------------------------------------------- */

.stop-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.25rem; margin-top: 1rem; }
.stop-actions form { display: contents; }

.approve {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2rem;
  padding: 0.25rem 0.8rem 0.25rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: none;
  color: var(--ink);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
}
.approve svg { width: 15px; height: 15px; color: var(--ink-3); }
.approve:hover { border-color: var(--ink-3); }
.approve[aria-pressed="true"] { background: var(--ok-tint); border-color: transparent; color: var(--ok); }
.approve[aria-pressed="true"] svg { color: var(--ok); }

.approved-by { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.875rem; color: var(--ok); }
.approved-by svg { width: 15px; height: 15px; }

.act {
  background: none;
  border: 0;
  padding: 0.25rem 0;
  color: var(--ink-2);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}
.act:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--blaze); text-underline-offset: 0.25em; }
.act.is-done { color: var(--ok); }
.act-quiet { margin-left: auto; }
.act-quiet .act, .cmt-del .act { color: var(--ink-3); font-weight: 400; font-size: 0.8125rem; }
.act-quiet .act:hover, .cmt-del .act:hover { color: var(--danger); text-decoration-color: currentColor; }
@media (hover: hover) {
  .act-quiet, .cmt-del { opacity: 0; transition: opacity 0.15s; }
  .stop:hover .act-quiet, .stop:focus-within .act-quiet,
  .cmt:hover .cmt-del, .cmt:focus-within .cmt-del { opacity: 1; }
}

/* Geteilter Link: Ziel kurz hervorheben */
.stop:target .stop-body { animation: target-glow 2.6s ease-out 0.2s both; border-radius: var(--r-m); }
@keyframes target-glow {
  from { background: var(--blaze-tint); box-shadow: 0 0 0 0.75rem var(--blaze-tint); }
  to { background: transparent; box-shadow: 0 0 0 0.75rem transparent; }
}

/* --- Kommentare ----------------------------------------------------------- */

.cmts {
  display: grid;
  gap: 0.9rem;
  max-width: 36rem;
  margin-top: 1rem;
  padding-left: 1rem;
  border-left: 2px solid var(--line);
}
.cmt-head { display: flex; align-items: baseline; gap: 0.6rem; font-size: 0.8125rem; color: var(--ink-3); }
.cmt-head strong { color: var(--ink); font-weight: 600; }
.cmt-del { margin-left: auto; }
.cmt-body { font-size: 0.9375rem; overflow-wrap: anywhere; }
.cmt-body p + p { margin-top: 0.5em; }

.cmt-form { display: none; gap: 0.5rem; max-width: 36rem; margin-top: 1rem; }
.cmt-form:target, .cmt-form.is-open { display: grid; }
.cmt-form textarea {
  width: 100%;
  min-height: 4.5rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  background: var(--surface);
  line-height: 1.5;
  resize: vertical;
}
.cmt-form textarea:focus { outline: none; border-color: var(--ink-2); box-shadow: 0 0 0 3px var(--line-soft); }
.cmt-form-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }

/* --- Vorschaubilder ------------------------------------------------------- */

.thumbs a[data-lightbox] { cursor: zoom-in; }
.thumbs li { min-width: 0; }
.thumbs img { transition: opacity 0.15s; }
.thumbs a[data-lightbox]:hover img { opacity: 0.85; }
.thumbs .thumb-cap { display: flex; color: inherit; text-decoration: none; }
.thumbs .thumb-cap .file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --- Lightbox ------------------------------------------------------------- */

.lb {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
}
.lb::backdrop { background: rgba(8, 10, 9, 0.94); }
.lb[open] { display: grid; place-items: center; }
.lb-fig { margin: 0; display: grid; gap: 0.75rem; justify-items: center; max-width: calc(100vw - 9rem); }
.lb-img {
  display: block;
  max-width: calc(100vw - 9rem);
  max-height: calc(100vh - 7rem);
  max-height: calc(100dvh - 7rem);
  object-fit: contain;
  border-radius: var(--r-s);
  transition: opacity 0.15s;
  user-select: none;
}
.lb-img.is-loading { opacity: 0.25; }
.lb-cap { display: flex; align-items: baseline; gap: 1rem; max-width: 100%; font-size: 0.875rem; color: rgba(255, 255, 255, 0.65); }
.lb-name { color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.lb-count, .lb-size { white-space: nowrap; font-variant-numeric: tabular-nums; }
.lb-cap a { color: #fff; white-space: nowrap; text-decoration-color: var(--blaze); }
.lb-btn {
  position: fixed;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
}
.lb-btn:hover { background: rgba(255, 255, 255, 0.16); }
.lb-btn:focus-visible { outline-color: #fff; }
.lb-btn[hidden] { display: none; }
.lb-btn svg { width: 22px; height: 22px; }
.lb-prev { left: 1.25rem; top: 50%; transform: translateY(-50%); }
.lb-next { right: 1.25rem; top: 50%; transform: translateY(-50%); }
.lb-close { right: 1.25rem; top: 1.25rem; }
html:has(.lb[open]) { overflow: hidden; }

/* --- Dateien-Übersicht ---------------------------------------------------- */

.media-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.5rem; margin-bottom: 1.75rem; }
.media-bar .kinds { margin: 0; }
.media-bar .hint { margin-left: auto; }

.mgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr));
  gap: 1.25rem 0.85rem;
  margin-bottom: 2.5rem;
}
.mgrid li { min-width: 0; }
.mgrid-img { display: block; cursor: zoom-in; }
.mgrid img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--r-s);
  border: 1px solid var(--line);
  background: var(--line-soft);
  transition: opacity 0.15s;
}
.mgrid-img:hover img { opacity: 0.85; }
.mcap { display: grid; margin-top: 0.4rem; font-size: 0.8125rem; min-width: 0; }
.mcap .file-name { color: var(--ink); }
.mmeta { color: var(--ink-3); font-size: 0.8125rem; }
.mmeta a { color: inherit; }
.mmeta a:hover { color: var(--ink); }

.mdocs { border-bottom: 1px solid var(--line); }
.mdocs li {
  display: grid;
  grid-template-columns: 3.25rem minmax(0, 1fr) auto;
  gap: 0.85rem;
  align-items: center;
  padding: 0.7rem 0;
  border-top: 1px solid var(--line);
}
.mdoc-main { display: grid; min-width: 0; }
.mdoc-main .file-name { text-decoration: none; font-weight: 500; }
.mdoc-main .file-name:hover { text-decoration: underline; text-decoration-color: var(--blaze); text-underline-offset: 0.2em; }

.media:has(#mf-img:checked) [data-kind="doc"],
.media:has(#mf-doc:checked) [data-kind="img"],
.media:has(#ma-owner:checked) [data-by="client"],
.media:has(#ma-client:checked) [data-by="owner"] { display: none; }

/* ==========================================================================
   Patch 2
   ========================================================================== */

.ico { width: 18px; height: 18px; flex: none; }
.approve .ico, .approved-by .ico { width: 15px; height: 15px; }
.btn .ico { width: 17px; height: 17px; margin-left: -0.15rem; }

/* Aktionen: links immer dieselben Links, rechts der Freigabe-Status.
   So steht „Kommentieren“ bei jedem Eintrag an derselben Stelle. */
.stop-actions { justify-content: space-between; }
.acts-main, .acts-side { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.25rem; }
.acts-side { margin-left: auto; gap: 0.5rem 1rem; }
.acts-main form, .acts-side form { display: contents; }
.act-quiet { margin-left: 0; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--ink-3);
  cursor: pointer;
  text-decoration: none;
}
.icon-btn:hover { color: var(--ink); background: var(--line-soft); }
.icon-btn.is-done { color: var(--ok); }
.icon-btn .ico { width: 17px; height: 17px; }
.fshare { display: contents; }

/* Dateiliste im Verlauf: Zeile + Teilen-Knopf */
.files li { display: flex; align-items: center; gap: 0.25rem; }
.files li > a { flex: 1; min-width: 0; }

/* Formulare */
.field textarea {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  line-height: 1.5;
  resize: vertical;
}
.field textarea:focus { outline: none; border-color: var(--ink-2); box-shadow: 0 0 0 3px var(--line-soft); }

/* --- Kacheln (Dateien-Übersicht) ----------------------------------------- */

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr));
  gap: 1.5rem 0.9rem;
}
.tile { min-width: 0; display: grid; align-content: start; }

.tile-prev, .share-prev {
  position: relative;
  display: block;
  aspect-ratio: 1;
  border-radius: var(--r-m);
  border: 1px solid var(--line);
  background: var(--surface);
  overflow: hidden;
}
.tile-prev[data-lightbox] { cursor: zoom-in; }
.tile-prev img, .share-prev img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--surface);
  transition: opacity 0.15s;
}
.is-pdf img { object-position: top; background: #fff; }
.tile-prev:hover img { opacity: 0.85; }
.tile-prev:hover { border-color: var(--ink-3); }

/* Platzhalter: ein Blatt mit Eselsohr */
.sheet {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 34%;
  aspect-ratio: 3 / 4;
  transform: translate(-50%, -54%);
  border: 1.5px solid var(--ink-3);
  border-radius: 3px;
  clip-path: polygon(0 0, 70% 0, 100% 22%, 100% 100%, 0 100%);
}
.sheet::after {
  content: "";
  position: absolute;
  right: -1.5px;
  top: -1.5px;
  width: 30%;
  aspect-ratio: 1;
  border-left: 1.5px solid var(--ink-3);
  border-bottom: 1.5px solid var(--ink-3);
  border-bottom-left-radius: 2px;
  background: var(--line-soft);
}

.badge {
  position: absolute;
  left: 0.5rem;
  top: 0.5rem;
  z-index: 1;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: rgba(14, 17, 16, 0.78);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  line-height: 1.3;
  backdrop-filter: blur(4px);
}

.tile-cap { display: grid; grid-template-columns: minmax(0, 1fr); margin-top: 0.45rem; min-width: 0; font-size: 0.8125rem; }
.tile-cap .file-name { color: var(--ink); font-size: 0.875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-row { display: flex; align-items: center; justify-content: space-between; gap: 0.25rem; margin-right: -0.4rem; min-height: 2rem; }
.tile-src { color: var(--ink-2); font-size: 0.8125rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; margin-top: 0.05rem; }
a.tile-src:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--blaze); text-underline-offset: 0.2em; }
.tile-row .mmeta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.tile-acts { display: flex; flex: none; }
.tile-shared {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ok);
  font-size: 0.75rem;
}
.tile-shared form { display: contents; }
.tile-shared .act { font-size: 0.75rem; color: var(--ink-3); font-weight: 400; padding: 0; }

/* --- Hinweis unten ("Link kopiert") --------------------------------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  z-index: 50;
  max-width: calc(100vw - 2rem);
  transform: translate(-50%, 1rem);
  padding: 0.7rem 1rem;
  border-radius: 10px;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.875rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast.is-error { background: var(--danger); color: #fff; }

.share-link { display: block; width: 100%; padding: 0.45rem 0.6rem; }

/* --- Öffentliche Freigabe-Seite ------------------------------------------ */

.share-prev { width: 9rem; margin-bottom: 1.5rem; }
.share-title { overflow-wrap: anywhere; }
.share-btns { display: grid; gap: 0.6rem; }
.share-exp { margin-top: 1.25rem; }

.lb-share { background: none; border: 0; padding: 0; color: #fff; font-size: inherit; cursor: pointer; text-decoration: underline; text-decoration-color: var(--blaze); text-underline-offset: 0.2em; white-space: nowrap; }

/* ==========================================================================
   Patch 3: Dateien & Transfers
   ========================================================================== */

.nav a { position: relative; }
.nav-dot {
  position: absolute;
  top: -1px;
  right: -9px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blaze);
}

.composer.composer-wide { margin-left: 0; margin-bottom: 2.5rem; }

.when-request { display: none; }
.composer:has(input[name="type"][value="request"]:checked) .when-send { display: none; }
.composer:has(input[name="type"][value="request"]:checked) .when-request { display: inline; }
.composer:has(input[name="type"][value="request"]:checked) p.when-request { display: block; }
.request-hint { color: var(--ink-2); font-size: 0.9375rem; padding: 0.25rem 0; max-width: 36rem; }

.transfer-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; padding: 0.25rem 0; }
.transfer-opts .field > span { font-size: 0.8125rem; }

/* Filter */
.file-filter { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 0.6rem; margin-bottom: 1.5rem; }
.file-filter input, .file-filter select {
  min-width: 0;
  min-height: 2.5rem;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  max-width: 100%;
}
.file-filter select { max-width: 14rem; }
.file-filter input:focus, .file-filter select:focus { outline: none; border-color: var(--ink-2); box-shadow: 0 0 0 3px var(--line-soft); }
.filter-count { margin: -0.5rem 0 1.25rem; }
.more { margin-top: 2rem; text-align: center; }
.muted { color: var(--ink-3); }

/* Transfer-Liste */
.tlist { border-bottom: 1px solid var(--line); }
.tlist li { border-top: 1px solid var(--line); }
.trow {
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: 0.9rem 0;
  text-decoration: none;
}
.trow-kind, .t-kind .ico {
  display: inline-grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--line-soft);
  color: var(--ink-2);
}
.trow-kind.kind-request { background: var(--blaze-tint); color: var(--blaze); }
.trow-main { display: grid; min-width: 0; }
.trow-title { font-weight: 600; display: flex; align-items: center; gap: 0.4rem; min-width: 0; }
.trow:hover .trow-title { text-decoration: underline; text-decoration-color: var(--blaze); text-underline-offset: 0.2em; }
.trow-lock .ico { width: 14px; height: 14px; color: var(--ink-3); }
.trow-sub { font-size: 0.875rem; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trow-state { font-size: 0.875rem; color: var(--ink-2); text-align: right; white-space: nowrap; }

/* Transfer-Detail */
.t-kind { display: flex; align-items: center; gap: 0.6rem; color: var(--ink-2); font-size: 0.875rem; margin-bottom: 0.9rem; }
.t-kind .ico { width: 1.75rem; height: 1.75rem; padding: 0.35rem; }
.t-kind.kind-request .ico { background: var(--blaze-tint); color: var(--blaze); }
.t-status { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.25rem; margin-top: 0.6rem; font-size: 0.875rem; }
.t-status form { display: contents; }
.t-on { color: var(--ok); }
.t-off { color: var(--danger); }
.t-pw { display: inline-flex; align-items: center; gap: 0.35rem; color: var(--ink-2); }
.t-pw .ico { width: 15px; height: 15px; }
.t-message {
  margin: 0 0 2rem;
  padding: 1rem 1.25rem;
  border-left: 3px solid var(--blaze);
  background: var(--surface);
  border-radius: 0 var(--r-m) var(--r-m) 0;
  max-width: none;
}
.t-files-head { display: flex; justify-content: flex-end; margin-bottom: 1.25rem; }
.t-public-head + .t-files-head, .t-message + .t-files-head { justify-content: flex-start; }
.batch { margin-bottom: 2.5rem; }
.batch-head { font-size: 1.0625rem; font-weight: 600; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.75rem; margin-bottom: 0.6rem; }
.batch-head span { font-size: 0.875rem; font-weight: 400; color: var(--ink-2); }
.batch-note { margin: 0 0 1rem; color: var(--ink-2); }
.t-delete { margin-top: 3rem; }
.badge-new { left: auto; right: 0.5rem; background: var(--blaze); color: #1b211f; }

/* Öffentliche Seite */
.is-guest .transfer-opts { grid-template-columns: 1fr; }
.t-done { display: grid; gap: 1rem; justify-items: start; padding: 1.5rem 1.25rem; }
.t-done-title { font-size: 1.25rem; font-weight: 600; }

/* --- Schmale Bildschirme -------------------------------------------------- */

@media (max-width: 640px) {
  :root { --gutter: 1rem; }
  .page { padding-top: 1.75rem; }
  .nav { gap: 0.9rem; font-size: 0.875rem; }
  .nav a[href$="/konto"] { display: none; }

  .trail { --mark: 1.25rem; }
  .stop {
    grid-template-columns: var(--mark) minmax(0, 1fr);
    grid-template-areas: "mark when" "mark body";
    column-gap: 0.85rem;
  }
  .stop-mark { grid-area: mark; grid-row: 1 / span 2; }
  .stop-when { grid-area: when; text-align: left; display: flex; gap: 0.4rem; padding-top: 0; }
  .stop-when time { display: inline; font-weight: 500; }
  .stop-body { grid-area: body; padding-top: 0.15rem; }
  .stop:first-child .stop-mark::before { top: 0.25rem; }
  .blaze { margin-top: 0.1rem; }

  .composer, .composer.is-client, .drawer-settings { margin-left: 0; }
  .invoice-fields, .grid-2, .client-new { grid-template-columns: 1fr; }
  .composer-foot { flex-direction: column; align-items: stretch; }
  .composer-foot .btn { width: 100%; }

  .prow { grid-template-columns: 1fr auto; gap: 0.35rem 1rem; }
  .prow-phase { grid-column: 1; grid-row: 2; display: flex; align-items: center; gap: 0.6rem; }
  .prow-when { grid-column: 2; grid-row: 1 / span 2; align-self: center; }

  .access-line { flex-wrap: wrap; }
  .access-label { width: 100%; }
  .drop-large { padding: 1.75rem 1rem; }
  .thumbs, .is-latest .thumbs { grid-template-columns: 1fr 1fr; }

  .prow { grid-template-columns: 2.25rem minmax(0, 1fr) auto; column-gap: 0.85rem; }
  .prow > .logo-plate { grid-row: 1 / span 2; align-self: center; }
  .prow-main { grid-column: 2; }
  .prow-phase { grid-column: 2; }
  .prow-when { grid-column: 3; }

  .lb-fig, .lb-img { max-width: calc(100vw - 1rem); }
  .lb-img { max-height: calc(100dvh - 10rem); }
  .lb-cap { flex-wrap: wrap; justify-content: center; gap: 0.25rem 1rem; padding: 0 1rem; }
  .lb-prev, .lb-next { top: auto; bottom: 1rem; transform: none; }
  .lb-close { top: 0.75rem; right: 0.75rem; }

  .media-bar .hint { margin-left: 0; width: 100%; }
  .mgrid, .tiles { grid-template-columns: 1fr 1fr; }
  .stop-actions { row-gap: 0.75rem; }

  .transfer-opts { grid-template-columns: 1fr; }
  .file-filter { grid-template-columns: 1fr 1fr; }
  .file-filter input { grid-column: 1 / -1; }
  .file-filter input, .file-filter select { width: 100%; min-width: 0; }
  .is-admin .mark-text { display: none; }
  .is-admin .mark .mark-blaze { height: 18px; }
  .file-filter select { max-width: none; }
  .trow { grid-template-columns: 2.25rem minmax(0, 1fr); }
  .trow-state { grid-column: 2; text-align: left; margin-top: -0.6rem; }
  .nav { gap: 0.75rem; }
  .ptabs { gap: 1.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
