:root {
  --bg: #171210;
  --panel: #1f1815;
  --panel-2: #251c18;
  --border: #3a2c25;
  --text: #ece3dd;
  --text-dim: #a6968c;
  --accent: #c98a5e;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 13px;
  overflow: hidden;
}

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

/* ---------------------------------------------------------------- */
/* Top bar and mode bar                                              */
/* ---------------------------------------------------------------- */

#topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 14px;
  height: 46px;
  flex: 0 0 auto;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

#mode-bar {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  height: auto;
  flex: 0 0 auto;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  align-items: center;
}

.mode-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.mode-btn:hover {
  background: #33251e;
  border-color: #55402f;
}

.mode-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #201510;
  font-weight: 600;
}

.chip-group {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.chip-group:nth-child(3) {
  margin-left: auto;
}

.chip {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  border-radius: 6px;
  padding: 6px 11px;
  font-size: 12px;
  font-family: inherit;
  cursor: default;
  transition: background 0.12s ease, border-color 0.12s ease;
}

/* Top-bar chips are inert scaffolding: hover feedback only, no state. */
#topbar .chip:hover {
  background: #33251e;
  border-color: #55402f;
}

.chip-title {
  font-weight: 600;
  min-width: 90px;
}

.chip-icon {
  min-width: 30px;
  text-align: center;
  padding: 6px 8px;
}

/* ---------------------------------------------------------------- */
/* Undo / redo (history.js) — floating chip pair, MAIN viewport top-left */
/* ---------------------------------------------------------------- */

/* Lives inside .main-slot now (index.html), not the top bar — see
   .viewport-history-group below for the anchoring. These rules are its own
   visual states, self-contained (no #topbar ancestor to lean on the way the
   old top-bar placement did). Both are always present: :disabled greys them,
   it never hides them — a control that comes and goes is harder to learn
   than one that dims, and a greyed redo is also how the user finds out redo
   exists at all. */
.chip-history {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  padding: 5px 8px;
  color: var(--text);
}

.chip-history svg {
  display: block;
}

.chip-history:hover {
  background: #33251e;
  border-color: #55402f;
}

.chip-history:disabled {
  cursor: default;
  color: #5d4e46;
  border-color: #2e231d;
  background: #1d1613;
}

/* A dead button must not answer the pointer with the live-hover lift above. */
.chip-history:disabled:hover {
  background: #1d1613;
  border-color: #2e231d;
}

.chip-history:not(:disabled):active {
  background: #3d2c22;
  border-color: var(--accent);
}

/* Floating pair over the MAIN viewport's top-left corner — dead space next
   to the round head, and unmissable the way the top bar never was.
   .main-slot has pointer-events:none (see below) so orbit/edit gestures
   still fall through to the canvas everywhere except this chip pair, which
   re-enables its own pointer events. Positioned below .view-label, never
   beside it, at every viewport size (main-slot's layout does not change
   between desktop and the stacked portrait layout — only the submenu panel
   and tile strip move — so one rule covers both; see docs/undo-redo.md). */
.viewport-history-group {
  position: absolute;
  top: 40px;
  left: 12px;
  z-index: 2;
  display: flex;
  gap: 6px;
  pointer-events: auto;
}

/* THE PULSE. Attention, not press feedback: it fires after a conflict
   resolution is saved, to say that however many crossings that just decided,
   one press takes all of it back. Two cycles for a single crossing, four for
   a cascade — history.js sets --pulse-cycles and drops the class on a timer
   sized to match. Keep the 0.42s here in step with PULSE_CYCLE_MS there. */
@keyframes history-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(201, 138, 94, 0);
    border-color: var(--border);
  }
  45% {
    transform: scale(1.14);
    box-shadow: 0 0 0 4px rgba(201, 138, 94, 0.34);
    border-color: var(--accent);
    background: #3d2c22;
  }
}

.chip-history.pulsing {
  animation: history-pulse 0.42s ease-in-out var(--pulse-cycles, 2);
}

