/* Ofertas instantâneas redesenhada (instant-offers-client-v1.js), no padrão do Filtro inteligente. */

#apex-instant-offers-root.ioc-on {
  background: var(--fx-bg);
  color: var(--fx-text);
  font-family: var(--fx-font);
  -webkit-font-smoothing: antialiased;
}

.ioc-on .apex-io-shell {
  background: radial-gradient(circle at 50% 0%, var(--fx-page-glow), transparent 46%), var(--fx-bg);
}

/* O que o desenho novo substitui. A lista de estações e o formulário foram levados para a janela. */
.ioc-on .apex-io-topbar,
.ioc-on .apex-io-pipeline,
.ioc-on .apex-io-layout,
.ioc-on .apex-io-history-card,
.ioc-on .apex-io-toast {
  display: none !important;
}

.ioc-on .apex-io-content {
  width: min(640px, calc(100% - 32px));
  padding: 0 0 calc(40px + env(safe-area-inset-bottom, 0px));
}

.ioc {
  display: flex;
  flex-direction: column;
  gap: 22px;
  font-variant-numeric: tabular-nums;
}

.ioc svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ioc button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.ioc button:focus-visible {
  outline: 2px solid var(--fx-accent);
  outline-offset: 2px;
}

.ioc [hidden] {
  display: none !important;
}

/* ── Topo ── */
.ioc-head {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 12px;
  padding-top: calc(14px + env(safe-area-inset-top, 0px));
}

.ioc-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--fx-line-2);
  border-radius: 13px;
  background: var(--fx-surface);
  color: var(--fx-muted);
  transition: border-color 0.18s ease, color 0.18s ease;
}

.ioc-icon:hover {
  border-color: var(--fx-accent-line);
  color: var(--fx-text);
}

.ioc-icon svg {
  width: 20px;
  height: 20px;
}

.ioc-title {
  min-width: 0;
}

.ioc-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--fx-accent-text);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.ioc-kicker::before {
  content: "";
  width: 26px;
  height: 1px;
  background: var(--fx-accent-line);
}

.ioc-title h1 {
  margin: 6px 0 0;
  overflow: hidden;
  font-size: clamp(16px, 4.5vw, 24px);
  font-weight: 300;
  line-height: 1.15;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Anel de ligar ── */
.ioc-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding-top: 8px;
}

