/* ==========================================================================
   ROLAVI Visor - UI styles
   Change --accent to the ROLAVI brand color to re-theme the whole interface.
   ========================================================================== */
:root {
  --accent: #0f5fa8;
  --accent-hover: #0c4f8c;
  --accent-soft: rgba(15, 95, 168, 0.1);
  --text: #1f2a37;
  --muted: #6b7785;
  --border: #e3e8ef;
  --surface: #ffffff;
  --hover: #eef3f9;
  --danger: #c62828;
  --success: #2e7d32;
  --warn: #a35a00;
  --warn-soft: #fff3e0;
  --radius: 12px;
  --shadow: 0 6px 24px rgba(16, 32, 56, 0.16), 0 1px 3px rgba(16, 32, 56, 0.12);
  --font: "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

html,
body,
#viewDiv {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
}

body {
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Generic line icons */
svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

svg .dot {
  fill: currentColor;
  stroke: none;
}

/* ==========================================================================
   Status pill
   ========================================================================== */
.status {
  position: absolute;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(640px, 70vw);
  padding: 9px 16px;
  background: var(--surface);
  border-radius: 999px;
  box-shadow: var(--shadow);
  z-index: 30;
}

.status .spinner {
  display: none;
  width: 14px;
  height: 14px;
  border: 2px solid var(--accent-soft);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex: none;
}

.status.loading .spinner {
  display: inline-block;
}

.status.error {
  color: var(--danger);
  border-radius: 10px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ==========================================================================
   Action bar
   ========================================================================== */
.action-bar {
  position: absolute;
  top: 15px;
  right: 15px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 30;
}

.ab-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.ab-btn svg {
  width: 22px;
  height: 22px;
}

.ab-btn:hover {
  background: var(--hover);
}

.ab-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.ab-btn.active {
  background: var(--accent);
  color: #ffffff;
}

/* Tooltip */
.ab-btn::after {
  content: attr(data-label);
  position: absolute;
  top: 50%;
  right: calc(100% + 14px);
  transform: translateY(-50%) translateX(4px);
  padding: 6px 10px;
  background: #1f2a37;
  color: #ffffff;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
}

.ab-btn:hover::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

.ab-btn.active::after {
  display: none;
}

.ab-sep {
  height: 1px;
  margin: 3px 6px;
  background: var(--border);
}

/* ==========================================================================
   Panels (shared)
   ========================================================================== */
.panel {
  position: absolute;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  z-index: 25;
}

.panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 8px 0 12px;
  border-bottom: 1px solid var(--border);
  flex: none;
}

.panel-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  flex: none;
}

.panel-icon svg {
  width: 18px;
  height: 18px;
}

.panel-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  flex: none;
  transition: background 0.15s, color 0.15s, transform 0.2s;
}

/* small text button (DWG / DXF) next to the icon buttons */
.icon-btn.text-btn {
  width: auto;
  min-width: 32px;
  padding: 0 6px;
  font: 700 10.5px/1 system-ui, -apple-system, "Segoe UI", sans-serif;
  letter-spacing: 0.03em;
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

.icon-btn:hover {
  background: var(--hover);
  color: var(--text);
}

/* ==========================================================================
   Side panel
   ========================================================================== */
.side-panel {
  top: 15px;
  right: 82px;
  width: 360px;
  max-height: calc(100% - 30px);
}

.side-panel .panel-title {
  flex: 1;
}

.panel-body {
  overflow-y: auto;
}

.tool-section {
  padding: 16px;
}

/* Esri widgets inside our panel: let the panel provide the card */
#widgetHost .esri-widget {
  box-shadow: none;
  width: 100%;
}

/* ==========================================================================
   Upload
   ========================================================================== */
.drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 22px 14px;
  border: 1.5px dashed #b9c6d6;
  border-radius: 10px;
  background: #f8fafc;
  color: var(--muted);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.drop-zone svg {
  width: 30px;
  height: 30px;
  margin-bottom: 4px;
  color: var(--accent);
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.dz-title {
  font-weight: 600;
  color: var(--text);
}

.dz-sub {
  font-size: 12px;
}

.dz-file {
  margin-top: 8px;
  padding: 4px 10px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-size: 12px;
}

.field-label {
  display: block;
  margin: 16px 0 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.text-input {
  width: 100%;
  box-sizing: border-box;
  height: 38px;
  padding: 0 12px;
  border: 1px solid #cdd6e1;
  border-radius: 8px;
  font: inherit;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.text-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 40px;
  margin-top: 16px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-primary svg {
  width: 18px;
  height: 18px;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-primary:disabled {
  background: #a9bccf;
  cursor: default;
}

.progress {
  margin-top: 14px;
  height: 6px;
  background: #e6ebf1;
  border-radius: 3px;
  overflow: hidden;
}

#uploadBar,
.progress .bar {
  width: 0;
  height: 100%;
  background: var(--accent);
  transition: width 0.2s;
}

.msg {
  margin-top: 10px;
  min-height: 18px;
  font-size: 13px;
  color: var(--muted);
}

.msg.error {
  color: var(--danger);
}

.msg.ok {
  color: var(--success);
}

/* ==========================================================================
   Basemap list
   ========================================================================== */
.option-list {
  list-style: none;
  margin: -6px -6px;
  padding: 0;
}

.option-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
}

.option-item:hover {
  background: var(--hover);
}

.option-item .swatch {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  flex: none;
}

.option-item .label {
  flex: 1;
}

.option-item .check {
  width: 18px;
  height: 18px;
  color: var(--accent);
  visibility: hidden;
}

.option-item.selected {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.option-item.selected .check {
  visibility: visible;
}

/* ==========================================================================
   Models list
   ========================================================================== */
.model-list {
  list-style: none;
  margin: -6px -6px 0;
  padding: 0;
}

.model-item + .model-item {
  border-top: 1px solid var(--border);
}

.model-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 0;
}

.model-main {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  padding: 8px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
}

.model-main:hover {
  background: var(--hover);
}

.model-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  flex: none;
}

.model-icon svg {
  width: 20px;
  height: 20px;
}

.model-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.model-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-meta {
  font-size: 12px;
  color: var(--muted);
}

.model-empty {
  padding: 18px 8px;
  color: var(--muted);
  text-align: center;
}

.icon-btn.danger:hover {
  background: rgba(198, 40, 40, 0.1);
  color: var(--danger);
}

.model-confirm {
  margin: 4px 6px 12px;
  padding: 12px;
  border: 1px solid rgba(198, 40, 40, 0.25);
  border-radius: 10px;
  background: rgba(198, 40, 40, 0.04);
}

.model-confirm p {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.45;
}

.model-confirm .text-input {
  margin-bottom: 10px;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.btn-secondary,
.btn-danger {
  height: 34px;
  padding: 0 14px;
  border-radius: 8px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-secondary {
  border: 1px solid #cdd6e1;
  background: var(--surface);
  color: var(--text);
}

.btn-secondary:hover {
  background: var(--hover);
}

.btn-danger {
  border: none;
  background: var(--danger);
  color: #ffffff;
}

.btn-danger:hover {
  background: #a71f1f;
}

.btn-danger:disabled {
  background: #d99a9a;
  cursor: default;
}

.model-confirm .msg {
  margin-top: 8px;
  min-height: 0;
}

/* ==========================================================================
   Layers panel: groups, visibility
   ========================================================================== */
.group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.group-title:first-child {
  margin-top: 0;
}

.group-count {
  padding: 1px 7px;
  border-radius: 999px;
  background: #eef1f5;
  font-size: 11px;
  letter-spacing: 0;
}

.vis-btn {
  color: var(--text);
}

.model-item.is-hidden .model-main {
  opacity: 0.45;
}

.model-item.is-hidden .vis-btn {
  color: var(--muted);
}

.model-icon.vector {
  background: rgba(255, 152, 0, 0.12);
  color: #c46b00;
}

/* ==========================================================================
   Import form
   ========================================================================== */
select.text-input {
  padding: 0 10px;
  background: var(--surface);
  cursor: pointer;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.field-hint {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.field-hint button {
  padding: 0;
  border: none;
  background: none;
  color: var(--accent);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.warning-list {
  margin: 8px 0 0;
  padding: 8px 10px 8px 26px;
  border-radius: 8px;
  background: #fff8e6;
  color: #7a5200;
  font-size: 12px;
  line-height: 1.45;
}

/* ==========================================================================
   Volume tool
   ========================================================================== */
:root {
  --cut: #4f8f2a; /* ArcGIS 3D colours */
  --fill: #6c63c7;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 3px;
  border-radius: 9px;
  background: #eef1f5;
}

.seg-btn {
  height: 32px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.seg-btn.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(16, 32, 56, 0.15);
}

.inline-row {
  display: flex;
  gap: 8px;
}

.inline-row .text-input {
  flex: 1;
}

.inline-row .btn-secondary {
  height: 38px;
}

.vol-results {
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.vol-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
}

.vol-row + .vol-row {
  border-top: 1px solid var(--border);
}

.vol-row b {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

.vol-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex: none;
}

.vol-dot.none {
  background: transparent;
}

.vol-row.cut .vol-dot {
  background: var(--cut);
}

.vol-row.cut b {
  color: var(--cut);
}

.vol-row.fill .vol-dot {
  background: var(--fill);
}

.vol-row.fill b {
  color: var(--fill);
}

/* ==========================================================================
   Draw panel
   ========================================================================== */
.draw-tools {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.draw-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 6px;
  border: 1px solid #cdd6e1;
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.draw-btn svg {
  width: 24px;
  height: 24px;
}

.draw-btn:hover {
  background: var(--hover);
}

.draw-btn.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.model-icon.drawing {
  background: rgba(255, 152, 0, 0.12);
  color: #c46b00;
}

.draw-meta {
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
  white-space: normal;
}

.draw-meta b {
  color: var(--text);
  font-weight: 600;
}

.rename-input {
  width: 100%;
  box-sizing: border-box;
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  font: inherit;
  font-weight: 600;
}

.export-box {
  margin-top: 16px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}

.full-width {
  width: 100%;
  margin-top: 10px;
}

/* ==========================================================================
   Save / image buttons, saved results
   ========================================================================== */
.btn-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.btn-pair .btn-secondary,
.full-width {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-pair svg {
  width: 17px;
  height: 17px;
}

.btn-secondary:disabled {
  opacity: 0.45;
  cursor: default;
}

.icon-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.icon-btn:disabled:hover {
  background: transparent;
}

.header-sep {
  width: 1px;
  height: 22px;
  background: var(--border);
  flex: none;
}

.profile-thumb {
  display: block;
  width: 100%;
  height: 48px;
  margin-top: 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
}

/* ==========================================================================
   Elevation profile dock
   ========================================================================== */
.dock {
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%);
  width: min(960px, calc(100vw - 180px));
  max-height: calc(100% - 90px);
}

.dock-header {
  cursor: pointer;
  user-select: none;
}

.dock-hint {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: var(--muted);
}

.dock-body {
  height: min(420px, 52vh);
  overflow: auto;
}

#profileHost {
  height: 100%;
  min-height: 360px;
}

#profileHost .esri-widget {
  box-shadow: none;
}

/* collapsed: only the header stays visible */
.dock.collapsed .dock-header {
  border-bottom: none;
}

.dock.collapsed .dock-body {
  display: none;
}

.dock.collapsed #profileCollapse {
  transform: rotate(180deg);
}

/* ==========================================================================
   Sync with the server (drawings, saved results)
   ========================================================================== */
.sync-bar {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 4px 8px;
  align-items: start;
  margin: 0 0 10px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f7f9fc;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}

.sync-bar.hidden {
  display: none;
}

.sync-bar svg {
  width: 18px;
  height: 18px;
}

.sync-bar.on {
  border-color: rgba(46, 125, 50, 0.25);
  background: rgba(46, 125, 50, 0.06);
  color: var(--success);
}

.sync-bar.off {
  border-color: rgba(15, 95, 168, 0.25);
  background: var(--accent-soft);
  color: var(--text);
}

.sync-bar.off svg {
  color: var(--accent);
}

.sync-form,
.sync-bar .msg {
  grid-column: 1 / -1;
}

.sync-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 6px;
}

.sync-form .btn-secondary {
  padding: 0 14px;
}

.sync-bar .msg {
  margin-top: 0;
  min-height: 0;
}

.sync-bar .msg:empty {
  display: none;
}

#section-results .sync-bar + .group-title {
  margin-top: 0;
}

.sync-tag {
  display: inline-block;
  align-self: flex-start;
  margin-top: 3px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #fff4e0;
  color: #9a5b00;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
}

/* ==========================================================================
   Side panel: fold (keeps the tool active, frees the map)
   ========================================================================== */
.side-header {
  cursor: pointer;
  user-select: none;
}

.side-panel.collapsed .panel-header {
  border-bottom: none;
}

.side-panel.collapsed .panel-body {
  display: none;
}

.side-panel.collapsed #toolPanelCollapse {
  transform: rotate(180deg);
}

/* Tooltips only where there is a mouse (on phones they stick after a tap) */
@media (hover: none) {
  .ab-btn::after {
    display: none;
  }
}


/* ==========================================================================
   2D / 3D switch (inside the map, top left, above the zoom buttons)
   ========================================================================== */
.view-controls {
  position: absolute;
  top: calc(15px + env(safe-area-inset-top));
  left: 15px;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 8px;
}

.north-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow);
  cursor: pointer;
}

