/* ==========================================================================
   PinRig Online — app.whatstudio.digital/pinrig
   Same tokens as ws-theme.css: dark is the base, light follows the system or
   an explicit [data-theme] (shared 'ws-theme' key with the main site).
   ========================================================================== */

:root {
  --bg: #000000;
  --stage: #0b0b0c;
  --stage-dot: rgba(255, 255, 255, 0.07);
  --surface: #161617;
  --surface-2: #1d1d1f;
  --surface-3: #2a2a2d;
  --glass: rgba(22, 22, 23, 0.78);
  --text: #f5f5f7;
  --text-2: #a1a1a6;
  --text-3: #6e6e73;
  --line: rgba(255, 255, 255, 0.14);
  --line-soft: rgba(255, 255, 255, 0.08);
  --accent: #f5f5f7;
  --accent-btn: #f5f5f7;
  --on-accent: #000000;
  --accent-text: #f5f5f7;
  --accent-soft: rgba(255, 255, 255, 0.1);
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  --shadow-soft: 0 12px 40px rgba(0, 0, 0, 0.4);
  --board-shadow: drop-shadow(0 24px 60px rgba(0, 0, 0, 0.6));
  --invert: none;
  --icon-filter: none;

  --r-xs: 10px;
  --r-sm: 14px;
  --r-md: 18px;
  --r-lg: 24px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --panel-w: 344px;
  --top-h: 62px;
  --head-space: 86px;
  --header-bg: rgba(0, 0, 0, 0.72);
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #ffffff;
    --stage: #f2f2f4;
    --stage-dot: rgba(0, 0, 0, 0.09);
    --surface: #f5f5f7;
    --surface-2: #ebebef;
    --surface-3: #dedee3;
    --glass: rgba(255, 255, 255, 0.82);
    --text: #1d1d1f;
    --text-2: #6e6e73;
    --text-3: #86868b;
    --line: rgba(0, 0, 0, 0.14);
    --line-soft: rgba(0, 0, 0, 0.08);
    --accent: #1d1d1f;
    --accent-btn: #1d1d1f;
    --on-accent: #ffffff;
    --accent-text: #1d1d1f;
    --accent-soft: rgba(0, 0, 0, 0.06);
    --shadow: 0 30px 80px rgba(0, 0, 0, 0.12);
    --shadow-soft: 0 12px 40px rgba(0, 0, 0, 0.08);
    --board-shadow: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.12));
    --invert: invert(1);
    --header-bg: rgba(255, 255, 255, 0.76);
    color-scheme: light;
  }
}

:root[data-theme="light"] {
  --bg: #ffffff;
  --stage: #f2f2f4;
  --stage-dot: rgba(0, 0, 0, 0.09);
  --surface: #f5f5f7;
  --surface-2: #ebebef;
  --surface-3: #dedee3;
  --glass: rgba(255, 255, 255, 0.82);
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #86868b;
  --line: rgba(0, 0, 0, 0.14);
  --line-soft: rgba(0, 0, 0, 0.08);
  --accent: #1d1d1f;
  --accent-btn: #1d1d1f;
  --on-accent: #ffffff;
  --accent-text: #1d1d1f;
  --accent-soft: rgba(0, 0, 0, 0.06);
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.12);
  --shadow-soft: 0 12px 40px rgba(0, 0, 0, 0.08);
  --board-shadow: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.12));
  --invert: invert(1);
  --header-bg: rgba(255, 255, 255, 0.76);
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body.pr {
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent-soft); }
svg.ic { width: 18px; height: 18px; flex: none; display: block; }

/* --- Top bar: the site's rounded header ------------------------------- */
.pr-top {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  height: var(--top-h);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 0 10px 0 20px;
  border: 1px solid var(--line-soft);
  border-radius: 99px;
  background: var(--header-bg);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  box-shadow: var(--shadow-soft);
  z-index: 10;
}
.pr-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  min-width: 0;
  flex: none;
}
.pr-mark { width: 28px; height: 28px; filter: var(--invert); }
.pr-brand { justify-self: start; }
.pr-brand-name { font-weight: 700; font-size: 17px; letter-spacing: -0.02em; white-space: nowrap; }
.pr-brand-name span { color: var(--text-2); }
.pr-wordmark { margin: 0; display: flex; align-items: flex-end; justify-content: center; height: 46px; overflow: visible;
  font: italic 400 34px/1 Georgia, "Times New Roman", serif; color: var(--text); pointer-events: none; }
.pr-wordmark canvas { display: block; flex: none; image-rendering: pixelated; }
.pr-chip {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 3px 9px;
  border-radius: 999px;
  color: var(--accent-text);
  background: var(--accent-soft);
}
.pr-nav { display: flex; align-items: center; gap: 2px; }
.pr-tools { --ws-bg: var(--bg); --ws-line-soft: var(--line-soft); --ws-text: var(--text); --ws-text-3: var(--text-3); --ws-surface: var(--surface); }
.pr-tools summary.pr-nav-link { display: block; padding: 9px 14px; font-weight: 800; letter-spacing: 0; cursor: pointer; list-style: none; }
.pr-tools summary::-webkit-details-marker { display: none; }
.pr-tools .pr-nav-link::after { left: 14px; width: calc(100% - 28px); background: #f93a00; }
.pr-nav-link {
  position: relative;
  padding: 9px 12px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
  text-decoration: none;
}
.pr-nav-link::after {
  content: "";
  position: absolute;
  left: 12px;
  bottom: 3px;
  width: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  transition: width 0.3s var(--ease);
}
.pr-nav-link:hover::after { width: calc(100% - 24px); }
.pr-board-btn {
  margin: 0 auto;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  padding: 7px 14px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
  transition: background 0.2s, color 0.2s;
}
.pr-board-btn:hover { background: var(--surface); color: var(--text); }
.pr-top-actions { display: flex; align-items: center; gap: 6px; justify-self: end; }
.pr-sep { width: 1px; height: 20px; background: var(--line-soft); margin: 0 6px; }

.pr-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--text-2);
  transition: background 0.2s, color 0.2s;
}
.pr-icon-btn:hover { background: var(--surface-2); color: var(--text); }
.pr-icon-btn:disabled { opacity: 0.35; pointer-events: none; }
.pr-icon-btn.sm { width: 32px; height: 32px; border-radius: 10px; }

