/* Tuscheteam-CI: zentrale Tokens und Komponenten für den Karteneditor-Prototyp. */
@font-face { font-family: 'Roboto'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/roboto-v18-latin-regular.woff2') format('woff2'); }
@font-face { font-family: 'Roboto'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/roboto-v18-latin-500.woff2') format('woff2'); }
@font-face { font-family: 'Roboto'; font-style: normal; font-weight: 700; font-display: swap; src: url('../wp-content/fonts/roboto-v18-latin-700.woff2') format('woff2'); }

:root {
  --tt-blue: #004f66;
  --tt-blue-hover: color-mix(in srgb, #004f66 82%, #000);
  --tt-blue-tint: color-mix(in srgb, #004f66 8%, #fff);
  --tt-red: #af0d2c;
  --tt-red-hover: color-mix(in srgb, #af0d2c 82%, #000);
  --tt-green: #008e5e;
  --tt-green-dark: #006f46;
  --tt-text: #3a3a3a;
  --tt-muted: #5f6366;
  --tt-line: #dde0e2;
  --tt-line-strong: #b9bec1;
  --tt-surface: #ffffff;
  --tt-bg: #f4f5f6;
  --tt-hover: #eef1f2;
  --tt-radius: 4px;
  --tt-shadow: 0 1px 3px rgba(0, 0, 0, .12);
  --tt-shadow-lg: 0 8px 28px rgba(0, 0, 0, .18);
  --tt-font: 'Roboto', system-ui, sans-serif;
  --tt-control-height: 36px;
}

html, body { margin: 0; height: 100%; overflow: hidden; background: var(--tt-bg); }
body, button, input, select, textarea { font-family: var(--tt-font); letter-spacing: normal; }
body { color: var(--tt-text); font-size: 16px; font-weight: 400; line-height: 1.45; }
h1, h2, h3, h4, h5, h6, p, ul, ol, dl, dd, figure { margin: 0; }
h1, h2 { font-size: 20px; font-weight: 500; line-height: 1.35; }
h3, h4, h5, h6 { font-size: 16px; font-weight: 500; line-height: 1.4; }
strong, b, th { font-weight: 500; }
a { color: var(--tt-blue); }
a:hover { color: var(--tt-blue-hover); }
:focus-visible { outline: 2px solid var(--tt-blue); outline-offset: 2px; }
::selection { background: var(--tt-blue-tint); }
input[type=checkbox], input[type=radio], input[type=range] { accent-color: var(--tt-blue); }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; margin: 0; flex: none; font-size: 16px; }
input[type=range] { font-size: 16px; }

/* Buttons – Label linksbündig, 4px Radius */
.btn { display: inline-flex; align-items: center; justify-content: flex-start; gap: 8px; min-height: 40px; padding: 0 14px; border: 1px solid transparent; border-radius: var(--tt-radius); font: inherit; font-size: 16px; font-weight: 500; line-height: 1.2; text-align: left; text-decoration: none; cursor: pointer; background: transparent; color: var(--tt-text); white-space: nowrap; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.btn[aria-disabled="true"]:hover { border-color: var(--tt-line-strong); color: var(--tt-text); background: var(--tt-surface); }
.tt-group > .btn[aria-disabled="true"]:hover { background: transparent; }
.btn-sm { min-height: 36px; padding: 0 10px; font-size: 14px; gap: 6px; }
.btn-primary { background: var(--tt-red); color: #fff; }
.btn-primary:hover:not(:disabled), .btn-primary:focus:not(:disabled), .btn-primary:focus-visible:not(:disabled) { background: var(--tt-green); color: #fff; text-decoration: none; }
.btn-brand { background: var(--tt-blue); color: #fff; }
.btn-brand:hover:not(:disabled) { background: var(--tt-blue-hover); }
.btn-secondary { background: var(--tt-surface); border-color: var(--tt-line-strong); color: var(--tt-text); }
.btn-secondary:hover:not(:disabled) { border-color: var(--tt-blue); color: var(--tt-blue); }
.btn-ghost { color: var(--tt-blue); padding: 0 8px; }
.btn-ghost:hover:not(:disabled) { background: var(--tt-blue-tint); }
.btn-link { display: inline; min-height: 0; padding: 0; border: 0; background: none; font: inherit; color: var(--tt-blue); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.btn-link:hover { color: var(--tt-blue-hover); }
.btn-icon { justify-content: center; width: 40px; padding: 0; }
.btn svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn[aria-pressed="true"] { background: var(--tt-blue); border-color: var(--tt-blue); color: #fff; }

/* Werkzeuggruppe auf der Karte */
.tt-group { display: flex; background: var(--tt-surface); border: 1px solid var(--tt-line-strong); border-radius: var(--tt-radius); box-shadow: var(--tt-shadow); overflow: hidden; }
.tt-group > .btn { box-sizing: border-box; border: 0; border-radius: 0; min-height: calc(var(--tt-control-height) - 2px); }
.tt-group > .btn-icon { width: calc(var(--tt-control-height) - 2px); }
.tt-group > .btn + .btn { border-left: 1px solid var(--tt-line); }
.tt-group.vertical { flex-direction: column; }
.tt-group.vertical > .btn + .btn { border-left: 0; border-top: 1px solid var(--tt-line); }
.map-tools { flex: 0 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.map-tools > .btn { flex: none; }

/* Formulare */
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.scale-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; align-items: stretch; }
.scale-zoom { min-width: 0; justify-content: center; padding-inline: 8px; white-space: normal; }
.format-options .seg-opt { flex-direction: column; gap: 2px; padding-block: 6px; line-height: 1.3; }
.format-price { font-variant-numeric: tabular-nums; }
.order-footer { flex: none; display: flex; align-items: center; gap: 12px; border-top: 1px solid var(--tt-line); padding: 8px 16px; background: var(--tt-surface); }
.order-price { display: flex; align-items: baseline; gap: 6px; min-width: max-content; flex: 1 0 auto; }
.legal-links { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.field > label, .label { font-size: 14px; color: var(--tt-muted); }
.input { box-sizing: border-box; width: 100%; height: 36px; min-height: 36px; padding: 0 10px; border: 1px solid var(--tt-line-strong); border-radius: var(--tt-radius); background: var(--tt-surface); color: var(--tt-text); font: inherit; font-size: 16px; }
.input:focus { border-color: var(--tt-blue); outline: 0; box-shadow: 0 0 0 1px var(--tt-blue); }
.input[aria-invalid="true"] { border-color: var(--tt-red); }
.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.check > input { margin-top: 2px; }
.error { font-size: 14px; color: var(--tt-red); }

/* Segmentierte Auswahl auf nativen Radios */
.seg { box-sizing: border-box; min-height: 36px; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); border: 1px solid var(--tt-line-strong); border-radius: var(--tt-radius); overflow: hidden; background: var(--tt-surface); }
.seg-opt { position: relative; display: flex; align-items: center; justify-content: center; min-height: 34px; padding: 0 6px; font-size: 14px; cursor: pointer; white-space: nowrap; }
.seg-opt + .seg-opt { border-left: 1px solid var(--tt-line); }
.seg-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg-opt:hover { background: var(--tt-hover); }
.seg-opt:has(input:checked) { background: var(--tt-blue); color: #fff; font-weight: 500; }
.seg-opt:has(input:focus-visible) { outline: 2px solid var(--tt-blue); outline-offset: -4px; box-shadow: inset 0 0 0 3px #fff; }
.seg-opt:has(input:disabled) { opacity: .45; cursor: not-allowed; }

/* Definitionszeilen */
.kv { display: grid; grid-template-columns: minmax(96px, 36%) minmax(0, 1fr); column-gap: 0; }
.kv > dt, .kv > .k { padding: 8px 12px 8px 0; border-bottom: 1px solid var(--tt-line); font-size: 14px; color: var(--tt-muted); line-height: 1.6; }
.kv > dd, .kv > .v { padding: 8px 0; border-bottom: 1px solid var(--tt-line); font-size: 16px; min-width: 0; overflow-wrap: anywhere; }
.kv > .v.num { font-variant-numeric: tabular-nums; }

.muted { font-size: 14px; color: var(--tt-muted); }
.small { font-size: 14px; }
.section { display: flex; flex-direction: column; gap: 12px; padding: 16px; }
.section + .section { border-top: 1px solid var(--tt-line); }
.note { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; background: var(--tt-bg); border-radius: var(--tt-radius); font-size: 14px; }
.note svg { width: 16px; height: 16px; flex: none; margin-top: 2px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.account-card { display: flex; flex-direction: column; gap: 12px; min-width: 0; background: var(--tt-surface); border: 1px solid var(--tt-line); border-radius: var(--tt-radius); padding: 16px; }
.account-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* Tabellen */
.table { width: 100%; border-collapse: collapse; font-size: 16px; }
.table th { text-align: left; font-size: 14px; font-weight: 500; color: var(--tt-muted); padding: 8px 12px 8px 0; border-bottom: 1px solid var(--tt-line-strong); white-space: nowrap; }
.table td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--tt-line); vertical-align: top; }

/* Dialoge */
.dialog-backdrop { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(30, 34, 36, .45); }
.dialog { box-sizing: border-box; display: flex; flex-direction: column; gap: 16px; padding: 24px; background: var(--tt-surface); border-radius: var(--tt-radius); box-shadow: var(--tt-shadow-lg); outline: 0; }
.dialog-title { font-size: 20px; font-weight: 500; line-height: 1.35; }
.dialog-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding-top: 4px; }
.checkout-summary { grid-template-columns: minmax(130px, 24%) minmax(0, 1fr); }
.checkout-summary > dt, .checkout-summary > dd { padding-block: 6px; }
.checkout-price { flex: none; border-top: 1px solid var(--tt-line); }
.checkout-price > dt, .checkout-price > dd { padding-block: 4px; }
.download-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--tt-line); flex-wrap: wrap; }
.download-label { display: flex; flex-direction: column; flex: 1; min-width: 0; }
@media (max-width: 759px) {
  .checkout-summary { grid-template-columns: minmax(96px, 32%) minmax(0, 1fr); }
  .download-label { flex-basis: calc(100% - 32px); }
  .download-row > .btn { margin-left: 32px; }
}

/* Touch: größere Ziele nur bei grobem Zeiger, Desktop bleibt kompakt (36 px). */
@media (pointer: coarse) {
  :root { --tt-control-height: 44px; }
  .input { height: 44px; min-height: 44px; }
  .seg { min-height: 44px; }
  .seg-opt { min-height: 42px; }
  .btn-sm { min-height: 44px; }
  .tt-group > .btn { min-height: 44px; }
  .tt-group > .btn-icon { width: 44px; }
}
