/* Sinnwerk Portal. Farben aus /design/tokens.css (DESIGN.md im Repo-Stamm); --brand ist die Akzentfarbe des Kunden. */
@font-face { font-family:"Inter"; src:url(/fonts/inter-latin-400.woff2) format("woff2"); font-weight:300 700; font-display:swap; }
@font-face { font-family:"Instrument Serif"; src:url(/fonts/instrument-serif-latin-400.woff2) format("woff2"); font-weight:400; font-display:swap; }
:root { --card:var(--chalk); }
* { box-sizing:border-box; }
[hidden] { display:none !important; }
html { -webkit-text-size-adjust:100%; }
body { margin:0; background:var(--paper); color:var(--ink); font:400 15px/1.55 Inter, Arial, sans-serif; -webkit-font-smoothing:antialiased; }
h1, h2, .h3 { font-family:"Instrument Serif", Georgia, serif; font-weight:400; letter-spacing:-.01em; margin:0; }
h1 { font-size:44px; line-height:1.05; }
h2 { font-size:28px; line-height:1.15; }
.h3 { font-size:22px; line-height:1.2; margin-bottom:14px; }
a { color:inherit; }
button, input, select, textarea { font:inherit; color:inherit; }
:focus-visible { outline:2px solid var(--ink); outline-offset:3px; }
.muted { color:var(--muted); }
.small { font-size:13px; }
.lead { font-size:17px; margin:10px 0 0; }
.vh { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); }
.wrap { max-width:1180px; margin:0 auto; padding:0 40px; }
.page { padding:44px 40px 80px; }
.narrow { max-width:900px; }
@media (max-width:640px) { .wrap, .page { padding-left:16px; padding-right:16px; } h1 { font-size:34px; } }

/* Kopf */
.top { border-bottom:1px solid var(--line); background:var(--paper); }
.top-in { display:flex; align-items:center; gap:24px; min-height:72px; flex-wrap:wrap; }
.brandmark { display:flex; align-items:center; text-decoration:none; min-height:44px; }
.brandmark img { max-height:44px; max-width:200px; object-fit:contain; }
.brandmark img.on-dark { background:var(--ink); padding:6px 10px; border-radius:2px; }
.brandmark span { font:400 24px/1 "Instrument Serif", Georgia, serif; }
.nav { display:flex; gap:4px; }
.nav a { text-decoration:none; padding:7px 11px; border:1px solid transparent; border-radius:2px; color:var(--muted); font-size:14px; }
.nav a[aria-current], .nav a:hover { color:var(--ink); background:var(--chalk); border-color:var(--line); }
.who { margin-left:auto; display:flex; align-items:center; gap:14px; font-size:14px; }
.who form { margin:0; }