.pr-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  background: var(--surface-2);
  color: var(--text);
  transition: background 0.2s, transform 0.2s var(--ease), box-shadow 0.2s;
}
.pr-btn:hover { background: var(--surface-3); }
.pr-btn-primary { background: var(--accent-btn); color: var(--on-accent); }
.pr-btn-primary:hover { background: var(--accent); opacity: 0.88; }
.pr-btn-primary:active { transform: scale(0.98); }
.pr-btn-wide { width: 100%; height: 46px; font-size: 15px; }
.pr-btn-ghost { background: transparent; border: 1px solid var(--line); }
.pr-btn-ghost:hover { background: var(--surface-2); }
.pr-btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.pr-account { text-decoration: none; }
.pr-account[hidden] { display: none; }
.pr-top-actions .pr-btn.pr-account { width: auto; padding: 0 14px; }

/* --- Layout ------------------------------------------------------------- */
.pr-main {
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--panel-w);
}

/* --- Stage -------------------------------------------------------------- */
.pr-stage {
  position: relative;
  overflow: hidden;
  background-color: var(--stage);
  background-image: radial-gradient(var(--stage-dot) 1px, transparent 1.2px);
  background-size: 22px 22px;
  touch-action: none;
}
.pr-view { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#board { filter: var(--board-shadow); }
#outside { fill: var(--stage); opacity: 0.72; pointer-events: none; }
#boardEdge { stroke: var(--line); vector-effect: non-scaling-stroke; pointer-events: none; }
.pr-stage[data-tool="pen"] .pr-view { cursor: crosshair; }
.pr-stage.is-panning .pr-view, .pr-stage.space .pr-view { cursor: grab; }
.pr-stage.is-panning.dragging .pr-view { cursor: grabbing; }
#scene [data-hit="obj"] { cursor: move; }
.pr-stage[data-tool="pen"] #scene [data-hit="obj"] { cursor: crosshair; }
#ui [data-hit="node"] { cursor: pointer; }
#ui [data-hit="handle"] { cursor: grab; }
#ui [data-hit="seg"] { cursor: copy; }

/* --- Dock --------------------------------------------------------------- */
.pr-dock {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  border-radius: var(--r-md);
  background: var(--glass);
  border: 1px solid var(--line-soft);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: var(--shadow-soft);
  z-index: 3;
}
.pr-dock hr { border: 0; height: 1px; background: var(--line-soft); margin: 4px 6px; }
.pr-tool {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--text-2);
  transition: background 0.2s, color 0.2s;
}
.pr-tool:hover { background: var(--surface-3); color: var(--text); }
.pr-tool.is-on { background: var(--accent-btn); color: var(--on-accent); }
.pr-tool .ic { width: 20px; height: 20px; }
.pr-tool::after {
  content: attr(data-tip);
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translate(-4px, -50%);
  white-space: nowrap;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--text);
  color: var(--bg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s, transform 0.2s var(--ease);
}
.pr-tool:hover::after { opacity: 1; transform: translate(0, -50%); }

/* --- Zoom + hint -------------------------------------------------------- */
.pr-zoom {
  position: absolute;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--line-soft);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow-soft);
  z-index: 3;
}
.pr-zoom .pr-icon-btn { border-radius: 999px; }
.pr-zoom-val {
  min-width: 64px;
  height: 32px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.pr-zoom-val:hover { background: var(--surface-3); }
.pr-zoom .pr-sep { margin: 0 4px; }
.pr-zoom-fit { height: 32px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--text); }
.pr-zoom-fit:hover { background: var(--surface-3); }
.pr-dest { margin-top: -4px; }
.pr-dest button { flex: 1; }
.pr-hint {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  margin: 0;
  width: max-content;
  max-width: calc(100% - 160px);
  text-align: center;
  font-size: 12px;
  color: var(--text-3);
  pointer-events: none;
  z-index: 2;
}
.pr-hint kbd {
  font-family: var(--font);
  font-size: 11px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 5px;
  border: 1px solid var(--line);
  color: var(--text-2);
}

.pr-drop {
  position: absolute;
  inset: 12px;
  border: 2px dashed var(--accent);
  border-radius: var(--r-lg);
  background: var(--accent-soft);
  display: none;
  place-items: center;
  z-index: 6;
  pointer-events: none;
}
.pr-drop.is-on { display: grid; }
.pr-drop div { display: grid; gap: 4px; text-align: center; }
.pr-drop strong { font-size: 20px; }
.pr-drop span { color: var(--text-2); }

/* --- Start screen ------------------------------------------------------ */
.pr-start {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 4;
  pointer-events: none;
}
.pr-start[hidden] { display: none; }
.pr-start-card { display: grid; gap: 14px; justify-items: center; width: min(440px, 100%); pointer-events: auto; }
.pr-start-drop {
  width: 100%;
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 44px 24px 38px;
  border-radius: var(--r-lg);
  border: 1.5px dashed var(--line);
  background: var(--glass);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow-soft);
  transition: border-color 0.2s, background 0.2s, transform 0.3s var(--ease);
}
.pr-start-drop:hover { border-color: var(--accent); background: var(--accent-soft); }
.pr-start-drop:active { transform: scale(0.99); }
.pr-start-ic {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  color: var(--on-accent);
  background: var(--accent-btn);
  margin-bottom: 6px;
}
.pr-start-ic .ic { width: 24px; height: 24px; }
.pr-start-drop strong { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; }
.pr-start-drop strong span { font-weight: 500; color: var(--text-2); }
.pr-start-drop small { font-size: 13px; color: var(--text-3); }
.pr-drop.is-on ~ .pr-start { display: none; }
.pr-start-sample { background: var(--glass); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }

/* --- Inspector ---------------------------------------------------------- */
.pr-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding-top: var(--head-space);
  border-left: 1px solid var(--line-soft);
  background: var(--bg);
}
.pr-panel-grip { display: none; }
.pr-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  margin: 14px 16px 6px;
  padding: 3px;
  border-radius: 999px;
  background: var(--surface);
}
.pr-tabs button {
  height: 34px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  transition: background 0.2s, color 0.2s;
}
.pr-tabs button:hover { color: var(--text); }
.pr-tabs button.is-on { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); }
.pr-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px 16px 32px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--surface-3) transparent;
}

.pr-sel-head { display: flex; align-items: center; gap: 10px; padding: 4px 2px 2px; }
.pr-sel-head .pr-name {
  flex: 1;
  min-width: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 4px 6px;
  margin-left: -6px;
}
.pr-sel-head .pr-name:hover { border-color: var(--line-soft); }
.pr-sel-head .pr-name:focus { border-color: var(--accent); outline: none; background: var(--surface); }
.pr-count { font-size: 12px; color: var(--text-3); white-space: nowrap; }

.pr-section-title {
  margin: 12px 2px 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}

.pr-card {
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid transparent;
  transition: border-color 0.2s, background 0.2s;
}
.pr-card.is-on { border-color: var(--line-soft); }
.pr-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px 10px 10px;
  width: 100%;
  text-align: left;
  border-radius: var(--r-md);
}
.pr-fx-icon {
  width: 58px;
  height: 36px;
  flex: none;
  border-radius: 10px;
  background: #2a2a2d;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.pr-fx-icon img { width: 48px; height: auto; display: block; }
.pr-card-titles { flex: 1; min-width: 0; display: grid; gap: 1px; }
.pr-card-titles strong { font-size: 14px; font-weight: 600; }
.pr-card-titles small { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pr-card-body { padding: 2px 12px 14px; display: grid; gap: 12px; }
.pr-card:not(.is-on) .pr-card-body { display: none; }
.pr-card.static .pr-card-body { display: grid; padding-top: 12px; }

.pr-switch {
  width: 40px;
  height: 24px;
  flex: none;
  border-radius: 999px;
  background: var(--surface-3);
  position: relative;
  transition: background 0.25s var(--ease);
}
.pr-switch::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 0.25s var(--ease);
}
.pr-switch[aria-pressed="true"] { background: var(--accent-btn); }
.pr-switch[aria-pressed="true"]::after { background: var(--bg); box-shadow: none; }
.pr-switch[aria-pressed="true"]::after { transform: translateX(16px); }

.pr-field { display: grid; gap: 7px; }
.pr-field-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pr-label { font-size: 12px; font-weight: 500; color: var(--text-2); }
.pr-val { font-size: 12px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }

.pr-seg {
  display: grid;
  grid-auto-columns: 1fr;
  grid-auto-flow: column;
  gap: 2px;
  padding: 3px;
  border-radius: 12px;
  background: var(--surface-2);
}
.pr-seg button {
  height: 30px;
  padding: 0 8px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}
.pr-seg button:hover { color: var(--text); }
.pr-seg button.is-on { background: var(--bg); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18); }

