/* AvtoPassport web UI - mobile first, light theme with an optional dark theme (header button). No build step. */

/* Light theme by default; the moon button in the header switches to dark (html[data-theme="dark"]). */
:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f1f3f6;
  --text: #14171f;
  --muted: #646b78;
  --border: #e3e6eb;
  --accent: #1f5ae0;
  --accent-text: #ffffff;
  --accent-soft: #e8effd;
  --ok: #16794a;
  --ok-bg: #e2f5ea;
  --warn: #9a5b00;
  --warn-bg: #fff2d9;
  --err: #c4301c;
  --err-bg: #fde5e2;
  --info: #1d55c4;
  --info-bg: #e6eefd;
  --sev-minor: #c99a06;
  --sev-minor-bg: #fdf3c8;
  --sev-moderate: #dd6b0c;
  --sev-moderate-bg: #ffe9d4;
  --sev-severe: #d4321f;
  --sev-severe-bg: #fde3e0;
  --pin: #d4321f;
  --stage: radial-gradient(ellipse at 50% 35%, #ffffff 0%, #f0f2f5 55%, #e3e7ed 100%);
  --synthetic: #6b21a8;
  --synthetic-bg: #f3e8ff;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  --topbar-h: calc(52px + env(safe-area-inset-top));
  --sidebar-w: 248px;
  --stage-h: min(62vh, 560px);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0e1116;
  --surface: #171b22;
  --surface-2: #1f242d;
  --text: #e7eaee;
  --muted: #9aa4b2;
  --border: #2b313b;
  --accent: #5b9bff;
  --accent-text: #06121f;
  --accent-soft: #15263f;
  --ok: #5fd38a;
  --ok-bg: #12301d;
  --warn: #f2c14e;
  --warn-bg: #352a0c;
  --err: #ff7b72;
  --err-bg: #3a1513;
  --info: #8cc4ff;
  --info-bg: #10263f;
  --sev-minor: #f2c94c;
  --sev-minor-bg: #33290a;
  --sev-moderate: #ff9a4d;
  --sev-moderate-bg: #3a2311;
  --sev-severe: #ff6b5e;
  --sev-severe-bg: #3a1513;
  --pin: #ff6b5e;
  --stage: radial-gradient(ellipse at 50% 35%, #2a313c 0%, #161a21 70%, #0e1116 100%);
  --synthetic: #e0b3ff;
  --synthetic-bg: #2e1745;
  --shadow: none;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}

a {
  color: var(--accent);
}

h1, h2, h3 {
  line-height: 1.25;
  margin: 0 0 0.5rem;
}

h1 { font-size: 1.45rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.02rem; }

p { margin: 0 0 0.75rem; }

code, .mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
  overflow-wrap: anywhere;
}

[hidden] { display: none !important; }

.vh {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
  padding: 0;
  margin: -1px;
}

.muted { color: var(--muted); }
.small { font-size: 0.875rem; }

/* ---------- layout ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  height: var(--topbar-h);
  padding: env(safe-area-inset-top) 16px 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.brand {
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  color: var(--text);
}

.brand span { color: var(--accent); }

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  min-width: 0;
}

.card { scroll-margin-top: 72px; }

.card > h2 {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.lead { color: var(--muted); }

.stack > * + * { margin-top: 0.75rem; }

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

/* ---------- pills, badges, banners ---------- */

.pill, .badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--border);
}

.badge:empty { display: none; }

.pill.ok, .badge.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.pill.warn, .badge.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.pill.err, .badge.err { background: var(--err-bg); color: var(--err); border-color: transparent; }
.pill.info, .badge.info { background: var(--info-bg); color: var(--info); border-color: transparent; }