.ioc-power {
  --ring: var(--fx-accent);
  --ring-soft: var(--fx-accent-soft);
  --ring-line: var(--fx-accent-line);
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(176px, 50vw, 214px);
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid var(--ring-line);
  border-radius: 50%;
  background: radial-gradient(circle, var(--ring-soft) 0%, transparent 70%);
  box-shadow: 0 0 0 10px color-mix(in srgb, var(--ring) 5%, transparent), 0 0 0 22px color-mix(in srgb, var(--ring) 3%, transparent);
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.ioc-power:active:not(:disabled) {
  transform: scale(0.97);
}

.ioc-power:disabled {
  cursor: default;
}

.ioc-core {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  width: 64%;
  aspect-ratio: 1;
  border: 1px solid var(--ring-line);
  border-radius: 50%;
  background: var(--fx-surface);
  color: var(--ring);
}

html[data-af-theme=light] .ioc-core {
  box-shadow: var(--fx-lift);
}

.ioc-core svg {
  width: 40px;
  height: 40px;
  stroke-width: 2;
}

.ioc-core b {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.ioc-wave {
  position: absolute;
  inset: 0;
  border: 1px solid var(--ring-line);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
}

.ioc[data-phase=on] .ioc-power,
.ioc[data-phase=lost] .ioc-power {
  --ring: var(--fx-ok);
  --ring-soft: var(--fx-ok-soft);
  --ring-line: var(--fx-ok-line);
}

.ioc[data-phase=on] .ioc-wave {
  animation: ioc-wave 3s ease-out infinite;
}

.ioc[data-phase=on] .ioc-wave.w2 { animation-delay: 1s; }
.ioc[data-phase=on] .ioc-wave.w3 { animation-delay: 2s; }

@keyframes ioc-wave {
  0% { opacity: 0.7; transform: scale(0.66); }
  100% { opacity: 0; transform: scale(1.18); }
}

.ioc[data-phase=lost] .ioc-power,
.ioc[data-phase=taken] .ioc-power,
.ioc[data-phase=down] .ioc-power {
  --ring: var(--fx-warn);
  --ring-soft: var(--fx-warn-soft);
  --ring-line: var(--fx-warn-line);
}

.ioc[data-phase=restore] .ioc-power {
  --ring: var(--fx-crit);
  --ring-soft: var(--fx-crit-soft);
  --ring-line: var(--fx-crit-line);
}

.ioc[data-phase=pick] .ioc-power,
.ioc[data-phase=save] .ioc-power,
.ioc[data-phase=load] .ioc-power {
  --ring: var(--fx-faint);
  --ring-soft: transparent;
  --ring-line: var(--fx-line-2);
}

.ioc[data-tone=busy] .ioc-core::after {
  content: "";
  position: absolute;
  inset: -1px;
  border: 2px solid transparent;
  border-top-color: var(--ring);
  border-radius: 50%;
  animation: ioc-spin 0.9s linear infinite;
}

@keyframes ioc-spin {
  to { transform: rotate(360deg); }
}

.ioc-state {
  max-width: 420px;
  text-align: center;
}

.ioc-state h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.ioc[data-tone=ok] .ioc-state h2 { color: var(--fx-ok-text); }
.ioc[data-tone=warn] .ioc-state h2 { color: var(--fx-warn-text); }
.ioc[data-tone=crit] .ioc-state h2 { color: var(--fx-crit-text); }

.ioc-state p {
  margin: 6px 0 0;
  color: var(--fx-muted);
  font-size: 14px;
  line-height: 1.45;
}

.ioc-state p:empty {
  display: none;
}

/* ── Oferta da vez ── */
.ioc-offer {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--fx-ok-line);
  border-radius: 18px;
  background: linear-gradient(180deg, var(--fx-ok-soft), transparent 70%), var(--fx-surface);
  box-shadow: var(--fx-lift);
  animation: ioc-in 0.28s ease-out;
}

@keyframes ioc-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.ioc-offer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ioc-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--fx-ok-text);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.ioc-badge i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--fx-ok);
  box-shadow: 0 0 0 0 var(--fx-ok-line);
  animation: ioc-dot 1.6s ease-out infinite;
}

@keyframes ioc-dot {
  0% { box-shadow: 0 0 0 0 var(--fx-ok-line); }
  100% { box-shadow: 0 0 0 9px transparent; }
}

.ioc-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid var(--fx-line-2);
  border-radius: 999px;
  color: var(--fx-text);
  font-size: 14px;
  font-weight: 600;
}

.ioc-count svg {
  width: 15px;
  height: 15px;
  color: var(--fx-muted);
}

.ioc-count.is-low {
  border-color: var(--fx-warn-line);
  background: var(--fx-warn-soft);
  color: var(--fx-warn-text);
}

.ioc-count.is-low svg {
  color: currentColor;
}

.ioc-offer-main {
  display: grid;
  gap: 8px;
}

.ioc-offer-pay {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.ioc-offer-pay strong {
  color: var(--fx-ok-text);
  font-size: 40px;
  font-weight: 300;
  line-height: 1;
  letter-spacing: 0.01em;
}

.ioc-offer-pay span {
  color: var(--fx-muted);
  font-size: 15px;
}

.ioc-offer-place,
.ioc-offer-meta span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.ioc-offer-place {
  font-size: 16px;
  font-weight: 600;
}

.ioc-offer-place svg,
.ioc-offer-meta svg {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  color: var(--fx-muted);
}

.ioc-offer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  color: var(--fx-muted);
  font-size: 14px;
}

