/* ==========================================================================
   roamcheaper.in — planner, results, reference tables
   The form speaks the same OS language as the rest of the site: settings
   rows, a segmented control, selectable cells with check badges, and app
   icon step markers. White cards, hairlines, one red.
   ========================================================================== */

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   Steps as cards
   -------------------------------------------------------------------------- */

.planner-form { max-width: 62rem; }

.step {
  border: 1px solid var(--rule);
  border-radius: 20px;
  background: #fff;
  padding: clamp(1.4rem, 3vw, 2.1rem);
  margin: 0 0 clamp(1rem, 2.5vw, 1.5rem);
  box-shadow: var(--shadow);
}

.step-legend {
  display: flex;
  align-items: center;
  gap: .85rem;
  font-family: var(--black);
  font-size: clamp(1.1rem, 1rem + .5vw, 1.45rem);
  letter-spacing: -.02em;
  padding: 0;
}

/* the step number wears the notification app-icon treatment */
.step-num {
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  flex: none;
  background: linear-gradient(160deg, var(--red-glow), var(--red-deep));
  color: #fff;
  border-radius: .65rem;
  font: 800 .95rem/1 var(--mono);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 3px 8px rgba(225, 29, 46, .25);
}

.step-hint {
  font: 500 .78rem/1.5 var(--mono);
  color: var(--ink-faint);
  margin: .9rem 0 0;
}

.step-sublabel {
  font: 700 .68rem/1 var(--mono);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 1.75rem 0 .85rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule-soft);
}

/* --------------------------------------------------------------------------
   Legs as settings rows
   -------------------------------------------------------------------------- */

.legs {
  margin: 1.15rem 0;
  border: 1px solid var(--rule);
  border-radius: 14px;
  overflow: hidden;
}

.leg {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: clamp(.6rem, 2vw, 1rem);
  padding: .75rem clamp(.75rem, 2vw, 1.1rem);
  background: #fff;
  border-bottom: 1px solid var(--rule-soft);
  transition: background-color .15s ease;
}
.leg:last-child { border-bottom: 0; }
.leg:hover { background: var(--card); }

.leg-flag {
  font-size: 1.5rem;
  line-height: 1;
  width: 2.2rem;
  height: 2.2rem;
  display: grid;
  place-items: center;
  background: var(--card);
  border-radius: .6rem;
}

.leg-where { display: block; min-width: 0; }

.leg-label {
  display: block;
  font: 600 .58rem/1 var(--mono);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: .25rem;
}

.leg select {
  width: 100%;
  font: 700 1rem/1.2 var(--sans);
  letter-spacing: -.01em;
  color: var(--ink);
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238b8c96' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .1rem center;
  padding-right: 1.1rem;
}

/* nights stepper, straight off a mobile OS */
.stepper {
  display: inline-flex;
  align-items: center;
  gap: .15rem;
  background: var(--card);
  border-radius: 999px;
  padding: .22rem;
}

