/* kapitel/datenbank.css — SQL-Code, Relationenschemata und kleine Datentabellen
   (Informatik › Datenbanken, alle Seitentypen). Nach der Typ-Datei und fach.css einbinden.
   Farben nur aus fach.css (var(--fach-*)) und der Nuklidkarten-Palette. */

/* Inline-Code wie in turtle.css */
.erklaer-text code,.stichliste code,.dbox code,.hinweis-card code,.applet-lead code,.applet-note code,.applet-readout code,
.aufgabe code,.aufgabe-text code,.teilaufgaben code,.ta-body code,.ux code,.umf code,.umf-note code,.lk-card code,.tf-card code,.zf code{font-family:ui-monospace,'SF Mono',Menlo,Consolas,'Liberation Mono',monospace;font-size:.9em;background:#f4ede0;border:1px solid #e6dcc9;border-radius:6px;padding:1px 6px;color:#2b241d;overflow-wrap:anywhere}
.dbox code{background:#fff}

/* SQL-Block */
.sql{display:block;margin:12px 0 16px;padding:13px 18px;background:#2b2621;color:#f3ece0;border-radius:12px;font:500 15px/1.65 ui-monospace,'SF Mono',Menlo,Consolas,'Liberation Mono',monospace;white-space:pre;overflow-x:auto;tab-size:4}
.sql .kw{color:#f4d03f;font-weight:700}
.sql .st{color:#a5d69a}
.sql .nu{color:#9dc1f5}
.sql .cm{color:#b3a896;font-style:normal}
.sql code{background:none!important;border:0!important;padding:0!important;color:inherit!important;font-size:inherit!important;border-radius:0!important;white-space:pre!important;overflow-wrap:normal!important}
.umf-eq .sql,.dbox .sql{margin:0}
.dbox .sql{margin:8px 0 0}

/* Relationenschema: Primärschlüssel unterstrichen, Fremdschlüssel mit ↑ */
.schema{font-family:ui-monospace,'SF Mono',Menlo,Consolas,'Liberation Mono',monospace;font-size:.93em;white-space:normal}
.schema .pk{text-decoration:underline;text-decoration-thickness:2px;text-underline-offset:3px}
.schema .fk::before{content:"\2191";font-weight:700;color:var(--fach-strong)}

/* Kleine Datentabelle */
.dbt-wrap{max-width:100%;overflow-x:auto;margin:10px 0 16px}
.dbt{border-collapse:separate;border-spacing:0;background:#fff;border:1px solid var(--rule,#d9cdb8);border-radius:10px;overflow:hidden;font-size:14.5px;line-height:1.4;font-variant-numeric:tabular-nums}
.dbt caption{caption-side:top;text-align:left;font:600 14px 'Fredoka',Inter,sans-serif;color:var(--fach-ink);padding:0 0 6px}
.dbt th,.dbt td{padding:6px 12px;border-bottom:1px solid #eee4d3;text-align:left;white-space:nowrap}
.dbt th{background:#f4ede0;font-weight:700;color:#2b241d}
.dbt tr:last-child td{border-bottom:0}
.dbt th.pk{text-decoration:underline;text-decoration-thickness:2px;text-underline-offset:3px}
.dbt th.fk::before{content:"\2191";color:var(--fach-strong)}
.dbt td.num{text-align:right}
.dbt-row{display:flex;flex-wrap:wrap;gap:14px;align-items:flex-start}
.dbt-row .dbt-wrap{margin:6px 0 10px}

@media(max-width:560px){.sql{font-size:13.5px;padding:11px 13px}.dbt{font-size:13.5px}.dbt th,.dbt td{padding:5px 9px}}
@media print{.sql{background:#fff;color:#000;border:1px solid #999}.sql .kw,.sql .st,.sql .nu,.sql .cm{color:#000}}

/* Auftragszeile über einer Applet-Zeichnung (bleibt beim waagerechten Scrollen stehen) */
.db-auftrag{position:sticky;left:0;margin:0 0 8px;padding:9px 14px;background:#faf6ee;border:1px solid #d9cdb8;border-radius:10px;font:600 16px/1.45 'Fredoka',Inter,sans-serif;color:var(--fach-ink);max-width:calc(100vw - 90px)}
@media(min-width:701px){.db-auftrag{max-width:none}}

/* Auswahl-Chips in Datenbank-Applets (Kandidaten, Bausteine) */
.db-chips{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px;align-items:center}
.db-chips .db-chips-lab{font:600 14px 'Fredoka',Inter,sans-serif;color:var(--fach-ink);margin-right:4px}
.applet-lab .db-chips button{min-height:38px;padding:6px 14px;border-radius:999px;font-size:14.5px}
.applet-lab .db-chips button.mono{font-family:ui-monospace,'SF Mono',Menlo,Consolas,monospace;font-size:14px}
.applet-lab .db-chips button[aria-pressed="true"]{background:var(--fach-ink);border-color:var(--fach-ink);color:#fff}
.applet-lab .db-chips button.is-ok{border-color:#4a7530;box-shadow:inset 0 0 0 1px #4a7530}
.applet-lab .db-chips button.is-wrong{border-color:#e2574c;box-shadow:inset 0 0 0 1px #e2574c}

/* Relationenschema als Kasten (Aufgabenseiten) */
.schema-box{background:#faf6ee;border:1px solid #e6dcc9;border-radius:10px;padding:10px 14px;line-height:1.9;margin:6px 0 12px;overflow-x:auto}
