/* Timo-Cloud – Gestaltung „Lagerregal“: Stahlgrau, Tinte, gelbes Markierungsband nur für Wichtiges. */
:root {
  --grund: #E3E8E5;
  --flaeche: #F7F9F8;
  --tinte: #17201C;
  --leise: #57645F;
  --linie: #C3CCC7;
  --band: #EDBE2A;
  --aktion: #1E5B57;
  --aktion-hell: #2A7671;
  --gefahr: #A8432C;
  --zwischen: #E7A33A; --galerie: #3F7C9C; --sicherung: #1E5B57; --privat: #6D5A8C; --system: #9AA6A1;
  --r: 3px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --grund: #141A17; --flaeche: #1C2420; --tinte: #E6ECE9; --leise: #9AA8A2; --linie: #334039;
    --aktion: #3E9A93; --aktion-hell: #52B0A9; --gefahr: #D9694F; --system: #56625C; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --grund: #141A17; --flaeche: #1C2420; --tinte: #E6ECE9; --leise: #9AA8A2; --linie: #334039;
  --aktion: #3E9A93; --aktion-hell: #52B0A9; --gefahr: #D9694F; --system: #56625C; color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--grund); color: var(--tinte);
  font: 400 16px/1.5 "Archivo", system-ui, sans-serif; font-variation-settings: "wdth" 100;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; font-weight: 750; font-stretch: 118%; letter-spacing: -0.01em; line-height: 1.15; }
h1 { font-size: 2rem; }
h2 { font-size: 1.15rem; margin-bottom: .6rem; }
p { margin: 0 0 .8rem; max-width: 68ch; }
a { color: var(--aktion); }
:focus-visible { outline: 3px solid var(--band); outline-offset: 2px; }
.zahl { font-variant-numeric: tabular-nums; }
.leise { color: var(--leise); }
[hidden] { display: none !important; }

/* Knöpfe & Felder */
button, .knopf {
  font: inherit; font-weight: 600; cursor: pointer; border-radius: var(--r);
  padding: .5rem .9rem; border: 1px solid var(--aktion); background: var(--aktion); color: #fff;
}
button:hover, .knopf:hover { background: var(--aktion-hell); border-color: var(--aktion-hell); }
button.zweit { background: transparent; color: var(--tinte); border-color: var(--linie); }
button.zweit:hover { border-color: var(--tinte); background: transparent; }
button.gefahr { background: transparent; color: var(--gefahr); border-color: transparent; padding: .3rem .5rem; }
button.gefahr:hover { border-color: var(--gefahr); background: transparent; }
input, textarea, select {
  font: inherit; color: var(--tinte); background: var(--flaeche); width: 100%;
  border: 1px solid var(--linie); border-radius: var(--r); padding: .55rem .7rem;
}
input:focus, textarea:focus, select:focus { border-color: var(--aktion); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--aktion) 25%, transparent); }
label { display: block; font-weight: 600; font-size: .9rem; margin: .8rem 0 .3rem; }