.leg-step {
  width: 1.9rem;
  height: 1.9rem;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  font: 600 1.05rem/1 var(--sans);
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(16, 17, 22, .12);
  transition: transform .12s var(--ease-spring), background-color .12s ease, color .12s ease;
}
.leg-step:hover { background: var(--red); color: #fff; transform: translateY(-1px); }
.leg-step:active { transform: translateY(1px); }

.stepper-val {
  min-width: 3.4rem;
  text-align: center;
  line-height: 1.05;
  padding-inline: .2rem;
}
.stepper-val b {
  display: block;
  font: 700 1rem/1 var(--mono);
  font-variant-numeric: tabular-nums;
}
.stepper-val small {
  display: block;
  font: 500 .55rem/1 var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-top: .2rem;
}

.leg-remove {
  width: 2rem;
  height: 2rem;
  font-size: 1.15rem;
  line-height: 1;
  color: var(--ink-faint);
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 50%;
  cursor: pointer;
  transition: all .15s ease;
}
.leg-remove:hover:not(:disabled) { background: var(--red); border-color: var(--red); color: #fff; }
.leg-remove:disabled { opacity: .3; cursor: not-allowed; }

@media (max-width: 34rem) {
  .leg { grid-template-columns: auto minmax(0, 1fr) auto; }
  .stepper { grid-column: 2; justify-self: start; margin-top: .1rem; }
  .leg-remove { grid-row: 1; grid-column: 3; }
}

/* --------------------------------------------------------------------------
   Chips as selectable cells with check badges
   -------------------------------------------------------------------------- */

.profiles, .mods, .priorities {
  display: grid;
  gap: .6rem;
  grid-template-columns: repeat(auto-fit, minmax(13.5rem, 1fr));
}

.chip {
  position: relative;
  display: block;
  padding: .9rem 1.05rem;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 14px;
  cursor: pointer;
  transition: border-color .15s ease, transform .15s var(--ease-spring), box-shadow .15s ease;
}
.chip:hover {
  border-color: rgba(16, 17, 22, .35);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.chip input {
  position: absolute;
  opacity: 0;
  width: 1px; height: 1px;
}

.chip.is-on {
  border-color: var(--red);
  box-shadow: inset 0 0 0 1px var(--red), 0 6px 16px rgba(225, 29, 46, .12);
}

/* the check badge */
.chip::after {
  content: '✓';
  position: absolute;
  top: -.45rem;
  right: -.45rem;
  width: 1.35rem;
  height: 1.35rem;
  display: grid;
  place-items: center;
  font: 800 .7rem/1 var(--sans);
  color: #fff;
  background: var(--red);
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(225, 29, 46, .4);
  opacity: 0;
  transform: scale(.4);
  transition: opacity .18s ease, transform .22s var(--ease-spring);
}
.chip.is-on::after { opacity: 1; transform: scale(1); }

.chip:has(input:focus-visible) {
  outline: 2.5px solid var(--red);
  outline-offset: 3px;
}

.chip-label {
  display: block;
  font-weight: 700;
  font-size: .95rem;
  letter-spacing: -.01em;
  margin-bottom: .12rem;
  padding-right: 4.2rem;
}

.chip-gb {
  position: absolute;
  top: .95rem;
  right: 1.05rem;
  font: 700 .66rem/1 var(--mono);
  color: var(--red);
}

.chip-hint {
  display: block;
  font-size: .8rem;
  color: var(--ink-faint);
  line-height: 1.4;
}

/* --------------------------------------------------------------------------
   Mode switch as a segmented control
   -------------------------------------------------------------------------- */

.modes {
  display: inline-flex;
  gap: .25rem;
  margin: 1.15rem 0 1.35rem;
  background: var(--card);
  border-radius: 999px;
  padding: .28rem;
}

.mode-tab {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font: 600 .88rem/1 var(--sans);
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  border-radius: 999px;
  padding: .6rem 1.05rem;
  cursor: pointer;
  transition: color .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.mode-tab:hover { color: var(--ink); }

.mode-tab.is-on {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(16, 17, 22, .14), 0 4px 10px rgba(16, 17, 22, .08);
}

.mode-tag {
  font: 700 .58rem/1 var(--mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: .24rem .45rem;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
}

/* --------------------------------------------------------------------------
   App picker as settings rows
   -------------------------------------------------------------------------- */

.appgroups { display: grid; gap: 1.5rem; }

.appgroup-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .3rem .75rem;
  font: 700 .68rem/1 var(--mono);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--red);
  padding-bottom: .55rem;
  margin-bottom: 0;
  border-bottom: 0;
}

.appgroup-note {
  font: 400 .78rem/1.3 var(--sans);
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-faint);
}

.appgroup-rows {
  border: 1px solid var(--rule);
  border-radius: 14px;
  overflow: hidden;
}

.approw {
  display: grid;
  grid-template-columns: 1.5rem minmax(0, 1fr) auto 4.5rem;
  align-items: center;
  gap: .7rem;
  padding: .6rem .85rem;
  background: #fff;
  border-bottom: 1px solid var(--rule-soft);
  border-left: 3px solid transparent;
  transition: background-color .15s ease, border-color .15s ease;
}
.approw:last-child { border-bottom: 0; }

.approw.is-on {
  background: #fff;
  border-left-color: var(--red);
}
.approw:not(.is-on) { background: var(--card); }
.approw:not(.is-on) .app-name { color: var(--ink-soft); }

.app-icon { color: var(--ink-faint); font-size: .9rem; text-align: center; }

.app-name { font-weight: 600; font-size: .9rem; min-width: 0; letter-spacing: -.01em; }

.app-controls { display: flex; gap: .35rem; flex-wrap: wrap; justify-content: flex-end; }

.app-controls select {
  font: 500 .78rem/1.2 var(--sans);
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: .32rem .45rem;
  max-width: 9rem;
}

.app-tier-static {
  font: 400 .72rem/1.2 var(--mono);
  color: var(--ink-faint);
  align-self: center;
}

.app-cost {
  font: 700 .78rem/1 var(--mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: var(--ink-faint);
}
.approw.is-on .app-cost { color: var(--ink); }

@media (max-width: 40rem) {
  .approw { grid-template-columns: 1.5rem minmax(0, 1fr) 4.5rem; }
  .app-controls { grid-column: 2 / -1; justify-content: flex-start; }
  .app-cost { grid-row: 1; grid-column: 3; }
}

.apptotal {
  margin-top: 1.5rem;
  padding: 1.15rem 1.3rem;
  background: var(--board);
  color: var(--board-txt);
  border-radius: 16px;
  box-shadow: var(--shadow-lift);
}

.apptotal-main {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem 1rem;
}

.apptotal-label {
  font: 700 .66rem/1 var(--mono);
  letter-spacing: .18em;
  text-transform: uppercase;
  opacity: .65;
}

.apptotal-figure {
  font-family: var(--black);
  font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.1rem);
  letter-spacing: -.02em;
}

.apptotal-unit { font-size: .5em; opacity: .6; margin-left: .1em; }

.apptotal-detail {
  margin: .5rem 0 0;
  font-size: .8rem;
  opacity: .72;
}

/* --------------------------------------------------------------------------
   Actions
   -------------------------------------------------------------------------- */

.planner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .7rem;
  align-items: center;
}

.btn-issue { font-size: 1.05rem; padding: 1.05rem 1.9rem; }

/* --------------------------------------------------------------------------
   The maths panel
   -------------------------------------------------------------------------- */

.maths {
  margin-top: 1.25rem;
  border-top: 1px solid var(--rule-soft);
  padding-top: .9rem;
}

.maths summary {
  cursor: pointer;
  font: 700 .7rem/1 var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--blue);
}