.north-btn.hidden {
  display: none;
}

.north-btn svg {
  width: 22px;
  height: 22px;
  transition: transform 0.2s;
}

.north-btn .north {
  fill: #e5484d;
}

.north-btn .south {
  fill: #9aa4b2;
}

.north-btn:hover {
  background: var(--hover);
}

.mode-toggle {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: var(--surface);
  border-radius: 999px;
  box-shadow: var(--shadow);
  font-family: var(--font);
}

.mode-toggle.hidden {
  display: none;
}

.mode-toggle button {
  min-width: 38px;
  height: 30px;
  padding: 0 10px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font: 600 13px var(--font);
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.mode-toggle button:hover {
  background: var(--hover);
}

.mode-toggle button.active {
  background: var(--accent);
  color: #ffffff;
}

.mode-toggle button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.model-icon.ortho {
  background: rgba(46, 125, 50, 0.12);
  color: #2e7d32;
}

.model-icon.dem {
  background: rgba(121, 85, 72, 0.14);
  color: #795548;
}

.model-icon.demdiff {
  background: linear-gradient(135deg, rgba(229, 72, 77, 0.16) 50%, rgba(46, 158, 68, 0.16) 50%);
  color: #b3262b;
}

.extra-slot {
  display: contents;
}

.terrain-btn.on {
  background: var(--accent-soft);
  color: var(--accent);
}

/* ==========================================================================
   Phones (portrait): tools in two columns at the top right,
   panels and the profile as sheets at the bottom, full width.
   ========================================================================== */
@media (max-width: 640px) {
  :root {
    --bar-bottom: 370px; /* bottom of the two-column action bar (app.js sets the real value) */
  }

  .action-bar {
    top: calc(10px + env(safe-area-inset-top));
    right: 10px;
    display: grid;
    grid-template-columns: repeat(2, 40px);
    gap: 3px;
    padding: 4px;
  }

  .ab-btn {
    width: 40px;
    height: 40px;
  }

  .ab-btn svg {
    width: 21px;
    height: 21px;
  }

  .ab-sep {
    display: none;
  }

  .status {
    top: calc(10px + env(safe-area-inset-top));
    left: 62px;
    transform: none;
    max-width: calc(100vw - 62px - 118px);
    padding: 8px 12px;
    font-size: 13px;
  }

  .side-panel,
  .dock {
    top: auto;
    left: 8px;
    right: 8px;
    bottom: calc(8px + env(safe-area-inset-bottom));
    width: auto;
    transform: none;
    max-height: calc(100% - var(--bar-bottom) - 16px - env(safe-area-inset-bottom));
  }

  .panel-header {
    min-height: 46px;
  }

  .tool-section {
    padding: 12px;
  }

  /* the profile: chart on the full width, all header buttons visible */
  .dock-header {
    flex-wrap: wrap;
    gap: 4px;
    padding: 0 4px 0 12px;
  }

  .dock-header .panel-icon {
    display: none;
  }

  .dock-header .panel-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px;
  }

  .dock-hint {
    order: 10;
    flex-basis: 100%;
    padding: 0 0 8px;
    white-space: normal;
  }

  .dock-header .header-sep {
    margin: 0 2px;
  }

  .dock-body {
    height: min(340px, 45vh);
  }

  #profileHost {
    min-height: 280px;
  }

  .view-controls {
    top: calc(10px + env(safe-area-inset-top));
    left: 12px;
    flex-direction: column;
    align-items: flex-start;
  }

  .mode-toggle {
    flex-direction: column;
    border-radius: 10px;
  }

  .mode-toggle button {
    min-width: 0;
    width: 34px;
    height: 32px;
    padding: 0;
    border-radius: 8px;
  }

  /* 16 px avoids the automatic zoom of iPhone when typing */
  .text-input,
  .rename-input {
    font-size: 16px;
  }
}

