:root {
  /* Palette derived from the ShipOtter logo: royal blue + orange. */
  --bg: #f4f6f9; --card: #fff; --ink: #14233b; --muted: #66738a;
  --line: #e2e8f1; --brand: #0050a0; --brand-d: #003a78; --brand-l: #e6eff8;
  --accent: #e06000; --danger: #c0392b; --ok-bg: #e6eff8; --ok-ink: #003a78;
  --warn-bg: #fdf3e0; --warn-ink: #8a5a13;
  --radius: 10px; --shadow: 0 1px 3px rgba(20,40,60,.08), 0 4px 14px rgba(20,40,60,.05);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }

/* topbar */
.topbar { display: flex; align-items: center; justify-content: space-between;
  background: var(--card); border-bottom: 1px solid var(--line); padding: 0 22px;
  position: sticky; top: 0; z-index: 10; box-shadow: var(--shadow); }
.brand { display: flex; align-items: baseline; gap: 9px; }
.brand a { display: inline-flex; text-decoration: none; }
.marketing-nav a { font-weight: 600; }
@media (max-width: 720px) { .marketing-nav { display: none; } }
.brand .logo { font-size: 22px; }
.brand .name { font-size: 20px; letter-spacing: -.4px; }
.brand .name b { color: var(--brand); }
.brand .tag { color: var(--muted); font-size: 12px; margin-left: 4px; }
nav { display: flex; align-items: center; gap: 6px; }
nav a { color: var(--muted); text-decoration: none; padding: 7px 13px; border-radius: 8px;
  font-weight: 500; }
nav a:hover { background: var(--bg); color: var(--ink); }
nav a.active { background: var(--brand-l); color: var(--brand-d); }

main { max-width: 1180px; margin: 22px auto; padding: 0 22px; }

/* flashes */
.flashes { max-width: 1180px; margin: 14px auto 0; padding: 0 22px; }
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 8px; font-weight: 500; }
.flash.ok { background: var(--ok-bg); color: var(--ok-ink); }
.flash.warn { background: var(--warn-bg); color: var(--warn-ink); }

