/* Layout: one column like an itemised bill; step 1 upload, step 2 the bill's own "sammanställning" table, step 3 ranked plans with cost bars. */
:root {
  --bg: #EEF1F4; --paper: #FFFFFF; --ink: #15202B; --muted: #5B6875; --line: #D5DCE3;
  --accent: #2346C8; --mark-green: #3DDC84; --accent-soft: #E3E9FB; --good: #1C7F4A; --warn: #A15C00; --switch-off: #7D8996;
  --seg-fee: #3C4C5C; --seg-dom: #7B5BC4; --seg-intl: #D08A1E; --seg-roam: #1A8C8C;
  --display: "Bricolage Grotesque", "Avenir Next", "Noto Sans Arabic", system-ui, sans-serif;
  --body: "Source Sans 3", "Segoe UI", "Noto Sans Arabic", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #10161D; --paper: #18212B; --ink: #E7EDF3; --muted: #9AA8B6; --line: #2C3948;
  --accent: #8EA6FF; --mark-green: #1C7F4A; --accent-soft: #1F2A4A; --good: #5CC98E; --warn: #E8A84A; --switch-off: #6B7A8C;
  --seg-fee: #8C9DB0; --seg-dom: #A98BEA; --seg-intl: #E8A84A; --seg-roam: #4FC2C2; color-scheme: dark } }
:root[data-theme="dark"] {
  --bg: #10161D; --paper: #18212B; --ink: #E7EDF3; --muted: #9AA8B6; --line: #2C3948;
  --accent: #8EA6FF; --mark-green: #1C7F4A; --accent-soft: #1F2A4A; --good: #5CC98E; --warn: #E8A84A; --switch-off: #6B7A8C;
  --seg-fee: #8C9DB0; --seg-dom: #A98BEA; --seg-intl: #E8A84A; --seg-roam: #4FC2C2; color-scheme: dark }

* { box-sizing: border-box }
body { background: var(--bg); color: var(--ink); font: 16px/1.5 var(--body);
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 24px 64px }
.wrap { max-width: 860px; margin: 0 auto; display: grid; gap: 20px }
h1, h2 { font-family: var(--display); text-wrap: balance; margin: 0; letter-spacing: -0.01em }
h1 { font-size: clamp(30px, 6vw, 44px); line-height: 1.05 }
h2 { font-size: 22px; display: flex; gap: 10px; align-items: baseline }
.step { font: 500 13px var(--mono); color: var(--accent); letter-spacing: .06em }
.lead { color: var(--muted); max-width: 60ch; margin: 8px 0 0 }
/* the operator list behind "N operatörer" (DECISIONS #52); placed under the whole sentence so it fits on phones */
.lead { position: relative }
.opsbtn { all: unset; font-weight: 700; color: var(--ink); cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px }
.opsbtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px }
.opspop { display: none; position: absolute; z-index: 30; top: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  width: min(340px, calc(100vw - 32px)); padding: 14px 16px; text-align: start; columns: 2; column-gap: 16px;
  background: var(--paper); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .16); font-size: 14px }
.opspop::before { content: ""; position: absolute; left: 0; right: 0; top: -10px; height: 10px }  /* keeps hover while moving into the list */
.opswrap:hover .opspop, .opswrap.open .opspop, .opsbtn:focus-visible + .opspop { display: block }
.opspop > b { column-span: all; display: block; margin-bottom: 8px; font-size: 15px }
.opspop > span { display: block; break-inside: avoid; padding: 2px 0 }
.opspop small { color: var(--muted) }
.lead b { color: var(--ink); font-weight: 700 }  /* the counts stand out (DECISIONS #45) */
.tag-proto { display: inline-block; font: 500 12px var(--mono); letter-spacing: .06em; text-transform: uppercase;
  color: var(--warn); border: 1px solid currentColor; border-radius: 4px; padding: 1px 6px; margin-bottom: 10px }
section.card { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 20px; display: grid; gap: 14px; min-width: 0 }

[hidden] { display: none !important }