.ioc-offer-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
  gap: 10px;
}

.ioc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid var(--fx-line-2);
  border-radius: 13px;
  background: transparent;
  font-size: 15px !important;
  font-weight: 600 !important;
  white-space: nowrap;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.ioc-btn svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
}

.ioc-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.ioc-reject {
  color: var(--fx-muted);
}

.ioc-reject:hover:not(:disabled),
.ioc-btn.is-crit {
  border-color: var(--fx-crit-line);
  background: var(--fx-crit-soft);
  color: var(--fx-crit-text);
}

.ioc-accept {
  border-color: var(--fx-ok);
  background: var(--fx-ok);
  color: #04130c;
}

.ioc-accept:hover:not(:disabled) {
  filter: brightness(1.06);
}

/* Gorjeta prevista e adicional de pico */
.ioc-offer-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ioc-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--fx-surface-3);
  color: var(--fx-text);
  font-size: 12px;
  font-weight: 600;
}

.ioc-chip.is-surge {
  background: var(--fx-warn-soft);
  color: var(--fx-warn-text);
}

/* ── Primeira parada da oferta e mapa ── */
.ioc-offer-route {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  padding: 10px 12px;
  border: 1px solid var(--fx-line-2);
  border-radius: 12px;
  background: var(--fx-surface);
  text-align: left;
}

.ioc-offer-route > svg {
  width: 20px;
  height: 20px;
  color: var(--fx-ok-text);
}

.ioc-offer-route span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ioc-offer-route small {
  color: var(--fx-muted);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ioc-offer-route b {
  overflow: hidden;
  font-size: 14px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ioc-offer-route em {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: var(--fx-accent-text);
  font-size: 13px;
  font-style: normal;
  font-weight: 600;
  white-space: nowrap;
}

.ioc-offer-route em svg {
  width: 15px;
  height: 15px;
}

.ioc-item.has-map {
  cursor: pointer;
}

.ioc-item.has-map:hover {
  background: var(--fx-surface-2);
}

.ioc-mapsheet .ioc-sheet-head h2 {
  margin: 0;
}

.ioc-map-sub {
  margin: 3px 0 0;
  color: var(--fx-muted);
  font-size: 13px;
}

.ioc-map {
  position: relative;
  height: min(42vh, 300px);
  overflow: hidden;
  border: 1px solid var(--fx-line-2);
  border-radius: 14px;
  background: var(--fx-surface-2);
}

.ioc-map > p {
  display: grid;
  place-items: center;
  height: 100%;
  margin: 0;
  color: var(--fx-muted);
  font-size: 14px;
}

/* Mapa no tema escuro: as ruas do OpenStreetMap são claras; inverte só as imagens. */
html:not([data-af-theme=light]) .ioc-map .leaflet-tile-pane {
  filter: invert(1) hue-rotate(180deg) brightness(0.85) contrast(0.9);
}

.ioc-map .leaflet-container {
  font: inherit;
  background: var(--fx-surface-2);
}

/* Sem as imagens das ruas: fundo quadriculado e aviso, a rota continua desenhada por cima. */
.ioc-map.is-tileless .leaflet-container {
  background-color: var(--fx-surface-2);
  background-image:
    linear-gradient(var(--fx-line-2) 1px, transparent 1px),
    linear-gradient(90deg, var(--fx-line-2) 1px, transparent 1px);
  background-size: 28px 28px;
}

.ioc-map .ioc-map-note {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  z-index: 500;
  display: block;
  height: auto;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--fx-line-2);
  border-radius: 10px;
  background: var(--fx-bg-2);
  color: var(--fx-muted);
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
}

.ioc-map .leaflet-control-attribution {
  font-size: 10px;
}

.ioc-pin {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--fx-ok);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  color: #04130c;
  font: 700 12px/1 var(--fx-font);
}

.ioc-pin.is-station {
  width: 30px;
  height: 30px;
  background: var(--fx-accent);
  color: #fff;
}

