/* Antennenberechnung – technisches Arbeitsblatt-Layout */
:root {
  --paper: #f6f4ef;
  --card: #ffffff;
  --ink: #1f2933;
  --ink-2: #52606d;
  --line: #d9dde1;
  --line-2: #e9ecef;
  --accent: #b03a2e;      /* Sicherheitsbereich */
  --accent-2: #1e7d4f;    /* kontrollierbarer Bereich */
  --blue: #2c7fb8;
  --violet: #8e44ad;
  --warn-bg: #fdf3e6;
  --warn-line: #e0a458;
  --ok: #1e7d4f;
  --bad: #b03a2e;
  --radius: 6px;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "DejaVu Sans Mono", Menlo, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #15191d; --card: #1d2227; --ink: #e6e9ec; --ink-2: #a0aab4; --line: #333b43; --line-2: #2a3138;
    --warn-bg: #3a2c16; --warn-line: #a8743a;
  }
}

* { box-sizing: border-box; }
html { font-size: 15px; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); line-height: 1.45; font-variant-numeric: tabular-nums; }
a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); text-underline-offset: 2px; }
a:hover { color: var(--accent); }
h1 { font-size: 1.6rem; margin: 0 0 .2rem; letter-spacing: -.01em; }
h2 { font-size: 1.12rem; margin: 0 0 .8rem; }
h3 { font-size: 1rem; margin: 1rem 0 .5rem; }
code, .mono { font-family: var(--mono); font-size: .86em; }
pre { white-space: pre-wrap; overflow-x: auto; }