/* THE TEACH BUBBLE. The keyboard's key-preview, borrowed: tap the button and
   the word it does appears, enlarged, just below it, then goes away. It is
   press feedback and it is the answer to "what is this icon" for someone who
   taps it once to find out. Fixed-positioned from the button's own rect
   (history.js), so it needs no positioned ancestor and follows the button
   wherever it lives with no further code. */
.history-teach {
  position: fixed;
  z-index: 200;
  pointer-events: none;
  transform: translate(-50%, 0);
  background: var(--panel-2);
  border: 1px solid var(--accent);
  border-radius: 9px;
  padding: 5px 15px 6px;
  color: var(--text);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.15;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  animation: history-teach 0.8s ease-out forwards;
}

/* Up fast (~95ms), hold ~305ms, fade ~400ms — the spec's timings. */
@keyframes history-teach {
  0%   { opacity: 0; transform: translate(-50%, 2px) scale(0.62); }
  12%  { opacity: 1; transform: translate(-50%, -5px) scale(1.12); }
  50%  { opacity: 1; transform: translate(-50%, -5px) scale(1.12); }
  100% { opacity: 0; transform: translate(-50%, -13px) scale(1.02); }
}

/* Reduced motion: both effects keep their MEANING and lose their movement.
   The pulse becomes a static highlight (history.js holds it for ~900ms) and
   the bubble simply appears and is removed. */
@media (prefers-reduced-motion: reduce) {
  .chip-history.pulsing {
    animation: none;
    border-color: var(--accent);
    background: #3d2c22;
    box-shadow: 0 0 0 2px rgba(201, 138, 94, 0.3);
  }

  .history-teach {
    animation: none;
    opacity: 1;
    transform: translate(-50%, -5px);
  }
}

/* history.js also adds these two classes itself under reduced motion, so
   neither no-animation path depends on the media query alone (a UA that
   reports the preference through matchMedia but not to CSS still behaves —
   and it is what makes the reduced-motion rendering testable). */
.history-teach.history-teach-static {
  animation: none;
  opacity: 1;
  transform: translate(-50%, -5px);
}

.chip-history.pulsing-static {
  animation: none;
  border-color: var(--accent);
  background: #3d2c22;
  box-shadow: 0 0 0 2px rgba(201, 138, 94, 0.3);
}

/* ---------------------------------------------------------------- */
/* Workspace: stage + submenu panel                                  */
/* ---------------------------------------------------------------- */

#workspace {
  flex: 1 1 auto;
  display: flex;
  min-height: 0;
  gap: 1px;
}

#stage {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  grid-template-rows: 1fr 140px;
  background: var(--bg);
}

#viewport-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none; /* we own all pointer/touch gesture handling */
}

.main-slot {
  grid-row: 1;
  grid-column: 1;
  position: relative;
  pointer-events: none; /* lets orbit/edit pointer events fall through to canvas */
}

.view-label {
  position: absolute;
  top: 10px;
  left: 12px;
  font-size: 11px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: rgba(23, 18, 16, 0.55);
  padding: 3px 8px;
  border-radius: 4px;
}

/* First-run gesture hint: a subtle, non-modal pill near the bottom of the
   MAIN view. `.main-slot` itself has pointer-events:none (so orbit/edit
   gestures pass through to the canvas underneath it) but this element
   re-enables pointer-events on itself so a tap can dismiss it. */
.gesture-hint {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  max-width: calc(100% - 24px);
  pointer-events: auto;
  cursor: default;
  background: rgba(23, 18, 16, 0.78);
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 11px;
  line-height: 1.4;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  z-index: 1;
  transition: opacity 0.2s ease;
}

.gesture-hint-dismissed {
  opacity: 0;
  pointer-events: none;
}

.tile-strip {
  grid-row: 2;
  grid-column: 1;
  display: flex;
  gap: 1px;
  background: var(--border);
  border-top: 1px solid var(--border);
}

.tile {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  /* transparent — the WebGL canvas renders each tile's view beneath this
     element; an opaque background here hides the render entirely */
  background: transparent;
  pointer-events: none;
}