.ioc-pin svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.ioc-stops {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ioc-stops li,
.ioc-stop-station {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 2px;
}

.ioc-stops li + li {
  border-top: 1px solid var(--fx-line);
}

.ioc-stops div,
.ioc-stop-station div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ioc-stops strong,
.ioc-stop-station strong {
  overflow: hidden;
  font-size: 14px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ioc-stops small,
.ioc-stop-station small {
  color: var(--fx-muted);
  font-size: 12px;
}

.ioc-stops em {
  color: var(--fx-muted);
  font-size: 13px;
  font-style: normal;
  white-space: nowrap;
}

.ioc-stop-num {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--fx-ok-soft);
  color: var(--fx-ok-text);
  font-size: 12px;
  font-weight: 700;
}

.ioc-stop-num.is-station {
  background: var(--fx-accent-soft);
  color: var(--fx-accent-text);
}

.ioc-stop-num svg {
  width: 15px;
  height: 15px;
}

.ioc-map-foot {
  display: grid;
  gap: 10px;
}

.ioc-map-foot:empty {
  display: none;
}

.ioc-map-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.ioc-map-links .ioc-btn {
  color: var(--fx-text);
  text-decoration: none;
}

.ioc-map-links .ioc-btn:hover {
  border-color: var(--fx-accent-line);
}

/* ── Cartão de estação e regras (como o do Filtro) ── */
.ioc-card {
  overflow: hidden;
  border: 1px solid var(--fx-line-2);
  border-radius: 18px;
  background: var(--fx-surface);
}

html[data-af-theme=light] .ioc-card,
html[data-af-theme=light] .ioc-list,
html[data-af-theme=light] .ioc-empty {
  box-shadow: var(--fx-lift);
}

.ioc-card:empty {
  display: none;
}

.ioc-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 14px 0;
}

.ioc-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 0 8px;
  text-align: center;
}

.ioc-tile + .ioc-tile {
  border-left: 1px solid var(--fx-line-2);
}

.ioc-tile span {
  color: var(--fx-faint);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.ioc-tile strong {
  font-size: 26px;
  font-weight: 300;
  line-height: 1.1;
}

.ioc-tile strong.is-muted {
  padding-top: 5px;
  color: var(--fx-muted);
  font-size: 14px;
  font-weight: 500;
}

.ioc-rows {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--fx-line-2);
}

.ioc-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 10px;
  min-height: 64px;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  text-align: left;
}

.ioc-row + .ioc-row {
  border-left: 1px solid var(--fx-line-2);
}

.ioc-row:hover {
  background: var(--fx-surface-2);
}

.ioc-row-ic {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--fx-surface-3);
  color: var(--fx-accent-text);
}

.ioc-row-ic svg {
  width: 18px;
  height: 18px;
}

.ioc-row-tx {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ioc-row-tx small {
  color: var(--fx-muted);
  font-size: 12px;
}

.ioc-row-tx strong {
  display: -webkit-box;
  overflow: hidden;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.ioc-row > svg {
  width: 16px;
  height: 16px;
  color: var(--fx-faint);
}

/* ── Ofertas recentes ── */
.ioc-hist h3 {
  margin: 4px 0 12px;
  font-size: 18px;
  font-weight: 600;
}

.ioc-list {
  overflow: hidden;
  border: 1px solid var(--fx-line-2);
  border-radius: 16px;
  background: var(--fx-surface);
}

.ioc-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
}

.ioc-item + .ioc-item {
  border-top: 1px solid var(--fx-line);
}

.ioc-item-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.ioc-item-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  min-width: 0;
}

.ioc-item-top strong {
  overflow: hidden;
  font-size: 15px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ioc-item small {
  color: var(--fx-muted);
  font-size: 12px;
}

.ioc-pill {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--fx-surface-3);
  color: var(--fx-muted);
  font-size: 11px;
  font-weight: 600;
}

