:root {
  --navy: #132b3a;
  --navy-2: #1d4054;
  --blue: #167bb3;
  --blue-dark: #0f6697;
  --yellow: #f2c94c;
  --paper: #f4f7f8;
  --panel: #ffffff;
  --ink: #14232c;
  --muted: #5d6d76;
  --line: #d9e2e6;
  --danger: #b53b42;
  --shadow: 0 14px 38px rgba(19, 43, 58, .14);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font: 16px/1.45 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow: hidden;
}

button, input, select { font: inherit; }

button { color: inherit; }

button:focus-visible, input:focus-visible, select:focus-visible, svg:focus-visible {
  outline: 3px solid rgba(22, 123, 179, .32);
  outline-offset: 2px;
}

.topbar {
  height: 74px;
  display: grid;
  grid-template-columns: minmax(310px, 1fr) auto minmax(310px, 1fr);
  align-items: center;
  gap: 24px;
  padding: 0 18px;
  color: #fff;
  background: var(--navy);
  position: relative;
  z-index: 30;
  box-shadow: 0 3px 14px rgba(0, 0, 0, .22);
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand h1 { margin: 0; font-size: 18px; line-height: 1.15; letter-spacing: -.015em; }
.brand p { margin: 3px 0 0; color: #b9cbd4; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-mark {
  width: 36px; height: 36px; flex: 0 0 auto; border: 2px solid #fff; border-radius: 8px;
  display: grid; place-items: center; transform: rotate(45deg); background: var(--blue);
}
.brand-mark span { width: 14px; height: 14px; border: 3px solid var(--yellow); border-radius: 50%; }

.view-tabs { display: flex; padding: 4px; border-radius: 10px; background: rgba(255,255,255,.09); }
.view-tab { border: 0; background: transparent; color: #c6d4da; padding: 8px 13px; border-radius: 7px; cursor: pointer; font-weight: 700; }
.view-tab.active { color: var(--navy); background: #fff; }

.file-actions { justify-self: end; display: flex; align-items: center; gap: 7px; position: relative; }
.button, .file-actions > button {
  border: 1px solid transparent; border-radius: 7px; padding: 8px 11px; cursor: pointer; font-weight: 700; line-height: 1;
}
.button.ghost, .file-actions > .ghost { color: #fff; border-color: rgba(255,255,255,.25); background: rgba(255,255,255,.07); }
.button.accent { color: var(--navy); background: var(--yellow); }
.file-actions button:hover { filter: brightness(1.08); }
.file-actions .compact { min-width: 48px; }
.more-menu {
  position: absolute; right: 0; top: 46px; width: 190px; padding: 6px; border: 1px solid var(--line); border-radius: 9px;
  background: #fff; box-shadow: var(--shadow); color: var(--ink);
}
.more-menu button { display: block; width: 100%; border: 0; border-radius: 6px; background: none; padding: 10px; text-align: left; cursor: pointer; }
.more-menu button:hover { background: #edf4f7; }
.more-menu .responsive-file-action { display: none; }
.mobile-panel-btn { display: none; }

.editor-shell {
  height: calc(100vh - 74px);
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 350px;
  min-height: 0;
}

.left-panel, .right-panel {
  min-height: 0; overflow: auto; background: var(--panel); position: relative; z-index: 15;
}
.left-panel { border-right: 1px solid var(--line); }
.right-panel { border-left: 1px solid var(--line); display: flex; flex-direction: column; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; padding: 20px 18px 14px; }
.panel-heading h2 { margin: 1px 0 0; font-size: 20px; }
.eyebrow { color: var(--blue-dark); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; }
.panel-close { display: none; width: 34px; height: 34px; border: 0; background: #eef3f5; border-radius: 50%; font-size: 24px; cursor: pointer; }

.tool-section { padding: 14px 18px 18px; border-top: 1px solid var(--line); }
.tool-section h3 { margin: 0 0 12px; color: #30434d; font-size: 13px; letter-spacing: .025em; text-transform: uppercase; }
.tool-grid { display: grid; gap: 8px; }
.tool-grid.two { grid-template-columns: 1fr 1fr; }
.tool {
  min-height: 70px; border: 1px solid var(--line); border-radius: 9px; padding: 10px 7px; background: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; cursor: pointer; font-weight: 700; font-size: 13px;
}
.tool:hover, .tool.active, .template.active { border-color: var(--blue); background: #eef8fd; color: var(--blue-dark); }
.tool.active { box-shadow: inset 0 0 0 1px var(--blue); }
.tool-icon { font-size: 25px; height: 26px; }
.road-icon { width: 42px; height: 25px; border-radius: 2px; background: #53626a; border-left: 3px solid #bcc5c9; border-right: 3px solid #bcc5c9; position: relative; }
.road-icon::after { content: ""; position: absolute; left: 18px; top: 0; bottom: 0; border-left: 2px dashed #fff; }
.curve-icon { width: 42px; height: 28px; border-radius: 50% 0 0; border-left: 8px solid #53626a; border-top: 8px solid #53626a; transform: rotate(12deg); }
.walk-icon { width: 42px; height: 20px; border-top: 6px solid #aab6bb; border-bottom: 6px solid #d7dfe2; }
.hint { min-height: 36px; margin: 10px 0 0; color: var(--muted); font-size: 12px; }

.template-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.template { border: 1px solid var(--line); background: #fff; border-radius: 9px; min-height: 72px; cursor: pointer; font-size: 12px; font-weight: 700; display: grid; place-items: center; gap: 3px; padding: 7px; }
.template:hover { border-color: var(--blue); background: #f2f9fc; }
.template-preview { width: 54px; height: 46px; display: block; overflow: visible; }
.area-templates .template { min-height: 86px; }
.area-template-preview { width: 62px; height: 42px; display: block; overflow: visible; }
.area-building { fill: #c89f73; stroke: #765437; stroke-width: 2; stroke-linejoin: round; }
.area-roof { fill: none; stroke: rgba(91,57,35,.72); stroke-width: 1.5; stroke-linejoin: round; }
.area-node { fill: #f2c94c; stroke: #765437; stroke-width: 1; }
.area-parking { fill: #68757b; stroke: #47565d; stroke-width: 2; }
.area-parking-lines { fill: none; stroke: #fff; stroke-width: 1.3; }
.area-paved { fill: #b5bec1; stroke: #839197; stroke-width: 2; }
.area-paved-lines { fill: none; stroke: #7f8d93; stroke-width: 1; opacity: .72; }
.area-green { fill: #afd08c; stroke: #77995e; stroke-width: 2; }
.area-grass { fill: none; stroke: #628c4d; stroke-width: 1.5; stroke-linecap: round; }
.area-gravel { fill: #cbbd9c; stroke: #998967; stroke-width: 2; }
.area-gravel-dot { fill: #887858; }
.preview-curb { fill: none; stroke: #c4cdd1; stroke-width: 17; stroke-linecap: butt; stroke-linejoin: round; }
.preview-road { fill: none; stroke: #59686f; stroke-width: 13; stroke-linecap: butt; stroke-linejoin: round; }
.preview-mark { fill: none; stroke: #fff; stroke-width: 1.2; stroke-dasharray: 4 3; }
.preview-curb-fill { fill: none; stroke: #c4cdd1; stroke-width: 17; }
.preview-road-fill { fill: none; stroke: #59686f; stroke-width: 13; }
.preview-island { fill: #d4ddc8; stroke: #a8b5a0; stroke-width: 1; }
.line-sample { width: 48px; border-top: 4px solid #68787f; }
.line-sample.dashed { border-top-style: dashed; }
.marking-sample { width: 46px; height: 23px; display: block; position: relative; background-color: #6a777d; }
.marking-sample.crosswalk { background: repeating-linear-gradient(90deg,#fff 0 4px,#68777d 4px 8px); }
.marking-sample.stopline { border-left: 8px solid #fff; }
.marking-sample.yield { background: linear-gradient(60deg,transparent 45%,#fff 46% 54%,transparent 55%); }
.marking-sample.arrow::after { content: "➜"; color: #fff; font-size: 24px; position: absolute; inset: -6px 4px; }
.lane-templates .template { min-height: 82px; }
.lane-scheme-preview { width: 64px; height: 42px; flex: 0 0 auto; overflow: visible; }
.road-user-templates .template { min-height: 94px; }
.road-user-preview { width: 58px; height: 62px; display: block; overflow: visible; }
.direction-tool { min-height: 82px; }
.direction-preview { width: 62px; height: 38px; display: block; overflow: visible; }
.direction-preview-line, .direction-preview-head { fill: none; stroke: #18bd68; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.direction-preview-line { stroke-dasharray: 9 7; }
.preview-road-base, .preview-aux-lane { fill: #59686f; }
.preview-road-curb { fill: none; stroke: #c4cdd1; stroke-width: 4; stroke-linejoin: round; }
.preview-lane-divider { fill: none; stroke: #fff; stroke-width: 1.5; stroke-dasharray: 5 3; }
.preview-lane-arrow { fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.priority-launch { width: 100%; display: flex; align-items: center; gap: 12px; padding: 11px; border: 1px solid #bfd6e1; border-radius: 9px; color: var(--ink); background: #eef8fd; text-align: left; cursor: pointer; }
.priority-launch:hover { border-color: var(--blue); background: #e3f3fb; }
.priority-launch > span:last-child { display: flex; min-width: 0; flex-direction: column; }
.priority-launch strong { font-size: 13px; }
.priority-launch small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.priority-launch-icon { width: 40px; height: 40px; flex: 0 0 auto; position: relative; border: 2px solid #232323; border-radius: 3px; background: #fff; }
.priority-launch-icon i, .priority-launch-icon b { position: absolute; display: block; background: #111; transform-origin: center; }
.priority-launch-icon i { width: 7px; height: 34px; left: 16px; top: 3px; transform: rotate(40deg); }
.priority-launch-icon b { width: 3px; height: 30px; left: 18px; top: 5px; transform: rotate(-46deg); }

.section-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.chip { max-width: 145px; border-radius: 30px; padding: 3px 8px; color: var(--muted); background: #eef2f4; font-size: 11px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.inspector label { display: block; margin: 12px 0; font-size: 12px; font-weight: 700; color: #41545d; }
.field-row { margin-top: 4px; display: grid; grid-template-columns: minmax(0,1fr) 50px; align-items: center; gap: 8px; }
.field-row input { width: 100%; accent-color: var(--blue); }
.field-row output { text-align: right; color: var(--muted); }
.inspector .text-input, .inspector .select-input { width: 100%; height: 36px; margin-top: 5px; border: 1px solid var(--line); border-radius: 6px; padding: 0 9px; color: var(--ink); background: #fff; font-size: 13px; }
.inspector .color-input { width: 100%; height: 36px; margin-top: 5px; border: 1px solid var(--line); border-radius: 6px; padding: 3px; background: #fff; cursor: pointer; }
.inspector-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.inspector-actions button { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 8px; cursor: pointer; font-size: 12px; }
.inspector-actions button:last-child { grid-column: 1 / -1; }
.inspector-actions .danger { color: var(--danger); border-color: #e5b5b7; }
.rotation-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin: -4px 0 12px; }
.rotation-actions button { border: 1px solid #bdd7e4; border-radius: 6px; padding: 8px; color: var(--blue-dark); background: #eef8fd; cursor: pointer; font-weight: 800; font-size: 13px; }
.rotation-actions button:hover { border-color: var(--blue); background: #e2f3fb; }
.size-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin: -4px 0 12px; }
.size-actions button { border: 1px solid var(--line); border-radius: 6px; padding: 7px; color: #40535d; background: #f7f9fa; cursor: pointer; font-size: 12px; font-weight: 700; }
.size-actions button:hover { border-color: var(--blue); color: var(--blue-dark); }
.traffic-light-controls, .vehicle-light-controls { margin: 14px 0; padding: 12px; border: 1px solid #b9cdd7; border-radius: 9px; background: #f2f7f9; }
.traffic-light-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.traffic-light-heading strong { color: var(--navy); font-size: 13px; }
.traffic-light-heading span { color: var(--muted); font-size: 11px; }
.traffic-light-controls > label, .vehicle-light-controls > label { margin: 8px 0; }
.traffic-light-modes { display: grid; grid-template-columns: 1fr 1.35fr; gap: 6px; margin-bottom: 8px; }
.traffic-light-modes button, .traffic-light-states button { min-height: 34px; border: 1px solid #bed0d8; border-radius: 6px; padding: 6px 7px; color: #344b56; background: #fff; cursor: pointer; font-size: 12px; font-weight: 750; line-height: 1.15; }
.traffic-light-modes button:hover, .traffic-light-states button:hover { border-color: var(--blue); }
.traffic-light-modes button.active, .traffic-light-states button.active { color: #fff; border-color: var(--blue-dark); background: var(--blue-dark); box-shadow: 0 0 0 2px rgba(15,102,151,.12); }
.traffic-light-states { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.traffic-light-states .signal-off, .traffic-light-states .signal-combined { grid-column: 1 / -1; }
.traffic-light-states .signal-auxiliary { border-style: dashed; }
.traffic-light-controls .traffic-light-flash { display: flex; align-items: center; gap: 7px; margin: 10px 0 5px; cursor: pointer; }
.traffic-light-flash input { accent-color: var(--blue); }
.traffic-light-controls > p { margin: 7px 0 0; color: var(--muted); font-size: 11px; line-height: 1.35; }
.vehicle-light-controls .vehicle-brake { display: flex; align-items: center; gap: 7px; margin: 10px 0 2px; cursor: pointer; }
.vehicle-brake input { accent-color: var(--blue); }
.inspector.is-disabled { opacity: .55; pointer-events: none; }

.workspace { min-width: 0; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; background: #dfe7ea; }
.workspace-toolbar { min-height: 58px; display: grid; grid-template-columns: auto minmax(180px, 1fr) auto; align-items: center; gap: 16px; padding: 9px 14px; border-bottom: 1px solid #c9d4d9; background: #fff; }
.history-actions { display: flex; gap: 5px; }
.history-actions button, .canvas-settings button { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 7px 9px; cursor: pointer; }
.history-actions button:disabled { opacity: .35; cursor: default; }
.diagram-name { justify-self: center; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 700; }
.diagram-name input { width: min(310px, 32vw); border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 5px 4px; color: var(--ink); font-weight: 800; text-align: center; }
.canvas-settings { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; }
.canvas-settings label { display: flex; align-items: center; gap: 5px; }
.canvas-settings input { accent-color: var(--blue); }
.zoom-controls { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; background: #fff; }
.zoom-controls button { min-width: 30px; border: 0; border-right: 1px solid var(--line); border-radius: 0; padding: 6px 8px; font-weight: 800; }
.zoom-controls button:last-child { border-right: 0; border-left: 1px solid var(--line); font-size: 11px; }
.zoom-controls output { min-width: 48px; color: #40535d; text-align: center; font-weight: 800; }

.canvas-stage { min-height: 0; overflow: auto; padding: 24px; position: relative; background: #dfe7ea; }
#drawing { display: block; width: 100%; height: auto; aspect-ratio: 14 / 9; max-width: none; max-height: none; margin: auto; background: #fff; box-shadow: 0 5px 22px rgba(26,52,65,.18); touch-action: none; user-select: none; }
#drawing.draw-mode { cursor: crosshair; }
#drawing.select-mode { cursor: default; }
.scene-element { cursor: grab; }
.scene-element:active { cursor: grabbing; }
.traffic-light-hit { cursor: pointer; }
.traffic-light-hit:focus { outline: none; stroke: #00a2e3; stroke-width: 4; stroke-dasharray: 4 3; }
.traffic-light-active { filter: drop-shadow(0 0 4px rgba(255,255,255,.6)); }
.scene-element.selected > .selection-outline { display: block; }
.selection-outline { display: none; fill: none; stroke: #00a2e3; stroke-width: 4; stroke-dasharray: 10 7; vector-effect: non-scaling-stroke; pointer-events: none; }
.road-end-handle, .intersection-arm-handle, .area-size-handle { display: none; fill: var(--yellow); stroke: var(--blue-dark); stroke-width: 4; vector-effect: non-scaling-stroke; cursor: move; }
.scene-element.selected > .road-end-handle, .scene-element.selected > .intersection-arm-handle, .scene-element.selected > .area-size-handle { display: block; }
.road-end-handle:hover, .intersection-arm-handle:hover, .area-size-handle:hover { fill: #fff4a8; stroke: #075e8d; }
.empty-tip { pointer-events: none; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 16px 21px; color: #52666f; border: 1px solid #bfcdd3; border-radius: 9px; background: rgba(255,255,255,.92); box-shadow: 0 8px 22px rgba(19,43,58,.1); text-align: center; }
.empty-tip strong { color: var(--ink); }
.empty-tip span { font-size: 13px; }
.statusbar { min-height: 32px; display: flex; justify-content: space-between; align-items: center; padding: 6px 14px; color: #5b6c74; background: #f8fafb; border-top: 1px solid #cbd7dc; font-size: 12px; }

.catalog-controls { padding: 0 16px 12px; }
.search-field { height: 40px; display: flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: #fff; border-radius: 7px; padding: 0 10px; color: var(--muted); }
.search-field:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(22,123,179,.12); }
.search-field input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); }
.catalog-controls select, .database-controls select { width: 100%; height: 40px; margin-top: 8px; border: 1px solid var(--line); border-radius: 7px; background: #fff; padding: 0 8px; color: var(--ink); }
.stack-option { display: flex; align-items: flex-start; gap: 8px; margin: 10px 2px 0; color: #40535d; font-size: 12px; font-weight: 700; line-height: 1.3; }
.stack-option input { margin-top: 2px; accent-color: var(--blue); }
.catalog-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 9px; color: var(--muted); font-size: 12px; }
.catalog-meta button { border: 0; color: var(--blue-dark); background: transparent; padding: 0; cursor: pointer; font-weight: 800; }
.sign-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; padding: 0 16px 16px; }
.sign-card { min-width: 0; min-height: 116px; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 5px; padding: 8px 5px 7px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; }
.sign-card:hover { border-color: var(--blue); background: #f2f9fc; transform: translateY(-1px); }
.sign-card img { width: 68px; height: 68px; object-fit: contain; }
.sign-card strong { max-width: 100%; color: #40515a; font-size: 11px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.sign-card .add-badge { position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--blue); font-size: 14px; opacity: 0; }
.sign-card:hover .add-badge { opacity: 1; }
.load-more { align-self: center; margin: 0 16px 16px; border: 1px solid var(--blue); color: var(--blue-dark); background: #fff; border-radius: 7px; padding: 9px 18px; cursor: pointer; font-weight: 800; }
.sign-details { position: sticky; bottom: 0; margin-top: auto; padding: 15px 17px 18px; border-top: 2px solid var(--yellow); background: #fffbe9; box-shadow: 0 -7px 20px rgba(19,43,58,.09); }
.details-head { display: flex; justify-content: space-between; align-items: center; }
.details-head strong { color: var(--blue-dark); }
.details-head button { border: 0; background: transparent; font-size: 22px; cursor: pointer; }
.sign-details h3 { margin: 7px 0; font-size: 16px; }
.sign-details p { margin: 0 0 8px; color: #485a63; font-size: 13px; }
.sign-details a { color: var(--blue-dark); font-size: 12px; font-weight: 700; }
.no-results { grid-column: 1 / -1; padding: 28px 12px; color: var(--muted); text-align: center; }

.database-view { height: calc(100vh - 74px); overflow: auto; padding: 38px clamp(20px,5vw,80px) 60px; background: #eef3f5; }
.database-head { max-width: 1180px; margin: 0 auto 22px; display: flex; justify-content: space-between; gap: 30px; align-items: end; }
.database-head h2 { margin: 3px 0 0; font-size: clamp(25px,3vw,38px); letter-spacing: -.035em; }
.database-head p { max-width: 520px; margin: 0; color: var(--muted); }
.database-controls { max-width: 1180px; margin: 0 auto 18px; display: grid; grid-template-columns: minmax(260px,1fr) 310px; gap: 10px; }
.database-controls select { margin: 0; }
.database-results { max-width: 1180px; margin: auto; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 13px; }
.database-card { min-width: 0; display: grid; grid-template-columns: 98px minmax(0,1fr); gap: 13px; padding: 16px; border: 1px solid var(--line); border-radius: 11px; background: #fff; box-shadow: 0 2px 7px rgba(19,43,58,.05); }
.database-card img { width: 90px; height: 90px; object-fit: contain; }
.database-card .code { color: var(--blue-dark); font-size: 12px; font-weight: 900; letter-spacing: .04em; }
.database-card h3 { margin: 3px 0 6px; font-size: 15px; line-height: 1.25; }
.database-card p { margin: 0; color: var(--muted); font-size: 12px; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.database-card button { margin-top: 9px; border: 0; border-radius: 6px; padding: 7px 9px; color: #fff; background: var(--blue); cursor: pointer; font-size: 12px; font-weight: 800; }
.load-more.wide { display: block; margin: 22px auto; }

.presenter-view { height: calc(100vh - 74px); min-height: 0; display: grid; grid-template-columns: 350px minmax(0,1fr); overflow: hidden; background: #dfe7ea; }
.presenter-picker { min-height: 0; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: #fff; }
.presenter-picker-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 20px 17px 13px; }
.presenter-picker-head h2 { margin: 2px 0 0; font-size: 19px; line-height: 1.2; }
.presenter-count { flex: 0 0 auto; margin-top: 2px; padding: 4px 8px; border-radius: 30px; color: var(--blue-dark); background: #e7f4fa; font-size: 11px; font-weight: 900; }
.presenter-picker-controls { padding: 0 16px 12px; }
.presenter-picker-controls select { width: 100%; height: 40px; margin-top: 8px; border: 1px solid var(--line); border-radius: 7px; padding: 0 8px; color: var(--ink); background: #fff; }
.presenter-catalog { min-height: 0; overflow: auto; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-content: start; gap: 8px; padding: 0 16px 16px; }
.presenter-catalog-card { min-width: 0; min-height: 124px; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 5px; padding: 9px 6px 7px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: #fff; cursor: pointer; }
.presenter-catalog-card:hover { border-color: var(--blue); background: #f2f9fc; }
.presenter-catalog-card.selected { border-color: #2f9467; background: #edf9f3; box-shadow: inset 0 0 0 1px #2f9467; }
.presenter-catalog-card img { width: 72px; height: 72px; object-fit: contain; }
.presenter-catalog-card strong { max-width: 100%; color: var(--blue-dark); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.presenter-catalog-card small { max-width: 100%; color: var(--muted); font-size: 11px; line-height: 1.2; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.presenter-catalog-card.selected::after { content: "✓"; position: absolute; top: 5px; right: 6px; width: 21px; height: 21px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: #2f9467; font-size: 12px; font-weight: 900; }
.presenter-more { margin-top: 0; }
.presenter-workspace { min-width: 0; min-height: 0; display: grid; grid-template-rows: auto minmax(0,1fr); }
.presenter-toolbar { min-height: 68px; display: flex; align-items: center; flex-wrap: wrap; gap: 12px 20px; padding: 10px 16px; border-bottom: 1px solid #c9d4d9; background: #fff; }
.presenter-toolbar label { display: flex; align-items: center; gap: 8px; color: #40535d; font-size: 12px; font-weight: 800; }
.presenter-toolbar select { height: 36px; border: 1px solid var(--line); border-radius: 7px; padding: 0 9px; color: var(--ink); background: #fff; }
.presenter-size-control { flex: 1 1 230px; }
.presenter-size-control > span { min-width: 190px; display: flex; align-items: center; gap: 8px; }
.presenter-size-control input { min-width: 100px; width: 100%; accent-color: var(--blue); }
.presenter-size-control output { min-width: 48px; color: var(--muted); text-align: right; }
.presenter-actions { display: flex; gap: 7px; margin-left: auto; }
.presenter-actions button { border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px; color: #344b57; background: #fff; cursor: pointer; font-size: 12px; font-weight: 800; }
.presenter-actions button:hover, .presenter-actions button[aria-pressed="true"] { border-color: var(--blue); color: var(--blue-dark); background: #eef8fd; }
.presenter-actions button:disabled { opacity: .42; cursor: not-allowed; }
.presenter-actions .presenter-danger { color: var(--danger); border-color: #e7c1c3; }
.presenter-stage { --presenter-sign-size: 230px; min-width: 0; min-height: 0; display: grid; grid-template-columns: minmax(0,1fr); gap: 15px; padding: 18px; overflow: hidden; background: #dfe7ea; }
.presenter-stage.explanations-open { grid-template-columns: minmax(0,1fr) minmax(290px,360px); }
.presenter-canvas { min-width: 0; min-height: 0; overflow: auto; display: grid; place-items: center; padding: 38px; border: 1px solid #ccd7dc; border-radius: 12px; background: #fff; box-shadow: 0 5px 22px rgba(26,52,65,.13); }
.presenter-combination { max-width: 100%; display: flex; align-items: center; justify-content: center; gap: 14px; }
.presenter-combination.stack { flex-direction: column; }
.presenter-combination.row { flex-direction: row; flex-wrap: wrap; }
.presented-sign { position: relative; flex: 0 0 auto; margin: 0; border-radius: 7px; }
.presented-sign:focus-visible { outline: 3px solid rgba(22,123,179,.32); outline-offset: 5px; }
.presented-sign > img { width: var(--presenter-sign-size); height: var(--presenter-sign-size); display: block; object-fit: contain; }
.presented-sign-actions { position: absolute; top: -12px; right: -12px; z-index: 2; display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.96); box-shadow: 0 4px 12px rgba(19,43,58,.16); opacity: 0; transition: opacity .16s; }
.presented-sign:hover .presented-sign-actions, .presented-sign:focus-within .presented-sign-actions { opacity: 1; }
.presented-sign-actions button { width: 29px; height: 29px; display: grid; place-items: center; border: 0; border-radius: 5px; color: #344b57; background: #edf2f4; cursor: pointer; font-weight: 900; }
.presented-sign-actions button:hover { color: var(--blue-dark); background: #dff1f9; }
.presented-sign-actions .remove { color: var(--danger); }
.presenter-empty { display: flex; flex-direction: column; align-items: center; gap: 5px; color: var(--muted); text-align: center; }
.presenter-empty strong { color: var(--ink); font-size: 18px; }
.presenter-empty span { font-size: 13px; }
.presenter-explanations { min-height: 0; overflow: auto; border: 1px solid #ccd7dc; border-radius: 12px; background: #fff; box-shadow: 0 5px 22px rgba(26,52,65,.1); }
.presenter-explanations-head { position: sticky; top: 0; z-index: 2; padding: 18px 18px 13px; border-bottom: 1px solid var(--line); background: #fff; }
.presenter-explanations-head h2 { margin: 2px 0 0; font-size: 20px; }
.presenter-explanation-list { display: grid; gap: 0; }
.presenter-explanation { display: grid; grid-template-columns: 66px minmax(0,1fr); gap: 12px; padding: 15px 16px; border-bottom: 1px solid var(--line); }
.presenter-explanation img { width: 62px; height: 62px; object-fit: contain; }
.presenter-explanation .code { color: var(--blue-dark); font-size: 12px; font-weight: 900; }
.presenter-explanation h3 { margin: 2px 0 6px; font-size: 15px; line-height: 1.25; }
.presenter-explanation p { grid-column: 1 / -1; margin: 0; color: #4f626c; font-size: 13px; line-height: 1.45; }
.presenter-stage:fullscreen { width: 100vw; height: 100vh; padding: clamp(15px,3vw,42px); background: #dfe7ea; }
.presenter-stage:fullscreen .presenter-canvas { min-height: 100%; }
.presenter-stage:fullscreen .presented-sign-actions { display: none; }

.three-d-view { height: calc(100vh - 74px); min-height: 0; display: grid; grid-template-rows: auto minmax(0,1fr); overflow: hidden; background: #dfe7ea; }
.three-d-toolbar { min-height: 76px; display: flex; align-items: center; flex-wrap: wrap; gap: 11px 22px; padding: 10px 16px; border-bottom: 1px solid #c9d4d9; background: #fff; }
.three-d-title { margin-right: 3px; }
.three-d-title h2 { margin: 1px 0 0; font-size: 18px; line-height: 1.15; }
.three-d-presets, .three-d-actions { display: flex; align-items: center; gap: 5px; }
.three-d-presets button, .three-d-actions button { border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px; color: #3b505b; background: #fff; cursor: pointer; font-size: 12px; font-weight: 800; }
.three-d-presets button:hover, .three-d-presets button.active, .three-d-actions button:hover { border-color: var(--blue); color: var(--blue-dark); background: #eef8fd; }
.three-d-actions { margin-left: auto; }
.three-d-actions output { min-width: 46px; color: var(--muted); text-align: center; font-size: 12px; font-weight: 800; }
.three-d-stage { min-height: 0; position: relative; overflow: hidden; margin: 18px; border: 1px solid #bdcbd1; border-radius: 13px; background: linear-gradient(#cce8f4 0 52%,#c3d3b5 52% 100%); box-shadow: 0 7px 25px rgba(19,43,58,.16); }
#threeDCanvas { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
#threeDCanvas:active { cursor: grabbing; }
.three-d-help, .three-d-status { position: absolute; z-index: 2; padding: 7px 11px; border-radius: 7px; color: #40535d; background: rgba(255,255,255,.9); box-shadow: 0 3px 12px rgba(19,43,58,.1); font-size: 12px; pointer-events: none; }
.three-d-help { left: 14px; bottom: 14px; }
.three-d-status { top: 14px; right: 14px; }
.three-d-stage:fullscreen { width: 100vw; height: 100vh; margin: 0; border: 0; border-radius: 0; }

.animation-view { height: calc(100vh - 74px); min-height: 0; display: grid; grid-template-rows: auto auto auto minmax(0,1fr) auto; overflow: hidden; background: #dfe7ea; }
.animation-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 20px; min-height: 70px; padding: 10px 16px; border-bottom: 1px solid #c9d4d9; background: #fff; }
.animation-title { margin-right: 2px; }
.animation-title h2 { margin: 1px 0 0; font-size: 18px; line-height: 1.15; }
.animation-scenario-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.animation-scenario-controls > button, .animation-scenario-controls > label { min-height: 35px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.animation-scenario-controls > button { padding: 0 11px; color: var(--blue-dark); cursor: pointer; font-size: 12px; font-weight: 900; }
.animation-scenario-controls > button:hover { border-color: var(--blue); background: #eef8fd; }
.animation-scenario-controls > button:disabled { opacity: .45; cursor: not-allowed; }
.animation-scenario-controls > label { display: flex; align-items: center; gap: 7px; padding: 0 8px; color: #50636c; font-size: 12px; font-weight: 800; }
.animation-scenario-controls select { height: 29px; border: 0; background: #fff; color: var(--ink); font-size: 12px; }
.animation-scenario-summary { padding: 5px 8px; border-radius: 999px; color: #245b45; background: #e5f4ec; font-size: 12px; font-weight: 900; }
.animation-check input { accent-color: var(--blue); }
.animation-playback { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.animation-playback button, .animation-camera-presets button, .animation-camera-actions button { border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px; color: #3b505b; background: #fff; cursor: pointer; font-size: 12px; font-weight: 800; }
.animation-playback button:hover, .animation-camera-presets button:hover, .animation-camera-presets button.active, .animation-camera-actions button:hover { border-color: var(--blue); color: var(--blue-dark); background: #eef8fd; }
.animation-playback button:disabled, .animation-camera-actions button:disabled { opacity: .45; cursor: not-allowed; }
.animation-playback .animation-primary { border-color: #147e53; color: #fff; background: #178b5d; min-width: 87px; }
.animation-playback .animation-primary:hover { color: #fff; background: #117349; }
.animation-playback .animation-record { border-color: #c8565c; color: #a32f36; background: #fff7f7; }
.animation-actors { min-height: 0; display: grid; grid-template-columns: minmax(190px,.28fr) minmax(760px,1fr); gap: 12px; align-items: center; padding: 8px 16px; border-bottom: 1px solid #c9d4d9; background: #f8fafb; overflow-x: auto; }
.animation-actors-intro { display: grid; gap: 2px; align-self: start; padding-top: 3px; }
.animation-actors-intro strong { font-size: 13px; }
.animation-actors-intro span { color: var(--muted); font-size: 11px; line-height: 1.35; }
.animation-actor-table { min-width: 760px; display: grid; gap: 4px; }
.animation-actor-header, .animation-actor-row { display: grid; grid-template-columns: 34px minmax(135px,1.1fr) minmax(135px,1.1fr) 100px 100px minmax(150px,1.2fr) 98px; gap: 6px; align-items: center; }
.animation-actor-header { padding: 0 7px; color: #61727a; font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; }
.animation-actor-list { max-height: 132px; display: grid; gap: 5px; overflow-y: auto; padding-right: 3px; }
.animation-actor-row { padding: 5px 7px; border: 1px solid #d6e0e4; border-radius: 8px; background: #fff; transition: border-color .15s, background .15s; }
.animation-actor-row.stopped { border-color: #d8a822; background: #fffaf0; }
.animation-actor-row.crashed { border-color: #c94d55; background: #fff0f1; box-shadow: inset 3px 0 0 #c23d46; }
.animation-actor-order { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--navy); font-size: 12px; }
.animation-actor-row select, .animation-number-field { width: 100%; height: 32px; border: 1px solid var(--line); border-radius: 6px; background: #fff; font-size: 12px; }
.animation-actor-row select { padding: 0 6px; }
.animation-number-field { display: flex; align-items: center; overflow: hidden; }
.animation-number-field input { min-width: 0; width: 100%; height: 30px; border: 0; padding: 0 4px 0 7px; font-size: 12px; }
.animation-number-field span { padding-right: 6px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.animation-actor-actions { display: flex; justify-content: flex-end; gap: 3px; }
.animation-actor-actions button { width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 6px; background: #fff; cursor: pointer; font-weight: 900; }
.animation-actor-actions button:hover { border-color: var(--blue); color: var(--blue-dark); background: #eef8fd; }
.animation-actor-actions button:disabled { opacity: .3; cursor: not-allowed; }
.animation-actor-actions .remove { color: var(--danger); }
.animation-actor-empty { grid-column: 2; padding: 10px; border: 1px dashed #b9c8ce; border-radius: 8px; color: var(--muted); text-align: center; font-size: 12px; }
.animation-camera-toolbar { min-height: 50px; display: flex; align-items: center; gap: 10px; padding: 7px 16px; border-bottom: 1px solid #c9d4d9; background: #f7f9fa; }
.animation-camera-presets, .animation-camera-actions { display: flex; align-items: center; gap: 5px; }
.animation-camera-actions { margin-left: auto; }
.animation-camera-actions output { min-width: 46px; color: var(--muted); text-align: center; font-size: 12px; font-weight: 800; }
.animation-stage { min-height: 0; position: relative; overflow: hidden; margin: 14px 18px 8px; border: 1px solid #bdcbd1; border-radius: 13px; background: linear-gradient(#cce8f4 0 52%,#c3d3b5 52% 100%); box-shadow: 0 7px 25px rgba(19,43,58,.16); }
#animationCanvas { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
#animationCanvas:active { cursor: grabbing; }
.animation-help, .animation-status { position: absolute; z-index: 2; padding: 7px 11px; border-radius: 7px; color: #40535d; background: rgba(255,255,255,.9); box-shadow: 0 3px 12px rgba(19,43,58,.1); font-size: 12px; pointer-events: none; }
.animation-help { left: 14px; bottom: 14px; }
.animation-status { top: 14px; right: 14px; max-width: min(430px,calc(100% - 28px)); text-align: right; }
.animation-timeline { display: grid; grid-template-columns: auto minmax(100px,1fr) 98px; align-items: center; gap: 10px; padding: 5px 18px 12px; color: #4a5d66; font-size: 12px; font-weight: 800; }
.animation-timeline input { width: 100%; accent-color: #18a767; }
.animation-timeline output { text-align: right; font-variant-numeric: tabular-nums; }
.animation-stage:fullscreen { width: 100vw; height: 100vh; margin: 0; border: 0; border-radius: 0; }

.modal { width: min(650px, calc(100vw - 30px)); padding: 0; border: 0; border-radius: 13px; color: var(--ink); box-shadow: var(--shadow); }
.modal::backdrop { background: rgba(10,26,35,.63); }
.modal form { padding: 22px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; }
.modal-head h2, .small-modal h2 { margin: 3px 0 18px; }
.modal-head > button { border: 0; background: transparent; font-size: 25px; cursor: pointer; }
.saved-list { display: grid; gap: 8px; max-height: 55vh; overflow: auto; }
.saved-item { display: grid; grid-template-columns: minmax(0,1fr) auto auto; align-items: center; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
.saved-item strong { display: block; }
.saved-item small { color: var(--muted); }
.saved-item button { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 7px 9px; cursor: pointer; }
.saved-item .remove-save { color: var(--danger); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.modal .button.ghost { color: var(--ink); background: #fff; border-color: var(--line); }
.danger-fill { border: 0; color: #fff; background: var(--danger); }
.small-modal { max-width: 440px; }
.small-modal p { color: var(--muted); }
.save-as-field { display: grid; gap: 7px; color: #40535d; font-size: 13px; font-weight: 800; }
.save-as-field input { width: 100%; height: 42px; border: 1px solid var(--line); border-radius: 7px; padding: 0 11px; color: var(--ink); background: #fff; font-size: 15px; font-weight: 500; }
.save-as-field input:focus { border-color: var(--blue); outline: 3px solid rgba(15,102,151,.14); }
.priority-modal { width: min(820px, calc(100vw - 30px)); }
.priority-intro { margin: -7px 0 18px; color: var(--muted); font-size: 14px; }
.priority-builder { display: grid; grid-template-columns: minmax(300px, 1fr) 260px; gap: 26px; align-items: center; }
.priority-arm-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.priority-arm-grid button, .priority-center { min-height: 74px; border: 1px solid var(--line); border-radius: 8px; background: #f7f9fa; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; }
.priority-arm-grid button { cursor: pointer; }
.priority-arm-grid button span { font-size: 25px; line-height: 1; }
.priority-arm-grid button small { color: var(--muted); font-size: 11px; font-weight: 800; }
.priority-arm-grid button[data-state="side"] { border-color: #9ab0bb; background: #edf2f4; }
.priority-arm-grid button[data-state="side"] span { color: #526872; }
.priority-arm-grid button[data-state="main"] { border-color: #183341; color: #fff; background: var(--navy); }
.priority-arm-grid button[data-state="main"] small { color: #d6e1e6; }
.priority-center { color: #71818a; background: #e5ecef; font-size: 10px; font-weight: 900; letter-spacing: .08em; }
.priority-preview-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.priority-preview-wrap > span { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
#priorityPreview { width: 190px; height: 190px; border-radius: 5px; box-shadow: 0 6px 18px rgba(19,43,58,.14); background: #fff; }
.priority-preview-wrap label { width: 100%; color: #40535d; font-size: 12px; font-weight: 800; }
.priority-preview-wrap select { width: 100%; height: 38px; margin-top: 4px; border: 1px solid var(--line); border-radius: 7px; background: #fff; padding: 0 8px; }
.priority-validation { min-height: 21px; margin: 14px 0 0; color: var(--danger); font-size: 13px; font-weight: 700; }
.priority-validation.valid { color: #2c7154; }
.priority-actions { flex-wrap: wrap; }
.priority-secondary { border-color: var(--blue); color: var(--blue-dark); background: #fff; }
.accent-dark { color: #fff; background: var(--blue); }
.priority-actions button:disabled { opacity: .42; cursor: not-allowed; }
.toast { position: fixed; left: 50%; bottom: 26px; z-index: 60; transform: translate(-50%, 20px); padding: 11px 17px; border-radius: 8px; color: #fff; background: var(--navy); box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: .2s; }
.toast.show { opacity: 1; transform: translate(-50%,0); }

@media (max-width: 1240px) {
  .editor-shell { grid-template-columns: 270px minmax(0,1fr) 305px; }
  .topbar { grid-template-columns: 1fr auto 1fr; gap: 12px; }
  .file-actions .ghost:not(.compact) { display: none; }
  .more-menu .responsive-file-action { display: block; }
  .database-results { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .presenter-view { grid-template-columns: 310px minmax(0,1fr); }
  .presenter-stage.explanations-open { grid-template-columns: minmax(0,1fr) 310px; }
  .three-d-title { display: none; }
  .three-d-toolbar { gap: 8px; }
  .animation-title { display: none; }
  .animation-toolbar { gap: 8px; }
  .animation-playback { width: 100%; margin-left: 0; }
}

@media (max-width: 950px) {
  body { overflow: hidden; }
  .topbar { grid-template-columns: repeat(5,1fr); height: 68px; }
  .brand { display: none; }
  .brand p, .view-tabs, .file-actions { display: none; }
  .mobile-panel-btn { display: inline-block; border: 1px solid rgba(255,255,255,.25); border-radius: 7px; padding: 8px 10px; color: #fff; background: rgba(255,255,255,.08); font-weight: 700; }
  .editor-shell { height: calc(100vh - 68px); grid-template-columns: minmax(0,1fr); }
  .left-panel, .right-panel { position: fixed; top: 68px; bottom: 0; width: min(350px, 92vw); z-index: 40; box-shadow: var(--shadow); transition: transform .22s ease; }
  .left-panel { left: 0; transform: translateX(-105%); }
  .right-panel { right: 0; transform: translateX(105%); }
  .left-panel.open, .right-panel.open { transform: translateX(0); }
  .panel-close { display: block; }
  .workspace-toolbar { grid-template-columns: auto minmax(0,1fr); }
  .canvas-settings { grid-column: 1 / -1; justify-content: flex-end; }
  .diagram-name input { width: min(330px,52vw); }
  .database-view { height: calc(100vh - 68px); }
  .database-head { align-items: start; flex-direction: column; gap: 12px; }
  .priority-builder { grid-template-columns: 1fr; }
  .presenter-view { height: calc(100vh - 68px); grid-template-columns: 280px minmax(0,1fr); }
  .presenter-stage, .presenter-stage.explanations-open { grid-template-columns: minmax(0,1fr); overflow: auto; }
  .presenter-explanations { max-height: 45vh; }
  .three-d-view { height: calc(100vh - 68px); }
  .three-d-toolbar { align-items: flex-start; padding: 8px; }
  .three-d-presets { width: 100%; overflow-x: auto; padding-bottom: 2px; }
  .three-d-presets button { flex: 0 0 auto; }
  .three-d-actions { width: 100%; margin-left: 0; overflow-x: auto; }
  .three-d-actions button { flex: 0 0 auto; }
  .three-d-stage { margin: 9px; }
  .animation-view { height: calc(100vh - 68px); }
  .animation-toolbar { align-items: flex-start; padding: 8px; max-height: 142px; overflow: auto; }
  .animation-scenario-controls { flex-wrap: nowrap; width: 100%; overflow-x: auto; padding-bottom: 2px; }
  .animation-scenario-controls > * { flex: 0 0 auto; }
  .animation-playback { width: auto; flex: 1 0 auto; }
  .animation-actors { max-height: 180px; grid-template-columns: 1fr; align-items: start; padding: 7px 9px; overflow: auto; }
  .animation-actors-intro { position: sticky; left: 0; }
  .animation-actor-empty { grid-column: 1; }
  .animation-camera-toolbar { padding: 7px 8px; overflow-x: auto; }
  .animation-camera-presets, .animation-camera-actions { flex: 0 0 auto; }
  .animation-camera-actions { margin-left: 0; }
  .animation-stage { margin: 9px 9px 4px; }
  .animation-timeline { padding: 4px 10px 8px; }
}

@media (max-width: 680px) {
  .topbar { padding: 0 11px; gap: 7px; }
  .topbar { grid-template-columns: repeat(5,1fr); }
  .mobile-panel-btn { padding: 7px; font-size: 12px; }
  .workspace-toolbar { gap: 7px; padding: 8px; }
  .history-actions span, .canvas-settings > label { display: none; }
  .diagram-name { justify-self: stretch; }
  .diagram-name > input { width: 100%; }
  .canvas-settings { grid-column: auto; }
  .canvas-stage { padding: 10px; }
  .statusbar { gap: 10px; }
  .database-view { padding: 24px 13px 45px; }
  .database-controls { grid-template-columns: 1fr; }
  .database-results { grid-template-columns: 1fr; }
  .database-card { grid-template-columns: 82px minmax(0,1fr); padding: 12px; }
  .database-card img { width: 76px; height: 76px; }
  .priority-arm-grid button, .priority-center { min-height: 62px; }
  .priority-actions .button { flex: 1 1 100%; }
  .presenter-view { grid-template-columns: 1fr; grid-template-rows: minmax(245px,42%) minmax(0,58%); }
  .presenter-picker { border-right: 0; border-bottom: 1px solid var(--line); }
  .presenter-picker-head { padding-top: 13px; }
  .presenter-catalog { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .presenter-catalog-card { min-height: 108px; }
  .presenter-catalog-card img { width: 60px; height: 60px; }
  .presenter-toolbar { gap: 8px; padding: 8px; }
  .presenter-size-control { order: 3; flex-basis: 100%; }
  .presenter-actions { margin-left: 0; }
  .presenter-actions button { padding: 7px; }
  .presenter-stage { padding: 9px; }
  .presenter-canvas { padding: 22px; }
  .three-d-help { left: 8px; bottom: 8px; max-width: calc(100% - 16px); }
  .three-d-status { top: 8px; right: 8px; }
  .animation-playback button { flex: 1 1 auto; padding: 7px 6px; }
  .animation-actors-intro span { display: none; }
  .animation-help { left: 8px; bottom: 8px; max-width: calc(100% - 16px); }
  .animation-status { top: 8px; right: 8px; }
  .animation-timeline { grid-template-columns: minmax(0,1fr) 82px; }
  .animation-timeline label { display: none; }
}
