:root {
  --bg: #121418;
  --panel: #1b1e24;
  --panel-2: #22262e;
  --line: #2c313b;
  --text: #e7e9ee;
  --muted: #9aa1ad;
  --accent: #3b82f6;
  --accent-soft: rgba(59, 130, 246, 0.16);
  --danger: #ef4444;
  --radius: 7px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 13px/1.4 "Segoe UI", system-ui, -apple-system, sans-serif;
  display: flex; flex-direction: column; overflow: hidden;
}
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: var(--text); }
[hidden] { display: none !important; }
svg { width: 18px; height: 18px; flex: none; }
.muted { color: var(--muted); }
.spacer { flex: 1; }

/* ---------- buttons ---------- */
.btn {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 6px 12px; white-space: nowrap;
}
.btn:hover { border-color: #3d4452; background: #282d36; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.primary:hover { background: #2f74e6; }
.btn.danger { color: #fca5a5; }
.btn.danger:hover { border-color: var(--danger); }
.icon-btn {
  display: inline-grid; place-items: center; width: 30px; height: 30px; padding: 0;
  background: transparent; border: 1px solid transparent; border-radius: var(--radius); color: var(--muted);
}
.icon-btn:hover { background: var(--panel-2); color: var(--text); }
.icon-btn:disabled { opacity: 0.35; cursor: default; background: transparent; }
.icon-btn.sm { width: 24px; height: 24px; }
.icon-btn.sm svg { width: 15px; height: 15px; }
.icon-btn.danger:hover { color: var(--danger); }
.mini {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 5px; padding: 2px 8px; font-size: 12px;
}
.mini:hover { border-color: var(--accent); }

/* ---------- top bar ---------- */
.topbar {
  height: 48px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 12px;
  background: var(--panel); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; color: #f1e6c8; margin-right: 4px; }
.brand svg { width: 22px; height: 22px; color: #cdb991; }
.project-name {
  width: 220px; background: transparent; border: 1px solid transparent; border-radius: var(--radius); padding: 5px 8px;
  font-weight: 600;
}
.project-name:hover, .project-name:focus { border-color: var(--line); background: var(--bg); outline: none; }
.group { display: flex; gap: 4px; }

/* ---------- layout ---------- */
.layout { flex: 1; display: grid; grid-template-columns: 280px 1fr 300px; min-height: 0; }
.left, .right { background: var(--panel); min-height: 0; display: flex; flex-direction: column; }
.left { border-right: 1px solid var(--line); }
.right { border-left: 1px solid var(--line); }
.center { display: flex; flex-direction: column; min-width: 0; min-height: 0; }

.tabs { display: flex; border-bottom: 1px solid var(--line); flex: none; }
.tabs button {
  flex: 1; background: none; border: none; padding: 11px 0 10px; color: var(--muted); font-weight: 600;
  border-bottom: 2px solid transparent;
}
.tabs button.active { color: var(--text); border-bottom-color: var(--accent); }
.tab-body { flex: 1; overflow-y: auto; padding: 12px; min-height: 0; }
#tab-map { display: flex; flex-direction: column; gap: 14px; }
#tab-map[hidden] { display: none; }

.sec-head {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted);
  margin: 4px 0 8px; display: flex; align-items: center; gap: 6px;
}
.sec-head.row .mini:first-of-type { margin-left: auto; }
.sec-head .count { text-transform: none; letter-spacing: 0; font-weight: 500; }
.hint { color: var(--muted); font-size: 12px; margin: 6px 0 10px; }

/* ---------- era picker ---------- */
.era-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.era-year { font-size: 24px; font-weight: 700; color: #f1e6c8; }
.era-note { color: var(--muted); }
.era-nav { display: flex; align-items: center; gap: 4px; margin-bottom: 8px; }
.era-slider { flex: 1; accent-color: var(--accent); }
.era-list {
  max-height: 210px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg);
}
.era-group {
  background: #181b20; padding: 4px 10px; font-size: 11px; font-weight: 700;
  color: #c9b98f; text-transform: uppercase; letter-spacing: 0.06em; border-bottom: 1px solid var(--line);
}
.era-item {
  display: flex; width: 100%; gap: 10px; align-items: baseline; padding: 5px 10px; text-align: left;
  background: none; border: none; border-left: 3px solid transparent;
}
.era-item:hover { background: var(--panel-2); }
.era-item.active { background: var(--accent-soft); border-left-color: var(--accent); }
.era-item .y { width: 84px; flex: none; font-weight: 600; }
.era-item .n { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- themes ---------- */
.theme-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.theme-card {
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px; font-size: 11px;
  display: flex; flex-direction: column; gap: 4px; align-items: stretch; text-align: center;
}
.theme-card:hover { border-color: #3d4452; }
.theme-card.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.theme-swatch { height: 34px; border-radius: 4px; position: relative; overflow: hidden; }
.theme-swatch .land, .theme-swatch .land2 { position: absolute; border: 1.5px solid; }
.theme-swatch .land { left: -6px; top: 8px; width: 46%; height: 34px; border-radius: 0 40% 0 0; }
.theme-swatch .land2 { right: 10%; top: 4px; width: 32%; height: 18px; border-radius: 50% 40% 45% 50%; }

/* ---------- territories ---------- */
.panel-sec.grow { flex: 1; display: flex; flex-direction: column; min-height: 180px; }
input[type="search"], input[type="text"], textarea, select, input[type="number"] {
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 8px; width: 100%;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); }
.terr-list { margin-top: 6px; overflow-y: auto; flex: 1; min-height: 120px; }
.terr-row { display: flex; align-items: center; gap: 6px; padding: 2px 2px; border-radius: 5px; }
.terr-row:hover { background: var(--panel-2); }
.terr-name { flex: 1; background: none; border: none; text-align: left; padding: 3px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.terr-name:hover { color: #fff; text-decoration: underline; }
.dot { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid #4a5160; flex: none; }

/* ---------- clip art ---------- */
.clip-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-bottom: 12px; }
.clip {
  aspect-ratio: 1; min-width: 0; background: #f4edd9; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 8px; overflow: hidden; position: relative;
}
.clip:hover { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.clip img { position: absolute; inset: 8px; width: calc(100% - 16px); height: calc(100% - 16px); object-fit: contain; pointer-events: none; }

/* ---------- layers ---------- */
.layer-list { display: flex; flex-direction: column; gap: 2px; margin-bottom: 12px; }
.layer-row {
  display: flex; align-items: center; gap: 4px; padding: 2px 4px; border-radius: 5px; cursor: pointer;
  border: 1px solid transparent;
}
.layer-row:hover { background: var(--panel-2); }
.layer-row.active { background: var(--accent-soft); border-color: rgba(59, 130, 246, 0.5); }
.layer-row.missing .layer-name, .layer-row.hidden-item .layer-name { opacity: 0.45; }
.layer-row.missing .layer-name::after { content: " (not in this era)"; font-size: 11px; }
.layer-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.layer-icon { display: grid; place-items: center; color: var(--muted); }
.layer-icon svg { width: 15px; height: 15px; }

/* ---------- toolbar ---------- */
.toolbar {
  height: 48px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 10px;
  background: var(--panel); border-bottom: 1px solid var(--line); overflow-x: auto;
}
.tools { display: flex; gap: 2px; background: var(--bg); padding: 3px; border-radius: 9px; border: 1px solid var(--line); }
.tool {
  display: flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 6px; border: none;
  background: none; color: var(--muted); font-weight: 600;
}
.tool:hover { color: var(--text); background: var(--panel-2); }
.tool.active { background: var(--accent); color: #fff; }
.tool-opts { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.tool-opts select { width: auto; padding: 4px 8px; }
.tool-opts .swatches { flex-wrap: nowrap; }
.opt-label { color: var(--muted); }
input[type="color"] {
  width: 30px; height: 26px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: none; cursor: pointer;
}
input[type="color"]::-webkit-color-swatch-wrapper { padding: 2px; }
input[type="color"]::-webkit-color-swatch { border: none; border-radius: 4px; }
.swatches { display: flex; gap: 3px; flex-wrap: wrap; }
.swatch { width: 18px; height: 18px; border-radius: 4px; border: 1px solid rgba(255, 255, 255, 0.15); padding: 0; }
.swatch:hover, .swatch.active { outline: 2px solid #fff; outline-offset: 1px; }
.segmented { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: 7px; padding: 2px; }
.segmented button { border: none; background: none; padding: 3px 10px; border-radius: 5px; color: var(--muted); }
.segmented button.active { background: var(--panel-2); color: var(--text); box-shadow: inset 0 0 0 1px #3d4452; }
.zoom { display: flex; align-items: center; gap: 2px; }
.zoom-label { min-width: 54px; text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- stage ---------- */
.stage {
  flex: 1; position: relative; display: grid; place-items: center; min-height: 0; overflow: hidden;
  background: radial-gradient(circle at 50% 40%, #1d2027, #111317);
}
.stage.drop::after {
  content: "Drop to add to the map"; position: absolute; inset: 12px; border: 2px dashed var(--accent); border-radius: 12px;
  display: grid; place-items: center; color: #fff; font-size: 16px; font-weight: 600; background: rgba(59, 130, 246, 0.12);
  pointer-events: none;
}
#canvas { display: block; box-shadow: 0 8px 40px rgba(0, 0, 0, 0.55); border-radius: 2px; touch-action: none; }
.tooltip {
  position: absolute; pointer-events: none; background: rgba(15, 17, 21, 0.92); color: #fff; padding: 4px 9px;
  border-radius: 6px; font-weight: 600; white-space: nowrap; border: 1px solid rgba(255, 255, 255, 0.1);
}
.loading {
  position: absolute; top: 16px; left: 50%; transform: translateX(-50%); background: rgba(15, 17, 21, 0.9);
  padding: 6px 14px; border-radius: 20px; color: #fff; pointer-events: none;
}
.status {
  height: 28px; flex: none; display: flex; align-items: center; gap: 16px; padding: 0 12px; font-size: 12px;
  background: var(--panel); border-top: 1px solid var(--line); color: var(--muted); white-space: nowrap; overflow: hidden;
}
.st-era { color: #c9b98f; font-weight: 600; }
.st-msg { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.st-pos { font-variant-numeric: tabular-nums; }

/* ---------- properties ---------- */
.panel-title { padding: 13px 14px 11px; font-weight: 700; font-size: 14px; border-bottom: 1px solid var(--line); flex: none; }
.props { flex: 1; overflow-y: auto; padding: 4px 14px 24px; }
.section-title {
  margin: 16px 0 8px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted);
  border-top: 1px solid var(--line); padding-top: 12px;
}
.props > .section-title:first-child { border-top: none; padding-top: 4px; margin-top: 8px; }
.field { display: grid; grid-template-columns: 104px 1fr; align-items: center; gap: 8px; margin: 7px 0; }
.field > label { color: var(--muted); font-size: 12px; }
.field.wide { grid-template-columns: 1fr; gap: 4px; }
.field textarea { resize: vertical; min-height: 64px; font-size: 14px; }
.range { display: flex; align-items: center; gap: 6px; }
.range input[type="range"] { flex: 1; min-width: 0; accent-color: var(--accent); }
.range .num { width: 58px; padding: 3px 5px; font-variant-numeric: tabular-nums; }
.color { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.btn-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.switch { position: relative; width: 36px; height: 20px; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch .slider {
  position: absolute; inset: 0; background: #3a404c; border-radius: 20px; transition: background 0.15s; cursor: pointer;
}
.switch .slider::before {
  content: ""; position: absolute; width: 14px; height: 14px; left: 3px; top: 3px; background: #fff; border-radius: 50%;
  transition: transform 0.15s;
}
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider::before { transform: translateX(16px); }
.font-btn {
  display: flex; align-items: center; justify-content: space-between; width: 100%; text-align: left;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 5px 8px; font-size: 16px;
}
.font-btn .caret { font-family: "Segoe UI", sans-serif; font-size: 11px; color: var(--muted); }
.popover {
  position: fixed; z-index: 50; width: 250px; overflow-y: auto; background: var(--panel); border: 1px solid #3d4452;
  border-radius: 9px; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5); padding: 4px;
}
.pop-head { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; padding: 8px 8px 4px; }
.pop-item { display: block; width: 100%; text-align: left; background: none; border: none; padding: 5px 10px; font-size: 18px; border-radius: 5px; }
.pop-item:hover { background: var(--panel-2); }
.pop-item.active { background: var(--accent-soft); }

/* ---------- modal & toast ---------- */
.modal { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55); display: grid; place-items: center; z-index: 60; }
.dialog {
  width: min(520px, 92vw); max-height: 80vh; overflow: auto; background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 18px 20px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}
.dialog h3 { margin: 0 0 12px; }
.proj-list { display: flex; flex-direction: column; gap: 4px; }
.proj-row {
  display: flex; justify-content: space-between; gap: 12px; padding: 9px 12px; background: var(--bg);
  border: 1px solid var(--line); border-radius: var(--radius); text-align: left;
}
.proj-row:hover { border-color: var(--accent); }
.toast {
  position: fixed; bottom: 44px; left: 50%; transform: translate(-50%, 20px); opacity: 0; z-index: 70;
  background: #2b313c; color: #fff; padding: 9px 16px; border-radius: 8px; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  transition: opacity 0.2s, transform 0.2s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #343a45; border-radius: 10px; border: 2px solid var(--panel); }
::-webkit-scrollbar-track { background: transparent; }

@media (max-width: 1100px) {
  .layout { grid-template-columns: 240px 1fr 260px; }
  .tool span { display: none; }
}

/* ---------- v0.2: saved styles, settings & export dialogs ---------- */
.btn.with-icon { display: inline-flex; align-items: center; gap: 6px; }
.btn.with-icon svg { width: 16px; height: 16px; color: var(--muted); }
.theme-card.mine .theme-swatch::after {
  content: "★"; position: absolute; right: 3px; top: 1px; font-size: 10px; color: #fff; text-shadow: 0 0 3px #000;
}
.theme-actions { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.dialog.wide { width: min(640px, 94vw); }
.dialog input[type="text"] { margin: 4px 0 2px; }
.btn-row.tight { margin-top: 6px; }
.choice-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.choice {
  display: grid; grid-template-columns: 22px 70px 130px 1fr; align-items: center; gap: 6px; padding: 7px 10px;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer;
}
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice input[type="radio"] { accent-color: var(--accent); margin: 0; }
.choice .row { display: flex; align-items: center; gap: 6px; }
.choice .num { width: 76px; padding: 3px 6px; }
.settings .sec-head { margin-top: 16px; }
.settings .sec-head:first-child { margin-top: 0; }
.set-list { display: flex; flex-direction: column; gap: 4px; }
.set-row {
  display: flex; align-items: center; gap: 6px; padding: 5px 8px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
}
.set-name { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.set-preview { width: 52px; flex: none; }
.set-preview .theme-swatch { height: 26px; }
.set-preview.text {
  height: 26px; display: grid; place-items: center; font-size: 18px; border-radius: 4px; background-color: #f4edd9;
}
.mini.danger { color: #fca5a5; }
.mini.danger:hover { border-color: var(--danger); }

/* ---------- v0.3: context menu ---------- */
.ctx-menu {
  position: fixed; z-index: 80; min-width: 230px; max-width: 300px; padding: 5px; background: #1f232b;
  border: 1px solid #3d4452; border-radius: 10px; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55); user-select: none;
}
.ctx-header { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 6px 9px 7px; }
.ctx-title { font-weight: 700; font-size: 14px; color: #f1e6c8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctx-sub { color: var(--muted); font-size: 11px; white-space: nowrap; }
.ctx-sep { height: 1px; background: var(--line); margin: 4px 2px; }
.ctx-item {
  display: flex; align-items: center; gap: 9px; width: 100%; padding: 6px 9px; background: none; border: none;
  border-radius: 6px; text-align: left; color: var(--text);
}
.ctx-item:hover:not(:disabled) { background: var(--accent); color: #fff; }
.ctx-item:hover:not(:disabled) .ctx-icon, .ctx-item:hover:not(:disabled) .ctx-kbd { color: #fff; }
.ctx-item:disabled { opacity: 0.4; cursor: default; }
.ctx-item.danger { color: #fca5a5; }
.ctx-item.danger:hover { background: var(--danger); }
.ctx-icon { width: 16px; height: 16px; display: grid; place-items: center; color: var(--muted); flex: none; }
.ctx-icon svg { width: 16px; height: 16px; }
.ctx-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctx-kbd { color: var(--muted); font-size: 11px; }
.ctx-swatches { padding: 4px 9px 7px; }
.ctx-sw-label { font-size: 11px; color: var(--muted); margin-bottom: 5px; }
.ctx-sw-row { display: flex; gap: 4px; align-items: center; }
.ctx-sw-row .swatch { width: 20px; height: 20px; }
.ctx-sw-row input[type="color"] { width: 26px; height: 22px; margin-left: 2px; }

/* ---------- v0.4: borders tool, save state ---------- */
.split { display: inline-flex; }
.split .btn:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.split .btn.caret { border-top-left-radius: 0; border-bottom-left-radius: 0; border-left: none; padding: 6px 8px; color: var(--muted); }
.btn.attention { border-color: #b7791f; box-shadow: inset 0 -2px 0 #e0a43a; }
#saveState { cursor: default; font-size: 12px; }
#saveState.dirty { color: #e0a43a; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 10px; border-radius: 20px;
  background: var(--accent-soft); border: 1px solid rgba(59, 130, 246, 0.5);
}
.chip button { background: none; border: none; color: var(--muted); padding: 0 6px; font-size: 12px; }
.chip button:hover { color: #fff; }
.segmented button.active.add { background: #166534; color: #fff; box-shadow: none; }
.segmented button.active.remove { background: #991b1b; color: #fff; box-shadow: none; }
.layer-icon.plus { color: #4ade80; }
.layer-icon.minus { color: #f87171; }
.muted.small { font-size: 11px; }
.sec-head .mini { white-space: nowrap; letter-spacing: 0; text-transform: none; font-weight: 500; }
.brush-size { width: 90px; accent-color: var(--accent); }

/* ---------- v0.6: land editing, new map dialog ---------- */
.check { display: inline-flex; align-items: center; gap: 6px; color: var(--text); cursor: pointer; white-space: nowrap; }
.check input { accent-color: #0ea5e9; margin: 0; }
.chip.land { background: rgba(14, 165, 233, 0.16); border-color: rgba(14, 165, 233, 0.55); }
.segmented button.active.land-add { background: #0369a1; color: #fff; box-shadow: none; }
.segmented button.active.land-remove { background: #c2410c; color: #fff; box-shadow: none; }
.newmap { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.newmap .col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.newmap .era-list { max-height: 300px; }
.newmap label.lbl { color: var(--muted); font-size: 12px; }
.newmap select { width: 100%; }
.newmap .picked { font-size: 20px; font-weight: 700; color: #f1e6c8; }
.newmap .picked span { font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 8px; }

/* ---------- v0.7: zoom / pan locks ---------- */
.lock-btn {
  display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 8px; margin-left: 2px;
  background: transparent; border: 1px solid transparent; border-radius: var(--radius); color: var(--muted); font-size: 12px;
}
.lock-btn svg { width: 15px; height: 15px; }
.lock-btn:hover { background: var(--panel-2); color: var(--text); }
.lock-btn.on { background: rgba(224, 164, 58, 0.16); border-color: rgba(224, 164, 58, 0.6); color: #f0c063; }

/* ---------- v0.8: animation ---------- */
.tabs button { font-size: 12.5px; }
.btn.wide { width: 100%; justify-content: center; }
.btn svg { width: 16px; height: 16px; }
.btn:has(svg) { display: inline-flex; align-items: center; gap: 6px; }
.btn.small { padding: 4px 10px; font-size: 12px; }
.anim-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.play-big { display: inline-flex; align-items: center; gap: 8px; padding: 9px 18px; font-size: 14px; }
.play-big svg { width: 16px; height: 16px; }
.step-list { display: flex; flex-direction: column; gap: 3px; margin-bottom: 10px; }
.step-row {
  display: flex; align-items: center; gap: 6px; padding: 4px 4px 4px 6px; border-radius: 6px; cursor: pointer;
  background: var(--bg); border: 1px solid var(--line);
}
.step-row:hover { border-color: #3d4452; }
.step-row.active { border-color: var(--accent); background: var(--accent-soft); }
.step-row.with { margin-left: 14px; }
.step-row.missing .step-title { opacity: 0.5; text-decoration: line-through; }
.step-num { width: 16px; text-align: center; color: var(--muted); font-size: 11px; font-weight: 700; }
.step-icon { display: grid; place-items: center; color: #c9b98f; }
.step-icon svg { width: 15px; height: 15px; }
.step-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step-dur { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.anim-sel { background: var(--bg); border: 1px dashed #3d4452; border-radius: var(--radius); padding: 8px; margin: 8px 0; }
#tab-animate .btn-row.tight { margin: 6px 0; }
#tab-animate > .btn.wide { margin: 6px 0; }
.transport {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; align-items: center; gap: 8px;
  background: rgba(20, 22, 27, 0.94); border: 1px solid #3d4452; border-radius: 12px; padding: 6px 10px; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  width: min(620px, calc(100% - 40px)); z-index: 5;
}
.transport.previewing { border-color: var(--accent); }
.transport .scrub { flex: 1; accent-color: var(--accent); }
.transport .ttime { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12px; white-space: nowrap; }
.pbar { height: 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin: 6px 0 10px; }
.pbar-fill { height: 100%; width: 0; background: linear-gradient(90deg, #3b82f6, #60a5fa); transition: width 0.15s; }
.hint.error { color: #fca5a5; }
@media (max-width: 1250px) { .tool span { display: none; } }