.ioc-pill i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.ioc-pill.is-acc,
.ioc-pill.is-auto { background: var(--fx-ok-soft); color: var(--fx-ok-text); }
.ioc-pill.is-new { background: var(--fx-accent-soft); color: var(--fx-accent-text); }
.ioc-pill.is-exp { background: var(--fx-warn-soft); color: var(--fx-warn-text); }
.ioc-pill.is-fail { background: var(--fx-crit-soft); color: var(--fx-crit-text); }

.ioc-item-pay {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.ioc-item-pay strong {
  color: var(--fx-ok-text);
  font-size: 18px;
  font-weight: 400;
  white-space: nowrap;
}

.ioc-item-pay span {
  color: var(--fx-faint);
  font-size: 12px;
  white-space: nowrap;
}

.ioc-empty {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 18px 16px;
  border: 1px solid var(--fx-line-2);
  border-radius: 16px;
  background: var(--fx-surface);
  color: var(--fx-muted);
  font-size: 14px;
  line-height: 1.45;
}

.ioc-empty svg {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  color: var(--fx-accent-text);
}

/* ── Janela de estação e regras ── */
.ioc-sheet-wrap,
.ioc-confirm-wrap {
  position: fixed;
  inset: 0;
  z-index: 10;
}

.ioc-backdrop {
  position: absolute;
  inset: 0;
  background: var(--fx-overlay);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.ioc-sheet-wrap.is-open .ioc-backdrop,
.ioc-confirm-wrap .ioc-backdrop {
  opacity: 1;
}

.ioc-sheet {
  position: absolute;
  left: 50%;
  bottom: 0;
  display: flex;
  flex-direction: column;
  width: min(640px, 100%);
  max-height: min(88vh, 860px);
  border: 1px solid var(--fx-line-2);
  border-bottom: 0;
  border-radius: 22px 22px 0 0;
  background: var(--fx-bg-2);
  box-shadow: var(--fx-pop);
  transform: translate(-50%, 100%);
  transition: transform 0.22s ease;
}

.ioc-sheet-wrap.is-open .ioc-sheet {
  transform: translate(-50%, 0);
}

.ioc-grab {
  width: 40px;
  height: 4px;
  margin: 8px auto 0;
  border-radius: 4px;
  background: var(--fx-line-3);
}

.ioc-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px 12px 20px;
  border-bottom: 1px solid var(--fx-line);
}

.ioc-sheet-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.ioc-sheet-body {
  display: flex;
  flex-direction: column;
  gap: 22px;
  overflow-y: auto;
  padding: 16px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.ioc-sheet-body > section {
  scroll-margin-top: 12px;
}

.ioc-sheet-body h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.ioc-sheet-body > section > p {
  margin: 4px 0 12px;
  color: var(--fx-muted);
  font-size: 13px;
}

/* Lista de estações e formulário do painel, no visual do app. */
.ioc-sheet .apex-io-stations {
  display: grid;
  gap: 8px;
  padding: 0;
}

.ioc-sheet .apex-io-station {
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--fx-line-2);
  border-radius: 14px;
  background: var(--fx-surface);
}

.ioc-sheet .apex-io-station:hover,
.ioc-sheet .apex-io-station.is-selected {
  border-color: var(--fx-accent-line);
  background: var(--fx-accent-soft);
}

.ioc-sheet .apex-io-station input {
  width: 18px;
  height: 18px;
  accent-color: var(--fx-accent);
}

.ioc-sheet .apex-io-station > span b {
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--fx-surface-3);
  color: var(--fx-accent-text);
  font-size: 11px;
  font-weight: 700;
}

.ioc-sheet .apex-io-station > span strong {
  color: var(--fx-text);
  font-size: 15px;
  font-weight: 600;
}

.ioc-sheet .apex-io-station > span small {
  color: var(--fx-muted);
  font-size: 12px;
}

.ioc-sheet .apex-io-station > em {
  display: none;
}

