/* Fixpoint — Werkstatt-Look.
 *
 * Dunkle Arbeitsplatte, Kacheln wie Magnettafeln mit sichtbarer Kante, ein
 * einziger warmer Akzent (das Haus-Amber). Schrift: System-Stacks, KEINE
 * externen Fonts (DSGVO, gleiche Linie wie das Portal). Monospace traegt die
 * Technik — Hex-Namen, Key-IDs, API-Beispiele.
 *
 * Beide Themen sind vollstaendig definiert (Tokens auf :root, dunkel als
 * @media-Ueberlagerung); kein Wert existiert nur in einem Zweig.
 */

:root {
  --grund: #f4f2ec;          /* helle Werkbank: geoeltes Holz, entsaettigt */
  --flaeche: #ffffff;
  --kante: #c9c3b4;
  --tinte: #26221a;
  --tinte-2: #5c564a;
  --mut: #7a7466;
  --akzent: #b45309;         /* Amber, abgedunkelt fuer 4,5:1 auf hell */
  --akzent-flaeche: #f59e0b;
  --gut: #1a7f37;
  --warn-grund: #fff3e0;
  --schatten: 0 1px 2px rgba(30, 25, 15, .18), 0 6px 18px rgba(30, 25, 15, .08);
  --einrast: cubic-bezier(.2, 1.6, .4, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --grund: #1c1e22;        /* dunkle Arbeitsplatte */
    --flaeche: #26292f;
    --kante: #3d4149;
    --tinte: #e8e6df;
    --tinte-2: #b6b2a6;
    --mut: #8d8a80;
    --akzent: #fbbf24;
    --akzent-flaeche: #f59e0b;
    --gut: #4ade80;
    --warn-grund: #3a2f1c;
    --schatten: 0 1px 2px rgba(0, 0, 0, .5), 0 8px 22px rgba(0, 0, 0, .35);
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--grund);
  color: var(--tinte);
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
code, .mono {
  font-family: ui-monospace, "Cascadia Code", "JetBrains Mono", Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums;
}
a { color: var(--akzent); }
:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; border-radius: 4px; }

/* ── Landing ──────────────────────────────────────────────────────────── */
.lp { max-width: 720px; margin: 0 auto; padding: 56px 24px 80px; }
.lp h1 { font-size: 2.4rem; letter-spacing: -.02em; margin: 0 0 4px; }
.lp .mark { color: var(--akzent); }
.claim { font-size: 1.2rem; color: var(--tinte-2); margin-top: 0; }
.lp h2 { margin-top: 2.2em; font-size: 1.15rem; text-transform: uppercase;
  letter-spacing: .06em; color: var(--tinte-2); }
.lp pre { background: var(--flaeche); border: 1px solid var(--kante);
  border-radius: 8px; padding: 14px 16px; overflow-x: auto; box-shadow: var(--schatten); }
.schritte li { margin-bottom: .5em; }
.zugang { margin-top: 2.5em; }
.lp footer { margin-top: 4em; padding-top: 1em; border-top: 1px solid var(--kante);
  color: var(--mut); font-size: .9rem; }
.recht h2 { text-transform: none; letter-spacing: 0; font-size: 1.05rem; color: var(--tinte); }
.recht address { font-style: normal; }

.knopf {
  display: inline-block; background: var(--akzent-flaeche); color: #241a06;
  padding: 10px 18px; border-radius: 8px; text-decoration: none; font-weight: 600;
  border: 0; box-shadow: 0 2px 0 #9a6206; cursor: pointer;
}
.knopf:active { transform: translateY(2px); box-shadow: none; }

/* ── App-Rahmen ───────────────────────────────────────────────────────── */
.leiste { display: flex; justify-content: space-between; align-items: baseline;
  padding: 14px 22px; }
.logo { font-weight: 700; font-size: 1.1rem; letter-spacing: .01em; }
.wer { color: var(--tinte-2); font-size: .92rem; }
.wer em { color: var(--akzent); font-style: normal; }
.meldung { margin: 0 22px 10px; padding: 10px 14px; border-radius: 8px;
  background: var(--warn-grund); border: 1px solid var(--kante); }

/* ── Das Board: Werkstatt in der Mitte, Kacheln an den Ecken ─────────── */
.board {
  display: grid; gap: 16px; padding: 8px 22px 40px;
  grid-template-columns: 1fr 1fr;
  grid-template-areas:
    "oben-links oben-rechts"
    "werkstatt  werkstatt"
    "unten-links unten-rechts";
}
.werkstatt {
  grid-area: werkstatt; min-height: 220px; border-radius: 14px;
  border: 2px dashed var(--kante); display: flex; align-items: center;
  justify-content: center; padding: 14px; position: relative;
  transition: border-color .18s ease, background .18s ease;
}
.werkstatt.zieht-an { border-color: var(--akzent); background: var(--warn-grund); }
.werkstatt.belegt { border-style: solid; align-items: stretch; }
.werkstatt.belegt > .leer { display: none; }
.werkstatt .leer { color: var(--mut); text-align: center; max-width: 46ch; }
.tagebuch { display: block; margin-top: .6em; font-size: .85rem; font-style: italic; }