/* language switch */
header { position: relative }
.lang { direction: ltr; position: absolute; top: 0; right: 0 }
.lang button { all: unset; cursor: pointer }
.lang button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px }
.lang .flag { width: 22px; height: 22px; display: block; flex: none; border-radius: 50%; box-shadow: 0 0 0 1px var(--line) }
.lang .lang-now { display: flex; align-items: center; gap: 5px; padding: 3px 6px 3px 3px; border-radius: 999px; color: var(--muted) }
.lang .lang-now:hover, .lang .lang-now[aria-expanded="true"] { background: var(--paper); color: var(--ink) }
.lang .chev { width: 10px; height: 6px; transition: transform .15s }
.lang .lang-now[aria-expanded="true"] .chev { transform: rotate(180deg) }
.lang-menu { position: absolute; top: calc(100% + 6px); right: 0; z-index: 20; display: flex; flex-direction: column; padding: 4px; min-width: 140px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .16) }
.lang-menu[hidden] { display: none }
.lang .lang-menu button { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 7px; font-size: 15px; white-space: nowrap }
.lang .lang-menu button:hover { background: var(--accent-soft) }
.lang .lang-menu button[aria-pressed="true"] { display: none }

/* stepper: one step is shown at a time */
.stepper { list-style: none; margin: 0; padding: 0; display: flex; justify-content: center; align-items: center; gap: 8px }
.stepper li { display: flex; align-items: center; gap: 8px }
.stepper li + li::before { content: ""; width: 28px; height: 1px; background: var(--line) }
.stepper button { all: unset; display: flex; align-items: center; gap: 8px; font: 600 14px var(--body); color: var(--muted); padding: 6px 2px; cursor: pointer; border-radius: 6px }
.stepper button:disabled { cursor: default; opacity: .6 }
.stepper button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px }
.stepper .n { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; font: 500 13px var(--mono) }
.stepper .done .n { border-color: var(--accent); color: var(--accent) }
.stepper [aria-current="step"] { color: var(--ink) }
.stepper [aria-current="step"] .n { background: var(--accent); border-color: var(--accent); color: var(--paper) }
@media (max-width: 480px) { .stepper button:not([aria-current="step"]) .lbl { display: none } }
.step { display: none }
.wrap:not(.start) header .lead, .wrap:not(.start) .tag-proto { display: none }
.wrap:not(.start) h1 { font-size: 24px }
.logo { display: flex; align-items: center; gap: .32em; font-weight: 800; letter-spacing: -0.025em }
.start .logo { justify-content: center }
.logo .mark { width: 1.15em; height: 1.15em; flex: none }
.logo .tld { color: var(--accent); font-weight: 700 }
.logo { direction: ltr }
/* Arabic script must not be letter-spaced or upper-cased */
[dir="rtl"] .tag-proto, [dir="rtl"] .tag, [dir="rtl"] .extra h3, [dir="rtl"] .step, [dir="rtl"] h1, [dir="rtl"] h2 { letter-spacing: 0; text-transform: none }
[dir="rtl"] .tag-proto, [dir="rtl"] .tag, [dir="rtl"] .extra h3 { font-family: var(--body) }
.nav { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center }
.next { font: 600 16px var(--body); background: var(--accent); color: var(--paper); border: 0; border-radius: 6px; padding: 10px 18px; cursor: pointer }

/* start state: only the upload is shown until a bill (or sample) is loaded */
.start { padding-top: 6vh; text-align: center }
.start .lead { margin-inline: auto }
.start .after, .start .step, .start #h1s, .start .samples { display: none }
.start section.card { background: none; border: 0; padding: 0 }
.start .drop { padding: 32px 22px; background: var(--paper) }
/* figures under the upload, start page only */
.savestats { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 26px; margin: 22px 0 0; font-size: 17px; color: var(--muted) }
.savestats > span { display: flex; align-items: center; gap: 8px }
.savestats .ssico { width: 22px; height: 22px; flex: none; color: var(--muted) }
.savestats b { color: var(--good); font: 800 22px var(--display) }
.wrap:not(.start) .savestats { display: none }
.howto { text-align: start; width: 100%; font-size: 15px }
.howto summary { list-style: none; cursor: pointer; width: fit-content; margin-inline: auto; display: flex; align-items: center; gap: 8px;
  font: 600 16px var(--body); color: var(--paper); border: 1px solid var(--accent); background: var(--accent); border-radius: 999px; padding: 8px 16px }
