/*! © 2015–2026 YourWeb (yourweb.se). All rights reserved. Proprietary – see LICENSE.md */
/* Prisräknare (/verktyg/vad-kostar-en-hemsida/). Styles only this tool uses.
   Linked after /verktyg/verktyg.css.

   Contents
   01 Short answer, wide hero
   02 Calculator: steps, options, summary, phone chip
   03 Price table
   04 Wider screens
   05 Print */

/* ───────────────────────── 01 Short answer, wide hero ───────────────────────── */

.answer {
  max-width: 44rem;
  padding: 0.9rem 1rem;
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: rgb(var(--accent-rgb) / 0.08);
  color: var(--text);
  line-height: 1.55;
  text-wrap: pretty;
}

.answer strong {
  color: var(--accent);
}

.tool-hero--wide {
  padding-block: 0.9rem 1rem;
}

.tool-hero--wide .tool-hero__copy {
  gap: 0.7rem;
}

.tool-hero--wide .answer {
  font-size: 0.96rem;
}

/* ───────────────────────── 02 Calculator ───────────────────────── */

.calc {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
  padding-bottom: 1.5rem;
  scroll-margin-top: 0.75rem;
}

.calc__form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.85rem;
  min-width: 0;
}

.calc-step {
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.016)),
    var(--surface);
}

.calc-step__head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 2.75rem;
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  list-style: none;
}

summary.calc-step__head {
  cursor: pointer;
}

summary.calc-step__head::-webkit-details-marker {
  display: none;
}

summary.calc-step__head::after {
  flex: none;
  width: 0.6rem;
  height: 0.6rem;
  margin: 0 0.35rem 0.25rem 0.25rem;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  content: "";
  transform: rotate(45deg);
  transition: transform 200ms var(--ease-out);
}

details[open] > summary.calc-step__head::after {
  margin-bottom: -0.2rem;
  transform: rotate(-135deg);
}

.calc-step__no {
  display: grid;
  flex: none;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: rgb(var(--accent-rgb) / 0.16);
  color: var(--accent);
  font-size: 0.88rem;
  letter-spacing: 0;
}

.calc-step__count {
  margin-left: auto;
  color: var(--text-dim);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0;
  white-space: nowrap;
}

.calc-step__hint {
  margin: 0.3rem 0 0.85rem;
  color: var(--text-dim);
  font-size: 0.9rem;
}

.calc-options {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.5rem;
}

.calc-option {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 0.25rem 0.8rem;
  min-height: 3.5rem;
  padding: 0.8rem 0.85rem;
  border: 1.5px solid var(--line);
  border-radius: 0.95rem;
  background: var(--surface-sunken);
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease;
}

.calc-option:hover {
  border-color: rgba(255, 255, 255, 0.36);
}

.calc-option__input {
  position: absolute;
  top: 0.8rem;
  left: 0.85rem;
  width: 1.5rem;
  height: 1.5rem;
  margin: 0;
  opacity: 0;
}

.calc-option__mark {
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border: 2px solid var(--line-strong);
  border-radius: 0.45rem;
  transition: background 160ms ease, border-color 160ms ease;
}

.calc-option__mark::after {
  content: "";
  transform: scale(0);
  transition: transform 180ms var(--ease-out);
}

.calc-option__input[type="radio"] + .calc-option__mark {
  border-radius: 50%;
}

.calc-option__input[type="radio"] + .calc-option__mark::after {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: var(--accent);
}

.calc-option__input[type="checkbox"] + .calc-option__mark::after {
  width: 0.4rem;
  height: 0.75rem;
  margin-top: -0.15rem;
  border-right: 2.5px solid var(--ink-950);
  border-bottom: 2.5px solid var(--ink-950);
}

.calc-option__input:checked + .calc-option__mark {
  border-color: var(--accent);
}

.calc-option__input[type="checkbox"]:checked + .calc-option__mark {
  background: var(--accent);
}

.calc-option__input[type="radio"]:checked + .calc-option__mark::after {
  transform: scale(1);
}

.calc-option__input[type="checkbox"]:checked + .calc-option__mark::after {
  transform: rotate(45deg) scale(1);
}

.calc-option:has(.calc-option__input:checked) {
  border-color: var(--accent);
  background: rgb(var(--accent-rgb) / 0.09);
}

.calc-option:has(.calc-option__input:focus-visible) {
  outline: 3px solid var(--yellow-500);
  outline-offset: 2px;
}

.calc-option__name {
  padding-top: 0.1rem;
  font-weight: 800;
  line-height: 1.3;
}

.calc-option__price {
  padding-top: 0.1rem;
  font-weight: 800;
  line-height: 1.3;
  text-align: right;
  white-space: nowrap;
}

.calc-option__desc {
  grid-column: 2 / -1;
  color: var(--text-soft);
  font-size: 0.9rem;
  line-height: 1.45;
}