/* Kopfzeile */
.topbar { display: flex; align-items: center; gap: 1.5rem; padding: .7rem 1.2rem; background: var(--ink); color: #f6f4ef; flex-wrap: wrap; }
.topbar a { color: inherit; text-decoration: none; }
.brand { display: flex; align-items: center; gap: .5rem; font-weight: 700; letter-spacing: .01em; }
.brand svg { color: #e86b5c; }
.mainnav { display: flex; gap: 1.1rem; flex: 1; flex-wrap: wrap; }
.mainnav a { opacity: .85; font-size: .95rem; }
.mainnav a:hover { opacity: 1; color: #fff; }
.userbox { display: flex; gap: .8rem; align-items: center; font-size: .9rem; }
.userbox form { margin: 0; }
.linkbtn { background: none; border: 0; color: inherit; cursor: pointer; font: inherit; opacity: .75; padding: 0; }
.linkbtn:hover { opacity: 1; text-decoration: underline; }

.page { max-width: 1320px; margin: 0 auto; padding: 1.4rem 1rem 3rem; }
.foot { max-width: 1320px; margin: 0 auto; padding: 1rem; font-size: .8rem; color: var(--ink-2); border-top: 1px solid var(--line); }

/* Karten und Layout */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; margin-bottom: 1rem; min-width: 0; }
.card.narrow { max-width: 440px; margin: 3rem auto; }
.card.subtle { background: transparent; border-style: dashed; }
.card.danger { border-color: color-mix(in srgb, var(--bad) 30%, var(--line)); }
.card.empty ol.flow { line-height: 1.9; }
.split { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.cards3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.pagehead, .projhead { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.eyebrow { font-family: var(--mono); font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.prose { max-width: 860px; }
.prose .formula { font-family: var(--mono); background: var(--line-2); padding: .5rem .8rem; border-radius: 4px; display: inline-block; }

/* Schritte */
.steps { display: flex; gap: 0; margin-bottom: 1.2rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); overflow-x: auto; }
.steps a { flex: 1; padding: .6rem .8rem; text-decoration: none; white-space: nowrap; font-size: .92rem; display: flex; align-items: center; gap: .45rem; border-right: 1px solid var(--line-2); color: var(--ink-2); }
.steps a:last-child { border-right: 0; }
.steps a .n { font-family: var(--mono); font-size: .75rem; width: 1.4rem; height: 1.4rem; border-radius: 50%; border: 1px solid currentColor; display: inline-flex; align-items: center; justify-content: center; }
.steps a.active { color: var(--ink); font-weight: 600; background: color-mix(in srgb, var(--accent) 7%, transparent); box-shadow: inset 0 -3px 0 var(--accent); }
.steps a.active .n { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Formulare */
.form { display: grid; gap: .75rem; }
.form.cols { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; display: grid; }
.form.cols .card { margin: 0; display: grid; gap: .75rem; align-content: start; }
.form.cols3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; }
.formactions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; grid-column: 1 / -1; }
label { display: grid; gap: .25rem; font-size: .88rem; font-weight: 500; }
label.check { display: flex; gap: .5rem; align-items: center; font-weight: 400; }
input, select, textarea { font: inherit; font-size: .95rem; padding: .45rem .55rem; border: 1px solid var(--line); border-radius: 4px; background: var(--card); color: var(--ink); width: 100%; min-width: 0; }
input[type=checkbox], input[type=radio] { width: auto; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--blue) 50%, transparent); outline-offset: 0; border-color: var(--blue); }
input[readonly] { background: var(--line-2); }
select[size] { padding: .2rem; }
textarea.mono { font-family: var(--mono); font-size: .85rem; }
input.upper { text-transform: uppercase; }
input.w6 { width: 6rem; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem .9rem; margin: 0; display: grid; gap: .7rem; align-content: start; min-width: 0; }
legend { font-weight: 600; padding: 0 .3rem; font-size: .92rem; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .7rem; }
.radios { display: flex; gap: 1rem; flex-wrap: wrap; }
.radios label { display: flex; align-items: center; gap: .35rem; font-weight: 400; }
.inline { display: inline-flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin: 0; }
form.inline { display: inline-flex; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .3rem; padding: .45rem .9rem; border-radius: 4px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-size: .92rem; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--ink-2); color: var(--ink); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn.primary:hover { background: color-mix(in srgb, var(--ink) 85%, var(--accent)); }
.btn.warn { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.btn.warn:hover { background: var(--bad); color: #fff; }
.btn.small { padding: .2rem .5rem; font-size: .82rem; }
.btn.block { width: 100%; margin-bottom: .4rem; }

/* Tabellen */
table.grid { border-collapse: collapse; width: 100%; font-size: .9rem; background: var(--card); }
table.grid th, table.grid td { border-bottom: 1px solid var(--line-2); padding: .5rem .55rem; text-align: left; vertical-align: top; }
table.grid thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); border-bottom: 1px solid var(--line); font-weight: 600; }
table.grid.compact th, table.grid.compact td { padding: .35rem .5rem; }
table.grid td.num, table.grid th.num { text-align: right; font-family: var(--mono); font-size: .86rem; white-space: nowrap; }
table.grid tr.sel td, table.grid th.sel { background: color-mix(in srgb, var(--blue) 9%, transparent); }
table.grid tr.hl td { background: color-mix(in srgb, var(--accent) 8%, transparent); }
table.grid th.inactive { opacity: .45; text-decoration: line-through; }
table.matrix th.rowhead { text-transform: none; letter-spacing: 0; font-size: .85rem; color: var(--ink-2); font-weight: 500; white-space: nowrap; background: var(--line-2); border-right: 1px solid var(--line); position: sticky; left: 0; }
table.matrix thead th { text-align: right; font-family: var(--mono); font-size: .9rem; color: var(--ink); }
table.matrix td { min-width: 9rem; }
.actions-cell { white-space: nowrap; text-align: right; }
.hscroll { overflow-x: auto; margin-bottom: .8rem; }
.right { text-align: right; }

/* Kennzahlen */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.kpi { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--ink); border-radius: var(--radius); padding: .8rem 1rem; }
.kpi .k { font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); }
.kpi .v { font-family: var(--mono); font-size: 1.45rem; font-weight: 600; margin: .15rem 0; }
.kpi .s { font-size: .82rem; }