.howto summary::-webkit-details-marker { display: none }
.howto summary::before { content: "?"; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--paper); color: var(--accent); font: 700 13px var(--body) }
.howto summary::after { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform .15s }
.howto[open] summary::after { transform: translateY(2px) rotate(-135deg) }
.howto summary:hover { filter: brightness(1.1) }
.howto summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px }
.howto-body { margin-top: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); padding: 16px; display: grid; gap: 14px }
.howto ol { margin: 0; padding-inline-start: 1.3em; display: grid; gap: 4px }
.howto ol b { color: var(--ink) }
.ops { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line) }
.ops li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding: 8px 2px; border-bottom: 1px solid var(--line) }
.ops a { font-weight: 600; color: var(--accent); text-decoration: none; min-width: 7.5em }
.ops a:hover { text-decoration: underline }
.ops small { color: var(--muted); font-size: 14px }
.ops-all { justify-self: start; display: inline-flex; align-items: center; gap: 6px; font: 600 15px var(--body); background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer }
.ops-all .chev { width: 10px; height: 6px; transition: transform .15s }
.ops-all[aria-expanded="true"] .chev { transform: rotate(180deg) }
.ops-all:hover { text-decoration: underline }
.howto .other { margin: 0; color: var(--muted); font-size: 14px }
.try { margin: 0; text-align: end }
/* help button and manual entry on one line; the link drops below on narrow screens */
.helprow { position: relative; width: 100% }
.helprow .try { position: absolute; top: 8px; inset-inline-end: 0 }
@media (max-width: 600px) { .helprow { display: flex; flex-direction: column } .helprow .try { position: static; order: -1; margin: -6px 0 8px } }
.try button::after { content: " →"; display: inline-block; margin-inline-start: 4px; text-decoration: none }
[dir="rtl"] .try button::after { content: " ←" }
.try button { font: 600 15px var(--body); background: none; border: 0; padding: 4px; color: var(--muted); text-decoration: none; text-underline-offset: 3px; cursor: pointer }
.try button:hover, .try button:focus-visible { color: var(--ink); text-decoration: underline }
.wrap:not(.start) .try { display: none }

/* step 1 */
.drop { border: 2px dashed var(--line); border-radius: 8px; padding: 22px; text-align: center; cursor: pointer; color: var(--muted) }
.drop .trust { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 10px; font-size: 13px; color: var(--muted) }
.drop .trust svg { width: 21px; height: 14px; flex: none; border-radius: 2px }
.drop:hover, .drop.over { border-color: var(--accent); color: var(--ink); background: var(--accent-soft) }
.drop strong { color: var(--ink); display: block; font-size: 17px }
.drop .upico { display: block; width: 52px; height: 52px; margin: 0 auto 10px }
.drop:hover .upico circle, .drop.over .upico circle { fill: var(--paper) }
.samples { display: flex; flex-wrap: wrap; gap: 8px; align-items: center }
.samples span { color: var(--muted); font-size: 14px }
.pick { margin: 0 0 -4px; color: var(--ink); font: 600 17px var(--body) }
.warnings { margin: 0; padding-inline-start: 1.2em; color: var(--warn); font-size: 14px; display: grid; gap: 2px }
@media (max-width: 640px) {
  .samples { flex-wrap: nowrap; overflow-x: auto; margin-inline: -20px; padding: 2px 20px; scrollbar-width: none }
  .samples > * { flex: none }
}
@media (max-width: 640px) {
  .samples { flex-wrap: nowrap; overflow-x: auto; margin-inline: -20px; padding: 2px 20px; scrollbar-width: none }
  .samples > * { flex: none }
}
.chip { font: 600 15px var(--body); border: 1px solid var(--line); background: var(--paper); color: var(--ink);
  border-radius: 999px; padding: 6px 14px; cursor: pointer }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--paper) }
.chip:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px }
.note { font-size: 14px; color: var(--warn) }
/* why the figures are empty after an upload we could not read (DECISIONS #53) */
.notice { margin: 0; padding: 10px 12px; border-radius: 8px; background: var(--accent-soft); color: var(--ink); font-size: 15px }

