/* Plan: einfaches 2D-Zeichnen im Massstab. Links Werkzeuge, Mitte Zeichenfläche, rechts Objekt-Info. */
:root { --text: #252525; --mint: #7aecce; --mint-hell: #c7f7ea; --sand: #f4f1ec; --linie: #e4ddd2; --grau: #6b6560; --auswahl: #1a73e8; color-scheme: light; }
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--text); background: #fff; }
/* Das Werkzeug füllt genau den Bildschirm; darunter (scrollen) der Erklärtext „Über dieses Werkzeug“ */
.app { height: 100vh; height: 100dvh; display: flex; flex-direction: column; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--text); outline-offset: 2px; }
kbd { font-family: inherit; font-size: 10px; padding: 0 4px; border: 1px solid var(--linie); border-radius: 4px; background: #fff; }

.leiste { display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: var(--mint); flex-wrap: wrap; }
.leiste button { min-height: 34px; padding: 0 14px; border: 0; border-radius: 9999px; background: var(--mint-hell); font-weight: 600; font-size: 14px; cursor: pointer; }
.leiste button.dunkel, .knoepfe .dunkel { background: var(--text); color: #fff; }
.zurueck { color: var(--text); text-decoration: none; font-size: 14px; }
.marke { font-size: 18px; }
.titel { min-width: 140px; padding: 4px 10px; border: 1px solid transparent; border-radius: 8px; background: transparent; font-weight: 600; }
.titel:hover, .titel:focus { border-color: rgba(0, 0, 0, 0.2); background: #fff; }
.abstand { flex: 1; }

.arbeit { flex: 1; min-height: 0; display: grid; grid-template-columns: 112px minmax(0, 1fr) 250px; }
.werkzeuge { display: flex; flex-direction: column; gap: 3px; padding: 8px; background: var(--sand); border-right: 1px solid var(--linie); overflow-y: auto; }
.werkzeuge > button { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 5px 2px; border: 1px solid transparent; border-radius: 10px; background: none; cursor: pointer; font-size: 18px; line-height: 1.1; }
.werkzeuge > button small { font-size: 11px; display: flex; gap: 3px; align-items: center; }
.werkzeuge > button:hover { background: #fff; }
.werkzeuge > button[aria-pressed="true"] { background: var(--text); color: #fff; }
.werkzeuge > button[aria-pressed="true"] kbd { color: var(--text); }
.werkzeuge > button:disabled { opacity: 0.35; cursor: default; background: none; }
.werkzeuge hr { width: 100%; border: 0; border-top: 1px solid var(--linie); margin: 4px 0; }
.farben { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 2px 8px; }
.farben button { aspect-ratio: 1; border-radius: 8px; border: 1px solid #999; cursor: pointer; }
.farben button[data-farbe="schwarz"] { background: #1d1d1b; }
.farben button[data-farbe="weiss"] { background: #fff; }
.farben button[data-farbe="rot"] { background: #e2342d; }
.farben button[data-farbe="gelb"] { background: #f6c623; }
.farben button[data-farbe="leer"] { background: #fff linear-gradient(to top right, transparent calc(50% - 1.5px), #e2342d calc(50% - 1.5px), #e2342d calc(50% + 1.5px), transparent calc(50% + 1.5px)); }
.farben button[aria-pressed="true"] { outline: 3px solid var(--auswahl); outline-offset: 1px; }

.blatt { position: relative; min-width: 0; min-height: 0; background: #fbfaf8; }
#zeichnung { display: block; width: 100%; height: 100%; user-select: none; touch-action: none; }
.blatt.zieht #zeichnung { cursor: grabbing; }
.blatt[data-werkzeug="linie"] #zeichnung, .blatt[data-werkzeug="rechteck"] #zeichnung, .blatt[data-werkzeug="mass"] #zeichnung { cursor: crosshair; }
.eingabe { position: absolute; display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; background: #fff; border: 1px solid var(--linie); border-radius: 10px; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12); font-size: 12px; z-index: 2; }
.eingabe input { width: 150px; padding: 4px 8px; border: 1px solid var(--auswahl); border-radius: 6px; font-size: 15px; }
.eingabe small { color: var(--grau); font-size: 11px; }

.info { padding: 10px 14px; border-left: 1px solid var(--linie); background: #fff; overflow-y: auto; font-size: 14px; }
.info h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--grau); margin: 10px 0 8px; }
.feld { display: flex; flex-direction: column; gap: 3px; margin-bottom: 8px; font-size: 13px; font-weight: 600; }
.feld input, .feld select { padding: 5px 8px; border: 1px solid var(--linie); border-radius: 8px; font-weight: 400; background: #fff; }
.zwei { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.leise { color: var(--grau); font-size: 13px; }
.hilfe { margin-top: 14px; font-size: 13px; line-height: 1.45; }
.hilfe summary { cursor: pointer; font-weight: 600; }
.hilfe ul { padding-left: 18px; }
.hilfe code { font-size: 12px; background: var(--sand); padding: 0 3px; border-radius: 3px; }

.status { display: flex; justify-content: space-between; gap: 12px; padding: 4px 14px; font-size: 12px; color: var(--grau); border-top: 1px solid var(--linie); background: #fff; }

dialog { border: 0; border-radius: 18px; padding: 22px; width: min(360px, calc(100% - 32px)); }
dialog::backdrop { background: rgba(0, 0, 0, 0.35); }
dialog h2 { margin: 0 0 12px; font-size: 20px; }
.haken { display: flex; gap: 8px; align-items: center; font-size: 14px; margin: 4px 0 10px; }
.knoepfe { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.knoepfe button { min-height: 36px; padding: 0 16px; border: 0; border-radius: 9999px; background: var(--mint-hell); font-weight: 600; cursor: pointer; }
.pdf-pruefung { font-size: 14px; font-weight: 600; }
.pdf-pruefung.passt-nicht { color: #b3261e; }

@media (max-width: 900px) { .arbeit { grid-template-columns: 96px minmax(0, 1fr); } .info { display: none; } }
.eingabe[hidden] { display: none; }
.feld input, .feld select { width: 100%; min-width: 0; }
.zwei > .feld { min-width: 0; }

.stile { display: flex; flex-direction: column; gap: 3px; padding: 0 4px; }
.stile button { height: 22px; padding: 0 6px; border: 1px solid transparent; border-radius: 8px; background: none; cursor: pointer; }
.stile button:hover { background: #fff; }
.stile button svg { width: 100%; height: 8px; display: block; stroke: var(--text); stroke-width: 2.4; stroke-linecap: round; }
.stile button[aria-pressed="true"] { background: var(--text); }
.stile button[aria-pressed="true"] svg { stroke: #fff; }
.werkzeuge > button[data-tun="raster"][aria-pressed="true"] { background: none; color: inherit; }
.werkzeuge > button[data-tun="raster"][aria-pressed="true"] kbd { color: inherit; }
.werkzeuge > button[data-tun="raster"][aria-pressed="false"] { opacity: 0.45; text-decoration: line-through; }
#zweites-feld { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
#zweites-feld[hidden] { display: none; }
.person { padding: 3px 10px; border-radius: 9999px; background: #fff; font-size: 13px; font-weight: 600; white-space: nowrap; }
.person[hidden] { display: none; }

/* Rückmeldung (Testversion) */
.marke .test { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; padding: 2px 8px; border-radius: 9999px; background: var(--text); color: #fff; vertical-align: 2px; margin-left: 4px; }
.leiste button.rueckmelden { background: #fff; }
#rueckmeldung { width: min(440px, calc(100% - 32px)); }
#rueckmeldung .leise { font-size: 14px; color: var(--grau); margin: 0 0 12px; line-height: 1.45; }
#rueckmeldung .wahl { border: 0; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
#rueckmeldung .wahl label { display: flex; gap: 8px; align-items: center; cursor: pointer; }
#rueckmeldung textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--linie); border-radius: 10px; font: inherit; font-size: 15px; font-weight: 400; resize: vertical; }
#rueckmeldung .danke { font-size: 16px; line-height: 1.5; margin: 0; }
.info-knopf { margin-top: 4px; min-height: 34px; padding: 0 14px; border: 0; border-radius: 9999px; background: var(--mint-hell); font-weight: 600; font-size: 14px; cursor: pointer; }
.werkzeuge > button svg { display: block; margin: 0 auto; }

/* Hinweis auf kleinen Touch-Bildschirmen (das Tool ist für Maus + Tastatur gebaut) */
.handy-hinweis { display: none; }
@media (pointer: coarse) and (max-width: 900px) {
  .handy-hinweis { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; background: #fde4eb; font-size: 14px; line-height: 1.45; }
  .handy-hinweis p { margin: 0; }
  .handy-hinweis button { align-self: flex-start; min-height: 34px; padding: 0 14px; border: 0; border-radius: 9999px; background: var(--text); color: #fff; font-weight: 600; font-size: 14px; cursor: pointer; }
  .handy-hinweis[hidden] { display: none; }
}

/* „Gefällt dir das?“ nach dem PDF-Export: kleine Karte unten rechts, kein Fenster, blockiert nichts */
.gefaellt { position: fixed; right: 16px; bottom: 16px; z-index: 20; width: min(340px, calc(100% - 32px)); padding: 16px 18px 12px; background: var(--mint-hell); border-radius: 16px; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18); font-size: 14px; line-height: 1.45; }
.gefaellt[hidden] { display: none; }
.gefaellt p { margin: 0 0 8px; }
.gefaellt a { color: var(--text); font-weight: 700; }
.gefaellt__titel { font-size: 17px; font-weight: 700; padding-right: 24px; }
.gefaellt__zu { position: absolute; top: 6px; right: 8px; border: 0; background: none; font-size: 22px; line-height: 1; cursor: pointer; color: var(--text); padding: 4px 6px; }
.gefaellt__nie { border: 0; background: none; padding: 0; font: inherit; font-size: 12px; color: var(--grau); text-decoration: underline; cursor: pointer; }

/* Erklärtext unter dem Werkzeug (für Leser:innen und Google) */
.status__rechts { display: flex; gap: 14px; }
.status a { color: var(--grau); }
.ueber { background: var(--sand); border-top: 1px solid var(--linie); padding: 48px 16px 64px; }
.ueber__innen { max-width: 720px; margin: 0 auto; font-size: 17px; line-height: 1.6; }
.ueber__kicker { margin: 0 0 6px; font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--grau); }
.ueber h1 { margin: 0 0 14px; font-size: clamp(28px, 4vw, 40px); line-height: 1.15; }
.ueber h2 { margin: 36px 0 10px; font-size: 22px; line-height: 1.25; }
.ueber__lead { font-size: 19px; }
.ueber__knopf { display: inline-block; padding: 10px 20px; border-radius: 9999px; background: var(--text); color: #fff; font-weight: 600; font-size: 15px; text-decoration: none; }
.ueber a:not(.ueber__knopf) { color: var(--text); }
.ueber__schritte, .ueber ul { padding-left: 1.3em; }
.ueber li { margin-bottom: 8px; }
.ueber code { font-size: 0.9em; padding: 1px 5px; border-radius: 5px; background: #fff; }
.ueber details { margin: 0 0 8px; padding: 12px 16px; border-radius: 14px; background: #fff; }
.ueber summary { font-weight: 600; cursor: pointer; }
.ueber details p { margin: 8px 0 0; }
.ueber__autorin { margin-top: 36px; padding: 18px 20px; border-radius: 16px; background: var(--mint-hell); font-size: 15px; }
.ueber__autorin p { margin: 0; }