.maths-list {
  list-style: none;
  margin: .9rem 0 0;
  padding: 0;
  font-size: .85rem;
}

.maths-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .35rem 0;
  border-bottom: 1px dotted var(--rule-soft);
}

.maths-detail { color: var(--ink-faint); font-size: .92em; }

.maths-gb {
  font-family: var(--mono);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.maths-total {
  font-weight: 700;
  border-bottom: none !important;
  border-top: 2px solid var(--ink);
  margin-top: .3rem;
  padding-top: .5rem !important;
}

.maths-note {
  margin: .9rem 0 0;
  font-size: .82rem;
  color: var(--ink-faint);
}

/* --------------------------------------------------------------------------
   Options
   -------------------------------------------------------------------------- */

.options { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }

.option {
  position: relative;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 18px;
  padding: clamp(1.2rem, 2.5vw, 1.7rem);
  box-shadow: var(--shadow);
}

.option.is-winner {
  border-color: var(--green);
  box-shadow: inset 0 0 0 1px var(--green), var(--shadow-lift);
}

.option.is-blocked { opacity: .72; }

.option-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: .9rem;
  align-items: start;
  margin-bottom: 1rem;
}

.option-rank {
  font: 700 .78rem/1 var(--mono);
  color: var(--ink-faint);
  padding-top: .35rem;
}

.option-headings { min-width: 0; }

.option-title {
  font-family: var(--black);
  font-size: clamp(1.05rem, 1rem + .4vw, 1.25rem);
  letter-spacing: -.015em;
  margin-bottom: .25rem;
}

.option-gist { font-size: .88rem; color: var(--ink-soft); margin: 0; }

.option-price { text-align: right; white-space: nowrap; }

.option-total {
  display: block;
  font-family: var(--black);
  font-size: clamp(1.35rem, 1.1rem + 1vw, 1.8rem);
  letter-spacing: -.025em;
  font-variant-numeric: tabular-nums;
}

.option-pernight {
  display: block;
  font: 500 .68rem/1 var(--mono);
  color: var(--ink-faint);
  margin-top: .2rem;
}

@media (max-width: 34rem) {
  .option-head { grid-template-columns: auto minmax(0, 1fr); }
  .option-price { grid-column: 1 / -1; text-align: left; }
}

/* Verdict stamps ----------------------------------------------------------- */

