/* Editor workspace: one browser on the left, one context on the right. */
/* Reserve final shell geometry before deferred controls are mounted. */
.editor-workspace {
  --editor-topbar-height: 56px;
  --editor-left-width: 272px;
  --editor-right-width: 320px;
  --editor-control-size: 0.8125rem;
  --editor-meta-size: 0.75rem;
}
.editor-workspace .app-layout { height: calc(100dvh - var(--editor-topbar-height)); }
.editor-project-bar {
  height: var(--editor-topbar-height, 56px);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  background: var(--bg-panel, #f8fafc);
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
  z-index: 40;
  font-family: var(--font-body);
}
.editor-brand { color: var(--text-primary); text-decoration: none; font-weight: 700; white-space: nowrap; font-size: 14px; }
.editor-project-actions { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.editor-project-bar button { min-height: 34px; font-size: var(--editor-control-size); white-space: nowrap; }
.editor-project-bar #inspectorSidebarTabProject { flex: 0 0 auto; width: auto; padding: 6px 14px; }
.editor-project-bar #inspectorSidebarTabProject[aria-pressed="true"] { color: #185f8b; background: #e0eef8; }
.editor-workspace .editor-retired-shell { display: none !important; }
.editor-empty-hint { color: var(--text-secondary); font-size: 13px; line-height: 1.7; margin: 8px 0; }
.editor-selected-name { color: var(--text-primary); font-size: 15px; margin: 0 0 12px; line-height: 1.5; }
.editor-project-bar #workspaceSaveStatus { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 0; font-size: var(--editor-meta-size); }
.editor-project-bar .editor-scenario-menu { position: relative; margin: 0; padding: 0; border: 0; background: transparent; flex-shrink: 0; }
.editor-scenario-menu > summary { padding: 8px 12px; font-size: 13px; cursor: pointer; }
.editor-scenario-menu > .sidebar-details-body { position: absolute; top: 38px; left: 0; width: 300px; padding: 16px; border-radius: 10px; border: 1px solid var(--border-subtle); background: var(--bg-panel, #fff); box-shadow: 0 12px 30px #10203026; }
.editor-project-bar #rightSidebarAccountShelf { position: static; margin: 0; padding: 0; width: auto; border: 0; background: none; }
.editor-project-bar .project-account-dock { padding: 0; gap: 0; }
.editor-project-bar .project-account-hint { display: none; }
.editor-project-bar .project-account-toggle { width: 34px; height: 34px; }
.editor-workspace #leftSidebar { flex-basis: var(--editor-left-width); width: var(--editor-left-width); }
.editor-workspace #rightSidebar { flex-basis: var(--editor-right-width); width: var(--editor-right-width); }
.editor-workspace #leftSidebarContent, .editor-workspace #rightSidebarContent {
  width: 100%; height: 100%; max-height: calc(100dvh - var(--editor-topbar-height)); padding: 0;
  --sidebar-section-size: 0.875rem;
  --sidebar-card-size: 0.8125rem;
  --sidebar-control-size: 0.8125rem;
  --sidebar-meta-size: 0.75rem;
  --sidebar-label-size: 0.75rem;
  --sidebar-line-height: 1.5;
  line-height: 1.5;
}
.editor-workspace #leftSidebarContent { display: flex; flex-direction: column; overflow: hidden; }
.editor-task-nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 12px 8px; gap: 3px; border-bottom: 1px solid var(--border-subtle); flex-shrink: 0; }
.editor-nav-button, .editor-task-nav button { border: 0; border-radius: 6px; padding: 8px; background: transparent; color: var(--text-secondary); cursor: pointer; font: inherit; font-size: 13px; line-height: 1.5; }
.editor-nav-button:hover, .editor-task-nav button:hover { background: #e8eef3; }
.editor-nav-button[aria-pressed="true"] { color: #185f8b; background: #e0eef8; font-weight: 650; }
.editor-workspace button:focus-visible, .editor-workspace summary:focus-visible { outline: 2px solid #287ead; outline-offset: 2px; }
.editor-workspace :is(input, select, textarea):focus-visible { outline: 2px solid #287ead; outline-offset: 2px; }
.editor-workspace :is(.editor-nav-button, .appearance-tab-btn, .map-content-tab-btn) { transition: background-color 120ms ease, color 120ms ease; }
.editor-workspace :is(.editor-nav-button, .appearance-tab-btn, .map-content-tab-btn):active:not(:disabled) { background-color: #d3e5f2; }
.editor-task-body { min-height: 0; flex: 1; overflow-y: auto; padding: 12px; }
.editor-task-body, .editor-workspace #rightSidebarContent { overscroll-behavior-y: contain; scrollbar-gutter: stable; scrollbar-width: thin; }
.editor-task-panel[hidden], .editor-property-panel[hidden], .editor-workspace [hidden] { display: none !important; }
.editor-object-nav { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 12px; }
.editor-object-nav button { min-height: 34px; font-size: 12px; padding: 6px 8px; }
.editor-workspace .editor-object-section { padding: 0; margin: 0; border: 0; background: none; box-shadow: none; }
.editor-workspace #leftSidebar .editor-object-section { padding: 0; margin: 0; border: 0; background: none; box-shadow: none; }
.editor-workspace #leftSidebar .editor-object-section > .inspector-panel-body { padding: 0; }
.editor-workspace #leftSidebar .country-list > * { box-shadow: none; }
.editor-workspace #leftSidebar .hgo-identity-controls { border: 0; background: transparent; padding: 8px 0; }
.editor-object-section > summary, .editor-object-section > .sidebar-section-description { display: none; }
.editor-workspace .editor-object-section > .inspector-panel-body { padding: 0; }
.editor-workspace .inspector-search-shell, .editor-workspace .inspector-search-block { margin: 0; padding: 0; border: 0; background: transparent; }
.editor-workspace #countryList, .editor-workspace #waterRegionList, .editor-workspace #specialRegionList, .editor-workspace #presetTree { height: auto; max-height: none; overflow: visible; }
.editor-workspace .country-list { border: 0; padding: 0; }
.editor-workspace .country-item { font-size: 13px; }
.editor-workspace #countryList .country-select-row .country-children-toggle { width: 32px; min-width: 32px; height: 32px; }
.editor-workspace #leftSidebar .inspector-item-btn { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 10px 8px; border: 0; border-bottom: 1px solid var(--border-subtle); border-radius: 0; background: transparent; text-align: left; }
.editor-workspace #leftSidebar .inspector-item-btn.is-active { background: #e0eef8; border-radius: 6px; }
.editor-workspace #leftSidebar .inspector-item-btn .scenario-action-card-copy { min-width: 0; flex: 1; }
.editor-workspace #leftSidebar .inspector-item-btn .country-row-actions { flex-shrink: 0; }
.editor-workspace #leftSidebar .inspector-item-btn .country-row-title { font-size: 13px; line-height: 1.5; }
.editor-workspace #leftSidebar .inspector-item-btn .country-select-meta { font-size: 12px; line-height: 1.5; }
.editor-workspace .editor-object-section .inspector-detail-section { padding: 8px 0; }
.editor-disclosure { margin: 10px 0; border-bottom: 1px solid var(--border-subtle); padding-bottom: 8px; font-size: 13px; }
.editor-disclosure > summary { cursor: pointer; color: var(--text-secondary); min-height: 32px; align-content: center; }
.physical-panel-body { display: grid; gap: 14px; min-width: 0; }
.physical-basic-controls, .physical-section-body { display: grid; gap: 14px; min-width: 0; }
.physical-disclosure { border-top: 1px solid var(--border-subtle); padding-top: 12px; min-width: 0; }
.physical-disclosure > summary { cursor: pointer; font-size: 13px; font-weight: 600; line-height: 1.6; padding: 4px 0; }
.physical-disclosure[open] > summary { margin-bottom: 12px; }
.physical-disclosure[hidden] { display: none; }
.physical-hint { margin: 0; font-size: 12px; line-height: 1.6; color: var(--text-secondary); }
.physical-tool-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.physical-tool-actions button { white-space: normal; min-height: 36px; padding: 6px 8px; }
.physical-class-list { display: grid; gap: 8px; }
.physical-class-group { display: grid; gap: 10px; border: 0; padding: 0; margin: 0; min-width: 0; }
.physical-class-group + .physical-class-group { margin-top: 14px; }
.physical-class-group legend { font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 10px; }
.physical-class-group .toggle-label { display: grid; grid-template-columns: 16px 12px minmax(0, 1fr); gap: 4px 8px; margin: 0; padding: 0; border: 0; }
.physical-class-swatch { width: 12px; height: 12px; border-radius: 3px; border: 1px solid rgb(0 0 0 / 10%); }
.physical-class-coverage { grid-column: 3; color: var(--text-secondary); font-size: 11px; }
.editor-workspace .water-filter-controls { grid-template-columns: minmax(0, 1fr); gap: 12px; }
.editor-workspace .water-filter-field { grid-template-columns: 42px minmax(0, 1fr); }
.editor-workspace .water-filter-field .app-select-shell { min-width: 0; }
.editor-workspace .water-filter-toggle { margin-bottom: 2px; }
.editor-workspace .sidebar-empty-state > button { margin-top: 12px; white-space: normal; }
.editor-workspace .city-hierarchy-help { margin-top: 10px; font-size: 12px; color: var(--text-secondary); }
.editor-workspace .city-hierarchy-help > summary { cursor: pointer; min-height: 28px; align-content: center; }
.editor-workspace details.city-hierarchy-help > summary::after { content: "▸"; transform: none; transition: none; }
.editor-workspace details.city-hierarchy-help[open] > summary::after { transform: rotate(90deg); }
.editor-workspace .city-hierarchy-help .city-symbol-legend { margin: 8px 0; }
.editor-workspace .preset-library-actions { display: flex; align-items: center; gap: 12px; }
.editor-workspace .preset-library-actions > .btn-primary { flex: 1; }
.editor-workspace .preset-delete-action { width: auto; background: transparent; box-shadow: none; color: var(--text-secondary); }
.editor-workspace .preset-delete-action:hover:not(:disabled) { color: #a12626; background: #fbeeee; }
.scenario-guide-step-action { margin-top: 8px; width: auto; }
.editor-properties-header { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 10px; min-height: 64px; box-sizing: border-box; background: var(--bg-panel, #f8fafc); padding: 12px 16px; border-bottom: 1px solid var(--border-subtle); }
.editor-properties-header #editorPropertiesBackBtn { min-height: 36px; flex-shrink: 0; padding: 6px 8px; font-size: 12px; }
.editor-properties-header #editorPropertiesBackBtn::before { content: "‹"; margin-right: 5px; font-size: 18px; line-height: 1; }
.editor-properties-title { font-size: 15px; line-height: 1.5; margin: 0; font-weight: 650; }
.editor-properties-title:focus-visible { outline: 2px solid #287ead; outline-offset: 4px; border-radius: 2px; }
.editor-properties-body { padding: 16px; }
.editor-group-heading { font-size: 12px; font-weight: 600; color: var(--text-tertiary); margin: 12px 8px 6px; letter-spacing: 0; text-transform: none; }
.editor-layer-list { display: flex; flex-direction: column; gap: 3px; }
.editor-workspace #leftSidebar .editor-layer-list > button { width: 100%; text-align: left; min-height: 36px; font-size: 13px; letter-spacing: 0; padding: 8px 12px; border-radius: 6px; border: 0; justify-content: flex-start; }
.editor-workspace #leftSidebar .editor-layer-list > button.is-active { background: #e0eef8; color: #185f8b; }
.editor-workspace .editor-property-panel > *, .editor-workspace .editor-property-panel .card-flat { max-width: 100%; }
.editor-property-panel > .appearance-subsection, .editor-property-panel > .inspector-detail-card, .editor-property-panel > details, .editor-property-panel > [data-appearance-panel] { border: 0; padding: 0; background: none; box-shadow: none; margin: 0; }
.editor-property-panel > details > summary, .editor-property-panel > [data-appearance-panel] > .appearance-panel-heading { display: none; }
.editor-property-panel > :is([data-appearance-panel], [data-map-content-panel]) > h2 { display: none; }
.editor-property-panel > [data-appearance-panel] > .appearance-subsection-stack { margin-top: 0; }
.editor-property-panel .appearance-mini-section[data-promoted-layer-panel] { border: 0; background: none; padding: 0; }
.editor-property-panel .appearance-mini-section[data-promoted-layer-panel] > summary { display: none; }
.editor-property-panel .appearance-control-card { background: transparent; border: 0; border-top: 1px solid var(--border-subtle); border-radius: 0; padding: 14px 0; }
.editor-property-panel .appearance-control-card:first-child { border-top: 0; }
.editor-property-panel .appearance-day-night-stack { gap: 0; margin-top: 0; }
.editor-property-panel .appearance-day-night-card { padding: 14px 0; border: 0; border-bottom: 1px solid var(--border-subtle); border-radius: 0; background: transparent; box-shadow: none; }
.editor-property-panel .appearance-day-night-advanced { padding: 14px 0; border: 0; border-radius: 0; background: transparent; }
.editor-property-panel .sidebar-section-description, .editor-property-panel .sidebar-shell-anchor { display: none; }
.editor-property-panel .sidebar-group-label, .editor-property-panel .range-label, .editor-property-panel .toggle-label { font-size: 13px; line-height: 1.5; letter-spacing: 0; text-transform: none; }
.editor-property-panel .appearance-section-header, .editor-property-panel .appearance-card-title { font-size: 14px; line-height: 1.5; letter-spacing: 0; }
.editor-property-panel .sidebar-tool-hint, .editor-property-panel .layer-status-strip, .editor-property-panel .city-points-advanced-hint { font-size: 12px; line-height: 1.5; }
.editor-property-panel .city-points-panel-body { margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; }
.editor-property-panel .city-symbol-legend { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.editor-property-panel .city-symbol-legend > * { white-space: normal; word-break: normal; }
.editor-property-panel .city-points-panel { margin: 0; padding: 0; }
.editor-property-panel .layer-status-strip { margin: 4px 0 12px; }
.editor-property-panel .city-points-toggle-card { border: 0; background: none; padding: 0 0 12px; }
.editor-workspace [data-status-tone="off"] { color: var(--text-tertiary); background: transparent; border-color: var(--border-subtle); }
.editor-workspace .range-row { align-items: baseline; gap: 12px; }
.editor-workspace .range-label { min-width: 0; white-space: normal; overflow-wrap: break-word; }
.editor-workspace .range-value { flex-shrink: 0; font-variant-numeric: tabular-nums; }
.editor-workspace input[type="range"].range-input { min-height: 28px; cursor: pointer; }
.editor-workspace input[type="range"].range-input:disabled { cursor: default; }
.editor-workspace :is(button, input, select) { font-family: inherit; }
.editor-workspace :is(.sidebar-shell-heading, .sidebar-field-label, .sidebar-group-label, .appearance-tab-btn) { letter-spacing: 0; text-transform: none; }
.editor-workspace .editor-task-panel > .color-library-card { padding: 0; border: 0; background: none; }
.editor-workspace .editor-task-panel .palette-grid { max-height: none; overflow: visible; }
.editor-workspace #bottomDock { bottom: 16px; border-radius: 12px; gap: 8px; padding: 8px; width: min(820px, calc(100% - 24px)); max-width: calc(100% - 24px); }
.editor-workspace #bottomDock:has(#riverPaintNavigation:not([hidden])) { overflow: visible; }
.editor-workspace .bottom-dock-primary { flex-wrap: wrap; gap: 8px; }
.editor-workspace #paletteGrid { grid-template-columns: repeat(3, 24px); }
.editor-workspace #paletteGrid > :nth-child(n + 4) { display: none; }
.editor-workspace .dock-group-mode { width: auto; min-width: 0; }
.editor-workspace .dock-group-mode .dock-segmented-control { width: auto; min-width: 0; grid-template-columns: auto; }
.editor-workspace .dock-group-mode { position: static; }
.editor-workspace #riverPaintNavigation { position: absolute; bottom: calc(100% + 16px); left: 50%; transform: translateX(-50%); width: min(320px, calc(100vw - 32px)); box-sizing: border-box; padding: 12px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; max-height: min(560px, calc(100dvh - 240px)); overflow-y: auto; background: var(--bg-surface, #fff); border: 1px solid var(--border-subtle); border-radius: 12px; box-shadow: 0 8px 24px #0002; }
.editor-workspace #riverPaintSearchInput { min-width: 0; width: 100%; box-sizing: border-box; padding: 8px; border: 1px solid var(--border-subtle); border-radius: 6px; background: var(--bg-surface, #fff); color: var(--text-primary); font-size: 12px; }
.editor-workspace :is(#riverPaintRiverSelect, #riverPaintLocationSelect) { width: 100%; min-width: 0; max-width: 100%; background-repeat: no-repeat; background-position: right 8px center; background-size: 12px; }
.editor-workspace :is(.river-paint-location-row, #riverPaintLocationResults, #riverCellPicker) { grid-column: 1 / -1; }
.editor-workspace .river-paint-location-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.editor-workspace #riverPaintLocationResults { font-size: 12px; line-height: 1.5; color: var(--text-secondary); }
.editor-workspace #riverCellPicker { display: grid; gap: 8px; padding-top: 8px; border-top: 1px solid var(--border-subtle); }
.editor-workspace #riverCellPickerTitle { font-size: 13px; overflow-wrap: anywhere; }
.editor-workspace :is(#riverPaintNavigation, #riverPaintSearchInput, #riverPaintRiverSelect, #riverPaintLocationSelect, #riverPaintLocationGoBtn, #riverPaintLocationResults, #riverCellPicker)[hidden] { display: none; }
.editor-workspace #riverCellSelect { width: 100%; background-repeat: no-repeat; background-position: right 8px center; background-size: 12px; }
.editor-workspace #riverCellPreview { width: 100%; height: 104px; background: #f8fafc; border-radius: 6px; }
@media (max-width: 767px) {
  .editor-workspace .dock-group-mode:has(#riverPaintToggleBtn:not(:disabled)) { display: flex !important; }
}
.editor-workspace #transportProjectSection { padding: 12px 0; border: 0; box-shadow: none; background: transparent; }
.editor-workspace #transportProjectSection .sidebar-section-description { display: none; }
.editor-workspace #transportProjectSection > summary { font-size: 13px; }
.editor-workspace #transportProjectSection > .inspector-panel-body { padding: 8px 0 0; }
.editor-workspace #bottomDock .dock-tool-btn { min-width: 36px; min-height: 36px; }
.editor-workspace .strategic-command-bar { border-radius: 12px; padding: 8px; max-width: calc(100vw - 32px); flex-wrap: wrap; }
.app-select-search { width: 100%; box-sizing: border-box; position: sticky; top: 0; padding: 9px 10px; border: 1px solid var(--border-subtle); border-radius: 5px; background: var(--bg-panel, #fff); font: inherit; z-index: 1; }
.app-select-group-heading { padding: 8px 10px 4px; font-size: 12px; font-weight: 600; color: var(--text-tertiary); }
.app-select-no-matches { padding: 12px; font-size: 13px; color: var(--text-tertiary); }
.app-select-menu [hidden] { display: none !important; }
.transport-workbench-pack-details { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border-subtle); font-size: 13px; line-height: 1.5; }
.transport-workbench-pack-details > summary { cursor: pointer; font-weight: 600; }
@keyframes editor-context-enter {
  from { opacity: 0.78; }
  to { opacity: 1; }
}
@keyframes editor-menu-enter {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: no-preference) {
  /* Keep fixed-position controls anchored to the viewport inside each panel. */
  .editor-task-panel:not([hidden]), .editor-property-panel:not([hidden]) {
    animation: editor-context-enter 140ms ease-out;
  }
  .editor-scenario-menu[open] > .sidebar-details-body {
    animation: editor-menu-enter 160ms ease-out;
  }
}
@media (prefers-reduced-motion: reduce) {
  .editor-workspace :is(.editor-nav-button, .appearance-tab-btn, .map-content-tab-btn) { transition: none; }
}
@media (max-width: 1280px) {
  .editor-workspace { --editor-left-width: 248px; --editor-right-width: 296px; }
  .editor-project-bar #workspaceSaveStatus { display: none; }
  .editor-workspace .bottom-dock-primary { gap: 4px; }
}
@media (min-width: 1024px) {
  .editor-workspace #rightSidebar { max-width: var(--editor-right-width); }
  /* Collapse the shell without squeezing and rewrapping its controls each frame. */
  .editor-workspace #leftSidebarContent { width: calc(var(--editor-left-width) - 1px); }
  .editor-workspace #rightSidebarContent { width: calc(var(--editor-right-width) - 1px); }
  .editor-workspace.left-sidebar-collapsed #leftSidebar,
  .editor-workspace.right-sidebar-collapsed #rightSidebar { flex-basis: 0; width: 0; }
}
@media (max-width: 1023px) {
  .editor-workspace #leftSidebar, .editor-workspace #rightSidebar { width: min(340px, 88vw); flex-basis: 0; }
  .editor-workspace .sidebar { top: var(--editor-topbar-height); max-height: calc(100dvh - var(--editor-topbar-height)); }
}
@media (max-width: 768px) {
  .editor-project-bar { gap: 5px; padding: 0 8px; }
  .editor-brand { font-size: 12px; max-width: 88px; white-space: normal; }
  .editor-project-actions { gap: 4px; }
  .editor-project-bar button { font-size: 12px; padding: 6px; }
  .editor-project-bar #scenarioGuideBtn { display: none; }
  .editor-project-bar .editor-scenario-menu > summary { padding: 8px 5px; font-size: 12px; }
  .editor-workspace .bottom-dock-primary { flex-wrap: wrap; justify-content: center; }
}
.palette-country-editor {
  display: grid;
  gap: 8px;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border-color, #d1d5db);
}
.palette-country-color-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}
.palette-country-color-row input[type="color"] {
  width: 40px;
  height: 32px;
  padding: 2px;
}
