/* ========================================================================
   SMKlog calculator — "booking" skin (owner pick 2026-08-10, variant 1).
   Loads AFTER calculator-v4.css and wins the cascade for the desktop look:
   white booking-style surfaces, the route drawn as a flight path, one 48px
   control system, Paste link elevated as the accurate path. Every rule that
   changes geometry lives above the 620px phone breakpoint — the mobile flow
   keeps the v4 layout untouched, only colors/radii bleed through where safe.
   ======================================================================== */

:root {
  --bk-navy: #0b2744;
  --bk-blue: #075cf7;
  --bk-orange: #ff4b12;
  --bk-green: #0e8a3e;
  --bk-green-bg: #e6f6ec;
  --bk-green-line: #bfe6cd;
  --bk-bg: #eef3f8;
  --bk-panel: #f6f9fc;
  --bk-ink: #0b2744;
  --bk-muted: #54708c;
  --bk-faint: #7d95ab;
  --bk-line: #d9e4ef;
  --bk-line-2: #c3d3e2;
  --bk-blue-tint: #ecf3fe;
  --bk-focus: rgba(7, 92, 247, .16);
  --bk-r: 12px;
  --bk-h: 48px;
}

/* ---------- page ground: flat booking gray, faint route doodle ---------- */
body.calculator-page {
  background:
    radial-gradient(circle at 12% -4%, rgba(7, 92, 247, .05), transparent 30%),
    var(--bk-bg) !important;
}