.badge.sev-minor { background: var(--info-bg); color: var(--info); border-color: transparent; }
.badge.sev-moderate { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.badge.sev-severe { background: var(--err-bg); color: var(--err); border-color: transparent; }

.banner {
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  background: var(--warn-bg);
  color: var(--warn);
  font-weight: 500;
}

.banner.err { background: var(--err-bg); color: var(--err); }
.banner.info { background: var(--info-bg); color: var(--info); }

.note {
  border-left: 4px solid var(--warn);
  background: var(--warn-bg);
  color: var(--text);
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  font-size: 0.92rem;
}

.note.info { border-left-color: var(--info); background: var(--info-bg); }

.error {
  color: var(--err);
  background: var(--err-bg);
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
  font-weight: 500;
  overflow-wrap: anywhere;
}

/* ---------- buttons & inputs ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 48px;
  padding: 0.6rem 1.1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.btn:hover { filter: brightness(0.97); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .swatch:focus-visible, .spin-stage:focus-visible, .chip:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-text);
  border-color: transparent;
}

.btn-block { width: 100%; }

.btn[disabled], .btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-sm { min-height: 40px; padding: 0.35rem 0.8rem; font-size: 0.9rem; }

.file-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
}

@media (min-width: 560px) {
  .file-row { grid-template-columns: 1fr 1fr; }
}

.file-btn { position: relative; width: 100%; }

.file-info { margin: 0.5rem 0 0; font-size: 0.92rem; overflow-wrap: anywhere; }

.thumb {
  display: block;
  max-width: 220px;
  max-height: 140px;
  margin-top: 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  object-fit: cover;
}

fieldset {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem 0.9rem 0.9rem;
  margin: 0 0 0.9rem;
  min-width: 0;
}

legend {
  font-weight: 700;
  padding: 0 0.35rem;
}

label.field-label {
  display: block;
  font-weight: 600;
  margin: 0.85rem 0 0.35rem;
}

input[type="text"], input[type="search"] {
  width: 100%;
  min-height: 48px;
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 1.05rem; /* >= 16px avoids iOS zoom on focus */
}

input.vin-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

input.vin-input::placeholder {
  text-transform: none;
  letter-spacing: normal;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.tips {
  margin: 0 0 1rem;
  border-radius: 12px;
  background: var(--surface-2);
  padding: 0.6rem 0.9rem;
}

.tips summary {
  font-weight: 700;
  cursor: pointer;
  min-height: 32px;
  display: flex;
  align-items: center;
}

.tips ul { margin: 0.4rem 0 0.2rem; padding-left: 1.2rem; }
.tips li { margin: 0.2rem 0; }

/* ---------- progress ---------- */

.progress {
  height: 12px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  overflow: hidden;
  margin: 0.75rem 0 0.4rem;
}

.progress-bar {
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.25s ease;
}

.steps {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.steps li {
  display: grid;
  grid-template-columns: 1.5rem 1fr auto;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  background: var(--surface-2);
  font-size: 0.95rem;
}

.steps li .mark { text-align: center; font-weight: 700; color: var(--muted); }
.steps li.done .mark { color: var(--ok); }
.steps li.active .mark { color: var(--accent); }
.steps li.failed .mark { color: var(--err); }
.steps li .pct { font-variant-numeric: tabular-nums; color: var(--muted); }

.spinner {
  display: inline-block;
  width: 1em;
  height: 1em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: -0.15em;
}

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

@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 2.4s; }
  .progress-bar { transition: none; }
}

/* ---------- VIN card ---------- */

.vin-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(1.15rem, 5.4vw, 1.7rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  overflow-wrap: anywhere;
  margin: 0.25rem 0 0.5rem;
}

.kv {
  display: grid;
  grid-template-columns: minmax(7rem, max-content) 1fr;
  gap: 0.3rem 0.9rem;
  margin: 0.5rem 0;
}

.kv dt { color: var(--muted); font-size: 0.92rem; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.kv dd .src { margin-left: 0.4rem; }

.kv .kv { margin: 0; }

ul.plain { list-style: none; padding: 0; margin: 0; }
ul.notes { margin: 0.4rem 0 0; padding-left: 1.2rem; font-size: 0.92rem; color: var(--muted); }

/* ---------- spin viewer ---------- */

.spin-stage {
  position: relative;
  border-radius: 12px;
  background: #000;
  overflow: hidden;
  touch-action: pan-y;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.spin-stage.dragging { cursor: grabbing; }

.spin-frame {
  position: relative;
  margin: 0 auto;
  width: 100%;
  aspect-ratio: 16 / 9;
}

.spin-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
}

.spin-pins {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.pin-box {
  position: absolute;
  border: 2px solid var(--pin);
  border-radius: 4px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45);
}

.pin-box::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: var(--pin);
  border: 2px solid #fff;
}