.pr-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pr-chips button {
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  border: 1px solid var(--line);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.pr-chips button:hover { color: var(--text); border-color: var(--text-3); }
.pr-chips button.is-on { color: var(--accent-text); border-color: var(--accent); background: var(--accent-soft); }

.pr-measures { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pr-measure {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 10px 6px 8px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1.5px solid transparent;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.pr-measure img { width: 76px; height: 40px; padding: 4px 8px; border-radius: 10px; background: #2a2a2d; object-fit: contain; }
.pr-measure:hover { color: var(--text); }
.pr-measure.is-on { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }
.pr-measure.wide { grid-column: span 2; grid-template-columns: auto 1fr; justify-items: start; align-items: center; padding: 8px 12px; gap: 12px; }

input[type="range"].pr-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 22px;
  background: transparent;
  margin: 0;
  --p: 50%;
}
.pr-range::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(to right, var(--accent) var(--p), var(--surface-3) var(--p));
}
.pr-range::-moz-range-track { height: 4px; border-radius: 4px; background: var(--surface-3); }
.pr-range::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--accent); }
.pr-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -6px;
  border-radius: 50%;
  background: #fff;
  border: 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(0, 0, 0, 0.06);
}
.pr-range::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.pr-swatches { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pr-swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--line);
  position: relative;
  transition: transform 0.2s var(--ease);
}
.pr-swatch:hover { transform: scale(1.08); }
.pr-swatch.is-on { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }
.pr-swatch.none { background: linear-gradient(135deg, transparent 45%, #ff3b30 45%, #ff3b30 55%, transparent 55%), var(--bg); }
.pr-swatch-custom { overflow: hidden; background: conic-gradient(#ff3b30, #ffd60a, #34c759, #0a84ff, #bf5af2, #ff3b30); }
.pr-swatch-custom input { position: absolute; inset: -8px; width: 44px; height: 44px; opacity: 0; cursor: pointer; }

.pr-input {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  background: var(--surface-2);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.pr-input:focus { outline: none; border-color: var(--accent); }
.pr-two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pr-inline-input { position: relative; }
.pr-inline-input span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--text-3); pointer-events: none; }
.pr-inline-input .pr-input { padding-left: 30px; }

.pr-empty {
  border-radius: var(--r-md);
  background: var(--surface);
  padding: 22px 18px;
  display: grid;
  gap: 10px;
  justify-items: start;
}
.pr-empty strong { font-size: 15px; }
.pr-empty p { margin: 0; color: var(--text-2); font-size: 13px; }
.pr-empty .pr-btn { margin-top: 4px; }

.pr-layers { display: grid; gap: 2px; }
.pr-layer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 6px 6px 10px;
  border-radius: 12px;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
}
.pr-layer:hover { background: var(--surface); color: var(--text); }
.pr-layer.is-on { background: var(--accent-soft); color: var(--text); }
.pr-layer .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-layer .pr-icon-btn { width: 28px; height: 28px; border-radius: 8px; }
.pr-layer.hidden .nm, .pr-layer.hidden .pr-layer-ic { opacity: 0.45; }
.pr-layer-group { display: grid; gap: 1px; padding-bottom: 6px; }
.pr-layer-obj .nm { font-weight: 600; color: var(--text); }
.pr-layer-fx { padding-left: 14px; min-height: 36px; }
.pr-layer-art { cursor: default; color: var(--text-3); }
.pr-layer-art:hover { background: transparent; color: var(--text-3); }
.pr-layer-ic { width: 34px; height: 18px; flex: none; border-radius: 5px; background: #2a2a2d; display: grid; place-items: center; overflow: hidden; }
.pr-layer-ic img { width: 30px; height: auto; display: block; }
.pr-layer-ic-art { background: var(--surface-3); }
.pr-layers-head { display: flex; align-items: flex-end; justify-content: space-between; margin-top: 12px; }
.pr-layers-head .pr-section-title { margin: 0 2px; }
.pr-layers-legend { font-size: 11px; color: var(--text-3); padding-right: 70px; }
.pr-switch.sm { width: 34px; height: 20px; }
.pr-switch.sm::after { width: 14px; height: 14px; }
.pr-switch.sm[aria-pressed="true"]::after { transform: translateX(14px); }
.pr-switch.xs { width: 28px; height: 16px; margin-right: 4px; }
.pr-switch.xs::after { width: 12px; height: 12px; left: 2px; top: 2px; }
.pr-switch.xs[aria-pressed="true"]::after { transform: translateX(12px); }
.pr-gear { color: var(--text-3); }
.pr-gear .ic { width: 16px; height: 16px; }
.pr-badge { font-style: normal; font-size: 10px; font-weight: 600; padding: 2px 6px; border-radius: 999px; color: var(--accent-text); background: var(--accent-soft); vertical-align: 2px; margin-left: 4px; }
.pr-measure-wrap { position: relative; display: grid; }
.pr-measure-wrap.wide { grid-column: span 2; }
.pr-measure-wrap .pr-gear { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; }
.pr-style-head { display: flex; align-items: center; gap: 12px; padding: 4px 2px; }
.pr-style-head > div { flex: 1; min-width: 0; display: grid; gap: 1px; }
.pr-style-head strong { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.pr-style-head small { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.pr-actions-row { display: flex; flex-wrap: wrap; gap: 6px; }
.pr-note { font-size: 12px; color: var(--text-3); margin: 0; }
.pr-kbd-list { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 12px; color: var(--text-2); }
.pr-kbd-list kbd { font-family: var(--font); font-weight: 600; font-size: 11px; color: var(--text); padding: 2px 6px; border-radius: 6px; background: var(--surface-2); justify-self: start; }

/* --- Modal -------------------------------------------------------------- */
.pr-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.pr-modal[hidden] { display: none; }
.pr-modal-card {
  width: min(420px, 100%);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 20px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow);
  display: grid;
  gap: 16px;
  animation: pr-pop 0.3s var(--ease);
}
@keyframes pr-pop { from { opacity: 0; transform: translateY(8px) scale(0.98); } }
.pr-modal-head { display: flex; align-items: center; justify-content: space-between; }
.pr-modal-head h2 { margin: 0; font-size: 20px; letter-spacing: -0.02em; }
.pr-modal .pr-seg { background: var(--surface-2); }
.pr-export-preview {
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
}
.pr-export-preview img { max-width: 100%; max-height: 100%; display: block; }
.pr-export-meta { margin: -4px 0 0; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }

.pr-toast {
  position: fixed;
  left: 50%;
  bottom: 100px;
  transform: translate(-50%, 12px);
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.3s var(--ease);
  z-index: 30;
}
.pr-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* --- Small screens: inspector becomes a bottom sheet -------------------- */
@media (max-width: 1180px) { .pr-nav > a, .pr-nav-sep { display: none; } }
@media (max-width: 640px) {
  .pr-top { grid-template-columns: auto minmax(0,1fr) auto; }
  .pr-nav .pr-tools.nav-has-menu { position: static !important; }
  .pr-nav .pr-tools .nav-sub-cols { width: min(100%, 364px); grid-template-columns: repeat(2,minmax(0,1fr)) !important; }
}
@media (max-width: 860px) {
  :root { --top-h: 56px; --head-space: 0px; }
  .pr-top { padding: 0 6px 0 14px; gap: 8px; top: 8px; left: 8px; right: 8px; }
  .pr-brand-name { display: none; }
  .pr-wordmark { font-size: 28px; height: 40px; }
  .pr-top-actions { margin-left: auto; }
  .pr-top-actions .pr-btn span:last-child { display: none; }
  .pr-top-actions .pr-btn { width: 38px; padding: 0; }
  .pr-main { grid-template-columns: 1fr; position: relative; }
  .pr-panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 56%;
    border-left: 0;
    border-top: 1px solid var(--line-soft);
    border-radius: 22px 22px 0 0;
    box-shadow: var(--shadow);
    transform: translateY(calc(100% - 64px));
    transition: transform 0.35s var(--ease);
    z-index: 8;
  }
  .pr-panel.is-open { transform: none; }
  .pr-panel-grip {
    display: block;
    width: 100%;
    height: 14px;
    flex: none;
    position: relative;
  }
  .pr-panel-grip::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 7px;
    width: 40px;
    height: 4px;
    margin-left: -20px;
    border-radius: 4px;
    background: var(--surface-3);
  }
  .pr-tabs { margin-top: 2px; }
  .pr-dock { left: 12px; top: 76px; transform: none; flex-direction: row; max-width: calc(100% - 24px); overflow-x: auto; }
  .pr-dock hr, .pr-dock [data-dock-cmd="sample"] { display: none; }
  .pr-tool { width: 36px; height: 36px; flex: none; }
  .pr-tool::after { display: none; }
  .pr-zoom { bottom: 76px; }
  .pr-hint { display: none; }
}
.pr-measure-wrap .pr-measure.wide { grid-column: auto; }

/* --- Style tab layer switcher ------------------------------------------ */
.pr-layerbar { display: grid; gap: 10px; padding: 12px; border-radius: var(--r-md); background: var(--surface); position: sticky; top: -10px; z-index: 2; box-shadow: 0 8px 16px -12px rgba(0, 0, 0, 0.5); }
.pr-layerbar-row { display: flex; align-items: center; gap: 10px; }
.pr-layer-select { flex: 1; height: 34px; appearance: none; -webkit-appearance: none; padding-right: 30px; font-weight: 600;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 16px) 15px, calc(100% - 11px) 15px; background-size: 5px 5px; background-repeat: no-repeat; }
.pr-lchips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -12px; padding: 0 12px 2px; }
.pr-lchips::-webkit-scrollbar { display: none; }
.pr-lchip { flex: none; display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px 0 6px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); font-size: 12px; font-weight: 600; white-space: nowrap; transition: background 0.2s, color 0.2s; }
.pr-lchip img { width: 30px; height: 20px; object-fit: contain; border-radius: 6px; background: #2a2a2d; padding: 2px; }
.pr-lchip-dot { width: 20px; height: 20px; border-radius: 50%; background: conic-gradient(var(--text) 0 50%, var(--text-3) 0); margin-left: 2px; }
.pr-lchip.is-on .pr-lchip-dot { background: conic-gradient(var(--on-accent) 0 50%, var(--text-3) 0); }
.pr-lchip:hover { color: var(--text); background: var(--surface-3); }
.pr-lchip.is-on { background: var(--accent-btn); color: var(--on-accent); }
.pr-lchip.is-hidden { opacity: 0.55; }
.pr-lchip i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.8; }