/* ==========================================================================
   Phones (landscape) and very short windows
   ========================================================================== */
/* Lower windows: a more compact toolbar, so it always ends above "Powered by Esri" */
@media (max-height: 840px) and (min-width: 641px) {
  .action-bar {
    top: 10px;
    gap: 2px;
    padding: 5px;
  }

  .ab-btn {
    width: 38px;
    height: 38px;
  }

  .ab-btn svg {
    width: 20px;
    height: 20px;
  }

  .ab-btn svg.flag {
    width: 22px;
    height: 15px;
  }

  .ab-sep {
    margin: 2px 6px;
  }
}

@media (max-height: 720px) and (min-width: 641px) {
  .action-bar {
    gap: 1px;
    padding: 4px;
  }

  .ab-btn {
    width: 34px;
    height: 34px;
  }

  .ab-btn svg {
    width: 19px;
    height: 19px;
  }

  .ab-btn svg.flag {
    width: 21px;
    height: 14px;
  }
}

@media (max-height: 620px) and (min-width: 641px) {
  .action-bar {
    top: 10px;
    right: 10px;
    display: grid;
    grid-template-columns: repeat(2, 40px);
    gap: 3px;
    padding: 4px;
  }

  .ab-btn {
    width: 40px;
    height: 40px;
  }

  .ab-sep {
    display: none;
  }

  .ab-btn::after {
    display: none;
  }

  .side-panel {
    top: 10px;
    right: 116px;
    max-height: calc(100% - 20px);
  }

  .dock {
    left: 8px;
    right: 116px;
    bottom: 8px;
    width: auto;
    transform: none;
    max-height: calc(100% - 16px);
  }

  .dock-body {
    height: calc(100vh - 90px);
  }

  #profileHost {
    min-height: 220px;
  }
}