/* dashboard strip */
.strip { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 18px; min-width: 92px; box-shadow: var(--shadow); }
.stat .num { display: block; font-size: 24px; font-weight: 700; line-height: 1; }
.stat .lbl { color: var(--muted); font-size: 12px; }
.stat.dim .num { color: var(--muted); }
.chanbar { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.chip.mini { font-size: 11px; padding: 4px 9px; }

/* toolbar / filters */
.toolbar { margin-bottom: 12px; }
.filters { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.flabel { color: var(--muted); font-size: 12px; }
.chip { display: inline-block; padding: 5px 12px; border-radius: 20px; text-decoration: none;
  color: var(--ink); background: var(--card); border: 1px solid var(--line); font-size: 13px; }
.chip:hover { border-color: var(--brand); }
.chip.on { background: var(--brand); color: #fff; border-color: var(--brand); }

/* actions */
.actions { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.inline { display: inline; margin: 0; }
.btn { border: 0; border-radius: 8px; padding: 9px 16px; font-size: 13px; font-weight: 600;
  cursor: pointer; }
.btn.primary { background: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-d); }
.btn.ghost { background: var(--card); color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover { border-color: var(--brand); color: var(--brand-d); }
.selcount { color: var(--muted); font-size: 12px; }
.link-btn { background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit;
  text-decoration: underline; padding: 0; }
.link-btn:hover { color: var(--ink); }
.link-btn.danger { color: var(--danger); }

/* grid */
.grid { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); }
.grid th, .grid td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line);
  font-size: 13px; vertical-align: middle; }
.grid th { background: #fafbfc; color: var(--muted); font-weight: 600; font-size: 11px;
  text-transform: uppercase; letter-spacing: .4px; }
.grid tbody tr:last-child td { border-bottom: 0; }
.grid tbody tr:hover { background: #fafcfb; }
.grid tr.off { opacity: .5; }
.grid .r { text-align: right; }
.grid .ck { width: 34px; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; }
.mono.small { font-size: 11px; }
.dest { color: var(--muted); }
.items { max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 30px; }
.money { font-weight: 600; font-variant-numeric: tabular-nums; }
.svc { font-weight: 600; color: var(--brand-d); }
.unassigned { color: #b9c2cc; font-style: italic; }

/* channel tags */
.chan { display: inline-block; padding: 3px 8px; border-radius: 6px; font-size: 11px;
  font-weight: 600; }
.chan.shopify { background: #e7f6ec; color: #1f7a3f; }
.chan.amazon  { background: #fdf0dd; color: #b4690e; }
.chan.ebay    { background: #e8effd; color: #2f5fc0; }
.chan.etsy    { background: #fde9e0; color: #c0501f; }
.chan.walmart { background: #e4f0fb; color: #1565c0; }
.chan.direct  { background: #eef1f4; color: #66738a; }

/* rules */
.page-h { margin: 0 0 4px; }
.sub { color: var(--muted); margin: 0 0 18px; max-width: 720px; }
.pill { border: 0; border-radius: 20px; padding: 4px 12px; font-size: 12px; font-weight: 600;
  cursor: pointer; }
.pill.green { background: var(--ok-bg); color: var(--ok-ink); }
.pill.gray { background: #eef1f4; color: var(--muted); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; margin-top: 22px; box-shadow: var(--shadow); }
.card h2 { margin: 0 0 14px; font-size: 16px; }
.ruleform { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.ruleform label { display: flex; flex-direction: column; gap: 4px; font-size: 12px;
  color: var(--muted); font-weight: 600; }
.ruleform input, .ruleform select { padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 7px; font: inherit; color: var(--ink); background: #fff; }
.ruleform input:focus, .ruleform select:focus { outline: 2px solid var(--brand-l);
  border-color: var(--brand); }

/* ============================== dashboard ============================== */
.dash-head { display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.head-actions { display: flex; gap: 8px; }
.btn.sm { padding: 6px 12px; font-size: 12px; }
.muted { color: var(--muted); }
.small { font-size: 12px; font-weight: 400; }

/* KPI cards */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow); text-decoration: none; color: var(--ink);
  display: flex; flex-direction: column; transition: transform .08s, border-color .08s; }
a.kpi:hover { transform: translateY(-2px); border-color: var(--brand); }
.kpi.accent { background: linear-gradient(135deg, var(--brand) 0%, var(--brand-d) 100%); color: #fff; }
.kpi.accent .kpi-lbl, .kpi.accent .kpi-sub { color: rgba(255,255,255,.85); }
.kpi-num { font-size: 30px; font-weight: 800; line-height: 1.1; letter-spacing: -.5px; }
.kpi-lbl { font-size: 13px; font-weight: 700; margin-top: 4px; }
.kpi-sub { font-size: 11px; color: var(--muted); }

/* two-column: decisions + charts */
.dash-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 16px; margin-bottom: 16px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow); }
.panel h2 { margin: 0 0 14px; font-size: 15px; }
.charts-col { display: flex; flex-direction: column; gap: 16px; }

/* decisions */
.decisions { display: flex; flex-direction: column; }
.decision { display: flex; align-items: center; gap: 12px; padding: 12px;
  border-radius: 9px; border: 1px solid var(--line); margin-bottom: 10px; }
.decision:last-child { margin-bottom: 0; }
.decision.go { background: var(--brand-l); border-color: #cfe7e1; }
.decision.warn { background: var(--warn-bg); border-color: #f3e1bf; }
.decision.clear { background: var(--ok-bg); border-color: #c7ecd9; }
.d-icon { font-size: 20px; line-height: 1; }
.d-body { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.d-body strong { font-size: 13px; }
.d-body span { font-size: 12px; color: var(--muted); }

/* funnel */
.funnel { display: flex; flex-direction: column; gap: 10px; }
.frow { display: flex; align-items: center; gap: 10px; }
.fl { width: 64px; font-size: 12px; color: var(--muted); font-weight: 600; }
.ftrack { flex: 1; background: #eef1f4; border-radius: 6px; height: 24px; overflow: hidden; }
.fbar { height: 100%; border-radius: 6px; display: flex; align-items: center; justify-content: flex-end;
  padding-right: 8px; color: #fff; font-size: 12px; font-weight: 700; min-width: 22px; transition: width .3s; }
.fbar.awaiting { background: var(--accent); }
.fbar.labeled { background: var(--brand); }
.fbar.shipped { background: #4b9e8c; }

/* bar chart (svg) */
.barchart { width: 100%; height: auto; max-height: 170px; }
.bc-val { font-size: 11px; font-weight: 700; fill: var(--ink); }
.bc-lbl { font-size: 10px; fill: var(--muted); }

/* carrier mix bar + legend */
.mixbar { display: flex; height: 22px; border-radius: 6px; overflow: hidden; background: #eef1f4; }
.mixseg { height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; }
.leg { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.leg i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }

/* hub */
.hub h2 { margin-bottom: 14px; }
.hub-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.hubcard { display: flex; flex-direction: column; gap: 4px; padding: 16px; border: 1px solid var(--line);
  border-radius: 9px; text-decoration: none; color: var(--ink); background: #fafbfc;
  transition: transform .08s, border-color .08s; }
.hubcard:hover { transform: translateY(-2px); border-color: var(--brand); }
.hubcard.soon { opacity: .65; cursor: default; }
.hubcard.soon:hover { transform: none; border-color: var(--line); }
.hub-i { font-size: 22px; }
.hubcard strong { font-size: 13px; }
.hubcard em { color: var(--accent); font-style: normal; font-size: 11px; font-weight: 700; }
.hubcard span { font-size: 12px; color: var(--muted); }

@media (max-width: 860px) {
  .kpis, .hub-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
}

/* ============================== channels ============================== */
.chan-card { margin-bottom: 0; }
.cc-head { display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-wrap: wrap; }
.cc-id { display: flex; align-items: center; gap: 14px; }
.cc-id strong { font-size: 15px; }
.cc-meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.cc-actions { display: flex; gap: 8px; }
.cc-logo { display: inline-flex; align-items: center; justify-content: center; min-width: 56px;
  height: 38px; padding: 0 10px; border-radius: 8px; font-weight: 800; font-size: 13px; color: #fff; }
.cc-logo.ebay { background: linear-gradient(90deg,#e53238 0 25%,#0064d2 25% 50%,#f5af02 50% 75%,#86b817 75%); }
.cc-logo.shopify { background: #1f9d52; }
.cc-logo.amazon { background: #e08400; }
.cc-logo.walmart { background: #1565c0; }
.cc-logo.etsy { background: #d4561f; }

.setup { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.setup h3 { margin: 0 0 12px; font-size: 14px; }
.setup ol { margin: 0; padding-left: 20px; }
.setup li { margin-bottom: 10px; font-size: 13px; }
.codeblock { background: #0f1b22; color: #cfe9e2; border-radius: 8px; padding: 12px 14px;
  margin-top: 8px; font-size: 12px; line-height: 1.7; overflow-x: auto; }
.missing { background: var(--warn-bg); color: var(--warn-ink); padding: 8px 12px;
  border-radius: 7px; font-size: 13px; }
.missing .mono { font-weight: 700; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* carrier logos */
.cc-logo.carrier { font-size: 11px; letter-spacing: .2px; }
.cc-logo.carrier.easypost { background: #11643f; }
.cc-logo.carrier.stampscom { background: #d6202a; }
.cc-logo.carrier.ups { background: #5a3a1b; }
.cc-logo.carrier.fedex { background: #4d148c; }
.setup a { color: var(--brand); }

/* order detail + quotes */
.crumbs{margin-bottom:10px}
.crumbs a{color:var(--brand);font-weight:600;font-size:13px}

/* ---- Reports ---- */
.report-list{display:flex;flex-wrap:wrap;gap:14px;margin-top:18px}
.report-card{display:block;width:340px;padding:16px 18px;border:1px solid var(--line);
  border-radius:12px;background:var(--card);text-decoration:none;transition:box-shadow .12s,transform .12s}
.report-card:hover{box-shadow:0 8px 20px rgba(20,40,60,.10);transform:translateY(-2px);border-color:var(--brand)}
.report-card-title{font-size:15px;font-weight:700;color:var(--ink);margin-bottom:6px}
.report-card-desc{font-size:12.5px;color:var(--muted);line-height:1.45}
.report-filter{display:flex;align-items:center;gap:10px;margin:0 0 14px}
.report-filter label{font-size:12px;font-weight:600;color:var(--muted);display:flex;
  flex-direction:column;gap:4px}
.report-filter select{border:1px solid var(--line);border-radius:8px;padding:7px 9px;
  font:inherit;font-size:13px;color:var(--ink);background:#fff}
.report-filter .mini{align-self:flex-end;color:var(--brand);font-size:12px}
/* Reports get a much wider, taller working area than the default 1180px app width. */
main:has(.report-wide){max-width:none;margin-left:24px;margin-right:24px}
.table-wrap{overflow-x:auto;overflow-y:auto;max-height:calc(100vh - 230px);
  border:1px solid var(--line);border-radius:12px;background:var(--card)}
.report-table{min-width:1100px;width:100%;border-collapse:collapse}
.report-table th,.report-table td{white-space:nowrap;padding:9px 14px}
.report-table thead th{position:sticky;top:0;background:#fafbfc;z-index:2;
  border-bottom:1px solid var(--line)}
.report-table tbody tr:nth-child(even) td{background:#fafbfc}
.report-table td.small{font-size:11.5px;color:var(--muted)}
.od-head{margin-bottom:18px}
.od-head .page-h{display:flex;align-items:center;gap:10px}
.od-grid{display:grid;grid-template-columns:1fr 1.2fr;gap:16px}
.kv{display:flex;justify-content:space-between;gap:18px;padding:9px 0;border-bottom:1px solid var(--line);font-size:14px}
.kv:last-child{border-bottom:0}
.kv span{color:var(--muted)}
.kv b{text-align:right}
.olink{color:var(--brand-d);font-weight:600}
.olink:hover{text-decoration:underline}
.notice{background:var(--brand-l);border:1px solid #cfe7e1;border-radius:9px;padding:11px 13px;font-size:13px}
.notice.warn{background:var(--warn-bg);border-color:#f3e1bf;color:var(--warn-ink)}
.notice a{color:var(--brand-d);font-weight:700}
.quote-from{font-size:13px;color:var(--muted);margin-bottom:12px}
.quote-form{display:flex;flex-direction:column;gap:12px;margin-bottom:12px}
.quote-form > label{display:flex;flex-direction:column;gap:5px;font-size:12px;font-weight:600;color:var(--muted);max-width:160px}
.quote-form .dims{display:flex;gap:10px}
.quote-form .dims label{display:flex;flex-direction:column;gap:5px;font-size:12px;font-weight:600;color:var(--muted)}
.quote-form input{padding:8px 10px;border:1px solid var(--line);border-radius:7px;font:inherit}
.quote-form input:focus{outline:2px solid var(--brand-l);border-color:var(--brand)}
.carriers-line{font-size:12px;color:var(--muted);display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.quote-h{margin:18px 0 10px;font-size:15px}
.quote-table{margin-top:4px}
@media(max-width:820px){.od-grid{grid-template-columns:1fr}}

/* Service guidance tooltip (the ⓘ next to a USPS service name). Shows on hover
   and keyboard focus; explains what the mail class is + when to pick it. */
.svc-help{display:inline-block;margin-left:5px;color:var(--brand);cursor:help;
  font-size:14px;line-height:1;position:relative;outline:none;opacity:.75}
.svc-help:hover,.svc-help:focus{color:var(--brand-d);opacity:1}

/* Floating tooltip: a single element appended to <body> and positioned with JS,
   so NOTHING (card edges, overflow, stacking contexts) can clip it. */
#svc-tip{position:fixed;z-index:9999;max-width:280px;background:#1f2430;color:#fff;
  padding:9px 11px;border-radius:7px;font-size:12px;font-weight:400;line-height:1.45;
  text-align:left;box-shadow:0 6px 20px rgba(0,0,0,.28);pointer-events:none;
  opacity:0;transition:opacity .12s}
#svc-tip.show{opacity:1}
#svc-tip::after{content:"";position:absolute;border:6px solid transparent;
  left:var(--arrow,50%);transform:translateX(-50%)}
#svc-tip.below::after{bottom:100%;border-bottom-color:#1f2430}
#svc-tip.above::after{top:100%;border-top-color:#1f2430}

/* Restricted rate cards — shown but greyed out and not selectable (the service
   needs an agreement/enrollment/content eligibility first). */
.rate-card.is-restricted{opacity:.55;background:#f4f5f7;filter:grayscale(.35)}
.rate-card.is-restricted .rc-price{color:#6b7280}
.rate-card.is-restricted .svc-help{opacity:1}            /* keep the ⓘ readable */
.rc-lock-note{font-size:11px;color:#8a6d3b;background:#fdf6e3;border:1px solid #f0e3bf;
  border-radius:6px;padding:5px 7px;margin:6px 0;line-height:1.35}
.btn.rc-buy.is-locked{background:#e5e7eb;color:#6b7280;border:1px solid #d1d5db;
  cursor:not-allowed;box-shadow:none}
.btn.rc-buy.is-locked:hover{background:#e5e7eb}

/* Dismissible page banner (e.g. "label voided"). */
.banner{display:flex;align-items:center;gap:12px;justify-content:space-between;
  padding:12px 16px;border-radius:9px;margin-bottom:16px;font-size:14px}
.banner-ok{background:#e7f7ec;border:1px solid #b6e6c5;color:#15673a}
.banner-x{border:none;background:transparent;color:inherit;cursor:pointer;
  font-size:15px;line-height:1;opacity:.6;padding:4px}
.banner-x:hover{opacity:1}

/* Voided confirmation inside a rate card. */
.rc-voided{background:#e7f7ec;border:1px solid #b6e6c5;color:#15673a;
  padding:8px 10px;border-radius:7px;font-size:13px;margin-top:8px}
.rc-dismiss{margin-left:6px;border:1px solid #b6e6c5;background:#fff;color:#15673a;
  font-size:12px;padding:2px 8px;border-radius:5px;cursor:pointer}

/* Labeled/shipped rows don't rate-shop — don't show the clickable affordance. */
tr.order-row.no-rates{cursor:default}

/* Inline "void" link in the Tracking column for labeled orders. */
.void-link{margin-left:7px;border:1px solid #e3b7b7;background:#fff;color:#b42318;
  font-size:11px;line-height:1;padding:2px 6px;border-radius:5px;cursor:pointer;
  vertical-align:middle;transition:background .12s}
.void-link:hover{background:#fdecec}
.void-link[data-busy]{opacity:.6;cursor:default}

/* ---- multi-tenant: company switcher, user chip, auth pages ---- */
.topbar-right { display: flex; align-items: center; gap: 14px; }
.company-switch select {
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px;
  font: inherit; font-weight: 600; color: var(--ink); background: var(--bg);
  cursor: pointer; max-width: 220px;
}
.company-switch select:focus { outline: 2px solid var(--brand-l); border-color: var(--brand); }
.user-chip { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.user-chip .who { color: var(--ink); font-weight: 600; max-width: 160px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.user-chip .mini { color: var(--muted); text-decoration: none; }
.user-chip .mini:hover { color: var(--brand-d); }
.inline { display: inline; }
.company-cell { font-size: 12px; color: var(--muted); font-weight: 600; }

.auth-wrap { min-height: 70vh; display: flex; align-items: center; justify-content: center; }
.auth-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); padding: 34px 32px; width: 360px; max-width: 92vw; }
.auth-brand { font-size: 22px; margin-bottom: 6px; }
.auth-brand b { color: var(--brand); }
.auth-card h1 { font-size: 20px; margin: 6px 0 18px; }
.form-stack { display: flex; flex-direction: column; gap: 14px; }
.form-stack label { display: flex; flex-direction: column; gap: 5px; font-size: 13px;
  font-weight: 600; color: var(--ink); }
.form-stack input { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px;
  font: inherit; }
.form-stack input:focus { outline: 2px solid var(--brand-l); border-color: var(--brand); }

/* ===================== Rate Cards decision board ===================== */
tr.order-row { cursor: pointer; transition: background .12s; }
tr.order-row:hover { background: var(--brand-l); }
tr.order-row.expanded { background: var(--brand-l); }
tr.order-row.expanded td { border-bottom-color: transparent; }
.rate-expand-cell { background: #f0f5f4; padding: 0 !important; }
.rate-board { padding: 18px 20px; animation: rateIn .22s ease; }
@keyframes rateIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.rate-board-head { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.rate-board-head b { color: var(--ink); }

.rate-deck { display: flex; gap: 14px; flex-wrap: wrap; }
.rate-card {
  position: relative; background: var(--card); border: 1.5px solid var(--line);
  border-radius: 14px; padding: 16px 16px 14px; width: 190px; min-height: 150px;
  display: flex; flex-direction: column; gap: 4px;
  box-shadow: 0 1px 2px rgba(20,40,60,.05); transition: transform .14s, box-shadow .14s, border-color .14s;
}
.rate-card:hover { transform: translateY(-4px); box-shadow: 0 10px 24px rgba(20,40,60,.13); }
.rate-card.is-hot { border-color: var(--brand); }
.rate-card::before {  /* carrier accent bar */
  content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px;
  border-radius: 4px; background: var(--cc, var(--muted));
}
/* carrier accent colors */
.rate-card.cc-usps  { --cc: #333a8e; }   /* USPS navy */
.rate-card.cc-fedex { --cc: #4d148c; }   /* FedEx purple */
.rate-card.cc-ups   { --cc: #8a6d3b; }   /* UPS brown */
.rate-card.cc-dhl   { --cc: #d40511; }

.rc-badges { display: flex; flex-wrap: wrap; gap: 4px; min-height: 20px; margin-bottom: 2px; }
.rbadge { font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 999px; white-space: nowrap; }
.b-cheap { background: #e4f7ec; color: #1a7a45; }
.b-fast  { background: #e6f0ff; color: #1f5ec2; }
.b-best  { background: #fff2da; color: #9a6a12; }

.rc-carrier { font-size: 12px; font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: 6px; }
.rc-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--cc, var(--muted)); }
.rc-service { font-size: 13px; color: var(--muted); line-height: 1.25; min-height: 32px; }
.rc-price { font-size: 26px; font-weight: 800; letter-spacing: -.5px; color: var(--ink); margin-top: 2px; }
.rc-transit { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.rc-buy { width: 100%; padding: 8px; font-size: 13px; margin-top: auto; }
.rc-buy:disabled { opacity: .55; cursor: not-allowed; }

.rate-loading { color: var(--muted); font-size: 14px; padding: 10px 0; display: flex; align-items: center; gap: 10px; }
.otter-spin { display: inline-block; font-size: 22px; animation: otterbob 1s ease-in-out infinite; }
@keyframes otterbob { 0%,100% { transform: translateY(0) rotate(-8deg); } 50% { transform: translateY(-5px) rotate(8deg); } }
.rate-empty { color: var(--muted); font-size: 14px; padding: 8px 0; }
.rate-empty a { color: var(--brand-d); font-weight: 600; }
.rate-err { color: #b3261e; font-size: 12px; margin-top: 8px; }

/* rate board: dims/weight controls */
.rate-controls { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; margin-bottom: 14px; }
.rc-field { display: flex; flex-direction: column; gap: 4px; font-size: 11px;
  font-weight: 600; color: var(--muted); }
.rc-field input, .rc-field select { border: 1px solid var(--line); border-radius: 8px;
  padding: 7px 9px; font: inherit; font-size: 13px; color: var(--ink); background: #fff; }
.rc-field.sm input { width: 58px; }
.rc-field input:focus, .rc-field select:focus { outline: 2px solid var(--brand-l); border-color: var(--brand); }
.rb-go { padding: 8px 16px; }
.rb-link { font-size: 12px; color: var(--brand-d); align-self: center; }
.rate-prompt { background: #fff7e6; border: 1px solid #f3d99b; color: #8a6a12;
  border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.rate-note { background: #fff4f0; border: 1px solid #f3cdbb; color: #8a4a2a;
  border-radius: 8px; padding: 8px 11px; font-size: 12.5px; margin-top: 8px; }
.rate-note b { color: #6e3416; }

/* --- buy-label result (inside a rate card) --- */
.rc-result { margin-top: 6px; font-size: 12.5px; }
.rc-bought { background: #eafaf0; border: 1px solid #bce6cc; color: #1f6b3b;
  border-radius: 8px; padding: 8px 10px; line-height: 1.5; }
.rc-bought .rc-track b { color: #14502b; letter-spacing: .3px; }
.rc-err { background: #fff4f0; border: 1px solid #f3cdbb; color: #8a4a2a;
  border-radius: 8px; padding: 7px 10px; }
.btn.small { display: inline-block; margin-top: 5px; padding: 4px 10px;
  font-size: 12px; line-height: 1.4; }
.rc-buy:disabled { opacity: .55; cursor: default; }

/* ===== Compact, sortable rate TABLE (scales better than cards) ===== */
.rate-table { width: 100%; border-collapse: collapse; background: var(--card);
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.rate-table thead th { text-align: left; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; color: var(--muted);
  padding: 10px 12px; border-bottom: 1px solid var(--line); background: #fafbfc;
  white-space: nowrap; }
.rate-table th.rt-sort { cursor: pointer; user-select: none; }
.rate-table th.rt-sort:hover { color: var(--brand-d); }
.rate-table th.rt-price-h, .rate-table td.rt-price { text-align: right; }

.rate-row td { padding: 9px 12px; border-bottom: 1px solid #f0f1f3;
  vertical-align: middle; font-size: 13px; }
.rate-row:hover td { background: #f7f9ff; }
/* per-carrier accent dot color */
.rate-row.cc-usps  { --cc: #333a8e; }
.rate-row.cc-fedex { --cc: #4d148c; }
.rate-row.cc-ups   { --cc: #8a6d3b; }
.rate-row.cc-dhl   { --cc: #d40511; }
.rate-row .rc-dot { width: 9px; height: 9px; border-radius: 50%;
  background: var(--cc, var(--muted)); display: inline-block; vertical-align: middle;
  margin-right: 6px; }
.rt-badge-c { width: 30px; text-align: center; }
.rt-badge { font-size: 15px; line-height: 1; }
.rt-carrier { font-weight: 700; color: var(--ink); white-space: nowrap; }
.rt-service { color: var(--ink); }
.rt-transit { color: var(--muted); white-space: nowrap; }
.rt-est-tag { font-size: 10px; color: #9aa1ad; font-style: italic; }
.rt-deliv { color: #9aa1ad; font-size: 11.5px; }
.rt-price { font-weight: 800; font-size: 15px; color: var(--ink);
  letter-spacing: -.3px; white-space: nowrap; }
.rt-action { text-align: right; white-space: nowrap; }
.rate-table .btn.sm { padding: 5px 12px; font-size: 12px; line-height: 1.3; }

/* highlight the row a label was just bought from */
.rate-row.is-bought td { background: #f3fbf6; }
.rate-row.is-bought .rt-price { color: #1f6b3b; }

/* once a label exists, every OTHER row greys out + is not selectable
   (one label per order — void first to pick a different service) */
.rate-row.is-locked-out td { opacity: .45; }
.rate-row.is-locked-out:hover td { background: inherit; }
.rate-row.is-locked-out .rc-buy { background: #e5e7eb; color: #9aa1ad;
  border: 1px solid #d1d5db; cursor: not-allowed; box-shadow: none; }
.rate-board.has-label .rt-sort { cursor: default; color: var(--muted); }
.rate-board.has-label .rt-sort:hover { color: var(--muted); }

/* agreement-locked rows: greyed + not selectable */
.rate-row.is-restricted td { color: #9aa1ad; background: #fafbfc; }
.rate-row.is-restricted .rt-price { color: #aab0ba; }
.rate-row.is-restricted .rc-dot { opacity: .5; }
.rate-row.is-restricted .svc-help { color: var(--brand); opacity: .8; }
.rt-lock-note { font-size: 11px; color: #8a6d3b; margin-top: 3px; }
.rate-table .btn.is-locked { background: #eceef1; color: #9aa1ad;
  border: 1px solid #dfe2e7; cursor: not-allowed; box-shadow: none; }

/* the hidden result row that expands under a rate after Buy/Void */
.rate-result-row td { padding: 0 12px; border: 0; }
.rate-result-row .rc-result:empty { display: none; }
.rate-result-row .rc-result:not(:empty) { padding: 8px 0 12px; }

/* --- settings: label references --- */
hr.sep { border: 0; border-top: 1px solid #e6e3dd; margin: 26px 0 18px; }
.labelref-form { display: flex; flex-direction: column; gap: 8px; }
.labelref-row { display: flex; align-items: center; gap: 10px; padding: 7px 10px;
  background: #faf9f6; border: 1px solid #ece9e2; border-radius: 8px; cursor: pointer; max-width: 480px; }
.labelref-row:hover { background: #f4f2ec; }
.labelref-row input[type=checkbox] { width: 16px; height: 16px; }
.labelref-name { font-weight: 600; min-width: 70px; }
.labelref-src { color: #8a857c; }

/* --- carriers: per-carrier credential entry --- */
.pill.amber { background:#fdf3e3; color:#9a6b1a; border:1px solid #f0d9aa; }
.cred-block { border-top:1px solid #ece9e2; margin-top:14px; padding-top:14px; }
.cred-form { display:flex; flex-direction:column; gap:12px; }
.cred-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); gap:12px; }
.cred-field { display:flex; flex-direction:column; gap:5px; }
.cred-label { font-size:12.5px; font-weight:600; color:#4a463f; }
.cred-label .req { color:#c0492b; }
.cred-field input { padding:8px 10px; border:1px solid #d8d4cc; border-radius:8px;
  font-size:13px; font-family:ui-monospace,SFMono-Regular,Menlo,monospace; }
.cred-field input:focus { outline:none; border-color:var(--brand); box-shadow:0 0 0 2px rgba(0,80,160,.18); }
.cred-actions { display:flex; align-items:center; gap:14px; flex-wrap:wrap; }
.cred-actions .missing { color:#9a6b1a; }
.cred-actions .mono { font-family:ui-monospace,Menlo,monospace; }

/* --- settings hub: collapsible sections --- */
.set-section { background:#fff; border:1px solid #e6e3dd; border-radius:12px; margin-bottom:14px; overflow:hidden; }
.set-section > summary { list-style:none; cursor:pointer; padding:16px 18px; font-size:16px; font-weight:700;
  display:flex; align-items:center; gap:10px; user-select:none; }
.set-section > summary::-webkit-details-marker { display:none; }
.set-section > summary::after { content:"▸"; margin-left:auto; color:#9a958c; font-weight:400; transition:transform .15s; }
.set-section[open] > summary::after { transform:rotate(90deg); }
.set-section > summary:hover { background:#faf9f6; }
.set-ico { font-size:18px; }
.set-count { font-size:12px; font-weight:600; color:var(--brand-d); background:var(--brand-l); border:1px solid #cfe0f2;
  border-radius:20px; padding:2px 10px; margin-left:8px; }
.set-body { padding:0 18px 18px; }
.cred-card { box-shadow:none; border:1px solid #ece9e2; margin-bottom:12px; }

/* --- signup (single short form) --- */
.signup-card { width:520px; max-width:94vw; }
.form-stack input, .form-stack select { width:100%; }
.form-stack .row2, .form-stack .row3 { display:flex; gap:10px; width:100%; }
.form-stack .row2 > label { flex:1; min-width:0; }
.form-stack .row3 > label { min-width:0; }
.form-stack .row3 > label:nth-child(1) { flex:2; }
.form-stack .row3 > label:nth-child(2) { flex:1; }
.form-stack .row3 > label:nth-child(3) { flex:1; }
.req { color:#c0492b; }
/* keep a required field's caption and its * together on one line (form-stack labels are flex-column) */
.form-stack label .cap { display:inline; }
.form-stack label .cap .req { margin-left:2px; }
.signup-more { border:1px solid var(--line); border-radius:10px; }
.signup-more > summary { cursor:pointer; padding:11px 14px; font-weight:600; font-size:13.5px;
  list-style:none; user-select:none; }
.signup-more > summary::-webkit-details-marker { display:none; }
.signup-more > summary::before { content:"\25B8  "; color:#9a958c; }
.signup-more[open] > summary::before { content:"\25BE  "; }
.signup-more-body { display:flex; flex-direction:column; gap:12px; padding:4px 14px 14px; }
.signup-sub { font-size:13px; font-weight:700; margin:8px 0 0; color:var(--ink); }

/* --- carrier account source toggle (ShipOtter's vs own) --- */
.src-toggle { display:flex; gap:8px; margin:12px 0 4px; flex-wrap:wrap; }
.src-opt { flex:1; min-width:200px; text-align:left; cursor:pointer; padding:10px 12px;
  border:1.5px solid #e0ddd5; border-radius:10px; background:#fff; display:flex; flex-direction:column; gap:2px;
  font-weight:600; font-size:13px; color:#4a463f; }
.src-opt:hover { border-color:#c7c2b8; }
.src-opt.active { border-color:var(--brand); background:var(--brand-l); color:var(--brand-d); }
.src-opt .src-sub { font-weight:400; font-size:11.5px; color:#8a857c; }
.src-opt.active .src-sub { color:var(--brand); }

/* --- signup MFA verify --- */
.code-input { font-size:24px; letter-spacing:8px; text-align:center; font-family:ui-monospace,Menlo,monospace; }

/* --- app footer (legal + carrier disclaimer) --- */
.app-footer { max-width:1180px; margin:40px auto 24px; padding:18px 22px 0;
  border-top:1px solid var(--line); text-align:center; }
.app-foot-links { display:flex; gap:8px; justify-content:center; align-items:center;
  font-size:12.5px; margin-bottom:8px; }
.app-foot-links a { color:var(--muted); text-decoration:none; }
.app-foot-links a:hover { color:var(--brand-d); text-decoration:underline; }
.app-foot-links span { color:var(--line); }
.app-foot-disclaimer { color:#9a958c; font-size:11px; line-height:1.5; max-width:760px;
  margin:0 auto 8px; }
.app-foot-copy { color:#b9b4ab; font-size:11px; margin:0; }

/* FedEx unified logo + mandated legal notice. The .fedex-mark padding reserves
   the FedEx-required clear space ("x" / cap-height of the logo on every side).
   Legal notice is 11px (>8pt minimum FedEx requires). */
.app-foot-fedex { display:flex; align-items:center; justify-content:center; gap:14px;
  flex-wrap:wrap; margin:6px auto 10px; max-width:760px; }
/* Official FedEx wordmark PNG (1536x864) — it already has generous white space
   baked in. We add 14px more padding on all sides so the FedEx clear-space rule
   (empty space ≥ the logo's "x" height) is satisfied with margin to spare.
   Height-driven sizing with width:auto preserves the 16:9 aspect ratio (no
   distortion); the !important on width overrides the legacy width attrs on the
   <img> tags. */
.fedex-mark { display:inline-block; box-sizing:content-box; padding:14px;
  height:42px; width:auto !important; background:#fff; border-radius:4px;
  vertical-align:middle; }
.fedex-legal { color:#6b675f; font-size:11px; line-height:1.5; max-width:420px;
  text-align:left; }

/* --- FedEx EULA / Track / Registration pages --- */
.eula-wrap, .track-wrap, .reg-wrap { max-width:860px; margin:24px auto; padding:0 20px; }
.eula-head, .track-head, .reg-head { display:flex; align-items:center; gap:16px;
  margin-bottom:14px; }
.eula-head h1, .track-head h1, .reg-head h1 { margin:0; font-size:22px; }
.eula-version { margin:2px 0 0; color:var(--muted); font-size:12.5px; }
.eula-instructions { color:#555; font-size:13.5px; max-width:760px; }
/* Tall enough to show an ENTIRE letter-size PDF page at once, then scroll to the
   next full page. (A US-letter page rendered at our width is ~1100px tall.) */
.eula-scroll { height:1180px; max-height:82vh; overflow-y:auto; border:1px solid var(--line);
  border-radius:8px; padding:16px; background:#ececed; font-size:13px; line-height:1.6;
  color:#2b2b2b; scroll-behavior:smooth; }
/* Rendered FedEx PDF pages (PDF.js canvases) — the actual official document. */
#eulaPages { display:flex; flex-direction:column; align-items:center; gap:6px; }
.eula-pdf-page { width:100%; max-width:920px; height:auto; display:block;
  box-shadow:0 1px 5px rgba(0,0,0,.20); background:#fff; }
.eula-pdf-pagenum { font-size:11px; color:#8a857c; margin:2px 0 18px; text-align:center; }
.eula-pdf-frame { width:100%; height:1150px; border:0; background:#fff; }
/* fallback iframe: tall enough that the OUTER scroll box must scroll to the end
   marker, so the read-to-the-end gate still applies when PDF.js can't render. */
.eula-pdf-frame-tall { height:5200px; }
.eula-download { margin:0 0 14px; }
.eula-scroll p { margin:0 0 11px; }
.eula-section-h { font-size:14.5px; margin:18px 0 8px; color:var(--brand-d); }
.eula-end { text-align:center; color:var(--muted); font-style:italic; margin-top:20px;
  padding-top:10px; border-top:1px dashed var(--line); }
/* Per-page footer with the FedEx revision date, as it appears on each page of
   the hosted EULA PDF. */
.eula-scroll-shell { position:relative; }
.eula-page-footer { display:flex; justify-content:space-between; gap:10px;
  margin:14px 0 22px; padding-top:8px; border-top:1px solid var(--line);
  color:#8a857c; font-size:10.5px; letter-spacing:.2px; }
.eula-page-footer span:nth-child(2) { font-style:italic; }
/* Persistent revision-date bar pinned to the bottom of the scroll box. */
.eula-revbar { position:absolute; left:1px; right:1px; bottom:1px; padding:6px 12px;
  background:rgba(248,248,248,.96); border-top:1px solid var(--line);
  font-size:11px; color:#5a5650; text-align:right; font-weight:600;
  border-radius:0 0 8px 8px; pointer-events:none; }
/* leave room so the revbar doesn't cover the last line */
.eula-scroll { padding-bottom:34px; }
.eula-form { margin-top:16px; }
.eula-ack { display:flex; align-items:flex-start; gap:10px; font-size:13.5px;
  cursor:pointer; }
.eula-ack input { margin-top:3px; }
.eula-actions { display:flex; gap:12px; margin-top:14px; align-items:center; }
.eula-hint { color:var(--muted); font-size:12px; margin:8px 0 0; }
button[disabled], .btn-primary[disabled] { opacity:.45; cursor:not-allowed; }

.track-form { display:flex; gap:10px; flex-wrap:wrap; margin:8px 0 16px; }
/* multi-number tracking form */
.track-form-multi { display:flex; flex-direction:column; gap:10px; margin:8px 0 20px; align-items:flex-start; }
.track-form-multi textarea { width:100%; padding:10px 12px; border:1px solid var(--line);
  border-radius:8px; font:inherit; font-size:13px; font-family:ui-monospace,Menlo,monospace;
  resize:vertical; }
.track-deliv { font-size:12px; color:var(--muted); margin:2px 0 8px; }
.track-err { color:#b3261e; font-weight:600; }
/* wide tracking page (breaks out of the 860px track-wrap for the table) */
main:has(.report-wide) .track-wide { max-width:none; margin-left:0; margin-right:0; }
.trk-table th, .trk-table td { white-space:nowrap; }
.trk-caret { width:22px; text-align:center; color:var(--muted); }
.trk-row { cursor:pointer; }
.trk-row:hover td { background:#f7f9ff; }
.trk-row.is-open td { background:#eef3ff; }
.trk-detail td { background:#fafbfc; padding:12px 18px; }
.trk-summary { font-size:13px; font-weight:600; color:var(--ink); margin-bottom:8px; }
.reg-form { margin:8px 0 16px; }
.reg-form .btn-primary { padding:10px 18px; }
.track-form input[type=text] { flex:1; min-width:240px; padding:10px 12px;
  border:1px solid var(--line); border-radius:7px; font-size:14px; }
.track-card { border:1px solid var(--line); border-radius:8px; padding:16px 18px;
  background:#fff; }
.track-status-row { display:flex; justify-content:space-between; align-items:center;
  border-bottom:1px solid var(--line); padding-bottom:10px; margin-bottom:10px; }
.track-num { font-weight:700; letter-spacing:.5px; }
.track-status { color:var(--brand-d); font-weight:600; }
.track-events { list-style:none; margin:0; padding:0; }
.track-events li { display:grid; grid-template-columns:1fr 1fr auto; gap:10px;
  padding:7px 0; border-bottom:1px dotted var(--line); font-size:13px; }
.track-ev-loc { color:var(--muted); }
.track-ev-ts { color:#999; font-size:12px; white-space:nowrap; }
.track-empty { color:var(--muted); }

.reg-steps { display:flex; gap:8px; list-style:none; padding:0; margin:0 0 16px;
  flex-wrap:wrap; font-size:12.5px; }
.reg-steps li { padding:6px 12px; border:1px solid var(--line); border-radius:20px;
  color:var(--muted); }
.reg-steps li.active { background:var(--brand); color:#fff; border-color:var(--brand); }
.reg-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin:10px 0 14px; }
.reg-grid label { display:flex; flex-direction:column; font-size:12.5px; gap:4px;
  color:#555; }
.reg-grid label.reg-wide { grid-column:1 / -1; }
.reg-grid input { padding:9px 11px; border:1px solid var(--line); border-radius:7px;
  font-size:14px; }
.reg-verify-options { display:flex; gap:10px; flex-wrap:wrap; margin-top:10px; }
.fedex-tools { display:flex; align-items:center; gap:14px; flex-wrap:wrap;
  margin-top:16px; padding:12px 14px; border:1px solid var(--line); border-radius:8px;
  background:#fafafa; }
.fedex-tools-label { font-size:12.5px; color:var(--muted); font-weight:600; }
.fedex-tools a { font-size:13px; color:var(--brand-d); text-decoration:none; }
.fedex-tools a:hover { text-decoration:underline; }

/* --- real logo image (replaces the otter emoji) --- */
.brand-logo { height: 113px; width: auto; display: block; }
.auth-brand .auth-logo { height: 54px; width: auto; display: block; margin: 0 auto 6px; }

/* --- cross-channel duplicate orders (shown only via 'Show duplicates') --- */
.order-row.is-dupe { opacity: .55; }
.order-row.is-dupe:hover { opacity: .8; }

/* API Access section */
.apikey-form { display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
.apikey-form input[type=text] { flex:1; min-width:220px; padding:8px 10px; border:1px solid var(--line); border-radius:8px; font:inherit; font-size:13px; }
.apikey-form select { padding:8px 10px; border:1px solid var(--line); border-radius:8px; font:inherit; font-size:13px; }
.apikey-show { display:inline-block; margin-top:6px; padding:6px 10px; background:#0d1b2a; color:#fff; border-radius:6px; font-family:ui-monospace,Menlo,monospace; font-size:13px; user-select:all; }
.revoked-row td { opacity:.5; }