.ioc-sheet .apex-io-empty-copy {
  margin: 0;
  color: var(--fx-muted);
  font-size: 14px;
}

.ioc-sheet .apex-io-rules {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 0;
}

.ioc-sheet .apex-io-rules > label > span {
  margin-bottom: 6px;
  color: var(--fx-muted);
  font-size: 12px;
  font-weight: 500;
}

.ioc-sheet .apex-io-rules > label > div {
  min-height: 48px;
  border: 1px solid var(--fx-line-2);
  border-radius: 12px;
  background: var(--fx-surface);
}

.ioc-sheet .apex-io-rules > label > div:focus-within {
  border-color: var(--fx-accent-line);
  box-shadow: 0 0 0 3px var(--fx-focus);
}

/* 16px evita o zoom do iPhone ao tocar no campo. */
.ioc-sheet .apex-io-rules select {
  width: 100%;
  height: 46px;
  padding: 0 12px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--fx-text);
  font: 500 16px/1 var(--fx-font);
  color-scheme: inherit;
}

.ioc-sheet .apex-io-rules input[type=number] {
  height: 46px;
  color: var(--fx-text);
  font: 500 16px/1 var(--fx-font);
}

.ioc-sheet .apex-io-rules input[type=number]::placeholder {
  color: var(--fx-faint);
  font-weight: 400;
}

.ioc-sheet .apex-io-rules > label > div > b {
  color: var(--fx-faint);
  font-size: 13px;
  font-weight: 500;
}

.ioc-sheet .apex-io-check {
  grid-column: 1 / -1;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--fx-line-2);
  border-radius: 12px;
  background: var(--fx-surface);
}

.ioc-sheet .apex-io-check input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--fx-accent);
}

.ioc-sheet .apex-io-check strong {
  color: var(--fx-text);
  font-size: 14px;
  font-weight: 600;
}

.ioc-sheet .apex-io-check small {
  margin-top: 2px;
  color: var(--fx-muted);
  font-size: 12px;
}

.ioc-sheet .apex-io-check.is-locked {
  opacity: 0.6;
}

.ioc-sheet-foot {
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--fx-line);
}

.ioc-sheet-foot:empty {
  display: none;
}

.ioc-sheet-foot > [data-io-save] {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--fx-btn-ring);
  border-radius: 14px;
  background: var(--fx-btn);
  box-shadow: var(--fx-halo);
  color: #fff;
  font: 600 16px/1 var(--fx-font);
}

.ioc-sheet-foot > [data-io-save]:disabled {
  opacity: 0.6;
  cursor: wait;
}

.ioc-sheet-foot > [data-io-save]:hover:not(:disabled) {
  background: var(--fx-btn-hover);
}

/* ── Confirmação de rejeitar ── */
.ioc-confirm {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(360px, calc(100% - 32px));
  padding: 20px;
  border: 1px solid var(--fx-line-2);
  border-radius: 18px;
  background: var(--fx-bg-2);
  box-shadow: var(--fx-pop);
  transform: translate(-50%, -50%);
}

.ioc-confirm h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.ioc-confirm p {
  margin: 6px 0 18px;
  color: var(--fx-muted);
  font-size: 14px;
  line-height: 1.45;
}

.ioc-confirm > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

/* ── Mensagem ── */
.ioc-toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  z-index: 12;
  max-width: min(420px, calc(100% - 32px));
  padding: 12px 16px;
  border: 1px solid var(--fx-line-2);
  border-radius: 14px;
  background: var(--fx-surface-2);
  box-shadow: var(--fx-pop);
  color: var(--fx-text);
  font-size: 14px;
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.ioc-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.ioc-toast.is-ok { border-color: var(--fx-ok-line); color: var(--fx-ok-text); }
.ioc-toast.is-error { border-color: var(--fx-crit-line); color: var(--fx-crit-text); }

/* ── Aba "Instantâneas" na barra de baixo do celular (instant-offers-client-v1.js, installTab) ── */
.mobile-tabbar.ioc-has-tab .mobile-tab small {
  letter-spacing: 0.04em !important;
  white-space: nowrap;
}