@media (min-width: 621px) {

  /* ---------- step bar: white card, numbered circles, dashes ---------- */
  .calc-stepbar {
    border: 1px solid var(--bk-line);
    border-radius: 16px;
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 14px 34px rgba(11, 39, 68, .07);
    padding: 10px 16px;
  }
  .calc-stepbar-title { color: var(--bk-ink); }
  .calc-stepbar-title span { color: var(--bk-faint); }
  .calc-steps { gap: 0; }
  .calc-steps span {
    position: relative;
    background: transparent !important;
    color: var(--bk-muted) !important;
    box-shadow: none !important;
    font-size: 12.5px !important;
    font-weight: 800;
    gap: 8px;
    min-height: 40px !important;
    white-space: nowrap;
  }
  .calc-steps span.is-active { background: transparent !important; box-shadow: none !important; }
  /* the numbered circle */
  .calc-steps span::before {
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    flex: none;
    border-radius: 50%;
    background: #edf3f8;
    color: var(--bk-muted);
    font-size: 12px;
    font-weight: 900;
    margin-right: 0 !important;
  }
  .calc-steps [data-step="shipment"]::before { content: "1"; }
  .calc-steps [data-step="rate"]::before { content: "2"; }
  .calc-steps [data-step="pay"]::before { content: "3"; }
  .calc-steps [data-step="label"]::before { content: "4"; }
  .calc-steps span.is-active {
    color: var(--bk-ink) !important;
  }
  .calc-steps span.is-active::before {
    background: var(--bk-blue);
    color: #fff;
    box-shadow: 0 0 0 4px var(--bk-focus);
  }
  .calc-steps span.is-done:not(.is-active) {
    color: var(--bk-green) !important;
  }
  .calc-steps span.is-done:not(.is-active)::before {
    content: "\2713";
    background: var(--bk-green-bg);
    color: var(--bk-green);
  }
  /* dashed connectors between steps, like the flight-leg dividers */
  .calc-steps span + span::after {
    content: "";
    position: absolute;
    left: -26px;
    top: 50%;
    width: 20px;
    border-top: 2px dashed var(--bk-line-2);
  }
  .calc-steps { grid-template-columns: repeat(4, auto); column-gap: 30px; justify-content: start; }
  /* section numbering follows DOM order while Route displays first — the
     stray circled digits read as a broken sequence, so the booking layout
     drops them and lets the titles speak. */
  .calc-section-title::before { display: none !important; }
  .calc-section.route-section .calc-section-title { display: none; }
  .calc-freight-link { border-radius: 9px; }
  .calc-reset-inline { border-radius: 9px; }

  /* ---------- panels ---------- */
  .calc-panel, .calc-output {
    border: 1px solid var(--bk-line) !important;
    border-radius: 20px !important;
    background: #fff !important;
    box-shadow: 0 22px 50px rgba(11, 39, 68, .08) !important;
  }
  .calc-panel { border-left: 1px solid var(--bk-line) !important; padding: 26px 28px !important; }

  /* runtime badge off the face (element stays for the JS that writes it);
     the mode banner below still announces non-live states. */
  .calc-status-row { display: none; }

  .calc-hero-v5 { text-align: center; margin: 2px 0 18px; }
  .calc-hero-v5 h2 {
    margin: 0 0 6px;
    font-size: 30px;
    line-height: 1.08;
    letter-spacing: -.3px;
    color: var(--bk-ink);
    text-wrap: balance;
  }
  .calc-hero-v5 p { margin: 0 auto; max-width: 640px; color: var(--bk-muted); font-size: 13.5px; line-height: 1.5; }

  /* ---------- form sections lose their boxes; groups breathe ---------- */
  .calc-section {
    border: 0 !important;
    padding: 0 !important;
    background: transparent !important;
  }
  .calc-section-title { margin: 0 0 10px !important; }
  .calc-section-title::before { background: var(--bk-blue-tint) !important; color: var(--bk-blue) !important; }
  .calc-section-title strong { font-size: 14px !important; color: var(--bk-ink) !important; }

  /* route first, then the item — the booking order */
  .calc-panel .smk-form { row-gap: 20px !important; }
  .calc-section.route-section { order: -1; grid-column: 1 / -1 !important; }
  .calc-section.type-section { display: none; }
  .calc-section.shipment-section { grid-column: 1 / -1 !important; }

  /* ---------- route hero: endpoint cards + flight arc ---------- */
  .route-zips {
    display: grid !important;
    grid-template-columns: 1fr 248px 1fr !important;
    gap: 18px !important;
    align-items: stretch;
  }
  .route-endpoint {
    border: 1px solid var(--bk-line);
    border-radius: 14px;
    background: var(--bk-panel);
    padding: 14px 16px !important;
    display: grid;
    gap: 6px;
    align-content: start;
  }
  .route-endpoint > span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 10.5px !important;
    font-weight: 900 !important;
    letter-spacing: .6px;
    text-transform: uppercase;
    color: var(--bk-muted) !important;
  }
  .route-endpoint > span::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 2.5px solid var(--bk-blue);
  }
  .route-endpoint-to > span::before { background: var(--bk-orange); border-color: var(--bk-orange); }
  .route-endpoint input {
    min-height: var(--bk-h) !important;
    border: 1px solid var(--bk-line-2) !important;
    border-radius: var(--bk-r) !important;
    background: #fff !important;
    font-size: 20px !important;
    font-weight: 800;
    letter-spacing: .5px;
    color: var(--bk-ink) !important;
  }
  .route-endpoint input:focus { border-color: var(--bk-blue) !important; box-shadow: 0 0 0 4px var(--bk-focus); outline: none; }
  .route-endpoint-sub { color: var(--bk-faint); font-size: 11.5px; }
  .route-mid {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
  }
  .route-arc { width: 240px; height: 92px; display: block; overflow: visible; }
  .route-arc-under { opacity: .14; stroke-dasharray: none; }
  .route-arc-dash { stroke-dasharray: 7 8; animation: bk-flow 1.6s linear infinite; }
  @keyframes bk-flow { to { stroke-dashoffset: -15; } }
  .route-parcel { animation: bk-bob 2.4s ease-in-out infinite; transform-origin: 120px 24px; }
  @keyframes bk-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
  .route-swap {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid var(--bk-line-2);
    background: #fff;
    color: var(--bk-blue);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: transform .2s ease, border-color .15s ease, box-shadow .15s ease;
  }
  .route-swap:hover { border-color: var(--bk-blue); box-shadow: 0 6px 14px rgba(7, 92, 247, .18); transform: rotate(180deg); }
  .route-swap:focus-visible { outline: 2px solid var(--bk-blue); outline-offset: 2px; }

  /* ---------- item entry: neutral Describe, elevated Paste link ---------- */
  .product-source-toggle { gap: 12px !important; }
  .product-source-toggle label {
    min-height: 56px !important;
    border-radius: var(--bk-r) !important;
    border: 1.5px solid var(--bk-line-2) !important;
    background: #fff !important;
    align-content: center;
    padding: 10px 14px !important;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
  }
  .product-source-toggle label:hover { border-color: var(--bk-blue) !important; }
  .product-source-toggle strong { font-size: 14px !important; display: flex; align-items: center; gap: 8px; }
  .product-source-toggle label:has(input:checked) {
    border-color: var(--bk-ink) !important;
    background: #fff !important;
    box-shadow: 0 8px 20px rgba(11, 39, 68, .10) !important;
  }
  /* the accurate path keeps its glow even when not selected */
  .product-source-toggle label:has(input[value="url"]) {
    border-color: #b8d0fb !important;
    background: linear-gradient(180deg, #fff, var(--bk-blue-tint)) !important;
  }
  .product-source-toggle label:has(input[value="url"]:checked) {
    border-color: var(--bk-blue) !important;
    box-shadow: 0 0 0 4px var(--bk-focus), 0 8px 20px rgba(7, 92, 247, .14) !important;
  }
  .product-source-toggle label:has(input[value="url"]) strong { color: var(--bk-blue); }
  .acc-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 1px solid #ffd2c2;
    border-radius: 999px;
    background: #fff1ea;
    color: #c73a0a;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .5px;
    text-transform: uppercase;
    padding: 3px 8px;
  }
  .acc-badge::before { content: "\2713"; }
  /* equal reserved height: switching Describe/Paste must not move the page.
     94px is the measured height of the taller (manual) panel — the shorter
     one pads up to it instead of letting the page breathe in and out. */
  .product-source-panel { min-height: 94px; align-content: start; }
  .product-source-panel input {
    min-height: var(--bk-h) !important;
    border-radius: var(--bk-r) !important;
    border: 1px solid var(--bk-line-2) !important;
    font-size: 15px !important;
  }
  .product-source-panel input:focus { border-color: var(--bk-blue) !important; box-shadow: 0 0 0 4px var(--bk-focus); outline: none; }
  .product-source-panel .small { color: var(--bk-faint) !important; }

  .qty-row { align-items: center; }
  .qty-stepper button {
    min-width: 44px;
    min-height: 44px;
    border-radius: 10px !important;
    border: 1px solid var(--bk-line-2) !important;
    background: #fff !important;
    color: var(--bk-ink) !important;
    font-size: 18px;
    font-weight: 800;
  }
  .qty-stepper button:hover { border-color: var(--bk-blue) !important; color: var(--bk-blue) !important; }
  .qty-stepper input { min-height: 44px !important; border-radius: 10px !important; font-weight: 800; }

  /* advanced options: quiet dashed row, booking style */
  .calc-advanced-toggle {
    border-radius: var(--bk-r) !important;
    border: 1.5px dashed var(--bk-line-2) !important;
    background: var(--bk-panel) !important;
    min-height: 52px;
  }
  .calc-advanced-toggle:hover { border-color: var(--bk-blue) !important; }

  /* ---------- primary action ---------- */
  .calc-panel .btn.block[type="submit"], .calc-form-actions .btn.block {
    min-height: 54px !important;
    border-radius: 14px !important;
    background: linear-gradient(180deg, #ff5c28, var(--bk-orange)) !important;
    box-shadow: 0 16px 30px rgba(255, 75, 18, .28) !important;
    font-size: 16px !important;
    letter-spacing: .2px;
  }
  .calc-panel .btn.block[type="submit"]:hover { filter: brightness(1.04); }
  .calc-reset-inline { min-height: 54px; }

  /* ---------- rate screen: white booking cards ---------- */
  .calculator-page .smart-rate-choices { gap: 10px !important; }
  .calculator-page .smart-rate-choice {
    border: 1.5px solid var(--bk-line) !important;
    border-radius: 14px !important;
    background: #fff !important;
    padding: 14px 16px !important;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  }
  .calculator-page .smart-rate-choice:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(11, 39, 68, .10);
    border-color: var(--bk-line-2) !important;
  }
  .calculator-page .smart-rate-choice:has(input:checked),
  .calculator-page .smart-rate-choice.rate-recommended:has(input:checked) {
    border-color: var(--bk-blue) !important;
    box-shadow: 0 0 0 4px var(--bk-focus), 0 12px 26px rgba(7, 92, 247, .12) !important;
  }
  .calculator-page .rate-badge {
    border-radius: 999px !important;
    background: var(--bk-green-bg) !important;
    border: 1px solid var(--bk-green-line) !important;
    color: var(--bk-green) !important;
    font-weight: 900 !important;
  }
  .calculator-page .rate-card-price { color: var(--bk-ink) !important; font-weight: 900 !important; }
  .calculator-page .rate-save {
    border-radius: 999px;
    background: var(--bk-green-bg);
    border: 1px solid var(--bk-green-line);
    color: var(--bk-green);
    padding: 3px 9px;
    font-weight: 900;
  }
  .calculator-page .rate-choose-btn {
    border-radius: 12px !important;
    background: linear-gradient(180deg, #ff5c28, var(--bk-orange)) !important;
    box-shadow: 0 12px 24px rgba(255, 75, 18, .24) !important;
    min-height: 48px;
    font-size: 15px !important;
  }
  .rate-continue-bar .btn {
    border-radius: 14px !important;
    min-height: 54px;
    background: linear-gradient(180deg, #ff5c28, var(--bk-orange)) !important;
    box-shadow: 0 16px 34px rgba(255, 75, 18, .30) !important;
    font-size: 16px !important;
  }
  .calculator-page .rate-and-protection-box,
  .calculator-page .smart-policy-box {
    border-radius: 16px !important;
    border-color: var(--bk-line) !important;
  }
  .calculator-page .package-confirm {
    border-radius: 16px !important;
    border: 1px solid var(--bk-line) !important;
    background: var(--bk-panel) !important;
  }
  .step-backlink { color: var(--bk-blue); }

  /* ---------- pay + label screens: same surface language ----------
     Text inputs only: a blanket `input` rule here once blew checkboxes
     and radios up to 46px squares and wrecked the restricted-content
     grid (owner report 2026-08-11). */
  .calculator-page .smart-checkout-grid input:not([type="checkbox"]):not([type="radio"]),
  .calculator-page .smart-checkout-grid select,
  .calculator-page .smart-policy-box input:not([type="checkbox"]):not([type="radio"]),
  .calculator-page .smart-policy-box select {
    min-height: 46px !important;
    border-radius: var(--bk-r) !important;
    border: 1px solid var(--bk-line-2) !important;
  }
  .calculator-page .smart-checkout-grid input:not([type="checkbox"]):not([type="radio"]):focus,
  .calculator-page .smart-policy-box input:not([type="checkbox"]):not([type="radio"]):focus {
    border-color: var(--bk-blue) !important;
    box-shadow: 0 0 0 4px var(--bk-focus);
    outline: none;
  }
  .calculator-page .order-summary {
    border-radius: 16px !important;
    border: 1px solid var(--bk-line) !important;
    background: var(--bk-panel) !important;
  }
  .calculator-page [data-create-checkout-session],
  .calculator-page [data-create-demo-label],
  .calculator-page .label-download-btn {
    border-radius: 14px !important;
    min-height: 54px !important;
    background: linear-gradient(180deg, #ff5c28, var(--bk-orange)) !important;
    box-shadow: 0 16px 30px rgba(255, 75, 18, .28) !important;
    font-size: 16px !important;
  }
}

@media (max-width: 620px) {
  /* phones keep the v4 flow; only the new route decorations bow out */
  .route-mid { display: none; }
  .route-endpoint-sub { display: none; }
  .acc-badge { font-size: 9px; padding: 2px 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .route-arc-dash, .route-parcel { animation: none !important; }
  .route-swap, .calculator-page .smart-rate-choice { transition: none !important; }
}

/* ------------------------------------------------------------------ */
/* v2 rate screen (owner mockup pick 2026-08-11, variant 1b screen 2):
   quiet header with one account door, floating context cards, one row
   per rate, orange continue bar. Desktop only — phones keep v4 flow.  */
/* ------------------------------------------------------------------ */
@media (min-width: 621px) {
  /* Header: the calculator is the product screen — marketing nav and the
     self-referential CTA step aside, one bordered "My account" pill stays. */
  .calculator-page .header nav a:not(.header-account-btn) { display: none; }
  .calculator-page .header-account-btn {
    display: inline-flex; align-items: center; gap: 8px;
    border: 1.5px solid var(--bk-line); border-radius: 999px;
    padding: 9px 18px; font-size: 13.5px; font-weight: 800;
    color: var(--bk-navy); background: #fff;
    transition: border-color .16s, color .16s, box-shadow .16s;
  }
  .calculator-page .header-account-btn svg { width: 16px; height: 16px; }
  .calculator-page .header-account-btn:hover { border-color: var(--bk-blue); color: var(--bk-blue); box-shadow: 0 0 0 4px var(--bk-focus); }
  /* The stepbar sign-in chip duplicates the header door */
  .calc-stepbar [data-account-area] { display: none !important; }

  /* The rate screen floats its cards straight on the page background */
  body.vstep-rate .calc-output,
  body.vstep-rate .smart-results,
  body.vstep-rate .rate-and-protection-box {
    background: transparent !important; border: 0 !important;
    box-shadow: none !important; padding: 0 !important;
  }
  .calculator-page .rate-screen-head .rate-choose-heading { font-size: 30px; }
  .calculator-page .ctx-card { border-radius: 16px !important; }
  .calculator-page .smart-rate-choices { gap: 10px !important; margin-top: 0 !important; }
  .calculator-page .rate-card {
    background: #fff !important; border: 1.5px solid var(--bk-line) !important;
    border-radius: 16px !important; padding: 16px 18px !important;
    transition: border-color .16s, box-shadow .16s;
  }
  .calculator-page .rate-card:hover { border-color: #b9cede !important; box-shadow: 0 10px 24px rgba(18, 39, 66, .08); }
  .calculator-page .rate-card:has(input:checked), .calculator-page .smart-rate-choice:has(input:checked) {
    border-color: var(--bk-blue) !important;
    background: linear-gradient(180deg, #f8fbff, #fff) !important;
    box-shadow: 0 0 0 3px var(--bk-focus), 0 14px 30px rgba(7, 92, 247, .10);
  }
  /* Row anatomy: pick circle | carrier chip | name+fact | delivery | price.
     The delivery cell sizes to its one-line text and rides against the
     price column, so its right edge lines up on every card. */
  .calculator-page .rate-card-body {
    display: grid !important;
    grid-template-columns: 24px 54px minmax(0, 1fr) auto auto;
    align-items: center; gap: 14px !important;
  }
  .calculator-page .rate-card-main { gap: 3px !important; }
  .calculator-page .rate-name-row strong { font-size: 15.5px; }
  .calculator-page .rate-card-when { justify-self: end; }
  .calculator-page .rate-when-date { font-size: 13px; }
  .calculator-page .rate-card-side { gap: 2px !important; min-width: 118px; }
  .calculator-page .rate-card-price { font-size: 20px !important; letter-spacing: -.3px; }

  /* Continue bar rides the bottom edge with the booking CTA language */
  .calculator-page .rate-continue-bar { border-radius: 16px !important; }
  .calculator-page .rate-continue-bar .btn {
    border-radius: 14px !important; min-height: 52px !important;
    background: linear-gradient(180deg, #ff5c28, var(--bk-orange)) !important;
    box-shadow: 0 16px 30px rgba(255, 75, 18, .28) !important;
    font-size: 15.5px !important;
  }
  .calculator-page .rate-continue-bar .btn::after { content: " \2192"; }
}

@media (max-width: 620px) {
  /* phones keep the site header exactly as it was */
  .calculator-page .header nav a.header-account-btn { display: none; }
}

/* Checkboxes and radios keep a finger-friendly 16px box on every width —
   the sizing lived inside the desktop media block and phones fell back to
   13px native boxes (QA find 2026-08-11). */
.calculator-page .smart-policy-box input[type="checkbox"],
.calculator-page .smart-policy-box input[type="radio"],
.calculator-page .smart-checkout-grid input[type="checkbox"],
.calculator-page .smart-checkout-grid input[type="radio"] {
  width: 16px !important;
  height: 16px !important;
  min-height: 0 !important;
  accent-color: var(--bk-blue);
  flex: 0 0 auto;
}