/* Buttons, Felder */
.btn { display:inline-flex; align-items:center; justify-content:center; gap:10px; min-height:42px; padding:0 18px; border-radius:2px; border:1px solid var(--ink); background:transparent; cursor:pointer; text-decoration:none; font-size:14px; white-space:nowrap; }
.btn:hover { background:var(--chalk); }
.btn.primary { background:var(--ink); color:var(--paper); }
.btn.primary:hover { background:var(--sage-deep); border-color:var(--sage-deep); color:var(--chalk); }
.btn.brand { background:var(--brand); border-color:var(--brand); color:var(--on-brand); }
.btn.brand:hover { filter:brightness(.94); }
.btn[disabled] { opacity:.5; cursor:default; }
.link { background:none; border:0; padding:0; cursor:pointer; text-decoration:underline; text-underline-offset:3px; font-size:14px; color:inherit; }
label { display:flex; flex-direction:column; gap:6px; font-size:14px; }
input[type=text], input[type=email], input[type=password], input:not([type]), select { min-height:42px; border:1px solid var(--line); border-radius:2px; background:var(--chalk); padding:8px 12px; font-size:15px; width:100%; }
input:focus { border-color:var(--ink); outline:none; }
input:disabled { background:var(--paper); color:var(--muted); }
.stack { display:flex; flex-direction:column; gap:16px; }
.grid2 { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
@media (max-width:640px) { .grid2 { grid-template-columns:1fr; } }
.row-input { display:flex; gap:12px; align-items:flex-end; }
.row-input .grow { flex:1; }
@media (max-width:520px) { .row-input { flex-direction:column; align-items:stretch; } }
.affix { display:flex; align-items:stretch; }
.affix input { border-right:0; }
.affix span { display:flex; align-items:center; padding:0 12px; border:1px solid var(--line); background:var(--paper); color:var(--muted); font-size:14px; border-radius:0 2px 2px 0; }
.check { flex-direction:row; align-items:center; gap:10px; margin-top:14px; }
.err { color:var(--danger); margin:0; }
.ok { color:var(--sage-deep); margin:0; }

/* Karten */
.card { background:var(--card); border:1px solid var(--line); border-radius:2px; padding:24px 26px; }
@media (max-width:640px) { .card { padding:18px 16px; } }
.actions { display:flex; align-items:center; gap:16px; }
.head-row { display:flex; align-items:flex-end; justify-content:space-between; gap:20px; flex-wrap:wrap; margin-bottom:28px; }

/* Anmeldung */
.auth { min-height:100vh; display:flex; flex-direction:column; align-items:center; justify-content:center; padding:32px 16px; }
.auth-card { width:100%; max-width:420px; background:var(--card); border:1px solid var(--line); border-radius:2px; padding:36px 32px; }
.auth-card h1 { font-size:36px; margin-top:20px; }
.auth-card .btn.primary { background:var(--brand); border-color:var(--brand); color:var(--on-brand); }
.auth-logo { max-height:56px; max-width:240px; object-fit:contain; display:block; }
.auth-logo.seal { width:44px; height:44px; }
.foot { display:flex; align-items:center; gap:8px; margin-top:22px; color:var(--muted); font-size:13px; letter-spacing:.18em; text-transform:uppercase; }

/* Portal */
.tiles { display:grid; grid-template-columns:repeat(auto-fill, minmax(280px, 1fr)); gap:18px; margin-top:32px; }
.tile { background:var(--card); border:1px solid var(--line); border-top:3px solid var(--brand); border-radius:2px; padding:24px; display:flex; flex-direction:column; gap:12px; align-items:flex-start; }
.tile h2 { font-size:26px; }
.tile p { margin:0 0 6px; flex:1; }
.block { margin-top:48px; }

/* Tabellen */
.table { width:100%; border-collapse:collapse; background:var(--card); border:1px solid var(--line); font-size:14px; }
.table th { text-align:left; font-weight:500; color:var(--muted); font-size:13px; padding:10px 14px; border-bottom:1px solid var(--line); }
.table td { padding:12px 14px; border-bottom:1px solid var(--line); vertical-align:middle; }
.table tr:last-child td { border-bottom:0; }
.customers { min-width:760px; }
main:has(.customers) { overflow-x:auto; }
.cust { display:flex; align-items:center; gap:12px; }
.cust small { display:block; }
.cust-logo { width:72px; height:36px; display:flex; align-items:center; justify-content:center; background:var(--chalk); border:1px solid var(--line); border-radius:2px; padding:3px; flex:none; }
.cust-logo.on-dark { background:var(--ink); }
.cust-logo img { max-width:100%; max-height:100%; object-fit:contain; }
.cust-logo.dot { width:14px; height:14px; border-radius:50%; border:0; padding:0; margin:0 29px; }
.pill { display:inline-block; padding:2px 10px; border-radius:999px; font-size:12px; border:1px solid var(--line); }
.pill.ok { background:var(--ok-soft); border-color:var(--ok-line); color:var(--ok); }
.pill.warn { background:var(--warn-soft); border-color:var(--warn-line); color:var(--warn); }

/* Schalter */
.switch { position:relative; display:inline-block; width:42px; height:24px; }
.switch input { position:absolute; opacity:0; width:100%; height:100%; margin:0; cursor:pointer; z-index:1; }
.switch span { position:absolute; inset:0; background:var(--sand); border-radius:999px; transition:background .15s; }
.switch span::after { content:""; position:absolute; top:3px; left:3px; width:18px; height:18px; border-radius:50%; background:var(--muted); transition:transform .15s, background .15s; }
.switch input:checked + span { background:var(--sage-deep); }
.switch input:checked + span::after { transform:translateX(18px); background:var(--chalk); }
.switch input:focus-visible + span { outline:2px solid var(--ink); outline-offset:2px; }
.switch input:disabled + span { opacity:.55; }
@media (prefers-reduced-motion:reduce) { .switch span, .switch span::after { transition:none; } }

/* Module wählen */
.modpick { display:grid; gap:10px; }
.modopt { flex-direction:row; align-items:flex-start; gap:12px; padding:14px 16px; border:1px solid var(--line); border-radius:2px; background:var(--chalk); cursor:pointer; }
.modopt input { margin-top:4px; width:18px; height:18px; accent-color:var(--sage-deep); }
.modopt b { font-weight:500; display:block; }
.modopt:has(input:checked) { border-color:var(--sage-deep); outline:1px solid var(--sage-deep); outline-offset:-2px; }

#brand { margin-top:16px; }
.done { margin-top:24px; border-color:var(--ok-line); }
.done code { display:block; word-break:break-all; background:var(--paper); border:1px solid var(--line); padding:10px 12px; font-size:13px; margin:8px 0 14px; }

/* Marke im Portal */
.brandrow { display:flex; gap:28px; flex-wrap:wrap; align-items:flex-start; margin-top:16px; }
.swatches { display:flex; gap:16px; flex-wrap:wrap; }
.swatch { display:flex; flex-direction:column; gap:6px; }
.swatch span { width:64px; height:64px; border:1px solid var(--line); border-radius:2px; }
.swatch small { font-size:12px; color:var(--muted); line-height:1.4; }
.swatch code { font-size:11px; }
.photos { display:flex; gap:10px; flex-wrap:wrap; }
.photos img { width:160px; height:110px; object-fit:cover; border-radius:2px; border:1px solid var(--line); }
.auth-card .ok, .auth-card .err { margin:12px 0 4px; }

/* Rechtliches */
.block-s { margin-top:20px; }
.note { margin:16px 0 0; }
.row-form { display:flex; align-items:center; gap:16px; flex-wrap:wrap; }
.row-form .check { margin:0; }
.textblock { border-top:1px solid var(--line); padding:14px 0 4px; }
.textblock:first-of-type { margin-top:8px; }
.textblock-head { display:flex; justify-content:space-between; align-items:baseline; gap:12px; }
.textblock p { margin:8px 0 10px; font-size:14px; }
mark { background:var(--sand); color:inherit; padding:0 2px; }
.draftnote { background:var(--warn-soft); border:1px solid var(--warn-line); color:var(--warn); padding:12px 16px; border-radius:2px; margin:18px 0 0; }
.signed { margin-top:18px; border-color:var(--ok-line); }
.legaltext { margin-top:18px; font-size:14px; line-height:1.6; }
.legaltext h2 { font-size:26px; margin:28px 0 10px; }
.legaltext h3 { font-size:20px; margin:22px 0 8px; font-family:"Instrument Serif", Georgia, serif; font-weight:400; }
.legaltext h4 { font-size:15px; margin:18px 0 6px; }
.legaltext h2:first-child { margin-top:0; }
.legaltext blockquote { margin:12px 0; padding:4px 14px; border-left:3px solid var(--sand); color:var(--muted); }
.legaltext hr { border:0; border-top:1px solid var(--line); margin:24px 0; }
.legaltext .tablewrap { overflow-x:auto; margin:10px 0; }
.legaltext .table td { vertical-align:top; }
@media print {
  .top, .noprint, #abschluss { display:none !important; }
  body { background:var(--chalk); }
  .card { border:0; padding:0; }
  .page { padding:0; }
}
