:root {
  color-scheme: dark;
  --bg: #0f1419;
  --panel: #171d26;
  --panel-2: #1f2733;
  --border: #2b3544;
  --text: #e8edf4;
  --muted: #93a0b3;
  --accent: #4da3ff;
  --accent-2: #7cc4ff;
  --hotspot: rgba(77, 163, 255, 0.18);
  --hotspot-active: hsla(20, 60%, 50%, 0.3);
  --hotspot-border: hsla(20, 60%, 50%, 0.5);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  font-family: "SF Pro Text", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: var(--bg); color: var(--text); overflow: hidden; }
button, input { font: inherit; }
.hidden { display: none !important; }

#app { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(15, 20, 25, 0.92);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-title { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.topbar-title strong { font-size: 0.98rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-title span { color: var(--muted); font-size: 0.78rem; }

.icon-btn, .ghost-btn {
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
}
.icon-btn { width: 40px; padding-inline: 0; }
.ghost-btn:hover, .icon-btn:hover { border-color: var(--accent); color: var(--accent-2); }

.layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  transition: grid-template-columns 180ms ease;
}

.sidebar {
  border-right: 1px solid var(--border);
  background: var(--panel);
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.sidebar-head { padding: 14px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.sidebar-head input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}
.meta { margin: 8px 0 0; color: var(--muted); font-size: 0.8rem; }

.nav-crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  font-size: 0.78rem;
}
.nav-crumb.hidden { display: none !important; }
.nav-crumb button {
  border: none;
  background: transparent;
  color: var(--accent-2);
  padding: 2px 4px;
  border-radius: 6px;
  cursor: pointer;
}
.nav-crumb button:hover { background: var(--panel-2); }
.nav-crumb button.current {
  color: var(--text);
  cursor: default;
  font-weight: 600;
}
.nav-crumb button.current:hover { background: transparent; }
.nav-crumb .sep { color: var(--muted); user-select: none; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 4px;
  cursor: pointer;
}
.nav-item:hover { background: var(--panel-2); border-color: var(--border); }
.nav-item .nav-label { flex: 1; min-width: 0; font-size: 0.9rem; line-height: 1.35; }
.nav-item .nav-chev { color: var(--muted); flex-shrink: 0; }

.layout.sidebar-collapsed { grid-template-columns: 0 1fr; }
.layout.sidebar-collapsed .sidebar {
  opacity: 0;
  pointer-events: none;
  border-right-color: transparent;
}

@media (min-width: 981px) {
  .layout.sidebar-collapsed .sidebar { width: 0; min-width: 0; overflow: hidden; }
}

.toc {
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px;
  flex: 1;
  min-height: 0;
  overscroll-behavior: contain;
}

.tree-node { margin-bottom: 2px; }
.tree-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  border-radius: 8px;
  padding: 7px 8px;
  cursor: pointer;
}
.tree-toggle:hover { background: var(--panel-2); border-color: var(--border); }
.tree-level-0 > .tree-toggle { font-weight: 600; font-size: 0.88rem; }
.tree-level-1 > .tree-toggle { font-size: 0.84rem; padding-left: 14px; }
.tree-level-2 > .tree-toggle { font-size: 0.8rem; padding-left: 22px; color: var(--muted); }
.tree-label { flex: 1; min-width: 0; }
.tree-count {
  color: var(--muted);
  font-size: 0.72rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 7px;
}
.chev { width: 12px; color: var(--muted); flex-shrink: 0; }
.tree-children { margin-left: 8px; border-left: 1px solid var(--border); padding-left: 4px; }
.tree-children.collapsed { display: none; }

.search-results {
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px;
  flex: 1;
  min-height: 0;
  overscroll-behavior: contain;
}

.search-results.hidden { display: none !important; }

.search-hit {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 6px;
  cursor: pointer;
}
.search-hit:hover { border-color: var(--accent); }
.search-hit .kind { color: var(--accent-2); font-size: 0.72rem; text-transform: uppercase; }
.search-hit .label { font-size: 0.9rem; margin-top: 4px; }
.search-hit .meta { color: var(--muted); font-size: 0.75rem; margin-top: 4px; }
.search-hit .score { float: right; color: var(--muted); font-size: 0.7rem; }

.toc-unit { margin-left: 18px; }