.pin-label {
  position: absolute;
  left: -2px;
  bottom: 100%;
  margin-bottom: 2px;
  max-width: 60vw;
  background: var(--pin);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.2;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pin-box.label-below .pin-label { bottom: auto; top: 100%; margin: 2px 0 0; }

.spin-overlay-msg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: rgba(0, 0, 0, 0.45);
  font-weight: 600;
  text-align: center;
  padding: 1rem;
}

.spin-controls {
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.6rem;
}

.spin-controls .btn { padding: 0; }

input[type="range"] {
  width: 100%;
  min-height: 40px;
  accent-color: var(--accent);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.chip {
  min-height: 40px;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--pin);
  background: transparent;
  color: var(--pin);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.chip.active { background: var(--pin); color: #fff; }

/* ---------- damage table ---------- */

.table-wrap { overflow-x: auto; }

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

table.data th, table.data td {
  text-align: left;
  padding: 0.55rem 0.5rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

table.data th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }

.cost-details summary {
  cursor: pointer;
  list-style: none;
  min-height: 32px;
  font-weight: 600;
}

.cost-details summary::-webkit-details-marker { display: none; }
.cost-details summary::after { content: " \24D8"; color: var(--muted); font-weight: 400; }
.cost-details[open] summary::after { content: " \25B4"; }

.cost-details .basis {
  margin-top: 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: left;
  font-weight: 400;
  overflow-wrap: anywhere;
}

@media (max-width: 640px) {
  table.data.responsive thead { display: none; }
  table.data.responsive, table.data.responsive tbody, table.data.responsive tr, table.data.responsive td {
    display: block;
    width: 100%;
  }
  table.data.responsive tr {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.35rem 0.6rem;
    margin-bottom: 0.6rem;
    background: var(--surface);
  }
  table.data.responsive td {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    border-bottom: 1px dashed var(--border);
    padding: 0.45rem 0;
    text-align: right;
  }
  table.data.responsive td:last-child { border-bottom: 0; }
  table.data.responsive td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--muted);
    text-align: left;
    flex: 0 0 auto;
  }
  table.data.responsive td.num { text-align: right; }
  table.data.responsive td > * { min-width: 0; }
}

.total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.8rem;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  background: var(--surface-2);
}

.total strong {
  font-size: 1.3rem;
  font-variant-numeric: tabular-nums;
}

/* ---------- diff ---------- */

.diff-group { margin-top: 0.6rem; }
.diff-group h3 { font-size: 0.95rem; margin-bottom: 0.3rem; }
.diff-group ul { margin: 0; padding-left: 1.2rem; }
.diff-group.new h3 { color: var(--err); }
.diff-group.worse h3 { color: var(--warn); }
.diff-group.resolved h3 { color: var(--ok); }

/* ---------- try-on ---------- */

.swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 0.5rem;
  margin: 0.6rem 0;
}

.swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  min-height: 48px;
  padding: 0.45rem 0.3rem;
  border-radius: 12px;
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.78rem;
  line-height: 1.2;
  cursor: pointer;
  text-align: center;
}

.swatch.active { border-color: var(--accent); }

.swatch .dot {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(127, 127, 127, 0.6);
}

.swatch .dot.original {
  background: conic-gradient(#c00, #cc0, #0c0, #0cc, #00c, #c0c, #c00);
}

.tryon-figure {
  margin: 0;
}

.tryon-figure img {
  display: block;
  width: 100%;
  border-radius: 12px;
  background: #000;
  min-height: 120px;
}

.tryon-figure figcaption { margin-top: 0.4rem; }

/* ---------- 3D viewer ---------- */

.v3d { position: relative; }

.v3d-stage {
  position: relative;
  width: 100%;
  height: min(65vh, 520px);
  min-height: 300px;
  border-radius: 12px;
  overflow: hidden;
  background: radial-gradient(circle at 50% 40%, #2a313c, #0b0d11);
  touch-action: none;
}

.v3d-stage canvas { display: block; }

.v3d-labels {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
}

.v3d-label {
  position: relative;
  top: -16px;
  display: inline-block;
  background: rgba(214, 40, 34, 0.92);
  color: #fff;
  font: 600 11px/1.2 system-ui, -apple-system, sans-serif;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

.v3d-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.v3d-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  pointer-events: none;
}

/* ---------- shops ---------- */

.shops-list { list-style: none; padding: 0; margin: 0.6rem 0 0; display: flex; flex-direction: column; gap: 0.5rem; }

.shop {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.65rem 0.8rem;
}

.shop-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
}

.shop-name { font-weight: 700; overflow-wrap: anywhere; }
.shop-dist { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--muted); }
.shop-meta { font-size: 0.88rem; color: var(--muted); margin-top: 0.2rem; overflow-wrap: anywhere; }
.shop-links { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 0.3rem; font-size: 0.9rem; }