/* --- Styles --------------------------------------------------------------- */
.pr-styles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pr-style-card-wrap { position: relative; display: grid; }
.pr-style-card { display: grid; gap: 5px; justify-items: center; padding: 6px 6px 7px; border-radius: 12px; background: var(--surface-2); font-size: 11px; font-weight: 600; color: var(--text-2); border: 1.5px solid transparent; transition: border-color 0.2s, color 0.2s; }
.pr-style-card svg { width: 100%; height: auto; display: block; }
.pr-style-card span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-style-card:hover { border-color: var(--accent); color: var(--text); }
.pr-style-add { align-content: center; min-height: 64px; border: 1.5px dashed var(--line); background: transparent; }
.pr-style-add .ic { width: 20px; height: 20px; }
.pr-style-del { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%; display: none; place-items: center; background: var(--text); color: var(--bg); }
.pr-style-del .ic { width: 12px; height: 12px; }
.pr-style-card-wrap:hover .pr-style-del { display: grid; }

/* --- Pin editor ----------------------------------------------------------- */
.pr-pin-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.pr-pin-grid button { display: grid; justify-items: center; gap: 2px; padding: 6px 2px 6px; border-radius: 12px; background: var(--surface-2); font-size: 10px; font-weight: 600; color: var(--text-2); border: 1.5px solid transparent; transition: border-color 0.2s, color 0.2s; }
.pr-pin-grid button svg { width: 34px; height: 34px; }
.pr-pin-grid button:hover { color: var(--text); }
.pr-pin-grid button.is-on { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }

