/* Artbox sales tools — Artboxkalkylen (seller) and Artboxförslag (customer),
   docs/ARTBOX.md. Tokens only (docs/DESIGN.md). The plan SVG is styled here:
   the CSP's style-src 'self' forbids inline style attributes, so the Go view
   model emits class names and this file maps them onto the palette —
   projection strips are the accent (the light source IS the accent),
   furniture is text at reduced opacity, PA/stage/tech are muted outlines. */

/* ---------------------------------------------------------------- layout */
.main-wide { max-width: 80rem; }

/* ---------------------------------------------------------------- inputs */
.kalkylator { margin-top: 1.5rem; }
.indata {
  border-top: 1px solid var(--labs-line);
  border-bottom: 1px solid var(--labs-line);
  padding: 1.75rem 0 1.5rem;
}
.indata fieldset, .skapa {
  border: 0;
  padding: 0;
  margin: 0 0 1.75rem;
  min-width: 0;
}
.indata fieldset:last-of-type { margin-bottom: 0; }
.indata legend, .skapa legend {
  font-family: var(--labs-font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--labs-muted);
  padding: 0;
  margin-bottom: 0.75rem;
}
.rakna-om { margin-top: 1.5rem; }

/* Segmented radios: the input stays in the accessibility tree and focusable
   but invisible; the sibling span is the pill. */
.seg { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.seg-opt {
  position: relative;
  display: inline-flex;
  margin: 0;
  font-size: 0.95rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: inherit;
}
.seg-opt input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  pointer-events: none;
}
.seg-opt span {
  display: inline-block;
  padding: 0.6rem 1.1rem;
  border: 1px solid var(--labs-line);
  border-radius: var(--labs-radius);
  color: var(--labs-muted);
  cursor: pointer;
  transition: border-color 150ms ease-out, color 150ms ease-out, background-color 150ms ease-out;
}
.seg-opt span:hover { color: var(--labs-text); border-color: var(--labs-muted); }
.seg-opt input:checked + span {
  background: var(--labs-signal);
  color: var(--labs-signal-ink);
  border-color: var(--labs-signal);
  font-weight: 600;
}
.seg-opt input:focus-visible + span {
  outline: 2px solid var(--labs-signal);
  outline-offset: 3px;
}

/* Guest row: the big number follows the slider through the oob swap. */
.gastrad { display: flex; align-items: flex-end; gap: 1.75rem; flex-wrap: wrap; }
#gastsiffra {
  display: block;
  font-family: var(--labs-font-display);
  font-weight: 700;
  font-size: 3rem;
  line-height: 0.9;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  min-width: 4ch; /* up to 1 000 guests without moving the slider */
}
.reglage { flex: 1; min-width: 16rem; }
input[type="range"] {
  width: 100%;
  margin: 0;
  accent-color: var(--labs-signal);
}
.skala {
  display: flex;
  justify-content: space-between;
  font-family: var(--labs-font-mono);
  font-size: 11px;
  color: var(--labs-muted);
  margin-top: 0.5rem;
}

/* Create fieldset. */
.skapa {
  border-top: 1px solid var(--labs-line);
  padding-top: 1.5rem;
  margin-top: 2rem;
  max-width: 44rem;
}
textarea {
  width: 100%;
  padding: 0.55rem 0.7rem;
  background: var(--labs-bg);
  border: 1px solid var(--labs-line);
  border-radius: var(--labs-radius);
  color: var(--labs-text);
  font: inherit;
  resize: vertical;
  transition: border-color 150ms ease-out;
}
textarea:focus-visible { outline-offset: 1px; border-color: var(--labs-signal); }
.hjalp { font-size: 0.8rem; margin: 0.3rem 0 0; }
.skapa-hjalp { font-size: 0.85rem; margin: 0.5rem 0 0; max-width: 40rem; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary:disabled:hover { background: var(--labs-signal); }

/* ---------------------------------------------------------------- result */
.kalkyl-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--labs-line);
}
.kalkyl-grid .section-label { margin-top: 1.5rem; }
@media (max-width: 900px) {
  .kalkyl-grid { grid-template-columns: 1fr; }
}