/* Meldungen */
.flash { padding: .6rem .9rem; border-radius: var(--radius); margin-bottom: .7rem; border: 1px solid; font-size: .92rem; }
.flash-success { background: color-mix(in srgb, var(--ok) 10%, var(--card)); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.flash-error { background: color-mix(in srgb, var(--bad) 10%, var(--card)); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.flash-warn { background: var(--warn-bg); border-color: var(--warn-line); }
.flash-info { background: color-mix(in srgb, var(--blue) 8%, var(--card)); border-color: color-mix(in srgb, var(--blue) 35%, transparent); }
.errormsg { background: var(--line-2); padding: .8rem; border-radius: 4px; font-family: var(--mono); font-size: .8rem; }
.muted { color: var(--ink-2); }
.small { font-size: .82rem; }
.oktext { color: var(--ok); }
.warntext { color: var(--bad); }
.tag { display: inline-block; font-size: .7rem; padding: .05rem .4rem; border-radius: 10px; background: color-mix(in srgb, var(--blue) 14%, transparent); color: var(--ink); font-weight: 500; }
.tag.neutral { background: var(--line-2); }
.dl { display: grid; grid-template-columns: auto 1fr; gap: .3rem 1rem; }
.dl dt { color: var(--ink-2); }
.dl dd { margin: 0; }

/* Seitenansichten, Diagramme */
.sides { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 1rem; }
.sides figure { margin: 0; border: 1px solid var(--line-2); border-radius: 4px; padding: .5rem; background: #fff; }
.sides figcaption { font-size: .82rem; margin-bottom: .3rem; color: #1f2933; }
.sides svg { width: 100%; height: auto; display: block; }
.bandrow { border-top: 1px solid var(--line-2); padding: .6rem 0; }
.bandrow.sel { background: color-mix(in srgb, var(--blue) 6%, transparent); }
.bandhead { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.bandhead .right { margin-left: auto; }
.patterns { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: .4rem; }
.patterns svg { background: #fff; border: 1px solid var(--line-2); border-radius: 4px; }
details.card > summary { cursor: pointer; list-style: none; }
details.card > summary h2 { display: inline; }
details.card > summary::before { content: "▸ "; }
details.card[open] > summary::before { content: "▾ "; }
.calc { border-top: 1px solid var(--line-2); padding-top: .4rem; font-family: var(--mono); font-size: .82rem; }
.calc h3 { font-family: var(--sans); }

/* Karte */
.mapwrap { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1rem; align-items: start; }
#map { height: 72vh; min-height: 460px; border: 1px solid var(--line); border-radius: var(--radius); }
#map.crosshair { cursor: crosshair; }
.mappanel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem; max-height: 72vh; overflow-y: auto; }
.panelblock { border-bottom: 1px solid var(--line-2); padding: .6rem 0; }
.panelblock:last-child { border-bottom: 0; }
.panelblock h3 { margin: 0 0 .5rem; font-size: .9rem; }
.chk { padding: .35rem 0; border-bottom: 1px dotted var(--line-2); }
.legend div { display: flex; align-items: center; gap: .5rem; margin: .2rem 0; }
.sw { display: inline-block; width: 22px; height: 12px; border-radius: 2px; border: 2px solid; }
.sw.area { border-color: var(--accent-2); background: color-mix(in srgb, var(--accent-2) 12%, transparent); }
.sw.zone { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 22%, transparent); }
.sw.zone0 { border-color: var(--accent); border-style: dotted; }
.sw.implant { border-color: var(--violet); border-style: dashed; }
.sw.group { border-color: #d35400; border-style: dashed; }
.antpin span, .refpin span { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; border-radius: 50%; font: 700 11px/1 var(--sans); }
.antpin span { background: #1f2933; color: #fff; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.refpin span { color: #1e7d4f; font-size: 22px; text-shadow: 0 0 3px #fff, 0 0 3px #fff; }

@media (max-width: 960px) {
  .split, .form.cols, .cards3, .mapwrap { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sides { grid-template-columns: 1fr; }
  #map { height: 60vh; }
  .mappanel { max-height: none; }
}
@media (max-width: 560px) {
  .row2, .row3 { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: 1fr; }
  .page { padding: 1rem 16px 2rem; }
}

.badge { display: inline-block; min-width: 1.2em; padding: 0 .35em; border-radius: 9px; background: #e86b5c; color: #fff; font-size: .72rem; font-weight: 700; text-align: center; }
.flash-warn, .flash-info { }

/* Bemaßung in der Karte */
.dimlabel { background: none; border: 0; }
.dimlabel span { display: inline-block; transform: translate(-50%, -50%); white-space: nowrap; font: 600 11px/1.2 var(--sans); padding: 1px 5px; border-radius: 3px; background: rgba(255,255,255,.92); border: 1px solid currentColor; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.dimlabel.radius span { color: #c0392b; }
.dimlabel.boundary span { color: #2c7fb8; }
.dimlabel.ok span, .dimlabel.edge span { color: #1e7d4f; }
.dimlabel.bad span { color: #b03a2e; }
.dimlabel.edge span { font-weight: 500; }
.plan { margin: .8rem 0; background: #fff; border: 1px solid var(--line-2); border-radius: 4px; padding: .4rem; }
.plan svg { width: 100%; height: auto; display: block; }

/* Startseite */
.hero { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 2rem; align-items: start; padding: 1.5rem 0 2rem; }
.hero h1 { font-size: clamp(1.6rem, 3.2vw, 2.4rem); line-height: 1.15; letter-spacing: -.02em; margin: .4rem 0 1rem; max-width: 22ch; }
.hero .lead { font-size: 1.05rem; color: var(--ink-2); max-width: 60ch; }
.hero-points { list-style: none; padding: 0; margin: 1.2rem 0 0; display: grid; gap: .45rem; }
.hero-points li { padding-left: 1.6rem; position: relative; }
.hero-points li::before { content: ""; position: absolute; left: 0; top: .45em; width: .9rem; height: .9rem; border-radius: 50%; border: 2px solid var(--accent); background: color-mix(in srgb, var(--accent) 18%, transparent); }
.hero-login { box-shadow: 0 10px 30px -18px rgba(31, 41, 51, .45); border-top: 4px solid var(--accent); }
.showcase { margin: 1rem 0 2rem; }
.showcase-head { margin-bottom: 1rem; }
.showcase-head h2 { font-size: 1.35rem; }
.showcase-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.demo-plan, .demo-sideview { margin: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem; }
.demo-plan svg, .demo-sideview svg { width: 100%; height: auto; display: block; }
.demo-plan figcaption, .demo-sideview figcaption { font-size: .82rem; color: #52606d; margin-top: .4rem; }
.demo-side { display: grid; gap: 1rem; }
.kpis-compact { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; }
.kpis-compact .kpi .v { font-size: 1.2rem; }
.kpi.ok { border-left-color: var(--ok); }
.examples { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 1rem; margin-bottom: 2rem; }
.example { position: relative; }
.example-tag { position: absolute; top: -.7rem; left: 1rem; background: var(--ink); color: var(--paper); font-family: var(--mono); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; padding: .15rem .5rem; border-radius: 3px; }
.mock-form { display: grid; gap: .6rem; pointer-events: none; }
.mock-form label { font-size: .82rem; }
.mock-input { border: 1px solid var(--line); border-radius: 4px; padding: .4rem .55rem; background: var(--line-2); font-weight: 400; font-size: .92rem; }
.mock-input.num { font-family: var(--mono); }
.mock-check { font-size: .88rem; }
table.matrix.mini td { min-width: 0; }
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.feature { border-top: 2px solid var(--ink); padding-top: .7rem; }
.feature h3 { margin: 0 0 .35rem; }
.feature p { margin: 0; color: var(--ink-2); font-size: .92rem; }
.center { text-align: center; }
@media (max-width: 960px) {
  .hero, .showcase-grid, .examples { grid-template-columns: 1fr; }
  .features { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .features, .kpis-compact { grid-template-columns: 1fr; }
}