.calc-option__desc a {
  color: var(--text);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: rgb(var(--accent-rgb) / 0.75);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
  white-space: nowrap;
}

.calc-sum {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.9rem;
  align-content: start;
  padding: 1.15rem;
  border-color: rgb(var(--accent-rgb) / 0.4);
  scroll-margin-top: 0.75rem;
}

.calc-sum > div {
  display: grid;
  gap: 0.9rem;
}

.calc-sum__title {
  font-size: 1.35rem;
}

.calc-sum__empty {
  color: var(--text-soft);
}

.calc-lines {
  display: grid;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.calc-lines li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.9rem;
  padding: 0.2rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.94rem;
  line-height: 1.3;
}

.calc-lines a {
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: rgb(var(--accent-rgb) / 0.75);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
}

.calc-lines a:hover {
  color: var(--accent);
}

.calc-lines__price {
  font-weight: 800;
  white-space: nowrap;
}

.calc-lines__remove {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  margin-right: -0.6rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
}

.calc-lines__remove:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.calc-totals {
  display: grid;
  gap: 0.5rem;
  margin: 0;
}

.calc-totals > div {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.1rem 1rem;
}

.calc-totals dt {
  color: var(--text-soft);
  font-size: 0.92rem;
  font-weight: 700;
}

.calc-totals dd {
  margin: 0;
  color: var(--accent);
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.1;
  white-space: nowrap;
}

.calc-sum__vat,
.calc-sum__note {
  color: var(--text-dim);
  font-size: 0.84rem;
  line-height: 1.5;
}

.calc-sum__actions .btn--sm {
  flex: 1 1 auto;
}

.assure--wide {
  padding-bottom: 2.25rem;
}

/* Phones: the running sum sits in the same bottom row as the chat button, never on top of it. */
.calc-chip {
  position: fixed;
  right: 7.9rem;
  bottom: max(0.75rem, env(safe-area-inset-bottom));
  left: max(0.75rem, env(safe-area-inset-left));
  z-index: 7000;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.25rem 0.85rem;
  overflow: hidden;
  border: 1px solid rgb(var(--accent-rgb) / 0.65);
  border-radius: var(--radius-pill);
  background: var(--ink-850);
  box-shadow: 0 8px 24px rgba(0, 18, 34, 0.4);
  color: #fff;
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.15;
  text-decoration: none;
  white-space: nowrap;
}

.calc-chip__more {
  overflow: hidden;
  color: var(--text-dim);
  font-size: 0.78rem;
  font-weight: 700;
  text-overflow: ellipsis;
}

.calc-chip .icon {
  margin-left: auto;
  color: var(--accent);
}

body:has(#yc-withdraw) .calc-chip {
  left: calc(max(0.75rem, env(safe-area-inset-left)) + 3.25rem);
}

body.menu-open .calc-chip,
body:has(.yc-backdrop--visible) .calc-chip {
  display: none;
}

/* ───────────────────────── 03 Price table ───────────────────────── */

.table-wrap {
  overflow-x: auto;
}

.price-table {
  width: 100%;
  border-collapse: collapse;
  color: var(--text);
  font-size: 0.98rem;
  line-height: 1.35;
}

.price-table th,
.price-table td {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: baseline;
}

.price-table thead th {
  color: var(--text-dim);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.price-table tbody th {
  padding-right: 1rem;
  font-weight: 700;
}

.price-table td,
.price-table thead th:last-child {
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}

/* ───────────────────────── 04 Wider screens ───────────────────────── */

@media (min-width: 40rem) {
  .calc-step {
    padding: 1.25rem;
  }

  .calc-sum {
    padding: 1.5rem;
  }
}

@media (min-width: 64rem) {
  .calc {
    grid-template-columns: minmax(0, 1.55fr) minmax(19rem, 0.85fr);
    align-items: start;
    gap: 1.5rem;
    padding-bottom: 2rem;
  }

  /* Stays beside the choices; its height leaves the corner with the chat button free. */
  .calc-sum {
    position: sticky;
    top: 6.25rem;
    max-height: calc(100vh - 6.25rem - 8.25rem);
    max-height: calc(100dvh - 6.25rem - 8.25rem);
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .calc-chip {
    display: none;
  }

  .tool-hero--wide {
    padding-block: 2rem 1.5rem;
  }

  .tool-hero--wide .answer {
    font-size: 1.02rem;
  }

  .tool-hero--wide {
    align-items: center;
  }

  .tool-hero--wide .tool-hero__side .art {
    height: 12rem;
  }
}

/* ───────────────────────── 05 Print ───────────────────────── */

@media print {
  .calc-chip {
    display: none !important;
  }

  .calc-step,
  .calc-option,
  .answer {
    border-color: var(--line) !important;
    background: #fff !important;
    color: #000 !important;
  }
}