.attribution { font-size: 0.85rem; color: var(--muted); margin-top: 0.6rem; }

/* ---------- verification / misc ---------- */

.hash {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  background: var(--surface-2);
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
  overflow-wrap: anywhere;
  word-break: break-all;
}

details.more { margin-top: 0.75rem; }
details.more > summary { cursor: pointer; font-weight: 600; min-height: 40px; display: flex; align-items: center; }

.history-list { list-style: none; padding: 0; margin: 0.4rem 0 0; display: flex; flex-direction: column; gap: 0.4rem; }
.history-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.5rem 0.7rem;
  border-radius: 10px;
  background: var(--surface-2);
}
.history-list li.current { outline: 2px solid var(--accent); }

/* ---------- footer ---------- */

.site-footer {
  max-width: 960px;
  margin: 0 auto;
  padding: 1rem 16px 2rem;
  color: var(--muted);
  font-size: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
}

.site-footer a { display: inline-flex; align-items: center; min-height: 40px; }

/* ---------- sandbox ---------- */

.synthetic-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border-radius: 8px;
  border: 2px solid var(--synthetic);
  background: var(--synthetic-bg);
  color: var(--synthetic);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.85rem;
}

.synthetic-badge.big { font-size: 1.05rem; padding: 0.55rem 1rem; }

.synthetic-notice {
  border: 2px dashed var(--synthetic);
  background: var(--synthetic-bg);
  color: var(--text);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
}

.registry-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.5rem; }

.registry-item {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  text-align: left;
  min-height: 56px;
  padding: 0.6rem 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.registry-item.active { border-color: var(--synthetic); outline: 2px solid var(--synthetic); }

/* ---------- damage confidence ---------- */

details.low-conf { border-left: 3px solid var(--warn); padding-left: 0.6rem; }
details.low-conf > summary { color: var(--warn); }
.finding-note { color: var(--warn); margin-top: 0.15rem; }

/* ---------- app shell: left sidebar + header + content (reference design); a top bar on phones ---------- */

.shell { display: flex; flex-direction: column; min-height: 100vh; }
.sidebar { display: contents; }

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  text-decoration: none;
}