.tile .view-label {
  top: 6px;
  left: 6px;
  font-size: 10px;
}

.tile-btn {
  position: absolute;
  top: 6px;
  appearance: none;
  border: 1px solid var(--border);
  background: rgba(31, 24, 21, 0.85);
  color: var(--text);
  border-radius: 4px;
  width: 20px;
  height: 20px;
  line-height: 1;
  font-size: 12px;
  cursor: pointer;
  pointer-events: auto;
}

.tile-btn:hover {
  background: #3a2c25;
  border-color: var(--accent);
}

.tile-close {
  right: 6px;
}

.tile-promote {
  right: 30px;
}

.views-chip {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 2;
  cursor: pointer;
}

.views-menu {
  position: absolute;
  top: 42px;
  right: 12px;
  z-index: 3;
  display: none;
  flex-direction: column;
  min-width: 130px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}

.views-menu.open {
  display: flex;
}

.views-menu-item {
  appearance: none;
  border: none;
  background: none;
  color: var(--text);
  text-align: left;
  padding: 8px 12px;
  font-size: 12px;
  cursor: pointer;
}

.views-menu-item:hover {
  background: var(--panel-2);
}

/* ---------------------------------------------------------------- */
/* Submenu panel (right side)                                        */
/* ---------------------------------------------------------------- */

#submenu-panel {
  flex: 0 0 260px;
  max-width: 300px;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border-left: 1px solid var(--border);
  overflow-y: auto;
}

#submenu-panel[hidden] {
  display: none;
}

.submenu-header {
  padding: 12px;
  font-weight: 600;
  color: var(--text);
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.submenu-header-title {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Collapse chevron: hidden by default (desktop/landscape side-panel mode
   has no need to collapse). The stacked-layout media query below turns it
   on; chrome.js checks this element's computed display before treating a
   header tap as a toggle, so hidden-here doubles as "inert" there. */
.submenu-collapse-btn {
  display: none;
  appearance: none;
  border: none;
  background: none;
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1;
  padding: 4px 6px;
  flex: 0 0 auto;
  cursor: pointer;
  transition: transform 0.15s ease, color 0.12s ease;
}

.submenu-collapse-btn:hover {
  color: var(--text);
}

.submenu-content {
  padding: 12px;
  flex: 1 1 auto;
  overflow-y: auto;
  font-size: 12px;
  color: var(--text);
}

.submenu-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.submenu-section:last-child {
  margin-bottom: 0;
}

.submenu-button {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.submenu-button:hover:not(:disabled) {
  background: #33251e;
  border-color: #55402f;
}

/* "coming next" buttons: still readable, obviously not pressable. */
.submenu-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Destructive action (Delete pattern). Warm red so it reads as a warning
   against the panel's browns without shouting. */
.submenu-button-danger {
  color: #e08a7a;
  border-color: #5a3129;
}

.submenu-button-danger:hover:not(:disabled) {
  background: #3a221d;
  border-color: #7a4237;
}

/* A control that is present but has nothing to act on yet (Frequency with
   the curvature at zero). Kept in the layout so the panel does not jump. */
.submenu-section-inert {
  opacity: 0.4;
}

.submenu-select {
  appearance: none;
  width: 100%;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
}

.submenu-select:hover {
  background: #33251e;
  border-color: #55402f;
}

.submenu-label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 4px;
}

/* Small muted explanatory line under a control (e.g. the hairline
   sliders) — unlike .submenu-label this is prose, not a field caption, so
   it stays sentence case. */
.hairline-hint {
  font-size: 11px;
  line-height: 1.4;
  color: var(--text-dim);
}

.stepper {
  display: flex;
  align-items: center;
  gap: 6px;
}

.stepper-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  border-radius: 4px;
  width: 24px;
  height: 24px;
  padding: 0;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.stepper-btn:hover {
  background: #33251e;
  border-color: #55402f;
}

.stepper-value {
  flex: 1 1 auto;
  text-align: center;
  font-weight: 600;
}

.segmented-controls {
  display: flex;
  gap: 4px;
  margin-bottom: 8px;
}

.segmented-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  border-radius: 4px;
  padding: 5px 10px;
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
  flex: 1 1 auto;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.segmented-btn:hover {
  background: #33251e;
  border-color: #55402f;
}

.segmented-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #201510;
  font-weight: 600;
}

/* ---------------------------------------------------------------- */
/* Shared control styling (row layout, slider, checkbox)             */
/* ---------------------------------------------------------------- */

/* .dialog-control-row is a holdover NAME, not a holdover WIDGET — the "+
   Spiral" dialog it was written for is gone (see the comment above
   createRowsControls in chrome.js), but the row layout and the slider/
   checkbox styles below it are still exactly what the live submenu controls
   and the hairline sliders use. */
.dialog-control-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.slider {
  flex: 1 1 auto;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  outline: none;
  cursor: pointer;
}

.slider::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  cursor: pointer;
}

.slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  cursor: pointer;
}

.slider-value {
  font-weight: 600;
  min-width: 50px;
  text-align: right;
}

.slider.disabled,
.slider:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.checkbox {
  appearance: none;
  width: 18px;
  height: 18px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--panel-2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.checkbox:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.checkbox:checked::after {
  content: '✓';
  color: #201510;
  font-size: 11px;
  font-weight: 600;
}

.checkbox:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 12px;
}

/* ---------------------------------------------------------------- */
/* Portrait or narrow-screen responsive layout                        */
/* ---------------------------------------------------------------- */

/* Submenu-stacking rules for portrait orientation or narrow screens.
   Any portrait screen (including tablets) puts the submenu under the
   mode bar. */
@media (max-width: 699px), (orientation: portrait) {
  /* Submenu panel: instead of the right-side rail, becomes a full-width
     compact bar docked directly under the mode bar, above the stage.
     #workspace normally lays #stage/#submenu-panel out side by side; here
     it stacks them and `order` puts the submenu first without touching
     the DOM/JS (submenu-panel is still the second element in markup). */
  #workspace {
    flex-direction: column;
  }

  /* Tile strip lives inside #stage: tiles keep a minimum readable width
     and the strip scrolls horizontally instead of squeezing all five into
     the available width; the row also shrinks a bit to give the
     (now-stacked) submenu and the MAIN view more room. Camera framing
     (viewports.js) re-fits itself to whatever size each tile ends up at,
     so the head stays framed regardless. */
  #stage {
    order: 2;
    min-height: 0;
  }

  #submenu-panel {
    order: 1;
    flex: 0 0 auto;
    width: 100%;
    max-width: none;
    max-height: 45dvh;
    border-left: none;
    border-bottom: 1px solid var(--border);
    /* .submenu-content does the scrolling (below); the panel itself must
       not also scroll or the sticky header row would scroll away with it. */
    overflow-y: hidden;
  }

  /* Header becomes a tap target here: the whole row toggles collapse, not
     just the chevron, so a thumb doesn't need to land on a 20px glyph.
     chrome.js's click handler no-ops when the chevron is display:none
     (desktop/landscape, base rule), so this only ever does something in
     this stacked layout. */
  .submenu-header {
    cursor: pointer;
  }

  .submenu-collapse-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Collapsed: only the header row (~44px) remains and the stage below
     reclaims the rest of the height — #stage already flexes to fill
     #workspace, so nothing else needs to change for it to grow. */
  .submenu-panel.collapsed .submenu-content {
    display: none;
  }

  .submenu-panel.collapsed .submenu-collapse-btn {
    transform: rotate(-90deg);
  }

  /* Long settings (Delete pattern at the bottom) scroll within the capped
     panel instead of pushing the stage down. min-height:0 lets this flex
     item shrink below its content's natural height so the overflow-y:auto
     already on the base .submenu-content rule actually engages, instead of
     the panel growing past max-height first. */
  .submenu-content {
    min-height: 0;
    -webkit-overflow-scrolling: touch;
  }
}

/* ---------------------------------------------------------------- */
/* Narrow-screen responsive layout (< 700px)                         */
/* ---------------------------------------------------------------- */