.stamp {
  position: absolute;
  top: -.6rem;
  right: 1.1rem;
  font: 700 .62rem/1 var(--mono);
  letter-spacing: .14em;
  padding: .4rem .65rem;
  border: 2px solid currentColor;
  border-radius: 6px;
  background: #fff;
  rotate: -2.5deg;
  filter: url(#stamp-bleed);
}

.stamp-best { color: var(--green); }
.stamp-bad { color: var(--red); }

/* Buys --------------------------------------------------------------------- */

.buys { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }

.buy {
  display: grid;
  grid-template-columns: minmax(6rem, auto) minmax(0, 1fr) auto;
  gap: .3rem .8rem;
  align-items: baseline;
  padding: .65rem .8rem;
  background: var(--card);
  border-radius: 10px;
  font-size: .87rem;
}

.buy-provider { font-weight: 700; }
.buy-provider a { text-decoration: none; }
.buy-provider a:hover { text-decoration: underline; }

.buy-plan { font-family: var(--mono); font-size: .82rem; }

.buy-units { color: var(--red); font-weight: 700; }

.buy-where { grid-column: 2; color: var(--ink-faint); font-size: .8rem; }

.buy-cost {
  grid-column: 3;
  grid-row: 1;
  font-family: var(--mono);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.buy-net {
  grid-column: 2 / -1;
  font: 400 .75rem/1.3 var(--mono);
  color: var(--ink-faint);
}

@media (max-width: 34rem) {
  .buy { grid-template-columns: minmax(0, 1fr) auto; }
  .buy-plan, .buy-where, .buy-net { grid-column: 1 / -1; }
}

/* Warnings ----------------------------------------------------------------- */

.warnings { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: .4rem; }

.warning {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: .6rem;
  align-items: start;
  font-size: .85rem;
  line-height: 1.45;
  padding: .6rem .75rem;
  border-radius: 10px;
  background: var(--card);
}

.warning-tag {
  font: 700 .58rem/1.5 var(--mono);
  letter-spacing: .1em;
  padding: .1rem .4rem;
  border-radius: 5px;
  color: #fff;
}

.warning-danger { background: rgba(225, 29, 46, .08); }
.warning-danger .warning-tag { background: var(--red); }

.warning-warn { background: rgba(178, 110, 5, .08); }
.warning-warn .warning-tag { background: var(--amber); }

.warning-info .warning-tag { background: var(--ink-faint); }

.no-options {
  padding: 1.5rem;
  background: var(--card);
  border-left: 3px solid var(--amber);
  border-radius: 10px;
  font-size: .95rem;
}

/* Disclosure --------------------------------------------------------------- */

.disclosure {
  margin: 1.25rem 0 0;
  padding: .9rem 1.05rem;
  background: var(--card);
  border-left: 3px solid var(--ink-faint);
  border-radius: 10px;
  font-size: .84rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

.disclosure-against {
  border-left-color: var(--green);
  background: rgba(20, 132, 73, .07);
  color: var(--ink);
}

.disclosure-tag {
  display: inline-block;
  font: 700 .58rem/1.5 var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-right: .5rem;
}
.disclosure-against .disclosure-tag { color: var(--green); }

.disclosure a { white-space: nowrap; font-weight: 600; }

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .7rem;
  margin-top: clamp(1.5rem, 3vw, 2rem);
}

/* --------------------------------------------------------------------------
   Reference tables (also used by every generated page)
   -------------------------------------------------------------------------- */

.appref-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--rule);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
}

.appref-table {
  width: 100%;
  min-width: 34rem;
  border-collapse: collapse;
  font-size: .88rem;
  font-variant-numeric: tabular-nums;
}

.appref-table th,
.appref-table td {
  text-align: left;
  padding: .65rem .9rem;
  border-bottom: 1px solid var(--rule-soft);
}

.appref-table thead th {
  font: 700 .6rem/1 var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--board-txt);
  background: var(--board);
  position: sticky;
  top: 0;
}

.appref-table tbody tr:last-child th,
.appref-table tbody tr:last-child td { border-bottom: 0; }

.appref-table tbody th { font-weight: 700; }

.appref-table .num { font-family: var(--mono); font-weight: 500; white-space: nowrap; }

.appref-table tr.is-default { background: rgba(225, 29, 46, .04); }

.appref-table tbody tr:hover { background: var(--card); }

.conf {
  font: 700 .56rem/1 var(--mono);
  letter-spacing: .09em;
  text-transform: uppercase;
  padding: .24rem .45rem;
  border-radius: 5px;
  border: 1px solid currentColor;
}

.conf-published { color: var(--green); }
.conf-bitrate { color: var(--blue); }
.conf-measured { color: var(--ink-faint); }

.appref-note {
  margin-top: 1.1rem;
  font-size: .84rem;
  color: var(--ink-faint);
  max-width: 46rem;
}

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

@media print {
  body { background: #fff; }

  .ticker, .hero, .journey, .netpick, .planner, .traps, .appref, .landscape,
  .result-actions, .skip-link, .footer-grid { display: none !important; }

  .result { border: 0; padding: 0; }
  .result[hidden] { display: none; }

  .esim-card, .option {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #333;
  }

  .maths[open] summary { display: none; }
  .maths { border-top: 1px solid #999; }

  .option.is-blocked { display: none; }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: .7em;
    color: #555;
  }
}