/* ==========================================================================
   Scale bar (bottom left, above the attribution)
   ========================================================================== */
.scale-bar {
  position: absolute;
  left: 15px;
  bottom: calc(26px + env(safe-area-inset-bottom));
  z-index: 5;
  padding: 4px 8px 5px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  font: 600 11px var(--font);
  color: var(--text);
  pointer-events: none;
  user-select: none;
}

.scale-bar.hidden {
  display: none;
}

.scale-line {
  position: relative;
  height: 16px;
  border: 2px solid #1f2a37;
  border-top: none;
  transition: width 0.15s;
}

.scale-line span {
  position: absolute;
  left: 4px;
  bottom: 2px;
  white-space: nowrap;
}

.scale-ratio {
  margin-top: 2px;
  font-weight: 500;
  font-size: 10.5px;
  color: var(--muted);
}

.scale-ratio:empty {
  display: none;
}

/* ==========================================================================
   Print panel
   ========================================================================== */
.scale-input {
  align-items: center;
}

.scale-prefix {
  font-weight: 600;
  color: var(--muted);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.chip {
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: 500 12px var(--font);
  cursor: pointer;
}

.chip:hover {
  background: var(--hover);
}

.chip.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.print-info {
  margin: 14px 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f7f9fc;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text);
}

.print-info:empty {
  display: none;
}

.print-info b {
  font-weight: 600;
}

@media (max-width: 640px) {
  .scale-bar {
    left: 12px;
    bottom: calc(24px + env(safe-area-inset-bottom));
  }
}

/* ======================================================================
   Accounts (step 15)
   ====================================================================== */
/* the old edit-key fields: the signed-in account replaces them */
.key-field {
  display: none !important;
}

/* visitors: the public examples, view only (also: the admin on a user's space) */
.demo-bar {
  position: absolute;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100vw - 220px);
  padding: 5px 5px 5px 6px;
  background: #071a33;
  color: #fff;
  border-radius: 999px;
  box-shadow: var(--shadow);
  z-index: 31;
  font-size: 13px;
  white-space: nowrap;
}

.demo-bar.hidden {
  display: none;
}

.demo-tag {
  padding: 4px 10px;
  border-radius: 999px;
  background: #eedda0;
  color: #071a33;
  font-weight: 700;
}

.demo-text {
  overflow: hidden;
  text-overflow: ellipsis;
  color: rgba(255, 255, 255, 0.82);
}

.demo-signin {
  padding: 6px 14px;
  border-radius: 999px;
  background: #fff;
  color: #071a33;
  font-weight: 600;
  text-decoration: none;
}

.demo-signin:hover {
  background: #eedda0;
}

body.is-demo .status {
  top: 62px;
}

/* account button: initials of the user */
.ab-avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.acc-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 10px;
  background: var(--hover);
}

.acc-avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #071a33;
  color: #fff;
  font-weight: 700;
  flex: none;
}

.acc-avatar.small {
  width: 30px;
  height: 30px;
  font-size: 11px;
  margin: 0 4px 0 2px;
}