.kachel {
  background: var(--flaeche); border: 1px solid var(--kante); border-radius: 12px;
  box-shadow: var(--schatten); padding: 0 0 6px; overflow: hidden;
  cursor: grab;
}
.kachel[data-ecke="oben-links"]  { grid-area: oben-links; }
.kachel[data-ecke="oben-rechts"] { grid-area: oben-rechts; }
.kachel[data-ecke="unten-links"] { grid-area: unten-links; }
.kachel[data-ecke="unten-rechts"]{ grid-area: unten-rechts; }
.kachel.schwebt { opacity: .55; cursor: grabbing; }
.kachel h2 {
  display: flex; justify-content: space-between; align-items: center; margin: 0;
  font-size: .98rem; padding: 10px 14px; border-bottom: 1px solid var(--kante);
  /* Magnetleiste: die Kante, an der die Tafel "haengt" */
  background: linear-gradient(to bottom, rgba(127,127,127,.10), transparent);
}
.kachel .inhalt { padding: 12px 14px; overflow-x: auto; }
/* Eingedockt: die Kachel fuellt die Werkstatt und darf atmen */
.kachel.gedockt { grid-area: auto; width: 100%; cursor: default; }
.kachel.gedockt h2 { background: none; border-bottom-color: var(--akzent); }
@keyframes einrasten {
  0% { transform: scale(.96); } 60% { transform: scale(1.012); } 100% { transform: none; }
}
.kachel.einrasten { animation: einrasten .32s var(--einrast); }
.dock {
  border: 1px solid var(--kante); background: none; color: var(--tinte-2);
  border-radius: 6px; width: 30px; height: 30px; font-size: 1rem; cursor: pointer;
}
.dock:hover { color: var(--akzent); border-color: var(--akzent); }

/* ── Inhalte ──────────────────────────────────────────────────────────── */
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th { text-align: left; color: var(--mut); font-weight: 600; font-size: .8rem;
  text-transform: uppercase; letter-spacing: .05em; }
th, td { padding: 6px 10px 6px 0; border-bottom: 1px solid var(--kante); }
.kv dt { color: var(--mut); font-size: .8rem; text-transform: uppercase;
  letter-spacing: .05em; margin-top: .7em; }
.kv dd { margin: 2px 0 0; }
.zeile { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.zeile input, .zeile select {
  background: var(--grund); color: var(--tinte); border: 1px solid var(--kante);
  border-radius: 7px; padding: 8px 10px; font: inherit; min-width: 0;
}
.zeile button, .blitz {
  background: var(--akzent-flaeche); color: #241a06; border: 0; border-radius: 7px;
  padding: 8px 14px; font: inherit; font-weight: 600; cursor: pointer;
  box-shadow: 0 2px 0 #9a6206;
}
.zeile button:active, .blitz:active { transform: translateY(2px); box-shadow: none; }
.inline { display: inline; }
.leise { background: none; border: 1px solid var(--kante); color: var(--tinte-2);
  border-radius: 6px; padding: 3px 9px; font-size: .82rem; cursor: pointer; }
.leise:hover { color: var(--akzent); border-color: var(--akzent); }
.fehler { font-size: .85rem; }
.mut { color: var(--mut); }
.warn { background: var(--warn-grund); border: 1px solid var(--kante);
  border-radius: 8px; padding: 10px 14px; }

/* ── Einmal-Seiten (Schluessel, Subdomain) ────────────────────────────── */
.einmal { max-width: 640px; margin: 0 auto; padding: 48px 24px; }
.einmal .kv dd { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.einmal code { background: var(--flaeche); border: 1px solid var(--kante);
  border-radius: 6px; padding: 6px 10px; word-break: break-all; }
.kopieren { background: none; border: 1px solid var(--kante); color: var(--tinte-2);
  border-radius: 6px; padding: 5px 11px; font: inherit; font-size: .85rem; cursor: pointer; }
.kopieren:hover { color: var(--akzent); border-color: var(--akzent); }
.kopieren.ok { color: var(--gut); border-color: var(--gut); }
.kopieren.gross { font-size: 1rem; padding: 9px 16px; }

.slot { font-size: 1.5rem; margin: 1.2em 0; overflow-wrap: anywhere; }
.slot .hex {
  font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: .08em;
  color: var(--akzent); font-weight: 700;
}
.slot .zone { color: var(--mut); font-size: 1.05rem; }
.slot.eingerastet .hex { text-shadow: 0 0 18px rgba(245, 158, 11, .35); }

/* ── Breite Schirme: die Ecken werden echte Ecken ─────────────────────── */
@media (min-width: 980px) {
  .board {
    grid-template-columns: minmax(260px, 1fr) minmax(420px, 2fr) minmax(260px, 1fr);
    grid-template-rows: auto auto;
    grid-template-areas:
      "oben-links  werkstatt oben-rechts"
      "unten-links werkstatt unten-rechts";
    align-items: start;
  }
  .werkstatt { min-height: 420px; }
}

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