/* Com a tela aberta, só a aba Instantâneas fica acesa. */
.mobile-tabbar.ioc-open .mobile-tab.active:not(.ioc-tab) {
  background: transparent !important;
  color: var(--fx-faint) !important;
}

.mobile-tabbar.ioc-open .mobile-tab.active:not(.ioc-tab)::before,
.mobile-tabbar.ioc-open .mobile-tab.active:not(.ioc-tab)::after {
  opacity: 0;
}

.mobile-tabbar .ioc-tab {
  position: relative;
}

.mobile-tabbar .ioc-tab .ioc-tab-dot {
  position: absolute;
  top: 7px;
  left: calc(50% + 9px);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--fx-ok);
  box-shadow: 0 0 0 2px var(--fx-bg);
}

.mobile-tabbar .ioc-tab .ioc-tab-dot[hidden] {
  display: none;
}

/* A tela abre entre o topo do app e a barra, como as outras abas; sem a seta de voltar.
   Camada 80: abaixo da barra (85), do topo (90) e das janelas do app (menu do perfil, avisos: 9998),
   que abrem por cima dela como em qualquer outra tela. Mesmo fundo das outras telas. */
#apex-instant-offers-root.ioc-tabbed {
  top: var(--ioc-topbar-h, 0px);
  bottom: var(--ioc-tabbar-h, 0px);
  z-index: 80 !important;
}

#apex-instant-offers-root.ioc-tabbed,
#apex-instant-offers-root.ioc-tabbed .apex-io-shell {
  background: var(--fx-bg) !important;
}

#apex-instant-offers-root.ioc-tabbed .ioc-head {
  grid-template-columns: minmax(0, 1fr) 42px;
  padding-top: 14px;
}

#apex-instant-offers-root.ioc-tabbed [data-ioc-back] {
  display: none;
}

/* Janelas (estação e regras, mapa, confirmação) ficam dentro da tela: acima da barra de baixo e
   abaixo do topo do app, para o rodapé (Salvar, Aceitar) não sumir atrás da barra. */
#apex-instant-offers-root.ioc-tabbed .ioc-sheet-wrap,
#apex-instant-offers-root.ioc-tabbed .ioc-confirm-wrap {
  top: var(--ioc-topbar-h, 0px);
  bottom: var(--ioc-tabbar-h, 0px);
}

/* A mensagem fica logo acima da barra de baixo (a tela está numa camada abaixo dela). */
#apex-instant-offers-root.ioc-tabbed .ioc-toast {
  bottom: calc(var(--ioc-tabbar-h, 0px) + 12px);
}

/* ── Celular: estação e regras uma embaixo da outra, para caber o nome inteiro ── */
@media (max-width: 519px) {
  .ioc-rows { grid-template-columns: 1fr; }
  .ioc-row + .ioc-row { border-left: 0; border-top: 1px solid var(--fx-line-2); }
}

@media (max-width: 370px) {
  .ioc-tile strong { font-size: 22px; }
  .ioc-sheet .apex-io-rules { grid-template-columns: 1fr; }
}

/* ── Computador: janela no centro ── */
@media (min-width: 720px) {
  .ioc-on .apex-io-content { padding-top: 12px; }
  .ioc-sheet {
    top: 50%;
    bottom: auto;
    border-bottom: 1px solid var(--fx-line-2);
    border-radius: 22px;
    opacity: 0;
    transform: translate(-50%, -46%);
    transition: transform 0.22s ease, opacity 0.22s ease;
  }
  .ioc-sheet-wrap.is-open .ioc-sheet {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
  .ioc-grab { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .ioc-wave,
  .ioc-badge i,
  .ioc-offer,
  .ioc[data-tone=busy] .ioc-core::after { animation: none !important; }
  .ioc-sheet, .ioc-backdrop, .ioc-toast { transition: none; }
}