.acc-who {
  flex: 1;
  min-width: 0;
}

.acc-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.acc-user {
  color: var(--muted);
  font-size: 13px;
}

.acc-role {
  padding: 3px 9px;
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.acc-role.admin {
  background: #071a33;
  color: #eedda0;
}

.acc-block {
  margin-top: 14px;
}

.acc-space-fixed {
  padding: 9px 12px;
  border: 1px solid var(--border, #d8dee6);
  border-radius: 8px;
  font-weight: 600;
}

.acc-users .model-row {
  align-items: center;
}

.acc-users .model-meta {
  white-space: normal;
}

.btn-link {
  padding: 6px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  flex: none;
}

.btn-link:hover {
  background: var(--accent-soft);
}

.acc-tools {
  display: grid;
  gap: 8px;
  margin: 6px 0 4px;
  padding: 10px;
  border-radius: 8px;
  background: var(--hover);
}

.acc-tools .field-label {
  margin: 0;
}

.acc-pw-row,
.acc-tool-row {
  display: flex;
  gap: 8px;
}

.acc-pw-row .text-input {
  flex: 1;
  min-width: 0;
}

.acc-tool-row > * {
  flex: 1;
}

.acc-fold {
  margin-top: 12px;
  border: 1px solid var(--border, #d8dee6);
  border-radius: 10px;
}

.acc-fold > summary {
  padding: 10px 12px;
  font-weight: 600;
  cursor: pointer;
}

.acc-form {
  display: grid;
  gap: 6px;
  padding: 0 12px 12px;
}

.acc-form .field-label {
  margin-top: 4px;
}

.acc-created {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #e8f5ec;
}

.acc-created p {
  margin: 0 0 6px;
}

.acc-cred {
  margin: 0 0 8px;
  padding: 8px 10px;
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
  white-space: pre-wrap;
  user-select: all;
}

.acc-signout {
  margin-top: 16px;
}

#accAdmin .group-title {
  margin-top: 20px;
}

.example-badge {
  display: inline-block;
  margin-right: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #eedda0;
  color: #071a33;
  font-size: 11px;
  font-weight: 700;
  vertical-align: 1px;
}

@media (max-width: 720px) {
  .demo-bar {
    top: calc(10px + env(safe-area-inset-top));
    max-width: calc(100vw - 190px);
    font-size: 12px;
  }
  .demo-text {
    display: none;
  }
  body.is-demo .status {
    top: calc(56px + env(safe-area-inset-top));
  }
}

.sync-form a.btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
}

/* signed-in space with no data yet */
.empty-space {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(420px, calc(100vw - 32px));
  padding: 26px 26px 22px;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow);
  text-align: center;
  z-index: 25;
}

.empty-space.hidden {
  display: none;
}

.empty-close {
  position: absolute;
  top: 8px;
  right: 8px;
}

.empty-art {
  width: 56px;
  height: 56px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.2;
  stroke-linejoin: round;
}

.empty-space h2 {
  margin: 10px 0 6px;
  font-size: 20px;
}

.empty-space p {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.5;
}

.empty-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.empty-actions > * {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: 42px;
  margin: 0;
  border-radius: 10px;
  font-weight: 600;
}

/* plan and storage (step 16) */
.acc-plan {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border, #d8dee6);
  border-radius: 10px;
  font-size: 13px;
}

.acc-plan.hidden {
  display: none;
}

.acc-plan-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
}

.acc-plan-row b {
  color: var(--text);
  text-align: right;
}

.acc-meter {
  height: 6px;
  border-radius: 999px;
  background: var(--hover);
  overflow: hidden;
}

.acc-meter.hidden {
  display: none;
}

.acc-meter i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--accent);
}

.acc-meter i.full {
  background: #d4373c;
}

.acc-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.acc-two .text-input {
  width: 100%;
  min-width: 0;
  font-size: 13px;
}

.acc-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0;
  font-size: 13px;
  color: var(--muted);
}

.acc-plan-fields {
  display: grid;
  gap: 6px;
}

.acc-plan-fields.hidden {
  display: none;
}

.acc-plan-line {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted);
}

.acc-state {
  display: inline-block;
  margin-right: 6px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: #e8f5ec;
  color: #1e7a3a;
}

.acc-state.expired,
.acc-state.disabled {
  background: #fdecec;
  color: #b3262b;
}

.acc-state.pending {
  background: #fff5d6;
  color: #8a6100;
}