.toc-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 4px;
  cursor: pointer;
}
.toc-item:hover { background: var(--panel-2); border-color: var(--border); }
.toc-item.active { background: rgba(77, 163, 255, 0.12); border-color: rgba(77, 163, 255, 0.35); }
.toc-item .idx { color: var(--muted); font-size: 0.75rem; margin-right: 8px; }
.toc-item .title { font-size: 0.9rem; line-height: 1.35; }
.toc-item .stats { display: block; color: var(--muted); font-size: 0.72rem; margin-top: 4px; }

.main {
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px;
  overscroll-behavior: contain;
}

.welcome {
  max-width: 1240px;
  margin: 4vh auto 0;
  padding: 24px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.welcome h1 { margin-top: 0; }
.hint { color: var(--muted); }

.trims-overview {
  margin-top: 24px;
  border-top: 1px solid var(--border);
  padding-top: 24px;
  font-size: 0.95rem;
}

.trims-head h2 {
  margin: 0;
  font-size: 1.25rem;
}

.trims-head p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.trim-engine-section {
  margin-top: 40px;
  padding-top: 8px;
}

.trim-engine-section:first-of-type {
  margin-top: 28px;
}

.trim-engine-heading {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--text);
}

.trim-engine-meta {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.trim-platform-block {
  margin-top: 28px;
}

.trim-platform-heading {
  margin: 0 0 14px;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--accent-2);
}

.trim-era-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

@media (max-width: 900px) {
  .trim-era-split {
    grid-template-columns: 1fr;
  }
}

.trim-era-col {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  background: color-mix(in srgb, var(--panel) 88%, var(--accent) 12%);
}

.trim-era-col--pre {
  border-color: color-mix(in srgb, var(--border) 70%, #6b8cae 30%);
}

.trim-era-col--post {
  border-color: color-mix(in srgb, var(--border) 70%, #8cae6b 30%);
}

.trim-era-heading {
  margin: 0 0 12px;
  font-size: 0.92rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text);
}

.trim-era-heading span {
  display: block;
  margin-top: 4px;
  font-size: 0.78rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: var(--muted);
}

.trim-era-span {
  margin-top: 14px;
  padding: 14px;
  border: 1px dashed var(--border);
  border-radius: 14px;
  background: var(--panel-2);
}

.trim-era-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.trim-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}

.trim-cards--era {
  grid-template-columns: 1fr;
}

.trim-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-2);
  padding: 14px 16px;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
}

button.trim-card--link {
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

button.trim-card--link:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

button.trim-card--link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.trim-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 18px;
  font-size: 0.88rem;
}

.trim-breadcrumb-link {
  border: none;
  background: none;
  color: var(--accent-2);
  cursor: pointer;
  padding: 0;
  font: inherit;
}

.trim-breadcrumb-link:hover {
  text-decoration: underline;
}

.trim-breadcrumb-sep {
  color: var(--muted);
}

.trim-breadcrumb-current {
  color: var(--text);
  font-weight: 600;
}

.trims-head--trim h2 {
  font-size: 1.25rem;
}

.trim-pick-hint {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

.trim-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.trim-category-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-2);
  padding: 16px;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  transition: border-color 0.15s ease;
}

.trim-category-card:hover {
  border-color: var(--accent);
}

.trim-category-card strong {
  font-size: 0.98rem;
}

.trim-category-card span {
  color: var(--muted);
  font-size: 0.84rem;
}

.trim-diagram-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.trim-diagram-row {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-2);
  padding: 10px 12px;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
}

.trim-diagram-row:hover {
  border-color: var(--accent);
}

.trim-diagram-row--offline {
  border-color: color-mix(in srgb, var(--border) 60%, var(--accent) 40%);
}

.trim-diagram-code {
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 0.82rem;
  color: var(--accent-2);
}

.trim-diagram-label {
  font-size: 0.9rem;
}

.trim-diagram-badge {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 8px;
}

.trim-diagram-badge--online {
  color: var(--muted);
}

.trim-diagram-row--offline .trim-diagram-badge:not(.trim-diagram-badge--online) {
  color: var(--accent-2);
  border-color: color-mix(in srgb, var(--border) 50%, var(--accent) 50%);
}

.trim-card-title {
  display: flex;
  gap: 10px;
  align-items: baseline;
}

.trim-card-title strong {
  color: var(--accent-2);
  font-size: 0.98rem;
}

