/* Up North Coding – Trade Portal */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --ink: #111; --ink-2: #404040; --muted: #737373; --faint: #a3a3a3;
  --line: #e5e5e5; --line-2: #d4d4d4; --bg: #f7f7f5; --field: #f3f3f1; --card: #fff;
  --ok: #15803d; --ok-bg: #ecfdf3; --warn: #92400e; --warn-bg: #fffbeb; --err: #b91c1c; --err-bg: #fef2f2;
  --r-card: 2rem; --r-field: 1rem;
}
html { -webkit-text-size-adjust: 100%; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; color: var(--ink); background: var(--bg); line-height: 1.5; }
a { color: inherit; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em; background: var(--field); padding: 1px 5px; border-radius: 4px; }
.ico { width: 20px; height: 20px; flex-shrink: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- buttons, fields ---------- */
.tp-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--ink); border-radius: 9999px; background: var(--ink); color: #fff;
  padding: 15px 26px; font: inherit; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .15em;
  text-decoration: none; cursor: pointer; white-space: nowrap; transition: transform .2s, box-shadow .2s, opacity .2s;
}
.tp-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0,0,0,.18); }
.tp-btn:focus-visible, .tp-input:focus-visible, .tp-select:focus-visible, .tp-choice:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.tp-btn:disabled { opacity: .35; cursor: not-allowed; transform: none; box-shadow: none; }
.tp-btn-block { display: flex; width: 100%; }
.tp-btn-ghost { background: #fff; color: var(--ink); border-color: var(--line-2); }
.tp-btn-ghost:hover { border-color: var(--ink); box-shadow: none; }
.tp-btn-sm { padding: 10px 16px; font-size: 11px; letter-spacing: .12em; }
.tp-btn-danger { background: #fff; color: var(--err); border-color: #fecaca; }
.tp-btn-danger:hover { border-color: var(--err); box-shadow: none; }

.tp-form { display: flex; flex-direction: column; }
.tp-label { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .15em; color: var(--muted); margin: 18px 0 8px; }
.tp-input, .tp-select, .tp-textarea {
  width: 100%; border: 1px solid var(--line-2); border-radius: var(--r-field); background: var(--field); color: var(--ink);
  padding: 15px 18px; font: inherit; font-size: 16px; transition: border-color .2s, background .2s;
}
.tp-input:focus, .tp-select:focus, .tp-textarea:focus { border-color: var(--ink); background: #fff; outline: none; }
.tp-input::placeholder { color: var(--faint); }
.tp-select { appearance: none; -webkit-appearance: none; padding-right: 48px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 26px) 52%, calc(100% - 20px) 52%; background-size: 6px 6px, 6px 6px; background-repeat: no-repeat; }
.tp-vin { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: uppercase; letter-spacing: .18em; font-size: 18px; }
.tp-vin::placeholder { letter-spacing: .14em; }
.tp-hint { font-size: 13px; color: var(--muted); margin-top: 8px; }
.tp-hint.is-error { color: var(--err); }
.tp-hint.is-ok { color: var(--ok); }

/* ---------- messages ---------- */
.tp-flash { border-radius: var(--r-field); padding: 14px 18px; margin: 0 0 18px; font-size: 14px; border: 1px solid var(--line); background: #fff; }
.tp-flash-success { background: var(--ok-bg); border-color: #bbf7d0; color: #14532d; }
.tp-flash-error { background: var(--err-bg); border-color: #fecaca; color: #7f1d1d; }
.tp-flash-warn { background: var(--warn-bg); border-color: #fde68a; color: var(--warn); }
.tp-flash-info { background: #fff; }

/* ---------- sign-in pages ---------- */
.tp-auth-body { min-height: 100vh; display: flex; flex-direction: column; }
.tp-auth { width: 100%; max-width: 460px; margin: auto; padding: 40px 16px; }
.tp-auth-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); padding: 36px 28px; box-shadow: 0 2px 8px rgba(0,0,0,.05); }
@media (min-width: 520px) { .tp-auth-card { padding: 44px 44px 40px; } }
.tp-auth-logo { display: block; width: 88px; margin: 0 auto 22px; }
.tp-auth-logo img { width: 88px; height: 88px; border-radius: 50%; border: 1px solid var(--line-2); display: block; }
.tp-h1 { font-size: 30px; font-weight: 900; letter-spacing: -.02em; line-height: 1.15; }
.tp-lead { color: var(--muted); font-size: 15px; margin-top: 8px; }
.tp-auth .tp-btn-block { margin-top: 26px; }
.tp-auth-links { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 18px; font-size: 14px; color: var(--muted); }
.tp-auth-links a { color: var(--ink); font-weight: 600; text-decoration: none; }
.tp-auth-links a:hover { text-decoration: underline; }
.tp-auth-note { font-size: 13px; color: var(--muted); margin-top: 22px; line-height: 1.6; }
.tp-auth-note a { color: var(--ink); font-weight: 700; }
.tp-auth-foot { text-align: center; font-size: 12px; color: var(--faint); margin-top: 22px; }
.tp-auth-foot a { color: var(--muted); }
.tp-pw-wrap { position: relative; }
.tp-pw-wrap .tp-input { padding-right: 74px; }
.tp-pw-toggle { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); border: none; background: none; font: inherit; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); cursor: pointer; padding: 10px 8px; }
.tp-pw-toggle:hover { color: var(--ink); }

/* ---------- signed-in shell ---------- */
.tp-shell { min-height: 100vh; display: flex; flex-direction: column; }
@media (min-width: 960px) { .tp-shell { flex-direction: row; } }
.tp-side { background: var(--ink); color: #fff; padding: 14px 16px; display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 20; overflow-x: auto; }
@media (min-width: 960px) {
  .tp-side { width: 270px; flex-shrink: 0; height: 100vh; align-self: flex-start; position: sticky; top: 0; flex-direction: column; align-items: stretch; padding: 26px 18px; overflow-y: auto; }
}
.tp-side-logo { display: flex; align-items: center; gap: 12px; text-decoration: none; flex-shrink: 0; }
.tp-side-logo img { width: 44px; height: 44px; border-radius: 50%; background: #fff; display: block; }
.tp-side-logo span { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .3em; display: none; }
@media (min-width: 960px) {
  .tp-side-logo { margin: 0 8px 26px; }
  .tp-side-logo img { width: 56px; height: 56px; }
  .tp-side-logo span { display: inline; }
}
.tp-nav { display: flex; gap: 6px; flex: 1; }
@media (min-width: 960px) { .tp-nav { flex-direction: column; flex: 1; } }
.tp-nav a {
  display: flex; align-items: center; gap: 10px; white-space: nowrap; text-decoration: none;
  color: rgba(255,255,255,.72); border-radius: 9999px; padding: 11px 14px; font-size: 14px; font-weight: 600;
  transition: background .2s, color .2s;
}
.tp-nav a:hover { color: #fff; background: rgba(255,255,255,.08); }
.tp-nav a.is-active { color: var(--ink); background: #fff; }
@media (min-width: 960px) { .tp-nav a { padding: 13px 16px; font-size: 15px; } }
.tp-nav-label { display: none; }
@media (min-width: 960px) { .tp-nav-label { display: block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .25em; color: rgba(255,255,255,.4); margin: 22px 16px 6px; } }
.tp-nav-sep { display: none; }
@media (min-width: 960px) { .tp-nav-sep { display: block; border: 0; border-top: 1px solid rgba(255,255,255,.12); margin: 14px 16px; } .tp-nav-sep + .tp-nav-label { margin-top: 8px; } }
.tp-badge { margin-left: auto; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 9999px; background: #fff; color: var(--ink); font-size: 11px; display: inline-flex; align-items: center; justify-content: center; }
.tp-nav a.is-active .tp-badge { background: var(--ink); color: #fff; }
.tp-side-site { display: none; }
@media (min-width: 960px) {
  .tp-side-site { display: flex; align-items: center; gap: 10px; color: rgba(255,255,255,.55); text-decoration: none; font-size: 13px; padding: 12px 16px; border-radius: 9999px; }
  .tp-side-site:hover { color: #fff; background: rgba(255,255,255,.08); }
}
@media (max-width: 959px) { .tp-nav a span { display: inline; } }

.tp-main { flex: 1; min-width: 0; padding: 18px 16px 28px; display: flex; flex-direction: column; }
@media (min-width: 640px) { .tp-main { padding: 24px 28px 32px; } }
@media (min-width: 1200px) { .tp-main { padding: 32px 48px 36px; } }
.tp-main > * { width: 100%; max-width: 1100px; }
.tp-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-bottom: 20px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.tp-top-title { display: flex; flex-direction: column; }
.tp-top-title span { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .3em; color: var(--muted); }
.tp-top-title strong { font-size: 20px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
.tp-top-user { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.tp-signed { font-size: 14px; color: var(--ink-2); max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: auto; padding-top: 28px; font-size: 13px; color: var(--faint); }
.tp-foot a { color: var(--muted); }
.tp-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #22c55e; margin-right: 8px; vertical-align: 1px; }

/* ---------- cards ---------- */
.tp-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); padding: 24px 20px; margin-bottom: 22px; box-shadow: 0 2px 8px rgba(0,0,0,.04); }
@media (min-width: 640px) { .tp-card { padding: 32px 36px; } }
.tp-card-title { font-size: 22px; font-weight: 900; letter-spacing: -.01em; }
.tp-card-sub { color: var(--muted); font-size: 15px; margin-top: 8px; max-width: 760px; }
.tp-card-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }

/* capacity */
.tp-cap { display: grid; gap: 22px; margin-top: 20px; }
@media (min-width: 760px) { .tp-cap { grid-template-columns: repeat(3, 1fr); } }
.tp-cap-top { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; font-weight: 700; }
.tp-cap-top em { font-style: normal; color: var(--ok); white-space: nowrap; }
.tp-cap-top em.is-low { color: #b45309; }
.tp-cap-top em.is-full { color: var(--err); }
.tp-bar { height: 8px; border-radius: 9999px; background: #ededea; margin: 10px 0 8px; overflow: hidden; }
.tp-bar span { display: block; height: 100%; border-radius: inherit; background: var(--ink); }
.tp-cap-note { font-size: 12px; color: var(--muted); }

/* how-to */
.tp-help { border: 1px solid var(--line); background: var(--bg); border-radius: 1.5rem; margin: 22px 0 4px; }
.tp-help summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 16px 20px; font-weight: 800; font-size: 16px; }
.tp-help summary::-webkit-details-marker { display: none; }
.tp-help summary::after { content: ''; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: rotate(45deg); transition: transform .2s; }
.tp-help[open] summary::after { transform: rotate(-135deg); }
.tp-help-q { width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; }
.tp-help ol { padding: 0 24px 6px 44px; color: var(--ink-2); font-size: 15px; }
.tp-help li { margin: 0 0 10px; padding-left: 4px; }
.tp-help-note { margin: 6px 20px 20px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-field); padding: 14px 16px; font-size: 14px; color: var(--ink-2); }

/* order form */
.tp-order { margin-top: 10px; }
.tp-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tp-choice {
  border: 1px solid var(--line-2); border-radius: var(--r-field); background: var(--field); padding: 18px 12px;
  font: inherit; font-size: 17px; font-weight: 800; letter-spacing: .04em; color: var(--ink); cursor: pointer; transition: all .2s;
}
.tp-choice:hover { border-color: var(--ink); }
.tp-choice.is-selected { background: var(--ink); color: #fff; border-color: var(--ink); }
.tp-sep { border: none; border-top: 1px solid var(--line); margin: 24px 0 4px; }
.tp-optset { margin-top: 10px; }
.tp-opts { display: grid; gap: 10px; margin-top: 4px; }
@media (min-width: 640px) { .tp-opts { grid-template-columns: 1fr 1fr; } }
.tp-opt { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line-2); border-radius: var(--r-field); background: #fff; padding: 14px 16px; cursor: pointer; transition: border-color .2s, background .2s; }
.tp-opt:hover { border-color: var(--ink); }
.tp-opt input { width: 20px; height: 20px; accent-color: var(--ink); flex-shrink: 0; }
.tp-opt-name { font-weight: 600; flex: 1; }
.tp-opt-price { font-weight: 800; white-space: nowrap; }
.tp-opt.is-checked { border-color: var(--ink); background: var(--bg); }
.tp-empty { color: var(--muted); font-size: 14px; padding: 6px 0; }
.tp-total { border: 1px solid var(--line-2); border-radius: 1.5rem; background: var(--field); padding: 18px 22px; margin: 22px 0 18px; }
.tp-total-items { font-size: 14px; color: var(--muted); padding-bottom: 14px; border-bottom: 1px solid var(--line-2); }
.tp-total-items li { list-style: none; display: flex; justify-content: space-between; gap: 12px; color: var(--ink-2); padding: 2px 0; }
.tp-total-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-top: 14px; font-weight: 700; }
.tp-total-row strong { font-size: 30px; font-weight: 900; letter-spacing: -.02em; }
.tp-terms { font-size: 13px; color: var(--muted); margin-top: 12px; }

/* tables */
.tp-table-wrap { overflow-x: auto; margin: 0 -4px; }
.tp-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.tp-table th { text-align: left; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .15em; color: var(--muted); padding: 10px 7px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tp-table td { padding: 14px 7px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tp-table tr:last-child td { border-bottom: none; }
.tp-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; letter-spacing: .04em; }
.tp-table td.tp-mono { white-space: nowrap; font-size: 12px; letter-spacing: .02em; }
.tp-table td[data-label="Items"] { min-width: 130px; }
.tp-pill { display: inline-block; border-radius: 9999px; padding: 4px 10px; font-size: 11px; font-weight: 700; white-space: nowrap; background: var(--field); color: var(--ink-2); }
.tp-pill-ok { background: var(--ok-bg); color: var(--ok); }
.tp-pill-wait { background: var(--warn-bg); color: var(--warn); }
.tp-pill-off { background: #f5f5f5; color: var(--faint); }
.tp-code { display: flex; align-items: flex-start; gap: 8px; }
.tp-code code { white-space: pre-wrap; word-break: break-all; background: var(--field); padding: 6px 8px; border-radius: 8px; font-size: 12px; min-width: 150px; max-width: 280px; }
.tp-copy { border: 1px solid var(--line-2); background: #fff; border-radius: 9999px; padding: 6px 10px; font: inherit; font-size: 11px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.tp-copy:hover { border-color: var(--ink); }

/* mobile: tables become stacked cards */
@media (max-width: 700px) {
  .tp-table.tp-stack thead { display: none; }
  .tp-table.tp-stack tr { display: block; border: 1px solid var(--line); border-radius: 1.25rem; padding: 10px 14px; margin-bottom: 12px; }
  .tp-table.tp-stack td { display: flex; justify-content: space-between; gap: 14px; padding: 7px 0; border: none; text-align: right; }
  .tp-table.tp-stack td::before { content: attr(data-label); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); text-align: left; padding-top: 2px; }
  .tp-table.tp-stack .tp-code { justify-content: flex-end; }
}

/* wide tables (orders) also stack when their box is too narrow, e.g. laptops with the sidebar */
.tp-table-wrap { container-type: inline-size; }
@container (max-width: 840px) {
  .tp-table.tp-wide thead { display: none; }
  .tp-table.tp-wide tr { display: block; border: 1px solid var(--line); border-radius: 1.25rem; padding: 10px 14px; margin-bottom: 12px; }
  .tp-table.tp-wide td { display: flex; justify-content: space-between; gap: 14px; padding: 7px 0; border: none; text-align: right; }
  .tp-table.tp-wide td::before { content: attr(data-label); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); text-align: left; padding-top: 2px; }
  .tp-table.tp-wide .tp-code { justify-content: flex-end; }
}

/* live activity */
.tp-feed { list-style: none; border: 1px solid var(--line); border-radius: 1.5rem; background: var(--bg); padding: 6px 18px; max-height: 420px; overflow-y: auto; }
.tp-feed li { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; flex-wrap: wrap; }
.tp-feed li:last-child { border-bottom: none; }
.tp-feed time { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; color: var(--faint); white-space: nowrap; padding-top: 2px; }
.tp-feed b { font-weight: 800; }

/* carplay checker */
.tp-result { border-radius: 1.5rem; border: 1px solid var(--line); padding: 20px 22px; margin-top: 20px; }
.tp-result h3 { font-size: 18px; font-weight: 900; }
.tp-result p { color: var(--ink-2); margin-top: 6px; }
.tp-result.is-ok { background: var(--ok-bg); border-color: #bbf7d0; }
.tp-result.is-warn { background: var(--warn-bg); border-color: #fde68a; }
.tp-result.is-bad { background: var(--err-bg); border-color: #fecaca; }
.tp-result.is-info { background: var(--bg); }
.tp-spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: tp-spin .8s linear infinite; }
@keyframes tp-spin { to { transform: rotate(360deg); } }

/* admin */
.tp-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.tp-tabs a { text-decoration: none; border: 1px solid var(--line-2); border-radius: 9999px; padding: 8px 14px; font-size: 13px; font-weight: 600; background: #fff; }
.tp-tabs a.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }
.tp-inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tp-inline .tp-input, .tp-inline .tp-select { padding: 10px 14px; font-size: 14px; border-radius: 12px; }
.tp-grid-2 { display: grid; gap: 0 18px; }
@media (min-width: 700px) { .tp-grid-2 { grid-template-columns: 1fr 1fr; } }
.tp-small { font-size: 13px; color: var(--muted); }
.tp-row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tp-opt-edit { display: grid; grid-template-columns: 1fr 110px 90px 70px auto; gap: 8px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.tp-opt-edit:last-child { border-bottom: none; }
.tp-opt-edit .tp-input { padding: 10px 12px; font-size: 14px; border-radius: 12px; }
.tp-opt-edit label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.tp-opt-edit input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--ink); }
@media (max-width: 760px) { .tp-opt-edit { grid-template-columns: 1fr 1fr; } .tp-opt-edit > :first-child { grid-column: 1 / -1; } }
.tp-opt-head { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .15em; color: var(--muted); border-bottom: 1px solid var(--line); }
@media (max-width: 760px) { .tp-opt-head { display: none; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

.tp-card-head .tp-inline { flex-wrap: nowrap; }
.tp-card-head .tp-inline .tp-input { width: 240px; max-width: 52vw; }

/* admin-only links (the live portal leaves them out for trade accounts) */
.tp-nav [hidden] { display: none !important; }

/* VIN check progress */
.tp-progress { border: 1px solid var(--line); background: var(--bg); border-radius: 1.5rem; padding: 18px 20px; margin-top: 20px; }
.tp-progress-head { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }
.tp-progress-head span { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); }
.tp-bar-lg { height: 10px; margin: 12px 0 14px; }
.tp-bar-lg span { transition: width .25s linear; }
.tp-progress.is-done .tp-bar span { background: var(--ok); }
.tp-progress.is-failed .tp-bar span { background: var(--err); }
.tp-progress-steps { list-style: none; display: grid; gap: 8px; }
.tp-progress-steps li { position: relative; padding-left: 28px; font-size: 14px; color: var(--faint); }
.tp-progress-steps li::before { content: ''; position: absolute; left: 0; top: 2px; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-2); box-sizing: border-box; }
.tp-progress-steps li strong { display: block; font-weight: 700; }
.tp-progress-steps li span { display: none; font-size: 13px; }
.tp-progress-steps li.is-now { color: var(--ink); }
.tp-progress-steps li.is-now span { display: block; color: var(--muted); }
.tp-progress-steps li.is-now::before { border-color: var(--ink); border-right-color: transparent; animation: tp-spin .8s linear infinite; }
.tp-progress-steps li.is-done { color: var(--ink-2); }
.tp-progress-steps li.is-done::before { border-color: var(--ok); background: var(--ok); }
.tp-progress-steps li.is-done::after { content: ''; position: absolute; left: 5px; top: 5px; width: 4px; height: 7px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.tp-progress.is-failed .tp-progress-steps li.is-now::before { animation: none; border-color: var(--err); }
.tp-feed-who { color: #b45309; }

/* downloads */
.tp-dl-grid { display: grid; gap: 18px; margin-top: 22px; }
.tp-dl-grid { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.tp-dl { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 1.5rem; padding: 24px; background: #fff; }
.tp-dl-icon { width: 56px; height: 56px; border-radius: 16px; background: var(--field); display: flex; align-items: center; justify-content: center; margin-bottom: 18px; }
.tp-dl-icon svg { width: 28px; height: 28px; }
.tp-dl h3 { font-size: 22px; font-weight: 900; letter-spacing: -.01em; }
.tp-dl-ver { align-self: flex-start; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; background: var(--field); border-radius: 9999px; padding: 4px 12px; margin: 8px 0 14px; color: var(--ink-2); }
.tp-dl > p { color: var(--ink-2); font-size: 15px; }
.tp-dl-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 18px 0 0; font-size: 14px; margin-top: auto; padding-top: 18px; }
.tp-dl-meta div { display: flex; gap: 6px; }
.tp-dl-meta dt { font-weight: 700; }
.tp-dl-meta dd { color: var(--muted); }
.tp-dl-note { margin-top: 12px; }
.tp-dl-btn { margin-top: 18px; }

/* how to use a code */
.tp-steps { list-style: none; counter-reset: step; display: grid; gap: 14px; margin-top: 22px; }
@media (min-width: 640px) { .tp-steps { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .tp-steps { grid-template-columns: repeat(4, 1fr); } }
.tp-steps li { counter-increment: step; border: 1px solid var(--line); border-radius: 1.25rem; padding: 20px; background: #fff; }
.tp-steps li::before { content: counter(step, decimal-leading-zero); display: inline-flex; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; font-weight: 700; background: var(--field); border-radius: 9999px; padding: 4px 10px; margin-bottom: 14px; }
.tp-steps h3 { font-size: 16px; font-weight: 800; margin-bottom: 6px; }
.tp-steps p { font-size: 14px; color: var(--muted); }

/* trade shop */
/* shop section tabs: one swipeable row on phones */
@media (max-width: 639px) { .tp-shop-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; } .tp-shop-tabs::-webkit-scrollbar { display: none; } .tp-shop-tabs a { flex: none; white-space: nowrap; } }
.tp-shop-grid { display: grid; gap: 18px; margin-top: 22px; }
@media (min-width: 700px) { .tp-shop-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1200px) { .tp-shop-grid { grid-template-columns: repeat(3, 1fr); } }
.tp-shop-card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 1.5rem; overflow: hidden; background: #fff; }
.tp-shop-card img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; display: block; background: var(--field); }
.tp-shop-body { display: flex; flex-direction: column; flex: 1; padding: 20px; }
.tp-shop-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.tp-shop-top h3 { font-size: 18px; font-weight: 900; }
.tp-shop-plat { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .15em; color: var(--muted); margin-top: 6px; }
.tp-shop-price { white-space: nowrap; border-radius: 9999px; background: var(--ink); color: #fff; padding: 6px 14px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; }
.tp-shop-desc { flex: 1; font-size: 14px; color: var(--ink-2); margin: 14px 0 18px; }

/* admin pricing */
.tp-price-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.tp-price-table th { text-align: left; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .15em; color: var(--muted); padding: 8px 6px; border-bottom: 1px solid var(--line); }
.tp-price-table td { padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tp-price-table .tp-input { padding: 9px 12px; font-size: 14px; border-radius: 10px; }
.tp-price-table input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--ink); }
.tp-price-table .tp-num { width: 110px; }
.tp-price-sub td { padding-top: 0; }
.tp-price-sub td:first-child { padding-left: 26px; color: var(--muted); }
.tp-savebar { position: sticky; bottom: 12px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--ink); color: #fff; border-radius: 9999px; padding: 10px 10px 10px 22px; margin-top: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.2); z-index: 5; }
.tp-savebar .tp-btn { background: #fff; color: var(--ink); border-color: #fff; }
.tp-savebar .tp-btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); }
@media (max-width: 700px) {
  .tp-price-table thead { display: none; }
  .tp-price-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .tp-price-table td { border: none; padding: 2px 0; }
  .tp-price-table td:first-child { grid-column: 1 / -1; }
  .tp-price-table .tp-num { width: 100%; }
  .tp-savebar { border-radius: 1.25rem; }
}

/* order history grouped by VIN */
.tp-vin-tools { display: flex; gap: 10px; align-items: center; margin: 18px 0 12px; }
.tp-vin-tools .tp-input { max-width: 320px; padding: 11px 14px; font-size: 15px; border-radius: 12px; }
.tp-vin-group { border: 1px solid var(--line); border-radius: 1.25rem; margin-bottom: 10px; background: #fff; }
.tp-vin-group[open] { background: var(--bg); }
.tp-vin-group summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 18px; }
.tp-vin-group summary::-webkit-details-marker { display: none; }
.tp-vin-group summary::after { content: ''; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: rotate(45deg); transition: transform .2s; }
.tp-vin-group[open] summary::after { transform: rotate(-135deg); }
.tp-vin-id { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 700; letter-spacing: .06em; font-size: 15px; }
.tp-vin-meta { font-size: 13px; color: var(--muted); }
.tp-vin-group .tp-table-wrap { padding: 0 14px 10px; }
.tp-vin-group .tp-table { background: transparent; }

/* exit button in the top bar */
.tp-exit { display: inline-flex; align-items: center; gap: 6px; }
.tp-exit .ico { width: 16px; height: 16px; }
@media (max-width: 520px) { .tp-signed { display: none; } }
.tp-consent { display: flex; gap: 10px; align-items: flex-start; margin-top: 20px; line-height: 1.5; }
.tp-consent input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--ink); flex-shrink: 0; }
.tp-consent a { color: var(--ink); font-weight: 600; }

/* receipt */
.tp-receipt { width: 100%; max-width: 760px; margin: 0 auto; padding: 32px 16px; }
.tp-receipt-actions { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.tp-receipt .tp-table th { width: 120px; }
@media print {
  .tp-receipt-actions { display: none; }
  .tp-receipt-body { background: #fff; }
  .tp-receipt .tp-card { border: 0; box-shadow: none; padding: 0; }
}

/* back to the main website, above the sign-in box */
.tp-auth-back { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 14px 4px; padding: 10px 16px; border: 1px solid var(--line-2); border-radius: 9999px; background: #fff; color: var(--ink); text-decoration: none; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; transition: border-color .2s; }
.tp-auth-back:hover { border-color: var(--ink); }
.tp-auth-back .ico { width: 16px; height: 16px; }

/* admins page: password-confirm panel */
.tp-confirm summary { list-style: none; cursor: pointer; }
.tp-confirm summary::-webkit-details-marker { display: none; }
.tp-confirm[open] summary { margin-bottom: 8px; }
.tp-confirm .tp-form { background: var(--bg); border: 1px solid var(--line); border-radius: 1rem; padding: 4px 14px 14px; min-width: 260px; }
.tp-confirm .tp-input { padding: 10px 12px; font-size: 14px; }

/* sign-in code page: "Send a new code" and "Start again" level, matching links */
.tp-auth-links-row { align-items: center; }
.tp-link-btn { border: 0; background: none; padding: 0; margin: 0; font: inherit; font-size: 14px; font-weight: 600; line-height: 1.5; color: var(--ink); cursor: pointer; }
.tp-link-btn:hover { text-decoration: underline; }

/* using a code: three stages */
.tp-ready { background: var(--bg); border: 1px solid var(--line); border-radius: 1.25rem; padding: 14px 18px; margin-top: 20px; }
.tp-ready-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .15em; color: var(--muted); margin-bottom: 8px; }
.tp-ready ul { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 14px; color: var(--ink-2); }
.tp-ready li { position: relative; padding-left: 22px; }
.tp-ready li::before { content: ''; position: absolute; left: 0; top: 4px; width: 14px; height: 14px; border-radius: 4px; border: 2px solid var(--ok); }
.tp-ready li::after { content: ''; position: absolute; left: 5px; top: 6px; width: 4px; height: 7px; border: solid var(--ok); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.tp-ready a { color: var(--ink); font-weight: 600; }
.tp-stages { display: grid; gap: 16px; margin-top: 18px; }
@media (min-width: 760px) { .tp-stages { grid-template-columns: repeat(2, 1fr); } }
.tp-stage { border: 1px solid var(--line); border-radius: 1.5rem; padding: 20px 20px 18px; background: #fff; }
.tp-stage-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.tp-stage-n { width: 36px; height: 36px; border-radius: 50%; background: var(--ink); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 900; font-size: 16px; flex-shrink: 0; }
.tp-stage-head h3 { font-size: 18px; font-weight: 900; line-height: 1.2; }
.tp-stage-head p { font-size: 12px; color: var(--muted); }
.tp-stage ol { padding-left: 20px; display: grid; gap: 9px; font-size: 14px; color: var(--ink-2); }
.tp-stage li::marker { color: var(--muted); font-weight: 700; }
.tp-stage em { font-style: normal; color: var(--err); font-weight: 600; }
.tp-stage-sub { font-size: 12px; font-weight: 700; color: var(--muted); margin: 14px 0 8px; text-transform: uppercase; letter-spacing: .1em; }
.tp-stage-note { font-size: 12px; color: var(--muted); margin-top: 12px; }
/* "before you start": one tidy line, spread across the box; wraps on narrow screens */ /* tp-ready-fit */
.tp-ready li.tp-ready-optional::before { border-color: var(--line-2); border-style: dashed; }
.tp-ready li.tp-ready-optional::after { display: none; }
.tp-ready li.tp-ready-optional span { color: var(--muted); }
.tp-ready li { white-space: nowrap; }
@media (min-width: 1000px) {
  .tp-ready { display: flex; align-items: center; gap: 20px; padding: 12px 18px; }
  .tp-ready-title { margin: 0; white-space: nowrap; }
  .tp-ready ul { flex: 1; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; font-size: 13px; min-width: 0; }
}

/* admin menu links can be dragged into any order */
.tp-nav-admin { display: contents; }
.tp-nav-admin a[draggable] { cursor: grab; }
.tp-nav-admin a.is-dragging { opacity: .4; }

/* ---------- phones and the iPhone home-screen app (admins): app bar, bottom tabs, More sheet ---------- */
a, button, summary, label { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
@media (hover: none) { .tp-btn:hover { transform: none; box-shadow: none; } }
/* the home-screen app draws under the status bar (black-translucent): keep content clear of the clock / notch */
.tp-auth-body { padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
.tp-app-title, .tp-app-refresh, .tp-appnav, .tp-more { display: none; }
@media (max-width: 959px) {
  /* iOS zooms into any box under 16px when you tap it */
  input:not([type=checkbox]):not([type=radio]):not([type=range]), select, textarea { font-size: 16px !important; }
  .tp-side { padding-top: calc(14px + env(safe-area-inset-top)); padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  .tp-admin .tp-side { padding-top: calc(8px + env(safe-area-inset-top)); padding-bottom: 8px; overflow: visible; }
  .tp-admin .tp-side .tp-nav { display: none; }
  .tp-admin .tp-side-logo img { width: 34px; height: 34px; }
  .tp-admin .tp-app-title { display: block; flex: 1; min-width: 0; font-size: 17px; font-weight: 800; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tp-admin .tp-app-refresh { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(255,255,255,.1); color: #fff; cursor: pointer; }
  .tp-admin .tp-app-refresh .ico { width: 20px; height: 20px; }
  .tp-admin .tp-app-refresh.is-spinning .ico { animation: tp-spin .8s linear infinite; }
  .tp-admin .tp-top, .tp-admin .tp-foot { display: none; }
  .tp-admin .tp-main { padding: 14px max(12px, env(safe-area-inset-left)) calc(84px + env(safe-area-inset-bottom)); }
  .tp-admin .tp-card { padding: 20px 16px; border-radius: 1.25rem; }

  .tp-admin .tp-appnav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: rgba(17,17,17,.96); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    padding: 6px max(6px, env(safe-area-inset-left)) calc(6px + env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-right));
  }
  .tp-appnav-item {
    flex: 1; min-width: 0; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    padding: 6px 2px; border: 0; background: none; font: inherit; font-size: 10.5px; font-weight: 600; color: rgba(255,255,255,.6);
    text-decoration: none; cursor: pointer; border-radius: 12px;
  }
  .tp-appnav-item .ico { width: 24px; height: 24px; }
  .tp-appnav-item span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .tp-appnav-item.is-active { color: #fff; }
  .tp-appnav-item.is-active .ico { stroke-width: 2.3; }
  .tp-appnav-item .tp-badge { position: absolute; top: 1px; left: calc(50% + 6px); min-width: 18px; height: 18px; font-size: 10px; padding: 0 5px; margin: 0; background: #dc2626; color: #fff; }

  .tp-admin .tp-more { display: block; position: fixed; inset: 0; z-index: 39; background: rgba(0,0,0,.45); }
  .tp-admin .tp-more[hidden] { display: none; }
  .tp-more-sheet {
    position: absolute; left: 0; right: 0; bottom: 0; max-height: 80vh; overflow-y: auto; background: var(--card);
    border-radius: 22px 22px 0 0; padding: 14px 14px calc(80px + env(safe-area-inset-bottom));
  }
  .tp-more-link { display: flex; align-items: center; gap: 14px; padding: 14px 12px; border-radius: 14px; text-decoration: none; font-weight: 600; font-size: 16px; }
  .tp-more-link.is-active { background: var(--field); }
  .tp-more-link[href$="/health.php"] { border-top: 1px solid var(--line); border-radius: 0 0 14px 14px; margin-top: 6px; padding-top: 18px; }
  .tp-more-link .tp-badge { background: var(--ink); color: #fff; }
  .tp-more-foot { display: flex; gap: 10px; flex-wrap: wrap; padding: 14px 12px 0; margin-top: 8px; border-top: 1px solid var(--line); }
  body.tp-more-open { overflow: hidden; }
}
@keyframes tp-spin { to { transform: rotate(360deg); } }

/* ---------- hover glow on boxes (28 Nov 2026, Oliver: like the main website's cards) ----------
   The same lift + soft all-round shadow + slightly darker edge as the main site's .stat-card. Only on devices that
   can hover (not the iPhone). "html" in front so it beats each page's own styles (e.g. the Jobs tiles' all:unset). */
@media (hover: hover) {
  html .jb-sum button, html .db-tile, html .so-tile, html .so-draft, html .so-cal-day, html .rc-fold,
  html .tp-choice, html .tp-opt, html .tp-dl, html .tp-shop-card, html .tp-stage, html .tp-steps li {
    transition: transform .3s, box-shadow .3s, border-color .3s, background-color .2s, color .2s;
  }
  html .jb-sum button:hover, html body:not(.is-editing) .db-tile:hover, html .so-tile:hover, html .so-draft:hover,
  html .so-cal-day:hover, html .rc-fold:hover, html .tp-choice:hover, html .tp-opt:hover, html .tp-dl:hover,
  html .tp-shop-card:hover, html .tp-stage:hover, html .tp-steps li:hover {
    transform: translateY(-4px); box-shadow: 0 0 35px rgba(0,0,0,.18);
  }
  html .jb-sum button:not(.is-active):hover, html body:not(.is-editing) .db-tile:hover, html .so-tile:hover, html .so-draft:hover,
  html .so-cal-day:hover, html .rc-fold:hover, html .tp-dl:hover, html .tp-shop-card:hover, html .tp-stage:hover, html .tp-steps li:hover { border-color: var(--line-2); }
}
/* the same glow, a little smaller, on the year / month tabs (Accounts, Mileage, Dashboard) */
@media (hover: hover) {
  html .rc-tabs button, html .mi-tabs button, html .db-years a, html .db-periods a { transition: transform .25s, box-shadow .25s, border-color .25s, background-color .2s, color .2s; }
  html .rc-tabs button:hover, html .mi-tabs button:hover, html .db-years a:hover, html .db-periods a:not(.is-future):hover { transform: translateY(-2px); box-shadow: 0 0 22px rgba(0,0,0,.18); }
  html .rc-tabs button:not(.is-active):hover, html .mi-tabs button:not(.is-active):hover, html .db-years a:not(.is-on):hover, html .db-periods a:not(.is-on):not(.is-future):hover { border-color: var(--line-2); }
}
/* …and everything else you click that's a box or a pill (28 Nov 2026, Oliver: "check them all"):
   page tabs (Social, Orders, Pricing, Shop, admin accounts), chips, fold-away help / VIN boxes, photo drop zones */
@media (hover: hover) {
  html .tp-tabs a, html .so-chip, html .jb-chip, html .tp-copy { transition: transform .25s, box-shadow .25s, border-color .25s, background-color .2s, color .2s; }
  html .tp-tabs a:hover, html .so-chip:hover, html .jb-chip:hover, html .tp-copy:hover { transform: translateY(-2px); box-shadow: 0 0 22px rgba(0,0,0,.18); }
  html .tp-tabs a:not(.is-active):hover, html .so-chip:not([aria-pressed="true"]):hover, html .jb-chip:hover, html .tp-copy:hover { border-color: var(--line-2); }
  html .tp-help, html .tp-vin-group, html .so-drop, html .rc-drop { transition: transform .3s, box-shadow .3s, border-color .3s, background-color .2s; }
  html .tp-help:hover, html .tp-vin-group:hover, html .so-drop:hover, html .rc-drop:hover { transform: translateY(-4px); box-shadow: 0 0 35px rgba(0,0,0,.18); }
}