/* Anmeldung */
.tor { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.tor-kasten { width: min(420px, 100%); background: var(--flaeche); border-top: 6px solid var(--band); padding: 2rem 1.6rem; }
.tor-kasten h1 { font-size: 1.7rem; margin-bottom: .3rem; }
.tor-kasten button { width: 100%; margin-top: 1.2rem; padding: .7rem; }
.tor-kasten .qr { background: #fff; padding: 10px; width: 200px; margin: .6rem 0; }
.tor-kasten .qr svg { width: 100%; height: auto; display: block; }
.fehler { color: var(--gefahr); font-weight: 600; min-height: 1.5em; margin-top: .6rem; }
code.geheim { word-break: break-all; font-size: .85rem; }

/* Grundaufbau */
.app { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.leiste { background: var(--tinte); color: var(--grund); padding: 1.2rem .8rem; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; }
.marke { font-weight: 800; font-stretch: 125%; font-size: 1.1rem; padding: 0 .6rem 1.4rem; display: flex; align-items: center; gap: .55rem; }
.marke-zeichen { width: 18px; height: 14px; background: linear-gradient(var(--band) 0 30%, transparent 30% 45%, #fff 45% 70%, transparent 70% 85%, #fff 85%); }
.leiste a { color: inherit; text-decoration: none; padding: .55rem .6rem; border-left: 4px solid transparent; font-weight: 500; }
.leiste a:hover { background: rgba(255,255,255,.06); }
.leiste a[aria-current="page"] { border-left-color: var(--band); background: rgba(255,255,255,.08); font-weight: 700; }
.abmelden { margin-top: auto; background: transparent; border-color: rgba(255,255,255,.25); color: inherit; }
.abmelden:hover { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.5); }
.inhalt { padding: 2rem clamp(16px, 4vw, 3rem) 4rem; max-width: 1200px; outline: none; }
.kopf { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.6rem; }
.abschnitt { background: var(--flaeche); padding: 1.3rem 1.4rem; margin-bottom: 1.2rem; }

/* Das Regal – der Speicherbalken */
.regal { margin: .4rem 0 1rem; }
.regal-balken { display: flex; height: 46px; background: var(--grund); border: 2px solid var(--tinte); position: relative; overflow: hidden; }
.regal-balken span { height: 100%; border-right: 2px solid var(--flaeche); min-width: 0; transition: flex-basis .6s ease; }
.regal-balken.knapp::after {
  content: ""; position: absolute; right: 0; top: 0; bottom: 0; width: 18%;
  background: repeating-linear-gradient(-45deg, var(--band) 0 10px, var(--tinte) 10px 20px);
}
.regal-zahlen { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.regal-zahlen strong { font-size: 2.6rem; font-weight: 800; font-stretch: 125%; line-height: 1; }
.legende { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; margin: 0; padding: 0; list-style: none; font-size: .92rem; }
.legende i { display: inline-block; width: 12px; height: 12px; margin-right: .4rem; vertical-align: -1px; }
.zwei { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.liste { list-style: none; margin: 0; padding: 0; }
.liste li { padding: .55rem 0; border-bottom: 1px solid var(--linie); display: flex; gap: .8rem; justify-content: space-between; }
.liste li:last-child { border-bottom: 0; }

/* Dateien */
.pfad { display: flex; flex-wrap: wrap; gap: .2rem; align-items: center; font-weight: 600; }
.pfad button { background: none; border: 0; color: var(--aktion); padding: .2rem .3rem; }
.pfad button:hover { text-decoration: underline; background: none; }
.ablage { border: 2px dashed var(--linie); padding: 1rem; text-align: center; color: var(--leise); margin-bottom: 1rem; }
.ablage.drueber { border-color: var(--band); background: color-mix(in srgb, var(--band) 12%, transparent); color: var(--tinte); }
.raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.teil { background: var(--flaeche); display: flex; flex-direction: column; min-width: 0; border: 1px solid transparent; }
.teil:hover { border-color: var(--linie); }
.teil .bild { aspect-ratio: 4/3; background: var(--grund); display: grid; place-items: center; overflow: hidden; cursor: pointer; border: 0; padding: 0; width: 100%; border-radius: 0; color: var(--leise); }
.teil .bild:hover { background: var(--grund); }
.teil .bild img, .teil .bild video { width: 100%; height: 100%; object-fit: cover; display: block; }
.teil .bild .symbol { font-weight: 800; font-stretch: 125%; font-size: 1.1rem; color: var(--leise); }
.teil.ordner .bild { background: color-mix(in srgb, var(--aktion) 14%, var(--grund)); }
.teil .unten { padding: .5rem .6rem; display: flex; justify-content: space-between; gap: .3rem; align-items: start; }
.teil .name { font-size: .88rem; font-weight: 600; overflow-wrap: anywhere; }
.teil .groesse { font-size: .8rem; color: var(--leise); }
.fortschritt { height: 6px; background: var(--grund); margin-top: .6rem; }
.fortschritt span { display: block; height: 100%; background: var(--band); width: 0; }

/* Vorschau */
dialog { border: 0; padding: 0; background: var(--flaeche); color: var(--tinte); max-width: min(1000px, 94vw); width: 100%; }
dialog::backdrop { background: rgba(10,14,12,.75); }
.vorschau-inhalt { background: #000; display: grid; place-items: center; max-height: 75vh; }
.vorschau-inhalt img, .vorschau-inhalt video { max-width: 100%; max-height: 75vh; display: block; }
.dialog-fuss { display: flex; gap: .6rem; padding: .8rem 1rem; align-items: center; flex-wrap: wrap; }
.dialog-fuss .name { margin-right: auto; font-weight: 600; overflow-wrap: anywhere; }
.formular { padding: 1.2rem 1.4rem; }

/* Planer */
.plan-zeile { display: grid; grid-template-columns: 7.5rem 1fr auto; gap: 1rem; align-items: center; padding: .8rem 0; border-bottom: 1px solid var(--linie); }
.plan-zeile:last-child { border-bottom: 0; }
.termin { font-weight: 700; font-stretch: 112%; line-height: 1.2; }
.termin small { display: block; font-weight: 400; color: var(--leise); font-stretch: 100%; }
.stempel { font-size: .8rem; font-weight: 700; padding: .15rem .5rem; border: 1.5px solid currentColor; border-radius: var(--r); white-space: nowrap; }
.stempel.geplant { color: var(--aktion); }
.stempel.entwurf { color: var(--leise); }
.stempel.hochgeladen { color: var(--galerie); }
.stempel.fehler { color: var(--gefahr); }

/* Verbindungen */
.neuer-schluessel { background: color-mix(in srgb, var(--band) 18%, var(--flaeche)); border-left: 6px solid var(--band); padding: 1rem; margin: 1rem 0; }
.neuer-schluessel code { display: block; word-break: break-all; font-size: .95rem; margin: .4rem 0 .6rem; }
.dienste { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1px; background: var(--linie); border: 1px solid var(--linie); }
.dienst { background: var(--flaeche); padding: 1rem; }
.dienst h3 { font-size: 1rem; margin-bottom: .3rem; }
.dienst p { font-size: .9rem; color: var(--leise); margin: 0; }
.dienst .zustand { font-size: .85rem; font-weight: 700; margin-top: .5rem; display: block; }
pre.beispiel { background: var(--tinte); color: var(--grund); padding: .8rem 1rem; overflow-x: auto; font-size: .85rem; border-radius: var(--r); }

.hinweis { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--tinte); color: var(--grund); padding: .7rem 1.1rem; border-left: 5px solid var(--band); opacity: 0; pointer-events: none; transition: opacity .2s; max-width: calc(100vw - 32px); }
.hinweis.zeigen { opacity: 1; }
.leer { padding: 2rem 1rem; text-align: center; color: var(--leise); }

@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .leiste { position: fixed; bottom: 0; top: auto; height: auto; width: 100%; flex-direction: row; padding: 0; z-index: 5; overflow-x: auto; }
  .marke, .abmelden { display: none; }
  .leiste a { flex: 1; text-align: center; border-left: 0; border-top: 4px solid transparent; font-size: .82rem; padding: .7rem .3rem; white-space: nowrap; }
  .leiste a[aria-current="page"] { border-top-color: var(--band); border-left: 0; }
  .inhalt { padding-bottom: 6rem; }
  .zwei { grid-template-columns: 1fr; }
  .plan-zeile { grid-template-columns: 1fr auto; }
  .plan-zeile .termin { grid-column: 1 / -1; }
  h1 { font-size: 1.6rem; }
  .raster { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