.trim-card-title span {
  font-size: 0.95rem;
  font-weight: 600;
}

.trim-card-meta {
  margin-top: 6px;
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.4;
}

.trim-card-stats {
  margin-top: 10px;
  font-size: 0.9rem;
}

.trim-card-cats {
  margin-top: 6px;
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

.viewer-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}
#viewer-position { color: var(--muted); font-size: 0.85rem; flex: 1; }

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.85rem;
}

.viewer-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 14px;
  align-items: stretch;
  height: calc(100vh - 150px);
  min-height: 320px;
}

.diagram-wrap {
  position: relative;
  background: #fff;
  border-radius: 14px;
  overflow: auto;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  max-height: calc(100vh - 150px);
  min-height: 240px;
}

.diagram-zoom-bar {
  position: sticky;
  top: 8px;
  left: 8px;
  z-index: 6;
  display: inline-flex;
  gap: 2px;
  margin: 8px;
  padding: 2px;
  border-radius: 8px;
  background: rgba(15, 20, 25, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
}

.zoom-btn {
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #e8eef5;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: background 120ms;
}
.zoom-btn:hover { background: rgba(255, 255, 255, 0.1); }
.zoom-btn--label {
  min-width: 52px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.diagram-stage {
  position: relative;
  display: inline-block;
  line-height: 0;
  margin: 0 8px 8px;
}

#diagram {
  display: block;
  max-width: none;
  width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
  touch-action: pan-x pan-y pinch-zoom;
}

.hotspot-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hotspot {
  position: absolute;
  border: 1px solid transparent;
  background: var(--hotspot);
  border-radius: 4px;
  pointer-events: auto;
  cursor: pointer;
  transition: background 120ms, border-color 120ms, box-shadow 120ms;
}
.hotspot:hover, .hotspot.active {
  background: var(--hotspot-active);
  border-color: var(--hotspot-border);
  box-shadow: 0 0 0 1px var(--hotspot-border);
}
.hotspot .label {
  position: absolute;
  top: -18px;
  left: 0;
  font-size: 10px;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 4px;
  background: rgba(15, 20, 25, 0.88);
  color: #fff;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 120ms ease;
}
.hotspot:hover .label,
.hotspot.active .label,
.hotspot-layer.show-all-labels .hotspot .label {
  opacity: 1;
}

.detail-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  height: 100%;
  max-height: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.selection-pane {
  flex-shrink: 0;
  padding: 14px;
  border-bottom: 1px solid var(--border);
}

.ref-badge {
  display: inline-block;
  margin: 0 0 8px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(77, 163, 255, 0.15);
  color: var(--accent-2);
  font-size: 0.8rem;
}
#sel-part-number { margin: 0; font-size: 1.1rem; word-break: break-all; }
.part-zzap { margin: 4px 0 0; }
.zzap-link {
  display: inline-block;
  margin-top: 4px;
  color: var(--accent);
  font-size: 0.8rem;
  text-decoration: none;
}
.zzap-link:hover { color: var(--accent-2); text-decoration: underline; }
.zzap-link--compact {
  margin-top: 0;
  margin-left: 8px;
  font-size: 0.72rem;
  vertical-align: middle;
}
.part-row .pn .zzap-link--compact { margin-left: 6px; }
#sel-part-assy { margin: 6px 0 0; }
#sel-part-name { margin-top: 6px; font-size: 1rem; line-height: 1.35; }
.part-applicability {
  margin-top: 8px;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--muted);
}
.part-applicability .app-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin-bottom: 4px;
}
.part-applicability .app-line + .app-line {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
}
.part-applicability.compact { margin-top: 4px; font-size: 0.72rem; }
.part-applicability.compact .app-line + .app-line {
  margin-top: 2px;
  padding-top: 2px;
}
.option-row .option-app { display: block; color: var(--muted); font-size: 0.76rem; margin-top: 4px; line-height: 1.35; }
#sel-part-note { color: var(--muted); margin-top: 6px; font-size: 0.82rem; line-height: 1.35; }