/* The plan SVG. */
svg.plan {
  width: 100%;
  height: auto;
  display: block;
  background: var(--labs-surface);
  border: 1px solid var(--labs-line);
}
.plan-room { fill: none; stroke: var(--labs-line); stroke-width: 1; }
.plan-dim, .plan-label, .plan-label--small {
  fill: var(--labs-muted);
  font-family: var(--labs-font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
}
.plan-label--small { font-size: 9px; }
.plan-proj { fill: var(--labs-signal); opacity: 0.8; }
.plan-proj-spill { fill: var(--labs-signal); opacity: 0.05; }
.plan-stage, .plan-stage--offert { fill: none; stroke: var(--labs-muted); stroke-width: 1; }
.plan-pa { fill: var(--labs-muted); }
.plan-pa--sub { opacity: 0.55; }
.plan-pa-line { stroke: var(--labs-muted); stroke-width: 1; stroke-dasharray: 2 2; }
.plan-pa-hang { fill: none; stroke: var(--labs-muted); stroke-width: 1; }
.plan-table { fill: none; stroke: var(--labs-text); stroke-width: 1.15; opacity: 0.66; }
.plan-chair { fill: var(--labs-text); opacity: 0.42; }
.plan-tech { fill: none; stroke: var(--labs-muted); stroke-width: 1; }

/* Select-and-delete in the seller's plan (src/islands/artboxkalkylen) —
   scoped to the calculator's #kalkyl; the customer page shares .planruta.
   The tables are unfilled, so pointer-events: all makes the whole disc
   clickable. touch-action stays default: a swipe over the plan scrolls. */
#kalkyl svg.plan { user-select: none; }
#kalkyl .plan [data-slot] { cursor: pointer; pointer-events: all; }
.plan-removed { fill: none; stroke: var(--labs-muted); stroke-width: 1; stroke-dasharray: 3 3; opacity: 0.6; }
.plan-table.is-selected, .plan-removed.is-selected {
  fill: var(--labs-signal);
  fill-opacity: 0.25;
  stroke: var(--labs-signal);
  opacity: 1;
}
.plan-marquee { fill: var(--labs-signal); fill-opacity: 0.08; stroke: var(--labs-signal); stroke-width: 1; stroke-dasharray: 4 3; }
.plan-hjalp { font-size: 12px; margin: 0.6rem 0 0; }
.plan-ta-bort { margin-top: 0.5rem; }
.plan-ta-bort[hidden] { display: none; } /* .btn's display would beat [hidden] */

.plan-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.9rem;
  font-family: var(--labs-font-mono);
  font-size: 11px;
  color: var(--labs-muted);
}
.plan-legend i {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 6px;
  vertical-align: middle;
  font-style: normal;
}
.plan-legend i.plan-proj { background: var(--labs-signal); opacity: 1; }
.plan-legend i.plan-pa { background: var(--labs-muted); }
.plan-legend i.plan-table { background: var(--labs-text); opacity: 1; }
.plan-legend i.plan-stage { border: 1px solid var(--labs-muted); }
.plan-notice {
  font-family: var(--labs-font-mono);
  font-size: 11px;
  color: var(--labs-muted);
  text-align: right;
  margin: 0.6rem 0 0;
}
.plan-notice--over { color: var(--labs-warn); }

/* Price and package. */
.pris {
  border-top: 1px solid var(--labs-line);
  border-bottom: 1px solid var(--labs-line);
  padding: 1.1rem 0;
  margin: 0 0 1.5rem;
}
.pris p { margin: 0; }
.pris .micro-label { margin: 0.4rem 0 0; }
.pris-siffra {
  font-family: var(--labs-font-mono);
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--labs-text);
}
.pris .pris-inkl {
  font-family: var(--labs-font-mono);
  font-size: 12px;
  color: var(--labs-muted);
  margin-top: 0.3rem;
}
.pris-panel { max-width: 44rem; margin-top: 1rem; }