.acc-tools-title {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

/* ======================================================================
   Shared links (step 17)
   ====================================================================== */
/* a shared link is view only: no tools that upload, save or change data */
body.is-share .ab-btn[data-tool="upload"],
body.is-share .ab-btn[data-tool="import"],
body.is-share .ab-btn[data-tool="draw"],
body.is-share .ab-btn[data-tool="results"],
body.is-share .ab-btn[data-tool="volume"],
body.is-share .ab-btn[data-tool="compare"],
body.is-share .ab-btn[data-tool="share"],
body.is-share .ab-btn[data-tool="print"],
body.is-share .ab-btn[data-tool="account"],
body.is-share #profileSave,
body.is-share .model-item .icon-btn.danger {
  display: none !important;
}

/* visitors of the demo do not share */
body.is-demo:not(.is-share) .ab-btn[data-tool="share"] {
  display: none;
}

.share-warning {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff5d6;
  color: #5c4300;
  font-size: 13px;
  line-height: 1.45;
}

.share-warning svg {
  flex: none;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: #a37700;
  stroke-width: 1.8;
  stroke-linejoin: round;
}

.share-pick {
  display: grid;
  gap: 8px;
  max-height: 280px;
  overflow: auto;
  padding: 2px;
}

.share-group {
  margin: 0;
  padding: 6px 10px 8px;
  border: 1px solid var(--border, #d8dee6);
  border-radius: 8px;
}

.share-group legend {
  padding: 0 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.share-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 14px;
  cursor: pointer;
}

.share-item input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  flex: none;
}

.share-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.share-empty {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.share-result {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 12px;
  border-radius: 10px;
  background: #e8f5ec;
  font-size: 13px;
}

.share-result p {
  margin: 0;
}

.share-result .btn-primary {
  margin: 0;
}

.share-url {
  font-size: 13px;
}

.share-actions {
  display: flex;
  gap: 8px;
}

.share-actions > * {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.share-entry {
  display: grid;
  gap: 4px;
  padding: 10px 4px;
}

.share-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.share-head .model-name {
  flex: 1;
  min-width: 0;
}

.share-state.off {
  padding: 0 7px;
  border-radius: 999px;
  background: #fdecec;
  color: #b3262b;
  font-size: 11px;
  font-weight: 700;
}

.share-meta {
  white-space: normal !important;
}

.share-layers {
  font-size: 12px;
  color: var(--text);
}

/* a long link title must not run under the panels */
body.is-share .demo-text {
  max-width: min(30vw, 340px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* with a panel open there is no room for a centred bar: it moves next to the 2D / 3D switch */
@media (min-width: 721px) and (max-width: 1499px) {
  body:has(#toolPanel:not(.hidden):not(.collapsed)) .demo-bar {
    left: 112px;
    transform: none;
    max-width: calc(100vw - 112px - 460px);
  }
}

/* Account panel: users and plans open in their own window (/admin) */
.acc-admin {
  margin: 4px 0 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8fafc;
}

.acc-admin-text b {
  display: block;
  margin-bottom: 2px;
}

.acc-admin-text span {
  color: var(--muted);
  font-size: 13px;
}

.acc-manage {
  margin-top: 10px;
  text-decoration: none;
}

.acc-admin .msg:empty {
  display: none;
}

/* ---------- Language: flag in the toolbar and the menu of languages ---------- */
svg.flag {
  stroke: none;
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(16, 32, 56, 0.18);
}

.ab-btn svg.flag {
  width: 24px;
  height: 16px;
}

.lang-menu {
  position: fixed;
  z-index: 60;
  display: flex;
  flex-direction: column;
  min-width: 168px;
  padding: 6px;
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.lang-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.lang-item svg.flag {
  width: 24px;
  height: 16px;
  flex: none;
}

.lang-item:hover,
.lang-item:focus-visible {
  background: var(--hover);
  outline: none;
}

.lang-item.is-current {
  font-weight: 600;
  color: var(--accent);
}

.lang-item.is-current::after {
  content: "";
  width: 8px;
  height: 8px;
  margin-left: auto;
  border-radius: 50%;
  background: var(--accent);
}

/* Volume: the PDF report under Save / Image */
.vol-report {
  margin-top: 8px;
  min-height: 38px;
}

.vol-report svg {
  width: 17px;
  height: 17px;
}

/* Layers: download a 3D model (administrator) */
a.icon-btn {
  display: inline-grid;
  place-items: center;
  color: inherit;
  text-decoration: none;
}

/* the plan ends soon (step 24) */
.plan-notice {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(400px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  box-sizing: border-box;
  padding: 22px 22px 20px;
  background: var(--surface);
  border-radius: 16px;
  border-top: 4px solid var(--warn);
  box-shadow: var(--shadow);
  z-index: 26;
}

.pn-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-right: 28px;
}

.pn-cal {
  flex: none;
  display: grid;
  width: 52px;
  border-radius: 10px;
  overflow: hidden;
  text-align: center;
  border: 1px solid #f0c890;
  background: var(--surface);
}

.pn-cal span {
  padding: 3px 0 2px;
  background: var(--warn);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-transform: capitalize;
}

.pn-cal b {
  padding: 3px 0 5px;
  font-size: 22px;
  line-height: 1.1;
  color: var(--text);
}

.plan-notice h2 {
  margin: 0;
  font-size: 19px;
  line-height: 1.25;
}

.pn-line {
  list-style: none;
  margin: 16px 0 12px;
  padding: 0;
  font-size: 13px;
}

.pn-line li {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 0 0 12px 22px;
  color: var(--muted);
}

.pn-line li::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 4px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--warn);
}

.pn-line li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 15px;
  bottom: 1px;
  width: 1px;
  background: #f0c890;
}

.pn-line li.pn-last {
  padding-bottom: 0;
}

.pn-line li.pn-last::before {
  background: var(--surface);
  border: 2px solid var(--danger);
  width: 5px;
  height: 5px;
}

.pn-line b {
  color: var(--text);
  text-align: right;
}

.plan-notice p {
  margin: 0 0 16px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--warn-soft);
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
}

.pn-renew {
  gap: 8px;
  text-decoration: none;
  background: #1f8f4e;
  color: #fff;
}

.pn-renew:hover {
  background: #187a41;
}

.pn-renew svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linejoin: round;
}

.acc-plan-warn {
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 12.5px;
  line-height: 1.45;
}

@media (max-width: 720px) {
  .plan-notice {
    top: auto;
    bottom: 12px;
    transform: translateX(-50%);
  }
}

.plan-notice .empty-actions > * {
  flex: 1 1 auto;
  box-sizing: border-box;
  padding: 0 14px;
  white-space: nowrap;
}

.plan-notice .empty-actions > .pn-renew {
  flex-grow: 1.4;
}

@media (max-width: 420px) {
  .plan-notice .empty-actions {
    flex-direction: column;
  }

  .plan-notice .empty-actions > * {
    flex: none;
    width: 100%;
  }
}

/* style of a vector layer (step 26) */
.style-btn.on {
  background: var(--accent-soft);
  color: var(--accent);
}

.model-item.is-styling {
  background: #f7f9fc;
  border-radius: 10px;
}

.style-editor {
  display: grid;
  gap: 12px;
  margin: 2px 6px 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  font-size: 13px;
}

.se-check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  cursor: pointer;
}