.sidebar > .brand {
  order: 0;
  height: var(--topbar-h);
  padding: env(safe-area-inset-top) 16px 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.brand-logo { width: 32px; height: 32px; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 1.08rem; font-weight: 800; letter-spacing: -0.01em; }
.brand-text small { color: var(--muted); font-size: 0.8rem; }

.content { order: 2; display: flex; flex-direction: column; min-width: 0; flex: 1; }

.tabs {
  order: 1;
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 8px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.tabs[hidden] { display: none; }
.tabs::-webkit-scrollbar { display: none; }

.tab, .side-new {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
  padding: 0.45rem 0.8rem;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}

.tab:hover, .side-new:hover { background: var(--surface-2); }
.tab:focus-visible, .side-new:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.tab[aria-selected="true"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

.tab-icon, .ico {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ico { width: 18px; height: 18px; }

.tab-count {
  min-width: 1.45rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.45rem;
  text-align: center;
  background: var(--surface-2);
  color: var(--muted);
}

.tab-count:empty { display: none; }
.tab-count[data-tone="warn"], .tab-count[data-tone="err"] { background: var(--err-bg); color: var(--err); }
.tab-count[data-tone="busy"] { background: var(--info-bg); color: var(--info); }

.side-new { display: none; color: var(--muted); }
.car-card { display: none; }

/* header */
.apphead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 14px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.apphead-title { min-width: 0; flex: 1 1 200px; }  /* the buttons share the title row when they fit */
.apphead h1 { margin: 0; font-size: 1.15rem; font-weight: 700; letter-spacing: -0.01em; }
.apphead p { margin: 0.1rem 0 0; color: var(--muted); font-size: 0.85rem; }
.apphead-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.apphead .btn { min-height: 42px; padding: 0.45rem 1rem; border-radius: 10px; }
.apphead .btn:not(.btn-primary) { background: var(--surface); }
.share-status { flex-basis: 100%; margin: 0; }
.share-status:empty { display: none; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.icon-btn:hover { background: var(--surface-2); }
.icon-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.i-sun { display: none; }
:root[data-theme="dark"] .i-sun { display: block; }
:root[data-theme="dark"] .i-moon { display: none; }

.content main { max-width: none; width: 100%; margin: 0; }
.content .site-footer { max-width: none; margin: 0; }

.card { border-radius: var(--radius); }
.btn-outline { background: var(--surface); border: 1px solid var(--border); color: var(--text); min-height: 44px; border-radius: 10px; }
.btn-outline:hover { background: var(--surface-2); }

/* passport panels */
.passport[hidden] { display: none; }
.panels { min-width: 0; scroll-margin-top: 70px; }
.tab-panel { display: flex; flex-direction: column; gap: 16px; }
.tab-panel[hidden] { display: none; }
.tab-panel:focus { outline: none; }
.panel-intro { margin: 0; color: var(--muted); }

/* Car tab: big viewer + inspection summary */
.overview { display: grid; gap: 16px; align-items: start; }
.viewer-card { padding: 12px; }
.stage-wrap { position: relative; }

.spin-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--stage-h);
  padding: 14px;
  background: var(--stage);
  border-radius: 12px;
}

.spin-frame { flex: none; width: auto; max-width: 100%; aspect-ratio: 9 / 16; border-radius: 10px; overflow: visible; }
.spin-frame img { border-radius: 10px; box-shadow: 0 10px 30px rgba(16, 24, 40, 0.18); }

.viewer-chip {
  position: absolute;
  top: 12px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.08);
}

.viewer-tools {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  flex-direction: column;
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 2px 8px rgba(16, 24, 40, 0.08);
}

.tool-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.tool-btn:hover { background: var(--surface-2); }
.tool-btn.active { background: var(--accent-soft); color: var(--accent); }
.tool-btn:focus-visible { outline: 2px solid var(--accent); }

.viewer-foot {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.4rem;
  pointer-events: none;
}

.legend {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding: 0.35rem 0.7rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.8rem;
  font-weight: 600;
}

.lg { display: inline-flex; align-items: center; gap: 0.3rem; }
.lg::before { content: ""; width: 12px; height: 12px; border-radius: 3px; border: 2px solid currentColor; }
.lg.sev-minor::before { color: var(--sev-minor); }
.lg.sev-moderate::before { color: var(--sev-moderate); }
.lg.sev-severe::before { color: var(--sev-severe); }
.lg.low::before { color: var(--muted); border-style: dashed; }
.viewer-hint { font-size: 0.8rem; color: var(--muted); background: var(--surface); padding: 0.15rem 0.5rem; border-radius: 6px; }

#spin-range { margin-top: 0.6rem; }

/* damage boxes coloured by severity; dashed = low confidence */
.pin-box.sev-minor { border-color: var(--sev-minor); }
.pin-box.sev-moderate { border-color: var(--sev-moderate); }
.pin-box.sev-severe { border-color: var(--sev-severe); }
.pin-box.sev-minor::after, .pin-box.sev-minor .pin-label { background: var(--sev-minor); }
.pin-box.sev-moderate::after, .pin-box.sev-moderate .pin-label { background: var(--sev-moderate); }
.pin-box.sev-severe::after, .pin-box.sev-severe .pin-label { background: var(--sev-severe); }
.pin-box.low { border-style: dashed; border-color: #9aa4b2; }
.pin-box.low::after, .pin-box.low .pin-label { background: #6b7280; }

/* summary column */
.summary { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.summary-title { margin: 0.25rem 0 0; font-size: 1.15rem; font-weight: 700; }
.sum-card { display: flex; flex-direction: column; gap: 0.6rem; }
.sum-big { display: flex; align-items: baseline; gap: 0.5rem; }
.sum-num { font-size: 2.1rem; font-weight: 800; line-height: 1; }
.sum-label { font-size: 1.05rem; font-weight: 600; color: var(--muted); }
.sev-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.sev-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 0;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--surface-2);
  color: var(--text);
}

.sev-chip.sev-minor, .badge.sev-minor { background: var(--sev-minor-bg); color: var(--warn); }
.sev-chip.sev-moderate, .badge.sev-moderate { background: var(--sev-moderate-bg); color: var(--sev-moderate); }
.sev-chip.sev-severe, .badge.sev-severe { background: var(--sev-severe-bg); color: var(--sev-severe); }

.bars { display: inline-flex; align-items: flex-end; gap: 1.5px; height: 11px; }
.bars i { display: block; width: 3px; border-radius: 1px; background: currentColor; opacity: 0.3; }
.bars i:nth-child(1) { height: 5px; }
.bars i:nth-child(2) { height: 8px; }
.bars i:nth-child(3) { height: 11px; }
.bars i.on { opacity: 1; }

.sum-cost { display: flex; flex-direction: column; gap: 0.1rem; padding-top: 0.75rem; border-top: 1px solid var(--border); }
.sum-cost strong { font-size: 1.25rem; font-weight: 800; }
.sum-card .btn-outline { align-self: flex-start; }

.rows-card { padding: 4px 0; }

.row-link {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "label chev" "value chev" "sub chev";
  align-items: center;
  width: 100%;
  padding: 0.6rem 1rem;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.row-link:last-child { border-bottom: 0; }
.row-link:hover { background: var(--surface-2); }
.rl-label { grid-area: label; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.rl-value { grid-area: value; font-weight: 700; overflow-wrap: anywhere; }
.rl-value.vin-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: 0.03em; }
.rl-value[data-tone="ok"] { color: var(--ok); }
.rl-value[data-tone="warn"] { color: var(--warn); }
.rl-value[data-tone="err"] { color: var(--err); }
.rl-value[data-tone="info"] { color: var(--info); }
.rl-sub { grid-area: sub; font-size: 0.82rem; color: var(--muted); }
.rl-sub:empty { display: none; }
.rl-chev { grid-area: chev; color: var(--muted); }

.hint-line { display: flex; gap: 0.5rem; margin: 0; font-size: 0.88rem; color: var(--muted); }
.hint-line .ico { color: var(--accent); margin-top: 2px; }
.parts-title { margin: 0.25rem 0 0; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.parts-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }

.part-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  min-height: 48px;
  padding: 0.55rem 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.part-row:hover { border-color: var(--accent); }
.part-name { display: flex; flex-direction: column; }

@keyframes flash-row { from { background: var(--accent-soft); } to { background: transparent; } }
tr.flash > td { animation: flash-row 2.4s ease-out; }

/* paint try-on: picture and colours side by side on wide screens */
.tryon-layout { display: grid; gap: 16px; }
.tryon-figure img { max-height: 70vh; object-fit: contain; background: var(--stage); padding: 12px; }

/* frames with damage boxes, under the 360 view */
.chip { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 999px; font-weight: 600; }
.chip:hover { background: var(--surface-2); }
.chip.active { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

/* 3D viewers on the light theme */
.v3d-stage { background: radial-gradient(ellipse at 50% 35%, #3a4350 0%, #1b2027 75%, #12161b 100%); }

/* phones: keep the header to two short rows (server problems still show in the banner) */
@media (max-width: 899px) {
  .apphead .pill.ok { display: none; }
  .apphead .btn-label { display: none; }
  .apphead #share-btn { width: 42px; padding: 0; }
}

/* ---------- wide screens: fixed left sidebar ---------- */
@media (min-width: 900px) {
  :root { --stage-h: min(72vh, 700px); }

  .shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }

  .sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    height: 100vh;
    padding: 18px 12px 12px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    overflow-y: auto;
  }

  .sidebar > .brand { height: auto; padding: 0 8px 18px; border: 0; background: transparent; }
  .brand-logo { width: 34px; height: 34px; }

  .tabs {
    order: 0;
    position: static;
    flex-direction: column;
    gap: 4px;
    overflow: visible;
    padding: 0;
    border: 0;
  }

  .tab, .side-new { width: 100%; justify-content: flex-start; }
  .tab-count { margin-left: auto; }
  .side-new { display: inline-flex; }

  .car-card {
    display: block;
    margin-top: auto;
    padding: 12px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface-2);
  }

  .car-card[hidden] { display: none; }
  #car-thumb { display: block; width: 100%; height: 120px; object-fit: cover; border-radius: 10px; margin-bottom: 0.6rem; background: #000; }
  #car-thumb[hidden] { display: none; }
  .car-name { font-weight: 700; }
  .car-meta { font-size: 0.85rem; color: var(--muted); }
  .car-vin-label { margin-top: 0.5rem; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.05em; color: var(--muted); }
  .car-vin { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.85rem; overflow-wrap: anywhere; }
  .car-card .badge { font-size: 0.72rem; padding: 0.15rem 0.5rem; }

  .apphead { position: sticky; top: 0; z-index: 20; padding: 12px 24px; min-height: 68px; }
  .content main { padding: 20px 24px; }
  .content .site-footer { padding: 0.5rem 24px 2rem; }
  .panels { scroll-margin-top: 84px; }

  .overview { grid-template-columns: minmax(0, 1fr) minmax(300px, 360px); }
  .viewer-card { position: sticky; top: 88px; }

  .tryon-layout { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; }
}

/* demo car shortcut on the upload card */
.demo-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 1rem;
  margin-bottom: 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  border: 1px dashed var(--accent);
  background: var(--accent-soft);
}

.demo-box[hidden] { display: none; }
.demo-text { display: flex; flex-direction: column; min-width: 0; }
.demo-text .small { overflow-wrap: anywhere; }
.btn-outline.active { border-color: var(--accent); color: var(--accent); }

/* parts 3D viewer (web/partsviewer.js) */
.pv { --pv-stage: #eef1f5; }
:root[data-theme="dark"] .pv { --pv-stage: #161a21; }
.pv-grid { display: grid; gap: 14px; align-items: start; }
.pv-main { min-width: 0; }
.pv-stage {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--pv-stage);
  overflow: hidden;
  touch-action: none;
  cursor: grab;
}
.pv-stage:active { cursor: grabbing; }
.pv-stage canvas { display: block; width: 100%; height: 100%; }
.pv-hint { position: absolute; left: 12px; bottom: 10px; font-size: 0.78rem; color: var(--muted); pointer-events: none; }
.pv-nogl { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; text-align: center; color: var(--muted); }
.pv-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 10px; }
.pv-controls button {
  min-height: 38px;
  padding: 0.35rem 0.8rem;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}
.pv-controls button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.pv-ex { display: flex; align-items: center; gap: 8px; font-size: 0.88rem; font-weight: 600; }
.pv-ex input { width: 150px; }
.pv-seg { display: inline-flex; }
.pv-seg button:first-child { border-radius: 9px 0 0 9px; }
.pv-seg button:last-child { border-radius: 0 9px 9px 0; border-left: 0; }
.pv-side { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.pv-detail { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); }
.pv-detail .kv { margin: 0.5rem 0 0; }
.pv-links { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 0.5rem; }
.pv-links a { padding: 0.25rem 0.6rem; border-radius: 7px; background: var(--accent-soft); font-size: 0.85rem; font-weight: 600; text-decoration: none; }
.pv-list { max-height: 420px; overflow: auto; border-radius: 12px; border: 1px solid var(--border); padding: 4px 0; }
.pv-list h4 { margin: 8px 12px 2px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.pv-list button {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 6px 12px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
}
.pv-list button:hover { background: var(--surface-2); }
.pv-list button[aria-pressed="true"] { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.pv-nm { display: flex; gap: 8px; min-width: 0; }
.pv-sw { flex: none; width: 10px; height: 10px; margin-top: 5px; border-radius: 2px; }
.pv-ct { color: var(--muted); font-size: 0.82rem; font-variant-numeric: tabular-nums; }
@media (min-width: 1100px) { .pv-grid { grid-template-columns: minmax(0, 1fr) 280px; } }

/* Car tab: 3D model / Photos switch; the parts viewer fills the same stage height as the 360° view */
.view-toggle { display: inline-flex; margin: 0 0 10px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.view-toggle[hidden] { display: none; }
.view-toggle button { min-height: 38px; padding: 0.35rem 0.9rem; border: 0; background: var(--surface); color: var(--text); font: inherit; font-size: 0.9rem; font-weight: 600; cursor: pointer; }
.view-toggle button + button { border-left: 1px solid var(--border); }
.view-toggle button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
.pv-compact .pv-stage { aspect-ratio: auto; height: var(--stage-h); }
.ov3d-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; margin-top: 0.5rem; }
.ov3d-foot p { margin: 0; }
.pv-compact .pv-grid { grid-template-columns: minmax(0, 1fr); }

/* language switch (EN / RU / UZ) */
.lang-switch { display: inline-flex; padding: 3px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); }
.lang-switch button { min-width: 38px; height: 34px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font: inherit; font-size: 0.82rem; font-weight: 700; cursor: pointer; }
.lang-switch button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(16, 24, 40, 0.1); }

/* VIN history timeline */
.tl-title { margin: 1rem 0 0.4rem; font-size: 0.95rem; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.timeline li { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.8rem; padding: 0.4rem 0.6rem; border-radius: 10px; background: var(--surface-2); }
.timeline li::before { content: ""; position: absolute; left: -21px; top: 50%; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%; background: var(--border); border: 2px solid var(--surface); }
.timeline li.current { outline: 0; background: var(--accent-soft); }
.timeline li.current::before { background: var(--accent); }
.tl-date { font-weight: 600; }
.tl-what { color: var(--muted); font-size: 0.9rem; }
.hint-line[hidden], .parts-title[hidden], .parts-list[hidden] { display: none; }

/* Paint check */
.pc-grid { display: grid; gap: 16px; align-items: start; }
.pc-diagram { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.pc-car { width: min(100%, 230px); height: auto; }
.pc-panel { fill: var(--surface-2); stroke: var(--muted); stroke-width: 1.2; transition: fill 0.2s; }
.pc-glass { fill: var(--border); stroke: none; pointer-events: none; }
.pc-dot { cursor: pointer; }
.pc-dot circle { fill: var(--surface); stroke: var(--accent); stroke-width: 2; }
.pc-dot text { font: 700 10px Inter, system-ui, sans-serif; fill: var(--accent); pointer-events: none; }
.pc-dot.match circle { fill: #3fa66a; stroke: #3fa66a; }
.pc-dot.check circle { fill: #e3b21b; stroke: #e3b21b; }
.pc-dot.differs circle { fill: #d4321f; stroke: #d4321f; }
.pc-dot.match text, .pc-dot.check text, .pc-dot.differs text { fill: #fff; }
.pc-dot.retake circle { stroke-dasharray: 3 2; }
.pc-legend .pc-ok::before { color: #3fa66a; }
.pc-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.pc-result { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); }
.pc-result p { margin: 0; }
.pc-progress { font-weight: 700; }
.pc-verdict { margin-top: 0.4rem !important; }
.pc-flagged { list-style: none; margin: 0.4rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.pc-flagged li { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.pc-joints { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.pc-joints li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; grid-template-areas: "num where actions" "num state thumb"; gap: 4px 10px; align-items: center; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); }
.pc-num { grid-area: num; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 0.85rem; }
.pc-where { grid-area: where; font-size: 0.92rem; }
.pc-state { grid-area: state; justify-self: start; }
.pc-state:empty { display: none; }
.pc-actions { grid-area: actions; display: flex; gap: 6px; align-items: center; }
.pc-orient { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 1rem; cursor: pointer; }
.pc-take { min-height: 34px; }
.pc-thumb { grid-area: thumb; width: 64px; height: 40px; object-fit: cover; border-radius: 6px; }
.pc-thumb[hidden] { display: none; }
@media (min-width: 900px) { .pc-grid { grid-template-columns: 250px minmax(0, 1fr); } .pc-diagram { position: sticky; top: 90px; } }
.pc-demo { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-bottom: 12px; padding: 10px 12px; border-radius: 12px; border: 1px dashed var(--accent); background: var(--accent-soft); }
.pc-demo[hidden] { display: none; }