/* --- Texture variants ----------------------------------------------------- */
.pr-tex-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pr-tex-grid button { display: grid; justify-items: center; gap: 4px; padding: 6px 4px 7px; border-radius: 12px; background: var(--surface-2); font-size: 10px; font-weight: 600; color: var(--text-2); border: 1.5px solid transparent; transition: border-color 0.2s, color 0.2s; }
.pr-tex-grid button img { width: 100%; max-width: 76px; height: auto; border-radius: 6px; background: #2a2a2d; }
.pr-tex-grid button:hover { color: var(--text); }
.pr-tex-grid button.is-on { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }

/* --- Misc ------------------------------------------------------------------ */
.pr-textarea { height: auto; min-height: 64px; padding: 10px 12px; resize: vertical; line-height: 1.35; font-family: var(--font); }
select.pr-input { cursor: pointer; }
.pr-swatch.auto { display: grid; place-items: center; font-size: 11px; font-weight: 800; color: var(--text-2); background: var(--surface-2); }
.pr-kind { width: 18px; height: 18px; display: grid; place-items: center; color: var(--text-3); flex: none; }
.pr-kind .ic { width: 15px; height: 15px; }
.pr-group-card .pr-card-body { gap: 10px; }
.pr-group-card .pr-btn .ic { width: 16px; height: 16px; }
.pr-promo { margin-top: 14px; display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--r-md); background: var(--surface); color: var(--text); text-decoration: none; transition: background 0.2s; }
.pr-promo:hover { background: var(--surface-2); }
.pr-promo > span:nth-child(2) { flex: 1; display: grid; gap: 2px; }
.pr-promo strong { font-size: 13px; }
.pr-promo small { font-size: 12px; color: var(--text-3); }
.pr-promo-ic { width: 46px; height: 32px; border-radius: 9px; background: #2a2a2d; display: grid; place-items: center; flex: none; }
.pr-promo-ic img { width: 38px; }
.pr-export-cta { font-size: 12px; color: var(--text-3); text-decoration: none; margin-top: -6px; }
.pr-export-cta strong { color: var(--text); font-weight: 600; }
.pr-export-cta:hover { color: var(--text-2); }
#ui [data-hit="xf"] { cursor: nwse-resize; }
#ui .xf-n, #ui .xf-s { cursor: ns-resize; }
#ui .xf-e, #ui .xf-w { cursor: ew-resize; }
#ui .xf-ne, #ui .xf-sw { cursor: nesw-resize; }
#ui [data-h="rot"] { cursor: grab; }

/* 2026-11-11: open demo, export needs a license */
.pr-modal-sm { width: min(360px, 100%); }
.pr-modal-card > a.pr-btn { text-decoration: none; justify-content: center; }
.pr-modal-text { margin: -6px 0 0; font-size: 13px; line-height: 1.5; color: var(--text-2); }
.pr-modal-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* --- Layers: empty slot so the original's eye sits in the eye column ----- */
.pr-layer-gap { width: 28px; flex: none; }

/* --- Send to AE fallback -------------------------------------------------- */
.pr-ae-help[hidden] { display: none; }
.pr-ae-help { display: grid; gap: 10px; padding: 14px; border-radius: 14px; background: var(--surface-2); font-size: 13px; color: var(--text-2); }
.pr-ae-help strong { font-size: 14px; color: var(--text); }
.pr-ae-help p { margin: 0; line-height: 1.5; }
.pr-ae-help b { color: var(--text); font-weight: 600; word-break: break-all; }
.pr-ae-help ol { margin: 0; padding-left: 20px; display: grid; gap: 4px; line-height: 1.5; }
.pr-ae-help .pr-btn { margin-top: 4px; }

/* --- Colour picker ------------------------------------------------------- */
.pr-picker { position: fixed; inset: 0; z-index: 30; }
.pr-picker[hidden] { display: none; }
.pr-pk-card {
  position: fixed;
  width: 436px;
  max-width: calc(100vw - 24px);
  padding: 14px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
  animation: pr-pop 0.2s var(--ease);
}
.pr-pk-main { display: grid; grid-template-columns: 1fr 18px 156px; gap: 12px; }
.pr-pk-sv { position: relative; height: 196px; border-radius: 10px; cursor: crosshair; touch-action: none; }
.pr-pk-knob {
  position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%;
  border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.35); pointer-events: none;
}
.pr-pk-hue {
  position: relative; border-radius: 9px; cursor: ns-resize; touch-action: none;
  background: linear-gradient(to top, #f00 0%, #ff0 16.66%, #0f0 33.33%, #0ff 50%, #00f 66.66%, #f0f 83.33%, #f00 100%);
}
.pr-pk-hknob {
  position: absolute; left: -3px; right: -3px; height: 8px; margin-top: -4px; border-radius: 4px;
  border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45); pointer-events: none;
}
.pr-pk-side { display: grid; align-content: start; gap: 10px; }
.pr-pk-cmp { display: grid; grid-template-rows: 30px 30px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.pr-pk-cmp [data-pk-old] { cursor: pointer; }
.pr-pk-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pr-pk-fields label, .pr-pk-hex {
  position: relative; display: flex; align-items: center; height: 30px; padding: 0 6px 0 8px; gap: 4px;
  border-radius: 8px; background: var(--surface-2); border: 1px solid transparent; font-size: 12px; color: var(--text-3);
}
.pr-pk-fields label:focus-within, .pr-pk-hex:focus-within { border-color: var(--line); }
.pr-pk-fields span, .pr-pk-hex span { font-weight: 600; width: 10px; flex: none; }
.pr-pk-fields i { font-style: normal; flex: none; }
.pr-pk-fields input, .pr-pk-hex input {
  width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text);
  font: 600 12px/1 var(--font); font-variant-numeric: tabular-nums; padding: 0;
}
.pr-pk-hex input { text-transform: uppercase; letter-spacing: 0.04em; }
.pr-pk-foot { display: grid; grid-template-columns: auto 1fr auto auto; gap: 8px; align-items: center; }
.pr-pk-eye[hidden] { display: none; }
.pr-swatch-custom.is-on { background-clip: padding-box; }
@media (max-width: 520px) {
  .pr-pk-main { grid-template-columns: 1fr 18px; }
  .pr-pk-side { grid-column: 1 / -1; grid-template-columns: 60px 1fr; }
  .pr-pk-hex { grid-column: 1 / -1; }
}

.pr-modal-text b { color: var(--text); font-weight: 600; }

/* --- Static | Animate ---------------------------------------------------- */
:root { --tl-h: 252px; --tl-name: 184px; }
.pr-mode {
  position: absolute;
  top: calc(var(--top-h) + 26px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--line-soft);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: var(--shadow-soft);
  z-index: 5;
}
.pr-mode button { height: 32px; padding: 0 18px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--text-2); transition: background 0.2s, color 0.2s; }
.pr-mode button:hover { color: var(--text); }
.pr-mode button.is-on { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); }
body.is-anim .pr-dock, body.is-anim .pr-tabs, body.is-anim .pr-start { display: none !important; }
body:not(.is-anim) .pr-tl { display: none; }
body.is-anim .pr-zoom { bottom: calc(var(--tl-h) + 56px); }
body.is-anim .pr-hint { bottom: calc(var(--tl-h) + 28px); }
body.is-anim .pr-toast { bottom: calc(var(--tl-h) + 112px); }
body.is-anim .pr-panel-body { padding-top: 18px; }
body.is-anim .pr-view { cursor: grab; }
body.is-anim .pr-stage.dragging .pr-view { cursor: grabbing; }