@media (max-width: 699px) {
  /* Top bar: chips must never clip. The row no longer shrinks to fit —
     .chip-group already carries flex-shrink:0 (see base rule) — instead
     it overflows and scrolls horizontally so every chip stays reachable.
     The 3rd group's auto-margin (pins it to the right on wide screens)
     is dropped here so the whole row packs together for scrolling. */
  #topbar {
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
  }

  #topbar::-webkit-scrollbar {
    display: none;
  }

  #topbar .chip-group:nth-child(3) {
    margin-left: 0;
  }

  /* Tile strip lives inside #stage: tiles keep a minimum readable width
     and the strip scrolls horizontally instead of squeezing all five into
     the available width; the row also shrinks a bit to give the
     MAIN view more room. Camera framing (viewports.js) re-fits itself to
     whatever size each tile ends up at, so the head stays framed
     regardless. */
  #stage {
    grid-template-rows: 1fr 90px;
  }

  .tile-strip {
    overflow-x: auto;
    overflow-y: hidden;
  }

  .tile {
    flex: 0 0 96px;
    min-width: 96px;
  }
}

/* ---------------------------------------------------------------- */
/* Conflict popover (red circle / scar tap)                          */
/* ---------------------------------------------------------------- */

/* Fixed at a deliberate top-right "straddle" position by conflicts-edit.js
   (placeStraddle) — NOT anchored to the tap. `position: fixed` is what lets
   it visually straddle #stage and #submenu-panel, two flex siblings under
   #workspace: fixed positioning is laid out against the viewport regardless
   of which of the two this element happens to be a DOM child of (still
   #stage, for convenience), so half the popover can sit over the canvas and
   half over the panel with no reparenting. Deliberately the submenu panel's
   visual language — same surface, border, radius and type scale — because it
   is the same kind of thing: a small set of controls that change the 3D
   live. It is not a modal and there is no scrim. */
.conflict-popover {
  position: fixed;
  z-index: 40;
  width: 208px;
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  font-size: 12px;
  color: var(--text);
}

.conflict-popover[hidden] {
  display: none;
}

.conflict-popover-title {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* The A/B choice, as a two-position slide: one track, one thumb that moves,
   two labels that stay put. A pair of buttons would read as two independent
   actions; this reads as one setting with two states, which is what it is. */
.conflict-slide {
  position: relative;
  display: flex;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel-2);
}

.conflict-slide-thumb {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc(50% - 3px);
  border-radius: 5px;
  background: var(--accent);
  transition: transform 0.16s ease;
  pointer-events: none;
}

.conflict-slide[data-side="b"] .conflict-slide-thumb {
  transform: translateX(100%);
}

.conflict-slide-half {
  position: relative;
  flex: 1 1 50%;
  min-width: 0;
  appearance: none;
  border: none;
  background: none;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 11px;
  line-height: 1.2;
  padding: 7px 4px;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.12s ease;
}

.conflict-slide[data-side="a"] .conflict-slide-half[data-side="a"],
.conflict-slide[data-side="b"] .conflict-slide-half[data-side="b"] {
  color: #201510;
  font-weight: 600;
}

/* "Alternate" is meaningless without a pair rule to be alternate ABOUT, so it
   is dimmed rather than hidden — the layout must not jump as the box above it
   is ticked. Same treatment as the Frequency section in the submenu. */
.conflict-check-disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Preview is a different KIND of control than Resolve-all/Alternate above it
   — a live-3D toggle, not a decision-scope option — so a hairline rule sets
   it apart rather than just letting it run into the same checkbox list.
   Unobtrusive by design: same small checkbox-label idiom as the rest of the
   popover, just visually bottom-left, right above the actions row. */
.conflict-check-preview {
  padding-top: 9px;
  border-top: 1px solid var(--border);
}

.conflict-popover-actions {
  display: flex;
  gap: 6px;
}

.conflict-popover-actions .submenu-button {
  flex: 1 1 50%;
  text-align: center;
}

.conflict-popover-actions .conflict-confirm {
  border-color: #55402f;
  background: #33251e;
}