/* step 2: bill-style summary */
/* step 2: usage as compact figures */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px }
.stat { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; display: grid; gap: 2px }
.stat > span { font-size: 13px; color: var(--muted) }
.val { display: flex; align-items: baseline; gap: 4px; font-size: 14px; color: var(--muted); white-space: nowrap }
.usage input, .usage select { font: 16px var(--body); color: var(--ink); background: var(--paper); border: 1px solid transparent; border-radius: 5px; padding: 2px 4px; font-variant-numeric: tabular-nums }
.usage input { width: 4.2em }
.stat input { font: 600 20px var(--display); width: 4.2em; min-width: 0; padding: 0 4px; margin-inline-start: -4px }
.usage input:hover, .usage select:hover { border-color: var(--line) }
.usage input:focus, .usage select:focus { border-color: var(--accent); outline: none }
.extra { display: grid; gap: 4px }
.extra h3 { font: 500 12px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 6px 0 0 }
.line { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; padding: 4px 0; border-bottom: 1px solid var(--line) }
.line select { font-weight: 600; max-width: 12em }
.line .x { margin-inline-start: auto }
.x { border: none; background: none; color: var(--muted); font-size: 20px; cursor: pointer; padding: 0 6px }
.adds { display: flex; flex-wrap: wrap; gap: 8px }
.ghost { font: 600 15px var(--body); background: none; border: 1px solid var(--line); color: var(--accent); border-radius: 6px; padding: 6px 12px; cursor: pointer }

