/*
 * Lattenzaun: accent and rules of this tool only; the shared look is in
 * common/css/base.css.
 */

:root {
  --tool-accent: #1f5135;
  --tool-accent-soft: #e7f0ea;
  --tool-accent-dark: #8fcaa5;
  --tool-accent-soft-dark: #16281d;
  --tool-on-accent-dark: #0b1f13;
}

/* ---------- Sidebar ---------- */

/* Distribution: the field of the chosen mode sits right under its toggle */
.lbl + .seg { margin-top: -4px; }
.row[hidden] { display: none; }
/* Ansicht from the front or the back: one button, pressed for the back */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  align-self: center;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  color: var(--muted);
  cursor: pointer;
}
.btn-icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.btn-icon:hover { border-color: var(--muted); color: var(--text); }
.btn-icon[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.btn-icon:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Sections as tabs, under the Gesamtlänge */
/* One section shows at a time: it ends at the panel padding, as the inputs do on the right */
[role="tabpanel"] { padding-bottom: 0; }
.tabs { display: flex; border-bottom: 1px solid var(--border); margin-top: 2px; }
.tab {
  position: relative;
  flex: 1 1 auto;
  padding: 8px 4px 9px;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: none;
  font: inherit;
  font-size: 13.5px;
  color: var(--muted);
  cursor: pointer;
}
.tab:hover:not(:disabled) { color: var(--text); }
.tab[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.tab:disabled { opacity: 0.4; cursor: default; }
.tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 4px 4px 0 0; }
/* A section with an invalid field */
.tab.invalid::after { content: ""; position: absolute; top: 6px; right: 2px; width: 6px; height: 6px; border-radius: 50%; background: var(--err); }

/* Parts highlighted from the tabs: slightly darker, the drawing otherwise unchanged */
.paper path[class^="part-"] { transition: filter 0.15s; }
main[data-hl="latte"] .paper path.part-latte,
main[data-hl="post"] .paper path.part-post,
main[data-hl="riegel"] .paper path.part-riegel { filter: brightness(0.86); }
@media (prefers-reduced-motion: reduce) { .paper path[class^="part-"] { transition: none; } }

/* A select in place of a label: reads like the label, with a small chevron */
select.label-select {
  -webkit-appearance: none;
  appearance: none;
  width: auto;
  border: 0;
  padding: 4px 18px 4px 0;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1.5 1 5 4.5 8.5 1' fill='none' stroke='%236b645c' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") right 4px center / 10px 6px no-repeat;
  cursor: pointer;
}
/* Only one choice left (Riegel: Höher um): a plain label */
select.label-select:has(option:disabled) { background-image: none; padding-right: 0; pointer-events: none; }

/* Label above a select whose options are too long to share the line */
.row-stack { flex-direction: column; align-items: stretch; gap: 4px; }
.row-stack select { width: 100%; }
/* Connections: one group per joint */
.lbl.sub-title { font-weight: 600; }
.lbl.sub-title ~ .lbl.sub-title { margin-top: 8px; }
/* Post base: a small sketch above each name */
.seg-icons span { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px 5px; font-size: 12.5px; }
.seg-icons svg { width: 36px; height: 36px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; }
.seg-icons .ground { stroke-width: 1; opacity: 0.5; }
.seg-icons .conc { fill: currentColor; fill-opacity: 0.1; stroke: none; }
.seg-icons .post { fill: currentColor; fill-opacity: 0.18; stroke-width: 1.2; }
.seg-icons .steel { stroke-width: 1.8; }
.seg-icons .rail { stroke-width: 1.4; }
.seg-icons input:checked + span .post { fill: var(--accent); fill-opacity: 0.25; }
/* Latten tops: lower icons, the Latte open at the bottom (cut off) */
.seg-low svg { height: 22px; }
.seg-low .mirror svg { transform: scaleX(-1); }

/* ---------- Tables ---------- */

/* Status chips sit close under the Ansicht */
.status { margin-top: -24px; }

/* Position lists are long: tighter rows with fainter lines */
table.vals tr.pos td { padding: 3px 0; border-bottom-color: color-mix(in srgb, var(--border) 50%, transparent); }

/* ---------- Print ---------- */

@media print {
  .print-page table.vals tr.pos td { padding: 1.5pt 0; }
}
