
  :root {
    --bg: #f6f7f8;
    --surface: #ffffff;
    --surface-2: #fafbfc;
    --border: #e4e7ec;
    --border-strong: #d0d5dd;
    --ink: #101828;
    --ink-2: #344054;
    --ink-3: #667085;
    --ink-4: #98a2b3;
    --accent: #0f5e5e;
    --accent-soft: #e6f0ee;
    --accent-ink: #0a4444;
    --warn: #b54708;
    --warn-soft: #fff8eb;
    --ok: #067647;
    --ok-soft: #ecfdf3;
    --err: #b42318;
    --err-soft: #fef3f2;
    --shadow-sm: 0 1px 2px rgba(16,24,40,.05);
    --shadow: 0 1px 3px rgba(16,24,40,.06), 0 1px 2px rgba(16,24,40,.04);
    --radius: 6px;
    --radius-lg: 10px;
    --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  }
  * { box-sizing: border-box; }
  html, body { margin: 0; padding: 0; }
  body {
    font-family: "Inter", system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--ink);
    font-size: 14px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    font-feature-settings: "ss01", "cv11";
  }
  button { font-family: inherit; }
  .num, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

  /* App shell */
  .app {
    min-height: 100vh;
    display: grid;
    grid-template-rows: 56px 1fr;
  }
  .topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
  }
  .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: -0.01em;
  }
  .brand-mark {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: var(--accent);
    color: #fff;
    display: grid;
    place-items: center;
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 600;
  }
  .brand small {
    color: var(--ink-3);
    font-weight: 400;
    font-size: 12px;
    margin-left: 2px;
  }
  .crumb {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--ink-3);
    font-size: 12.5px;
  }
  .crumb .step {
    padding: 3px 8px;
    border-radius: 4px;
  }
  .crumb .step.is-active {
    color: var(--ink);
    background: #eef2f4;
    font-weight: 500;
  }
  .crumb .sep { color: var(--ink-4); }
  .topbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--ink-3);
    font-size: 12.5px;
  }
  .endpoint {
    font-family: var(--mono);
    font-size: 11.5px;
    color: var(--ink-3);
    background: #f1f3f5;
    padding: 3px 8px;
    border-radius: 4px;
  }
  .who {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .who .avatar {
    width: 24px; height: 24px; border-radius: 50%;
    background: #e4e7ec; color: var(--ink-2);
    display: grid; place-items: center;
    font-size: 11px; font-weight: 600;
  }

  .main { padding: 24px 32px 64px; max-width: 1480px; width: 100%; margin: 0 auto; }

  /* Page header */
  .page-h {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 18px;
    gap: 24px;
  }
  .page-h h1 {
    font-size: 22px;
    line-height: 1.2;
    margin: 0 0 4px;
    letter-spacing: -0.01em;
    font-weight: 600;
  }
  .page-h p {
    margin: 0;
    color: var(--ink-3);
    font-size: 13.5px;
  }
  .page-h .actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
  }

  /* Buttons */
  .btn {
    appearance: none;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--ink-2);
    padding: 7px 12px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: var(--shadow-sm);
    transition: background .12s, border-color .12s, color .12s;
  }
  .btn:hover { background: #f7f8fa; border-color: #b8c0cc; }
  .btn:active { background: #f0f2f5; }
  .btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
  }
  .btn-primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
  .btn-ghost {
    border-color: transparent;
    background: transparent;
    box-shadow: none;
    color: var(--ink-2);
  }
  .btn-ghost:hover { background: #eef0f2; }
  .btn-danger-ghost {
    border-color: transparent;
    background: transparent;
    box-shadow: none;
    color: var(--ink-3);
    padding: 6px 8px;
  }
  .btn-danger-ghost:hover { color: var(--err); background: var(--err-soft); }
  .btn[disabled] { opacity: .55; cursor: not-allowed; }
  .btn .ico { width: 14px; height: 14px; flex-shrink: 0; }
  .btn-sm { padding: 5px 9px; font-size: 12.5px; }

  /* Cards / panels */
  .card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
  }
  .card-h {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }
  .card-h h2 {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    color: var(--ink);
    letter-spacing: -0.005em;
  }
  .card-h .sub {
    color: var(--ink-3);
    font-size: 12.5px;
  }

  /* Itinerary table */
  .itable-wrap {
    overflow-x: auto;
  }
  .itable {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
  }
  .itable thead th {
    text-align: left;
    padding: 10px 12px;
    font-weight: 500;
    color: var(--ink-3);
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
  }
  .itable thead th:first-child { padding-left: 18px; }
  .itable thead th:last-child { padding-right: 18px; }
  .itable td {
    padding: 8px 8px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
  }
  .itable td:first-child {
    padding-left: 18px;
    color: var(--ink-3);
    font-family: var(--mono);
    font-size: 12px;
    width: 36px;
  }
  .itable td:last-child {
    padding-right: 18px;
    width: 32px;
  }
  .itable tr:last-child td { border-bottom: 0; }
  .itable input,
  .itable select {
    width: 100%;
    border: 1px solid transparent;
    background: transparent;
    padding: 7px 8px;
    font: inherit;
    color: var(--ink);
    border-radius: 5px;
    transition: background .12s, border-color .12s, box-shadow .12s;
  }
  .itable input:hover,
  .itable select:hover {
    background: #f7f8fa;
  }
  .itable input:focus,
  .itable select:focus {
    outline: none;
    background: var(--surface);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(15,94,94,.12);
  }
  .itable select { appearance: none; padding-right: 22px; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' stroke='%23667085' stroke-width='1.5' fill='none' stroke-linecap='round'/></svg>"); background-repeat: no-repeat; background-position: right 7px center; }
  .itable .dt input { font-family: var(--mono); font-size: 12.5px; }

  .itable tfoot td {
    padding: 10px 18px;
    background: var(--surface-2);
    border-top: 1px solid var(--border);
  }

  .row-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
  }

  /* Upload + saved batches */
  .home-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 20px;
    align-items: start;
  }
  .side { display: flex; flex-direction: column; gap: 16px; }

  .upload {
    border: 1.5px dashed var(--border-strong);
    border-radius: var(--radius-lg);
    background: var(--surface);
    padding: 18px 18px;
    text-align: left;
    color: var(--ink-3);
    font-size: 13px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    display: flex;
    gap: 12px;
    align-items: center;
  }
  .upload:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
  .upload .ico-wrap {
    width: 36px; height: 36px;
    border-radius: 8px;
    background: #eef2f4;
    color: var(--ink-2);
    display: grid; place-items: center;
    flex-shrink: 0;
  }
  .upload b { color: var(--ink); font-weight: 600; display: block; font-size: 13.5px; }
  .upload .hint { font-family: var(--mono); font-size: 11.5px; color: var(--ink-4); margin-top: 2px; }

  .saved-list { padding: 6px 0; }
  .saved-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 18px;
    gap: 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
  }
  .saved-item:last-child { border-bottom: 0; }
  .saved-item:hover { background: var(--surface-2); }
  .saved-item .name { font-size: 13px; font-weight: 500; color: var(--ink); }
  .saved-item .meta { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
  .saved-item .count {
    font-family: var(--mono);
    font-size: 11.5px;
    color: var(--ink-3);
    background: #f1f3f5;
    padding: 2px 7px;
    border-radius: 10px;
  }

  /* Footer bar (sticky-ish actions) */
  .footer-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 12px 18px;
    box-shadow: var(--shadow);
  }
  .footer-bar .summary { color: var(--ink-3); font-size: 13px; }
  .footer-bar .summary b { color: var(--ink); font-weight: 600; }
  .footer-bar .actions { display: flex; gap: 8px; }

  /* Progress screen */
  .progress-grid {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
  }
  .iti-list { padding: 6px 0; }
  .iti-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 11px 18px;
    border-left: 3px solid transparent;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
  }
  .iti-item:last-child { border-bottom: 0; }
  .iti-item:hover { background: var(--surface-2); }
  .iti-item.is-active {
    background: var(--accent-soft);
    border-left-color: var(--accent);
  }
  .iti-item .top {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
  }
  .iti-item .route {
    font-size: 13px;
    font-weight: 500;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .iti-item .meta { font-size: 11.5px; color: var(--ink-3); font-family: var(--mono); }
  .iti-item .pill-mini {
    font-size: 11px;
    font-family: var(--mono);
    color: var(--ink-3);
    background: #f1f3f5;
    padding: 2px 6px;
    border-radius: 10px;
    flex-shrink: 0;
  }
  .iti-item.is-active .pill-mini { background: rgba(15,94,94,.1); color: var(--accent-ink); }

  .iti-detail .iti-detail-h {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
  }
  .iti-detail-h .route-big {
    font-size: 15px;
    font-weight: 600;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .iti-detail-h .route-big .arrow { color: var(--ink-4); }
  .iti-detail-h .meta-row {
    display: flex;
    gap: 16px;
    margin-top: 6px;
    color: var(--ink-3);
    font-size: 12.5px;
  }
  .iti-detail-h .meta-row b { color: var(--ink-2); font-weight: 500; }
  .iti-detail-h .meta-row .mono { font-size: 12px; }

  .broker-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 16px 18px;
  }
  .broker-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-2);
  }
  .broker-row .bname {
    font-weight: 500;
    color: var(--ink);
    font-size: 13px;
    flex: 1;
  }
  .broker-row .btime {
    font-family: var(--mono);
    font-size: 11.5px;
    color: var(--ink-3);
  }

  .status-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--ink-4);
    flex-shrink: 0;
  }
  .status-dot.queued { background: #cbd2da; }
  .status-dot.running {
    background: var(--accent);
    box-shadow: 0 0 0 3px rgba(15,94,94,.18);
    animation: pulse 1.4s ease-in-out infinite;
  }
  .status-dot.done { background: var(--ok); }
  .status-dot.error { background: var(--err); }
  @keyframes pulse {
    0%,100% { box-shadow: 0 0 0 0 rgba(15,94,94,.35); }
    50% { box-shadow: 0 0 0 5px rgba(15,94,94,0); }
  }

  .pill {
    font-size: 11px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-family: var(--mono);
  }
  .pill.queued { background: #f1f3f5; color: var(--ink-3); border-color: var(--border); }
  .pill.running { background: var(--accent-soft); color: var(--accent-ink); border-color: rgba(15,94,94,.18); }
  .pill.done { background: var(--ok-soft); color: var(--ok); border-color: rgba(6,118,71,.18); }
  .pill.error { background: var(--err-soft); color: var(--err); border-color: rgba(180,35,24,.18); }

  /* Global progress strip */
  .gprog {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 18px 14px;
  }
  .gprog .bar {
    flex: 1;
    height: 6px;
    background: #eef0f2;
    border-radius: 999px;
    overflow: hidden;
    position: relative;
  }
  .gprog .bar > span {
    display: block;
    height: 100%;
    background: var(--accent);
    border-radius: 999px;
    transition: width .4s ease;
  }
  .gprog .stat { font-family: var(--mono); font-size: 12px; color: var(--ink-3); white-space: nowrap; }
  .gprog .stat b { color: var(--ink); }

  /* Results */
  .res-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 10px 14px;
    box-shadow: var(--shadow);
  }
  .res-toolbar .left, .res-toolbar .right { display: flex; align-items: center; gap: 8px; }
  .seg {
    display: inline-flex;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    overflow: hidden;
    background: var(--surface);
  }
  .seg button {
    appearance: none;
    border: 0;
    background: transparent;
    padding: 6px 10px;
    font: inherit;
    font-size: 12.5px;
    color: var(--ink-2);
    cursor: pointer;
    border-right: 1px solid var(--border);
  }
  .seg button:last-child { border-right: 0; }
  .seg button.is-active { background: #eef2f4; color: var(--ink); font-weight: 500; }
  .search-input {
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    padding: 6px 10px 6px 30px;
    font-size: 13px;
    width: 240px;
    background: var(--surface) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2'><circle cx='11' cy='11' r='7'/><path d='m20 20-3.5-3.5'/></svg>") no-repeat 9px center;
  }
  .search-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(15,94,94,.12); }

  .results-stack { display: flex; flex-direction: column; gap: 16px; }

  .result-card { overflow: hidden; }
  .result-card-h {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto auto;
    gap: 14px;
    align-items: center;
  }
  .result-card-h .idx {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: #f1f3f5;
    color: var(--ink-2);
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 600;
    display: grid;
    place-items: center;
  }
  .result-card-h .route {
    font-size: 14.5px;
    font-weight: 600;
    letter-spacing: -0.005em;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .result-card-h .route .arrow { color: var(--ink-4); }
  .result-card-h .meta {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--ink-3);
    margin-top: 2px;
    display: flex;
    gap: 14px;
  }
  .result-card-h .meta b { color: var(--ink-2); font-weight: 500; }
  .result-card-h .summary {
    text-align: right;
    font-size: 12.5px;
    color: var(--ink-3);
  }
  .result-card-h .summary .price {
    font-family: var(--mono);
    font-size: 16px;
    font-weight: 600;
    color: var(--ink);
    display: block;
  }
  .result-card-h .summary .price .cur { font-size: 11px; color: var(--ink-3); margin-left: 3px; font-weight: 500; }
  .result-card-h .actions { display: flex; gap: 6px; align-items: center; }

  .broker-blocks {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-top: 1px solid var(--border);
  }
  .broker-block {
    padding: 14px 18px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
  }
  .broker-block:nth-child(2n) { border-right: 0; }
  .broker-block:nth-last-child(-n+2):not(:nth-child(2n+1) ~ *) { border-bottom: 0; }
  .broker-block .bh {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    gap: 8px;
  }
  .broker-block .bh .name {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .broker-block .bh .name .swatch {
    width: 10px; height: 10px; border-radius: 3px;
    background: var(--accent);
  }
  .broker-block .bh .meta { font-family: var(--mono); font-size: 11px; color: var(--ink-4); }

  .plan-table { width: 100%; font-size: 12.5px; border-collapse: collapse; }
  .plan-table td { padding: 6px 0; border-top: 1px dashed var(--border); }
  .plan-table tr:first-child td { border-top: 0; }
  .plan-table .pname { color: var(--ink-2); }
  .plan-table .pprice {
    text-align: right;
    font-family: var(--mono);
    font-variant-numeric: tabular-nums;
    color: var(--ink);
    font-weight: 500;
    white-space: nowrap;
  }
  .plan-table .pprice .cur { color: var(--ink-4); font-size: 10.5px; margin-left: 4px; font-weight: 400; }
  .plan-row.is-best .pname { color: var(--accent-ink); font-weight: 600; }
  .plan-row.is-best .pprice { color: var(--accent-ink); }
  .badge-best {
    display: inline-block;
    font-family: var(--mono);
    font-size: 9.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: var(--accent);
    color: #fff;
    padding: 1px 5px;
    border-radius: 3px;
    margin-right: 6px;
    vertical-align: middle;
  }
  .broker-block.has-error {
    background: var(--err-soft);
  }
  .broker-block.has-error .name { color: var(--err); }
  .broker-block .err-msg {
    font-size: 12px;
    color: var(--err);
    font-family: var(--mono);
    background: rgba(180,35,24,.06);
    padding: 6px 8px;
    border-radius: 4px;
  }
  .broker-block.is-propia {
    border-left: 3px solid var(--accent);
    background: var(--accent-soft);
  }
  .broker-block.is-propia .swatch { background: var(--accent-ink); }
  .delta-badge {
    display: inline-block;
    font-size: 11.5px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    margin-top: 4px;
  }
  .delta-badge.delta-cheaper { background: var(--ok-soft); color: var(--ok); }
  .delta-badge.delta-pricier { background: #fef3f2; color: var(--err); }
  .delta-badge.delta-same    { background: #f2f4f7; color: var(--ink-3); }

  /* Modal */
  .modal-back {
    position: fixed; inset: 0;
    background: rgba(16,24,40,.45);
    display: grid; place-items: center;
    z-index: 100;
    padding: 24px;
    backdrop-filter: blur(2px);
  }
  .modal {
    background: var(--surface);
    border-radius: var(--radius-lg);
    width: 720px;
    max-width: 100%;
    max-height: calc(100vh - 48px);
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 50px rgba(16,24,40,.25);
    overflow: hidden;
  }
  .modal-h {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .modal-h h3 { font-size: 14px; font-weight: 600; margin: 0; }
  .modal-h .seg { margin-right: 12px; }
  .modal-h .right { display: flex; align-items: center; gap: 8px; }
  .modal-body {
    padding: 0;
    flex: 1;
    overflow: auto;
  }
  .modal-body pre {
    margin: 0;
    padding: 18px;
    font-family: var(--mono);
    font-size: 12.5px;
    line-height: 1.55;
    color: var(--ink);
    background: var(--surface-2);
    white-space: pre-wrap;
    word-wrap: break-word;
  }
  .modal-body .rich {
    padding: 18px;
    font-size: 13px;
    color: var(--ink);
  }
  .modal-body .rich h4 { margin: 0 0 6px; font-size: 13.5px; }
  .modal-body .rich p { margin: 0 0 10px; color: var(--ink-3); font-size: 12.5px; }
  .modal-body .rich table { width: 100%; border-collapse: collapse; margin: 6px 0 18px; }
  .modal-body .rich th, .modal-body .rich td {
    text-align: left; padding: 6px 10px; font-size: 12.5px;
    border-bottom: 1px solid var(--border);
  }
  .modal-body .rich th { color: var(--ink-3); font-weight: 500; background: var(--surface-2); }
  .modal-body .rich td.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
  .modal-f {
    padding: 12px 18px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface-2);
  }
  .copy-status {
    color: var(--ok);
    font-size: 12.5px;
    font-weight: 500;
    opacity: 0;
    transform: translateY(2px);
    transition: opacity .2s, transform .2s;
  }
  .copy-status.is-on { opacity: 1; transform: translateY(0); }

  /* Empty state */
  .empty {
    padding: 48px 24px;
    text-align: center;
    color: var(--ink-3);
    font-size: 13.5px;
  }
  .empty b { color: var(--ink-2); display: block; font-size: 14px; margin-bottom: 4px; }

  /* Progress overlay (small floating run indicator on home if needed) */
  .toast {
    position: fixed;
    bottom: 18px; left: 18px;
    background: var(--ink);
    color: #fff;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 12.5px;
    box-shadow: 0 10px 25px rgba(0,0,0,.2);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 90;
  }

  /* Density variants */
  body[data-density="compact"] .itable td { padding: 4px 8px; }
  body[data-density="compact"] .itable input,
  body[data-density="compact"] .itable select { padding: 5px 8px; }
  body[data-density="compact"] .broker-block { padding: 10px 14px; }
  body[data-density="compact"] .plan-table td { padding: 4px 0; }
  body[data-density="compact"] .saved-item,
  body[data-density="compact"] .iti-item { padding-top: 8px; padding-bottom: 8px; }

  /* Accent variants */
  body[data-accent="indigo"] { --accent: #3538cd; --accent-soft: #eef2ff; --accent-ink: #2d31b3; }
  body[data-accent="slate"]  { --accent: #344054; --accent-soft: #eef2f6; --accent-ink: #1d2939; }
  body[data-accent="amber"]  { --accent: #b45309; --accent-soft: #fef6e7; --accent-ink: #92400e; }

  /* Hide best-price badge per tweak */
  body[data-best="off"] .badge-best { display: none; }
  body[data-best="off"] .plan-row.is-best .pname { font-weight: 500; color: var(--ink-2); }
  body[data-best="off"] .plan-row.is-best .pprice { color: var(--ink); }

  /* Misc */
  .kbd {
    font-family: var(--mono);
    font-size: 10.5px;
    background: #eef0f2;
    border: 1px solid var(--border);
    border-bottom-width: 2px;
    border-radius: 4px;
    padding: 0 5px;
    color: var(--ink-2);
  }
  .err-text { color: var(--err); }
  .ok-text { color: var(--ok); }

  /* Hidden file input */
  .hidden-file { display: none; }

/* ── MVP additions ─────────────────────────────────────────────────────── */

/* File input hidden (used by Importar JSON button) */
.hidden-file { display: none; }

/* Results toolbar (search bar row above results stack) */
.res-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}

/* Search/filter input */
.search-input {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 10px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--ink);
  background: var(--surface);
  outline: none;
  min-width: 240px;
}
.search-input:focus { border-color: var(--accent); }

/* Results stack (container for result cards) */
.results-stack { display: flex; flex-direction: column; gap: 16px; }

/* Copy status feedback in email modal */
.copy-status {
  font-size: 12.5px;
  color: var(--ok);
  opacity: 0;
  transition: opacity 0.2s;
}
.copy-status.is-on { opacity: 1; }

/* Rich text area inside email modal */
.modal-body .rich {
  font-size: 13.5px;
  line-height: 1.6;
}
.modal-body .rich table { border-collapse: collapse; width: 100%; margin-top: 8px; }
.modal-body .rich th, .modal-body .rich td {
  padding: 4px 8px;
  border: 1px solid var(--border);
  font-size: 12.5px;
}
.modal-body .rich h4 { margin: 0 0 4px; font-size: 13.5px; }

/* Progress grid (left list + right detail) */
.progress-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
}

/* Global progress bar */
.gprog {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
}
.gprog .bar {
  flex: 1;
  height: 8px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}
.gprog .bar span {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  transition: width 0.4s ease;
}
.gprog .stat { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }

/* Itinerary list in progress screen */
.iti-list { display: flex; flex-direction: column; }
.iti-item {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.iti-item:last-child { border-bottom: none; }
.iti-item:hover { background: var(--surface-2); }
.iti-item.is-active { background: var(--accent-soft); }
.iti-item .top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.iti-item .route { font-weight: 500; font-size: 13px; }

/* Itinerary detail panel */
.iti-detail-h { padding: 16px; border-bottom: 1px solid var(--border); }
.route-big { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.meta-row { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 12.5px; color: var(--ink-3); }
.broker-list { padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; }
.broker-row { display: flex; align-items: center; gap: 10px; }
.status-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  background: var(--ink-4);
}
.status-dot.running { background: var(--warn); }
.status-dot.done { background: var(--ok); }
.status-dot.error { background: var(--err); }
.bname { font-size: 13px; font-weight: 500; flex: 1; }

/* Status pills */
.pill {
  font-size: 11px; font-weight: 500; padding: 2px 7px; border-radius: 99px;
  background: var(--surface-2); color: var(--ink-3);
}
.pill.running { background: var(--warn-soft); color: var(--warn); }
.pill.done    { background: var(--ok-soft);   color: var(--ok);   }
.pill.error   { background: var(--err-soft);  color: var(--err);  }
.pill-mini    { font-size: 10px; padding: 1px 5px; border-radius: 99px; background: var(--surface-2); color: var(--ink-4); }

/* Result cards */
.result-card-h {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}
.result-card-h .idx {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-4);
  margin-top: 2px;
  flex-shrink: 0;
}
.result-card-h .route { font-size: 15px; font-weight: 600; }
.result-card-h .meta  { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.result-card-h .summary { margin-left: auto; text-align: right; flex-shrink: 0; }
.price { font-family: var(--mono); font-size: 18px; font-weight: 600; color: var(--ink); }
.price .cur { font-size: 12px; font-weight: 400; color: var(--ink-3); margin-left: 3px; }

/* Broker blocks inside result cards */
.broker-blocks { display: flex; flex-wrap: wrap; gap: 0; border-top: 1px solid var(--border); }
.broker-block { flex: 1; min-width: 220px; padding: 12px 16px; border-right: 1px solid var(--border); }
.broker-block:last-child { border-right: none; }
.broker-block.has-error .bh { color: var(--err); }
.bh { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.bh .name { display: flex; align-items: center; gap: 6px; font-weight: 500; font-size: 12.5px; }
.swatch { width: 8px; height: 8px; border-radius: 2px; background: var(--accent); display: inline-block; }
.err-msg { font-size: 12px; color: var(--err); }

/* Plan table */
.plan-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.plan-row td { padding: 3px 0; }
.plan-row.is-best td { font-weight: 600; color: var(--ok); }
.pname { color: var(--ink-2); }
.pprice { text-align: right; font-family: var(--mono); color: var(--ink); }
.pprice .cur { color: var(--ink-4); font-size: 11px; margin-left: 2px; }
.badge-best {
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  color: var(--ok); background: var(--ok-soft); padding: 1px 5px; border-radius: 3px;
  margin-right: 5px;
}

/* Toast notification */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff;
  padding: 10px 18px; border-radius: var(--radius);
  font-size: 13px; display: flex; align-items: center; gap: 8px;
  box-shadow: var(--shadow);
  z-index: 1000;
}

/* Home grid layout */
.home-grid { display: grid; grid-template-columns: 1fr 280px; gap: 16px; align-items: start; }
.side { display: flex; flex-direction: column; gap: 16px; }

/* Saved batch list */
.saved-list { display: flex; flex-direction: column; gap: 2px; }
.saved-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: var(--radius); font-size: 12.5px; }
.saved-item:hover { background: var(--surface-2); }
.saved-item .name { font-weight: 500; }
.saved-item .meta { color: var(--ink-4); font-size: 11.5px; }
.saved-item .count { color: var(--ink-3); font-size: 11.5px; font-family: var(--mono); }

/* Footer bar */
.footer-bar {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--surface); border-top: 1px solid var(--border);
  padding: 12px 32px;
  display: flex; align-items: center; justify-content: space-between;
  z-index: 100;
}
.footer-bar .summary { font-size: 13px; color: var(--ink-3); }