/* step 3 */
.controls { display: grid; grid-template-columns: auto repeat(3, minmax(0, 1fr)); gap: 16px 8px; align-items: start; font-size: 15px }
/* binding first, then the three toggles in equal columns; on phones the binding gets its own row */
@media (max-width: 640px) {
  .controls { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 0 }  /* equal columns: the toggles sit symmetrically */
  .controls > .ctl:first-child { grid-column: 1 / -1 }
  .controls .seglbl { font-size: 13px }
}
/* each control on top, its label under it; the top row is as tall as the segmented control so labels line up */
.ctl { display: grid; grid-template-rows: 36px auto; justify-items: center; align-items: center; gap: 4px; text-align: center; cursor: pointer }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden }
.seg button { font: 600 15px var(--body); border: none; background: var(--paper); color: var(--ink); padding: 6px 12px; cursor: pointer }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper) }
.seglbl { font-size: 15px; color: var(--muted) }
.switch { appearance: none; -webkit-appearance: none; position: relative; width: 44px; height: 26px; margin: 0; border-radius: 13px; background: var(--switch-off); cursor: pointer; transition: background .15s }
.switch::before { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: inset-inline-start .15s }
.switch:checked { background: var(--accent) }
.switch:checked::before { inset-inline-start: 21px }
.switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px }
.summary { font-size: 15px; color: var(--muted) }
.summary b { color: var(--ink) }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 13px; color: var(--muted) }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-inline-end: 5px; vertical-align: -1px }
ol.rank { list-style: none; margin: 0; padding: 10px; display: grid; gap: 8px; background: var(--bg); border-radius: 12px }
@media (max-width: 640px) { ol.rank { padding: 6px; margin-inline: -8px } }
.row { border: 1px solid var(--line); border-radius: 8px; background: var(--paper) }
/* places 1-3: gold, silver, bronze tint and edge */
.row.p1 { --medal: #E3B23C } .row.p2 { --medal: #A9B3BE } .row.p3 { --medal: #CD8A4E }
.row.p1, .row.p2, .row.p3 { background: color-mix(in srgb, var(--medal) 13%, var(--paper));
  border-color: color-mix(in srgb, var(--medal) 55%, var(--paper)); border-inline-start: 6px solid var(--medal) }
.row.p1 > button, .row.p2 > button, .row.p3 > button { padding-block: 16px }
.row.p1 .price b, .row.p2 .price b, .row.p3 .price b { font-size: 23px }
.row.p1 .pname b, .row.p2 .pname b, .row.p3 .pname b { font-size: 18px }
/* same size as the medals of places 1-3 */
.num { display: grid; place-items: center; width: 38px; height: 38px; box-sizing: border-box; border-radius: 50%; background: var(--bg);
  border: 2px solid var(--line); font: 700 18px var(--body); color: var(--muted) }
.row > button { all: unset; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 12px 14px; cursor: pointer; width: 100%; box-sizing: border-box }
.row > button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 8px }
.pos { font: 500 15px var(--mono); color: var(--muted); grid-row: span 3; align-self: center; justify-self: center }
.pname { min-width: 0 }
.pname b { font-size: 17px }
.pname small { color: var(--muted); font-size: 14px; margin-inline-start: 6px }
.price { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap }
.price b { font: 700 19px var(--display) }
.price b .pm { font: 600 14px var(--body); color: var(--muted); margin-inline-start: 1px }
.price small { display: block; color: var(--muted); font-size: 13px }
.bar { grid-column: 2 / 4; display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--line) }
.bar span { display: block; height: 100% }
.tags { grid-column: 2 / 4; display: flex; flex-wrap: wrap; gap: 6px }
.tag { font: 500 12px var(--mono); border-radius: 4px; padding: 1px 6px; background: var(--accent-soft); color: var(--accent) }
.tag.warn { background: transparent; color: var(--warn); border: 1px solid currentColor }
.tag.good { background: transparent; color: var(--good); border: 1px solid currentColor }
.detail { border-top: 1px solid var(--line); padding: 12px 14px 14px; padding-inline-start: 3.6em; display: grid; gap: 10px; font-size: 15px }
.detail table { border-collapse: collapse; font-variant-numeric: tabular-nums; width: 100%; max-width: 520px }
.detail td { padding: 3px 0; border-bottom: 1px dotted var(--line) }
.detail td:last-child { text-align: end; white-space: nowrap; padding-inline-start: 12px }
.detail ul { margin: 0; padding-inline-start: 18px; color: var(--muted) }
/* paywall: the three cheapest show price but not operator or plan until unlocked */
.row.locked .blur { filter: blur(7px); user-select: none }
.lockico { width: 24px; height: 24px; flex: none; color: var(--ink) }
/* a short search before the results (DECISIONS #39): only the heading and the progress bar show */
section.searchmode > :not(h2):not(.searching) { display: none !important }
.searching { display: grid; gap: 14px; padding: 28px 0 36px }
.searching p { margin: 0; font: 600 17px var(--body); min-height: 1.4em }
.sbar { height: 10px; border-radius: 5px; background: var(--line); overflow: hidden }
.sbar span { display: block; height: 100%; width: 0; border-radius: 5px; background: var(--accent); transition: width .5s ease-out }
/* one unlock box over the names of all locked rows, as tall as all of them; the price column has a fixed width so the box can stop before it */
.lockgroup { position: relative; --pricew: 150px }
.lockrows { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px }
.row.locked > button { grid-template-columns: 44px minmax(0, 1fr) var(--pricew) }
.unlockbox { position: absolute; top: 8px; bottom: 8px; inset-inline-start: 66px; inset-inline-end: calc(var(--pricew) + 26px);
  max-width: 320px; margin-inline: auto; display: grid; justify-items: center; align-content: center; gap: 12px; padding: 14px 12px; text-align: center;
  background: #15202B; color: #fff; border: 1px solid color-mix(in srgb, #E3B23C 45%, #15202B); border-radius: 10px; box-shadow: 0 8px 28px rgba(0, 0, 0, .22) }
/* dark with gold in both themes; the gold is the first place's medal */
.unlockbox .lockico { width: 56px; height: 56px; padding: 14px; box-sizing: border-box; border-radius: 50%; background: #E3B23C; color: #15202B }
.unlockbox b { font-size: 16px; line-height: 1.3 }
.unlockbox .next { width: 100%; background: #E3B23C; color: #15202B; font-weight: 700 }
.unlockbox .next:hover { background: #EDC255 }
/* the free way: invite a friend (DECISIONS #41) */
.unlockbox .or { font-size: 13px; color: #9AA8B6 }
.unlockbox .invbtn { width: 100%; font: 600 15px var(--body); background: transparent; color: #E3B23C;
  border: 1px solid #E3B23C; border-radius: 6px; padding: 8px 10px; cursor: pointer }
.unlockbox .invbtn:hover { background: rgba(227, 178, 60, .12) }
.unlockbox .next:focus-visible { outline-color: #E3B23C }
@media (max-width: 640px) {
  .lockgroup { --pricew: 112px }
  .row.locked > button { grid-template-columns: 36px minmax(0, 1fr) var(--pricew) }
  .unlockbox { inset-inline-start: 10px; inset-inline-end: calc(var(--pricew) + 20px); padding: 10px 8px; gap: 6px }
  .unlockbox .next { font-size: 15px; padding-inline: 8px }
  .unlockbox b { font-size: 14px }
  .unlockbox .lockico { width: 48px; height: 48px; padding: 12px }
}
.tag .lockico, .order .lockico { width: 13px; height: 13px; vertical-align: -2px; margin-inline-end: 3px; color: currentColor }
.order .lockico { width: 15px; height: 15px }
/* savings: the headline of the result */
/* savings: what you pay today, the cheapest, and the yearly saving */
.savings { display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; padding: 14px 18px; border-radius: 10px;
  background: var(--paper); border: 1px solid var(--line) }
.savings .ba { display: grid }
.savings .lbl { font-size: 13px; color: var(--muted) }
.savings .v { font: 800 26px/1.15 var(--display); white-space: nowrap }
.savings .old { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 2px }
.savings .arrow { font-size: 24px; color: var(--muted) }
[dir="rtl"] .savings .arrow { transform: scaleX(-1) }
.savings .pill { margin-inline-start: auto; padding: 8px 14px; border-radius: 999px; font-weight: 700; font-size: 16px;
  background: color-mix(in srgb, var(--good) 14%, var(--paper)); color: var(--good); white-space: nowrap }
.savings.none .v { font-size: 20px }
@media (max-width: 480px) { .savings { display: grid; grid-template-columns: 1fr auto 1fr; padding: 12px }
  .savings .v { font-size: 18px } .savings .pill { grid-column: 1 / -1; margin: 0; text-align: center } }
@media (max-width: 560px) { .lang { position: relative; width: fit-content; margin: 0 0 4px auto } }
.saverow { color: var(--good) !important; font-weight: 700 }
.costlier { color: var(--muted) }
.unlock { list-style: none; border: 1px solid var(--accent); border-radius: 8px; background: var(--accent-soft);
  padding: 14px; display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between }
.unlock p { margin: 0; max-width: 46ch }
.unlock small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px }
.order { justify-self: start; font: 600 15px var(--body); background: var(--accent); color: var(--paper); text-decoration: none; border-radius: 6px; padding: 8px 14px }
/* under each result: when its price was checked, and the way to buy (DECISIONS #40) */
.buyrow { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 0 14px 14px; padding-inline-start: 70px }
.buyrow small { color: var(--muted); font-size: 13px }
.buyrow > span { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px }
/* "Visa uträkning": opens the cost lines under the row (DECISIONS #61) */
.calcbtn { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; font: 600 14px var(--body); color: var(--accent) }
.calcbtn:hover { text-decoration: underline; text-underline-offset: 3px }
.calcbtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px }
.calcbtn .chev { width: 10px; height: 6px; transition: transform .15s }
.calcbtn[aria-expanded="true"] .chev { transform: rotate(180deg) }
.detail .calc { display: block; color: var(--muted); font-size: 13px; margin-top: 1px }
.buy { font: 700 15px var(--body); background: var(--accent); color: var(--paper); text-decoration: none; border-radius: 6px; padding: 8px 16px; white-space: nowrap }
.buy:hover { filter: brightness(1.1) }
@media (max-width: 640px) { .buyrow { padding-inline-start: 60px } }
.disclaimer { margin: 0; color: var(--muted); font-size: 13px; max-width: 70ch }
.more { justify-self: center }
/* share the tip, under the results (DECISIONS #63) */
.share { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; display: grid; gap: 6px; text-align: center }
.share h3 { margin: 0; font: 700 18px var(--display) }
.share p { margin: 0 0 8px; color: var(--muted); font-size: 15px }
.sharebtns { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px }
.sharebtns a, .sharebtns button { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px;
  border: 1px solid var(--line); border-radius: 999px; font: 600 15px var(--body); color: var(--ink); background: var(--paper) }
.sharebtns a:hover, .sharebtns button:hover { border-color: var(--accent); color: var(--accent) }
.sharebtns a:focus-visible, .sharebtns button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px }
.sharebtns svg { width: 20px; height: 20px; flex: none }
footer { color: var(--muted); font-size: 13px; max-width: 70ch }
footer.site { max-width: none; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); display: grid; gap: 8px; justify-items: center; text-align: center }
footer.site nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 10px }
footer.site a { color: var(--muted); text-decoration: none; display: inline-block; padding: 6px 4px }  /* at least 32 px to tap */
footer.site a:hover { color: var(--ink); text-decoration: underline }
footer.site p { margin: 0 }

/* footer pages */
#pageDlg { text-align: start; width: min(680px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 24px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--paper); color: var(--ink); font-size: 16px; line-height: 1.55 }
#pageDlg::backdrop { background: rgb(0 0 0 / .45) }
/* payment for the locked plans (mockup) */
:is(#payDlg, #invDlg) { width: min(420px, calc(100vw - 32px)); padding: 24px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--paper); color: var(--ink); text-align: center }
:is(#payDlg, #invDlg)::backdrop { background: rgb(0 0 0 / .45) }
:is(#payDlg, #invDlg) h2 { justify-content: center; align-items: center; gap: 8px; font-size: 22px; margin: 0 0 6px }
:is(#payDlg, #invDlg) h2 .lockico { width: 20px; height: 20px; color: var(--accent) }
:is(#payDlg, #invDlg) p { margin: 0 0 12px; color: var(--muted); font-size: 15px }
:is(#payDlg, #invDlg) .payprice { font: 800 34px var(--display); color: var(--ink); margin: 4px 0 8px }
:is(#payDlg, #invDlg) .paybtns { display: grid; gap: 8px; margin: 4px 0 10px }
:is(#payDlg, #invDlg) .paybtns button { width: 100%; padding: 11px }
:is(#payDlg, #invDlg) .paynote { font-size: 12px; color: var(--warn); margin: 0 }
:is(#payDlg, #invDlg) .invite { display: grid; gap: 10px; justify-items: center }
:is(#payDlg, #invDlg) .invite p { margin: 0; font-size: 14px }
:is(#payDlg, #invDlg) .invite b { color: var(--ink) }
:is(#payDlg, #invDlg) .invlink { display: grid; gap: 8px; width: 100% }
:is(#payDlg, #invDlg) .invlink input { font: 16px var(--body); width: 100%; padding: 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--ink); text-align: center }
:is(#payDlg, #invDlg) .invshare { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap }
:is(#payDlg, #invDlg) .invshare a { text-decoration: none; display: inline-flex; align-items: center }
:is(#payDlg, #invDlg) .invwait { font-size: 12px !important }
.refnote { margin: 0; padding: 8px 12px; border-radius: 8px; background: var(--accent-soft); color: var(--ink); font-size: 14px }
:is(#payDlg, #invDlg) .close { position: absolute; top: 10px; inset-inline-end: 10px; font-size: 24px; background: none; border: 0; color: var(--muted); cursor: pointer; width: 36px; height: 36px }
/* places 1-3 */
.medal { width: 40px; height: 40px; display: block }

#pageDlg h2 { margin: 0 32px 8px 0; font-size: 26px }
#pageDlg h3 { margin: 18px 0 4px; font-size: 17px; font-family: var(--display) }
#pageDlg p { margin: 0 0 8px }
#pageDlg dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 8px 0 12px }
#pageDlg dt { color: var(--muted) }
#pageDlg dd { margin: 0 }
#pageDlg mark { background: var(--accent-soft); color: var(--ink); padding: 0 3px; border-radius: 3px }
#pageDlg .draft { color: var(--warn); font-size: 14px }
#pageDlg .small { color: var(--muted); font-size: 14px; margin-top: 16px }
#pageDlg .close { position: absolute; top: 12px; inset-inline-end: 12px; font-size: 24px; background: none; border: 0; color: var(--muted); cursor: pointer; width: 36px; height: 36px }
@media (max-width: 640px) {
  .detail { padding-inline-start: 14px }
  .row > button { grid-template-columns: 36px minmax(0, 1fr) auto; gap: 4px 10px }
  .medal { width: 34px; height: 34px }
  .num { width: 32px; height: 32px; font-size: 15px }
}
@media (prefers-reduced-motion: no-preference) { .row { transition: border-color .2s } }