.assy-badge {
  display: inline-block;
  margin-right: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  vertical-align: middle;
  line-height: 1.4;
}
.assy-badge--full {
  background: rgba(120, 190, 120, 0.18);
  color: #8fd48f;
  border: 1px solid rgba(120, 190, 120, 0.35);
}
.assy-badge--sub {
  background: rgba(190, 160, 90, 0.18);
  color: #d9bf7a;
  border: 1px solid rgba(190, 160, 90, 0.35);
}
.part-row .nm { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 2px; }
.part-row .nm > span:last-child { color: var(--muted); font-size: 0.78rem; line-height: 1.3; }
.option-row .assy-badge { margin: 4px 0 2px; }

.options { margin-top: 10px; }
.option-row {
  display: block;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 6px;
  background: var(--panel-2);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 120ms, border-color 120ms;
}
.option-row:hover { border-color: var(--accent); }
.option-row.active {
  border-color: var(--accent);
  background: rgba(77, 163, 255, 0.14);
  box-shadow: inset 0 0 0 1px rgba(77, 163, 255, 0.4);
}
.option-row strong { display: block; font-size: 0.92rem; }
.option-row .option-title { display: block; margin-top: 2px; font-size: 0.88rem; }
.option-row .option-note { display: block; color: var(--muted); font-size: 0.78rem; margin-top: 4px; }
.part-row .part-note { color: var(--muted); font-size: 0.74rem; margin-top: 4px; line-height: 1.3; }

.parts-block {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 14px;
}
.parts-block h3 { margin: 0 0 10px; font-size: 0.95rem; flex-shrink: 0; }
#parts-filter {
  width: 100%;
  margin-bottom: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  flex-shrink: 0;
}

.parts-list-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  margin: 0 -4px;
  padding: 0 4px;
}

.parts-list { display: flex; flex-direction: column; gap: 6px; }
.part-row {
  border: 1px solid var(--border);
  background: var(--panel-2);
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
  text-align: left;
  width: 100%;
  color: inherit;
  font: inherit;
  transition: background 120ms, border-color 120ms, box-shadow 120ms;
}
.part-row:hover { border-color: var(--accent); }
.part-row.active {
  border-color: var(--accent);
  background: rgba(77, 163, 255, 0.14);
  box-shadow: inset 0 0 0 1px rgba(77, 163, 255, 0.4);
}
.part-row .pn { font-weight: 600; font-size: 0.88rem; }
.part-row .rf { color: var(--accent-2); font-size: 0.72rem; margin-top: 4px; }
.part-row.part-incompatible { opacity: 0.42; }
.part-row.part-incompatible .part-fit-badge {
  display: inline-block;
  margin-top: 4px;
  font-size: 0.7rem;
  color: var(--muted);
}
.search-hit.search-incompatible { opacity: 0.5; }
.option-row.option-incompatible { opacity: 0.45; }

.vehicle-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(8, 12, 18, 0.88);
  backdrop-filter: blur(8px);
}
.vehicle-card {
  width: min(100%, 440px);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  box-shadow: var(--shadow);
}
.vehicle-card h2 {
  margin: 0 0 16px;
  font-size: 1.1rem;
}
.vehicle-card h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}
.vehicle-copy {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}
.vehicle-hint {
  margin: 0 0 12px;
  color: var(--accent-2);
  font-size: 0.84rem;
}
.vehicle-error {
  margin: 8px 0 0;
  color: #ff8f8f;
  font-size: 0.82rem;
}
#vin-input {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.primary-btn {
  margin-top: 14px;
  width: 100%;
  border: 1px solid var(--accent);
  background: linear-gradient(180deg, #2f6eb8, #245a98);
  color: #fff;
  border-radius: 10px;
  padding: 11px 14px;
  cursor: pointer;
  font-weight: 600;
}
.primary-btn:hover { filter: brightness(1.06); }
.trim-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(52vh, 360px);
  overflow-y: auto;
}
.trim-option {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  border-radius: 10px;
  padding: 12px;
  cursor: pointer;
}
.trim-option:hover { border-color: var(--accent); }
.trim-option strong { display: block; font-size: 0.92rem; margin-bottom: 4px; }
.trim-option span { color: var(--muted); font-size: 0.78rem; }

.empty-state { color: var(--muted); font-size: 0.9rem; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  background: #102033;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  z-index: 50;
}

@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    inset: 58px auto 0 0;
    width: min(88vw, 360px);
    transform: translateX(-105%);
    transition: transform 180ms ease;
    z-index: 30;
    box-shadow: var(--shadow);
  }
  .sidebar.open { transform: translateX(0); }
  .viewer-body { grid-template-columns: 1fr; }
}