.paket-namn { font-size: 1.6rem; margin: 0 0 0.3rem; }
.paket-rad { color: var(--labs-muted); margin: 0 0 1.25rem; }
.paket-grupp { margin-bottom: 1.25rem; }
.paket-grupp .micro-label { margin-bottom: 0.4rem; }
.paket-grupp ul { list-style: none; margin: 0; padding: 0; }
.paket-grupp li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--labs-line);
  font-size: 0.92rem;
}
.paket-grupp li:last-child { border-bottom: 0; }
.paket-grupp span.spec {
  font-family: var(--labs-font-mono);
  font-size: 12px;
  color: var(--labs-muted);
  text-align: right;
}
.paket-grupp li.ingar span.spec { color: var(--labs-signal); }
.paket-grupp p { font-size: 0.92rem; margin: 0 0 0.6rem; }

/* Admin-only Kalkylunderlag. */
.kalkylunderlag { margin-top: 1.5rem; }
.kalkyl-tabell {
  width: 100%;
  max-width: 34rem;
  border-collapse: collapse;
  font-family: var(--labs-font-mono);
  font-size: 13px;
  margin-top: 0.75rem;
}
.kalkyl-tabell td { padding: 0.45rem 0; border-bottom: 1px solid var(--labs-line); }
.kalkyl-tabell td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.kalkyl-tabell tr.sum td {
  border-top: 1px solid var(--labs-muted);
  font-weight: 500;
  padding-top: 0.7rem;
}

/* ---------------------------------------------------------------- proposals */
.forslag-sektion { margin-top: 2rem; }
.alternativ { display: flex; flex-direction: column; gap: 0.4rem; }
.alternativ .check { margin: 0; font-size: 0.9rem; }
.forslag-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin: 0 0 1rem;
}
.forslag-filter .check { margin: 0; font-size: 0.9rem; }
.forslag-filter .btn { margin-top: 0; }
.forslag-sok {
  min-width: 16rem;
  padding: 0.35rem 0.6rem;
  background: var(--labs-bg);
  border: 1px solid var(--labs-line);
  border-radius: var(--labs-radius);
  color: var(--labs-text);
}
.forslag-rensa { font-size: 0.85rem; color: var(--labs-muted); }
.forslag-tabell { overflow-x: auto; }
.forslag-tabell table.data { min-width: 60rem; }
.forslag-url { width: 100%; min-width: 14rem; font-size: 0.8rem; }
.forslag-lankar {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
  margin: 0.35rem 0 0;
}
table.data tr.muted td { color: var(--labs-muted); }
.aterkalla .btn-small { margin-top: 0; }
.aterkalla small { display: block; font-size: 0.75rem; margin-top: 0.3rem; max-width: 14rem; }

/* ---------------------------------------------------------------- customer page */
.forslag-not {
  border-left: 2px solid var(--labs-line);
  margin: 1rem 0;
  padding: 0.2rem 1rem;
  color: var(--labs-muted);
  white-space: pre-line;
}
.cta {
  max-width: 44rem;
  margin: 2.5rem 0;
  padding: 1.5rem;
  background: var(--labs-surface);
  border: 1px solid var(--labs-line);
  border-radius: var(--labs-radius);
}
.cta .btn { margin-top: 0; }
.cta p { margin: 1rem 0 0; font-size: 0.95rem; }
.forslag-avsnitt {
  padding: 2.25rem 0;
  border-top: 1px solid var(--labs-line);
}
.forslag-avsnitt h2 { margin-bottom: 1.25rem; }
.tvakol { display: grid; grid-template-columns: 1fr 1fr; gap: 2.75rem; }
.tillval { list-style: none; margin: 0; padding: 0; }
.tillval li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--labs-line);
  font-size: 0.95rem;
}
.tillval b {
  font-family: var(--labs-font-mono);
  font-weight: 500;
  font-size: 13px;
  color: var(--labs-muted);
  white-space: nowrap;
}
.brodtext p { color: var(--labs-muted); font-size: 0.95rem; margin: 0 0 0.9rem; }
.brodtext p:last-child { margin-bottom: 0; }
.brodtext-2 { columns: 2; column-gap: 2.75rem; }
.brodtext-2 p { break-inside: avoid; }
.nasta-steg p { max-width: 44rem; }
.forslag-fot {
  font-family: var(--labs-font-mono);
  font-size: 11px;
  color: var(--labs-muted);
  margin: 2rem 0 0;
}
@media (max-width: 900px) {
  .tvakol { grid-template-columns: 1fr; gap: 2rem; }
  .brodtext-2 { columns: 1; }
}