/* --- Timeline ------------------------------------------------------------ */
.pr-tl {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  height: var(--tl-h);
  display: flex;
  flex-direction: column;
  border-radius: var(--r-md);
  background: var(--glass);
  border: 1px solid var(--line-soft);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  z-index: 4;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
.pr-tl-bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 2px; padding: 6px 8px; border-bottom: 1px solid var(--line-soft); flex: none; }
.pr-tl-bl { display: flex; align-items: baseline; min-width: 0; }
.pr-tl-bc { display: flex; align-items: center; gap: 2px; }
.pr-tl-br { display: flex; justify-content: flex-end; }
.pr-tl-bar .pr-icon-btn.is-on { color: var(--text); background: var(--surface-2); }
.pr-tl-play { background: var(--surface-2); }
.pr-tl-tc { margin-left: 6px; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text); }
.pr-tl-durl { margin-left: 6px; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--text-3); }
.pr-tl-sp { flex: 1; }
.pr-tl-scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
.pr-tl-rows { position: relative; min-height: 100%; padding-bottom: 6px; }
.pr-tl-row { display: grid; grid-template-columns: var(--tl-name) minmax(0, 1fr); height: 28px; align-items: stretch; }
.pr-tl-row.is-on { background: var(--accent-soft); }
.pr-tl-ruler { position: sticky; top: 0; z-index: 3; height: 24px; background: var(--surface); border-bottom: 1px solid var(--line-soft); }
.pr-tl-name {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 0 6px 0 12px;
  font-size: 12px;
  color: var(--text-2);
  border-right: 1px solid var(--line-soft);
  cursor: pointer;
}
.pr-tl-name .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-tl-name:hover { color: var(--text); }
.pr-tl-ruler .pr-tl-name { cursor: default; }
.pr-tl-obj .pr-tl-name { font-weight: 600; color: var(--text); }
.pr-tl-kid .pr-tl-name { padding-left: 28px; }
.pr-tl-kid .pr-layer-ic { width: 26px; height: 14px; border-radius: 4px; }
.pr-tl-kid .pr-layer-ic img { width: 23px; }
.pr-tl-ic { display: grid; place-items: center; color: var(--text-2); }
.pr-tl-ic svg.ic { width: 16px; height: 16px; }
.pr-tl-caret { width: 10px; height: 10px; flex: none; position: relative; }
.pr-tl-caret::before { content: ""; position: absolute; left: 2px; top: 1px; border: 4px solid transparent; border-left: 5px solid currentColor; }
.pr-tl-caret.open::before { left: 1px; top: 3px; border: 4px solid transparent; border-top: 5px solid currentColor; }
.pr-tl-mini { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; color: var(--text-3); flex: none; }
.pr-tl-mini:hover { background: var(--surface-3); color: var(--text); }
.pr-tl-mini svg.ic { width: 14px; height: 14px; }
.pr-tl-lane { position: relative; margin: 0 16px 0 12px; }
.pr-tl-ruler .pr-tl-lane { cursor: ew-resize; }
.pr-tl-tick { position: absolute; bottom: 0; width: 1px; height: 4px; background: var(--line); }
.pr-tl-tick.major { height: 8px; background: var(--text-3); }
.pr-tl-lbl { position: absolute; top: 3px; transform: translateX(-50%); font-size: 10px; font-weight: 600; color: var(--text-3); font-variant-numeric: tabular-nums; pointer-events: none; }
.pr-tl-clip {
  position: absolute;
  top: 4px;
  bottom: 4px;
  min-width: 6px;
  display: flex;
  align-items: center;
  border-radius: 7px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  overflow: hidden;
  cursor: grab;
}
.pr-tl-clip:active { cursor: grabbing; }
.pr-tl-clip.is-on { border-color: #0a84ff; background: rgba(10, 132, 255, 0.2); }
.pr-tl-clip .in, .pr-tl-clip .out { position: absolute; top: 0; bottom: 0; pointer-events: none; }
.pr-tl-clip .in { left: 0; background: linear-gradient(90deg, rgba(10, 132, 255, 0.55), rgba(10, 132, 255, 0.12)); }
.pr-tl-clip .out { right: 0; background: linear-gradient(270deg, rgba(10, 132, 255, 0.55), rgba(10, 132, 255, 0.12)); }
.pr-tl-clip span { position: relative; padding: 0 10px; font-size: 10.5px; font-weight: 600; color: var(--text); white-space: nowrap; pointer-events: none; }
.pr-tl-clip b { position: absolute; top: 0; bottom: 0; width: 8px; cursor: ew-resize; z-index: 1; }
.pr-tl-clip b[data-edge="l"] { left: 0; }
.pr-tl-clip b[data-edge="r"] { right: 0; }
.pr-tl-clip b::after { content: ""; position: absolute; top: 5px; bottom: 5px; left: 3px; width: 2px; border-radius: 2px; background: var(--text-3); opacity: 0; transition: opacity 0.15s; }
.pr-tl-clip:hover b::after, .pr-tl-clip.is-on b::after { opacity: 1; }
.pr-tl-span { position: absolute; top: 10px; height: 8px; min-width: 4px; border-radius: 4px; background: var(--text-3); opacity: 0.55; cursor: grab; }
.pr-tl-span:hover { opacity: 0.85; }
.pr-tl-camspan { position: absolute; top: 50%; height: 2px; margin-top: -1px; background: var(--line); pointer-events: none; }
.pr-tl-key {
  position: absolute;
  top: 50%;
  width: 11px;
  height: 11px;
  margin: -5.5px 0 0 -5.5px;
  transform: rotate(45deg);
  border-radius: 2px;
  background: var(--text-2);
  box-shadow: 0 0 0 2px var(--surface);
  cursor: ew-resize;
}
.pr-tl-key:hover { background: var(--text); }
.pr-tl-key.is-on { background: #0a84ff; }
.pr-tl-ph-wrap { position: absolute; top: 0; bottom: 0; left: calc(var(--tl-name) + 12px); right: 16px; pointer-events: none; z-index: 4; }
.pr-tl-ph { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #0a84ff; }
.pr-tl-ph::before { content: ""; position: absolute; top: 2px; left: -5px; width: 12px; height: 12px; border-radius: 3px 3px 6px 6px; background: #0a84ff; }
.pr-tl-empty { padding: 18px 12px; font-size: 12px; color: var(--text-3); }
.pr-chips-tight button { padding: 0 10px; }

@media (max-width: 860px) {
  :root { --tl-h: 210px; --tl-name: 128px; }
  .pr-mode { top: calc(var(--top-h) + 16px); }
  .pr-dock { top: 122px; }
  .pr-tl { left: 8px; right: 8px; bottom: 72px; }
  body.is-anim .pr-zoom { bottom: calc(var(--tl-h) + 84px); }
}

/* vertex build row + clip */
.pr-layer-ic-morph { background: var(--surface-3); position: relative; }
.pr-layer-ic-morph::before { content: ""; position: absolute; inset: 4px; border: 1.5px dashed var(--text-2); border-radius: 50% 20% 45% 25%; }
.pr-tl-clip.is-morph { background: repeating-linear-gradient(135deg, rgba(10, 132, 255, 0.22) 0 6px, rgba(10, 132, 255, 0.1) 6px 12px); }

/* easing editor */
.pr-ease { display: grid; gap: 8px; }
.pr-ease-graph { width: 100%; height: auto; display: block; background: var(--surface-2); border-radius: var(--r-sm); touch-action: none; overflow: visible; }
.pr-ease-graph .grid { stroke: var(--line); stroke-width: 1; fill: none; }
.pr-ease-graph .arm { stroke: var(--text-3); stroke-width: 1; fill: none; }
.pr-ease-graph .crv { stroke: #0a84ff; stroke-width: 2.4; fill: none; stroke-linecap: round; }
.pr-ease-graph .end { fill: var(--text-3); }
.pr-ease-graph .hd { fill: var(--surface); stroke: #0a84ff; stroke-width: 2; cursor: grab; }
.pr-ease-graph .hd:hover { fill: #0a84ff; }
.pr-ease-num { font-variant-numeric: tabular-nums; font-size: 12px; }

/* gate: second button */
.pr-gate-key { margin-top: 8px; }

/* key selection */
.pr-tl-ck { z-index: 2; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; background: var(--text-3); }
.pr-tl-marq { position: fixed; z-index: 50; border: 1px solid #0a84ff; background: rgba(10, 132, 255, 0.12); pointer-events: none; }
.pr-tl-reset { opacity: 0; }
.pr-tl-kid:hover .pr-tl-reset, .pr-tl-kid.is-on .pr-tl-reset { opacity: 1; }

/* typed slider values */
.pr-val[data-out] { cursor: text; border-radius: 5px; padding: 1px 4px; margin-right: -4px; }
.pr-val[data-out]:hover { background: var(--surface-3); }
.pr-val-input { width: 64px; height: 20px; border: 0; border-radius: 5px; padding: 0 4px; font: inherit; text-align: right; color: var(--text); background: var(--surface-3); outline: 1px solid #0a84ff; }

.pr-seg button svg.ic { margin: 0 auto; }

/* inline text editing */
.pr-inline-text { position: fixed; z-index: 40; margin: 0; padding: 0; border: 0; outline: 1px dashed rgba(10, 132, 255, 0.8); outline-offset: 2px; background: transparent; resize: none; overflow: hidden; white-space: pre; font-kerning: normal; }

/* start card hover stays solid, so it reads on a dark board in the light theme */
.pr-start-drop:hover { background: var(--surface); }
.pr-swatch-grad{border-radius:8px}
.pr-done{position:fixed;inset:0;z-index:45;display:grid;place-items:center;pointer-events:none;opacity:0;transition:opacity .2s}
.pr-done.is-on{opacity:1;pointer-events:auto}
.pr-done-card{display:grid;justify-items:center;gap:8px;min-width:240px;max-width:min(340px,calc(100vw - 32px));padding:22px 24px 20px;border-radius:var(--r-lg);background:var(--surface);border:1px solid var(--line-soft);box-shadow:var(--shadow);text-align:center;transform:translateY(8px) scale(.97);transition:transform .3s var(--ease)}
.pr-done.is-on .pr-done-card{transform:none}
.pr-done-check{width:44px;height:44px;border-radius:50%;display:grid;place-items:center;background:var(--text);color:var(--bg)}
.pr-done-check svg{width:24px;height:24px;stroke-dasharray:24;stroke-dashoffset:24}
.pr-done.is-on .pr-done-check svg{animation:pr-done-draw .45s .1s var(--ease) forwards}
@keyframes pr-done-draw{to{stroke-dashoffset:0}}
.pr-done-card strong{font-size:15px;letter-spacing:-.01em}
.pr-done-file{font-size:12px;color:var(--text-3);word-break:break-all}
.pr-done-wide{position:relative;width:min(340px,calc(100vw - 32px));padding-top:26px}
.pr-done-x{position:absolute;top:10px;right:10px}
.pr-done.is-sticky{background:rgba(0,0,0,.35)}
.pr-done-steps{margin:6px 0 0;padding:12px 14px 12px 32px;border-radius:12px;background:var(--surface-2);text-align:left;font-size:13px;line-height:1.7;color:var(--text-2);justify-self:stretch}
.pr-done-steps b{color:var(--text);font-weight:600}
.pr-version{margin:10px 0 0;text-align:center;font-size:12px;color:var(--text-3);font-variant-numeric:tabular-nums}
body.is-anim .pr-stage.is-vedit .pr-view { cursor: default; }
body.is-anim .pr-stage.is-vedit .pr-vh { cursor: move; }

/* round 2: start row, templates, clickable effect cards, font row */
.pr-start-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.pr-card[data-fx-card] { cursor: pointer; }
.pr-card[data-fx-card]:hover { background: var(--surface-2); }
.pr-font-row { display: flex; align-items: center; gap: 6px; }
.pr-font-row .pr-input { flex: 1; min-width: 0; }
.pr-font-row .pr-icon-btn { flex: none; width: 36px; height: 36px; border-radius: 10px; background: var(--surface-2); }
.pr-modal-wide { width: min(940px, 100%); }
.pr-tpl-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 14px; }
.pr-tpl-grid.is-loading { min-height: 260px; }
.pr-tpl { display: grid; gap: 8px; padding: 0; border: 0; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.pr-tpl-thumb { display: block; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; border: 1px solid var(--line-soft); background: var(--surface-2); transition: border-color 0.2s, transform 0.3s var(--ease); }
.pr-tpl-thumb svg { display: block; width: 100%; height: 100%; }
.pr-tpl:hover .pr-tpl-thumb, .pr-tpl:focus-visible .pr-tpl-thumb { border-color: var(--line); transform: translateY(-2px); }
.pr-tpl-name { padding: 0 2px; font-size: 13px; font-weight: 600; }
@media (max-width: 720px) { .pr-tpl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