.se-check input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
}

.se-row {
  display: grid;
  gap: 6px;
}

.se-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.se-color.is-off {
  opacity: 0.4;
  pointer-events: none;
}

.se-swatches {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.se-swatch {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid rgba(16, 32, 56, 0.18);
  border-radius: 50%;
  cursor: pointer;
}

.se-swatch.is-on {
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text);
}

.se-custom {
  width: 30px;
  height: 24px;
  padding: 0 2px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  cursor: pointer;
}

.se-range {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.se-range .se-label {
  grid-column: 1 / -1;
}

.se-range input {
  width: 100%;
  margin: 0;
  accent-color: var(--accent);
}

.se-range output {
  min-width: 46px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.se-seg {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.se-seg-btn {
  display: grid;
  place-items: center;
  height: 30px;
  padding: 0;
  border: 0;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}

.se-seg-btn + .se-seg-btn {
  border-left: 1px solid var(--border);
}

.se-seg-btn svg {
  width: 36px;
  height: 8px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
}

.se-seg-btn.is-on {
  background: var(--accent-soft);
  color: var(--accent);
}

.se-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 2px;
}

.se-gap {
  flex: 1;
}

.se-actions .btn-link {
  padding: 6px 4px;
  white-space: nowrap;
}

.se-actions .btn-primary,
.se-actions .btn-secondary {
  white-space: nowrap;
  display: flex;
  align-items: center;
  width: auto;
  height: 32px;
  margin: 0;
  padding: 0 12px;
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

