:root {
  /* MapTiler-inspired interface palette. Blue is an accent on white, not a bar. */
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: #eff6ff;
  --accent-line: #bfdbfe;
  --ink: #1e293b;
  --ink-soft: #334155;
  --muted: #64748b;
  --faint: #64748b;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --bg: #f8fafc;
  --panel: #ffffff;
  --card: #ffffff;
  --hover: #f1f5f9;
  --ok: #15803d;
  --ok-soft: #f0fdf4;
  --danger: #dc2626;
  --danger-soft: #fff5f5;
  --danger-line: #fecaca;
  --warn: #b45309;
  --warn-soft: #fffbeb;
  --warn-line: #fde68a;
  --shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
  --sidebar: 216px;
  --font: "Segoe UI", "Helvetica Neue", ui-sans-serif, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SFMono-Regular", Menlo, Consolas, monospace;
  --radius: 10px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
}
button, input, select, textarea { font-family: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input[type="checkbox"],
input[type="radio"],
input[type="range"],
progress { accent-color: var(--accent); }
h1, h2, h3, p { margin: 0; }
h1, h2, h3, h4 {
  font-family: var(--font);
  font-weight: 640;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
h2 { font-size: 16px; }
h3 { font-size: 15px; }
::selection { background: #dbeafe; }

/*
 * Materialize compatibility
 * Vendor CSS is kept only for modal JS helpers. It globally styles `nav`, hides
 * native `select`, and restyles inputs/buttons. Undo those globals here with
 * design-system rules so every page uses the approved controls.
 */
.select-wrapper { display: contents; }
.select-wrapper .caret,
.select-wrapper input.select-dropdown,
.select-dropdown.dropdown-content { display: none; }
select,
select.browser-default,
.field select,
.ctrl select,
.toolbar select,
.sort {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 34px;
  margin: 0;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background-color: #fff;
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.2;
  box-shadow: none;
  outline: none;
  appearance: auto;
  -webkit-appearance: auto;
}
select:focus,
select.browser-default:focus,
.field select:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: none;
}
input:not([type]),
input[type="text"]:not(.browser-default),
input[type="password"]:not(.browser-default),
input[type="email"]:not(.browser-default),
input[type="url"]:not(.browser-default),
input[type="tel"]:not(.browser-default),
input[type="number"]:not(.browser-default),
input[type="search"]:not(.browser-default),
textarea:not(.browser-default) {
  background-color: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  height: 34px;
  width: 100%;
  margin: 0;
  padding: 0 10px;
  box-sizing: border-box;
  box-shadow: none;
  outline: none;
  font-size: 13.5px;
  color: var(--ink);
}
textarea:not(.browser-default) {
  height: auto;
  min-height: 88px;
  padding: 8px 10px;
  resize: vertical;
}
input:not([type]):focus:not([readonly]),
input[type="text"]:not(.browser-default):focus:not([readonly]),
input[type="password"]:not(.browser-default):focus:not([readonly]),
input[type="email"]:not(.browser-default):focus:not([readonly]),
input[type="url"]:not(.browser-default):focus:not([readonly]),
input[type="tel"]:not(.browser-default):focus:not([readonly]),
input[type="number"]:not(.browser-default):focus:not([readonly]),
input[type="search"]:not(.browser-default):focus:not([readonly]),
textarea:not(.browser-default):focus:not([readonly]) {
  border: 1px solid var(--accent);
  border-bottom: 1px solid var(--accent);
  box-shadow: none;
  background-color: #fff;
}
input[type="file"] {
  display: block;
  width: 100%;
  max-width: 420px;
  padding: 8px 0;
  border: 0;
  background: transparent;
  height: auto;
  box-shadow: none;
}
.subnav,
.account-nav,
.side-nav {
  background: transparent;
  background-color: transparent;
  color: inherit;
  height: auto;
  line-height: inherit;
  box-shadow: none;
  width: auto;
}
.subnav a,
.account-nav a,
.side-nav a {
  color: inherit;
  line-height: inherit;
  height: auto;
}
.tabs.int-tabs {
  background: transparent;
  background-color: transparent;
  height: auto;
  overflow: visible;
  white-space: normal;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
  box-shadow: none;
}
.tabs.int-tabs .tab {
  display: inline-flex;
  line-height: inherit;
  height: auto;
  text-transform: none;
}
.tabs.int-tabs .tab a {
  color: var(--muted);
  background: transparent;
  padding: 6px 10px;
  border-radius: 8px;
  font-weight: 600;
  text-transform: none;
}
.tabs.int-tabs .tab a.active,
.tabs.int-tabs .tab a:hover {
  color: var(--accent);
  background: var(--accent-soft);
}
.tabs.int-tabs .indicator { display: none; }

.app { display: flex; height: 100%; min-height: 0; }
.sidebar {
  flex: 0 0 var(--sidebar);
  width: var(--sidebar);
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
  z-index: 20;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px 14px;
  color: var(--ink);
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand img { height: 26px; width: auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 14px; font-weight: 650; letter-spacing: -0.01em; }
.brand-text span { margin-top: 2px; font-size: 11px; color: var(--faint); letter-spacing: 0.04em; text-transform: uppercase; }
.side-nav { display: flex; flex-direction: column; padding: 4px 10px; gap: 2px; }
.side-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 14px;
  font-weight: 550;
}
.side-nav a:hover { background: var(--hover); text-decoration: none; }
.side-nav a.active { background: var(--accent-soft); color: var(--accent); }
.side-nav svg { flex: 0 0 auto; }
.side-foot {
  margin-top: auto;
  padding: 12px;
  border-top: 1px solid var(--line);
}
.user-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px;
  border: 0;
  background: transparent;
  border-radius: 8px;
  text-align: left;
}
.user-btn:hover { background: var(--hover); }
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 650;
  flex: 0 0 auto;
}
.user-meta { min-width: 0; }
.user-meta strong, .user-meta span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta strong { font-size: 13px; font-weight: 650; }
.user-meta span { font-size: 12px; color: var(--muted); }

.workspace { flex: 1; min-width: 0; overflow: auto; background: var(--bg); display: flex; flex-direction: column; }
.workspace > main { flex: 1; min-height: 0; }
body.editor-mode .workspace { overflow: hidden; }
body.editor-mode .console-bar { display: none !important; }
body.editor-mode .sidebar { display: none; }
body.editor-mode .app { display: block; }
body.editor-mode .workspace { height: 100%; }
.console-bar {
  display: none;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 16px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 16;
}
html[data-auth] .console-bar { display: flex; }
.console-menu, .console-brand { display: none; }
.account-menu-host { margin-left: auto; }
.account-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px 0 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}
.account-trigger:hover { background: var(--hover); }
.account-name {
  font-size: 14px;
  font-weight: 650;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-dropdown { min-width: 168px; }
.account-dropdown button {
  display: block;
  width: 100%;
  padding: 12px 16px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.account-dropdown button:hover { background: var(--hover); }
.nav-sign-out { width: 100%; margin-top: 8px; }

.page { padding: 28px 36px 72px; max-width: 1240px; }
.page.wide { max-width: 1360px; }
.page.fluid { max-width: none; padding: 22px 28px 56px; }

.crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 8px; color: var(--muted); font-size: 13px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.crumbs .sep { color: var(--faint); }

.page-head, .detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.page-head h1, .detail-head h1 {
  font-size: 28px;
  line-height: 1.15;
  font-weight: 620;
  letter-spacing: -0.025em;
}
.lede { margin-top: 4px; color: var(--muted); font-size: 14px; }
.head-actions, .inline-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.title-row h1 { margin-right: 4px; }

/* Design-system buttons — include Materialize class names (.btn-small/.btn-flat)
   so vendor styles (teal fill, uppercase, elevation) cannot leak through. */
.btn, .btn-small, .btn-secondary, .btn-quiet, .btn-danger, .btn-flat {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 34px;
  padding: 0 13px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  text-decoration: none;
  background: var(--accent);
  background-color: var(--accent);
  color: #fff;
  white-space: nowrap;
  box-shadow: none;
  vertical-align: middle;
}
.btn:hover, .btn-small:hover {
  background: var(--accent-hover);
  background-color: var(--accent-hover);
  color: #fff;
  text-decoration: none;
  box-shadow: none;
}
.btn:focus, .btn-small:focus, .btn-flat:focus {
  background-color: var(--accent-hover);
  box-shadow: none;
}
.btn-secondary {
  background: #fff;
  background-color: #fff;
  color: var(--ink);
  border-color: var(--line-strong);
  font-weight: 580;
}
.btn-secondary:hover, .btn-secondary:focus {
  background: var(--hover);
  background-color: var(--hover);
  color: var(--ink);
  text-decoration: none;
  box-shadow: none;
}
.btn-quiet, .btn-flat {
  background: transparent;
  background-color: transparent;
  color: var(--ink-soft);
  border-color: transparent;
  box-shadow: none;
}
.btn-quiet:hover, .btn-flat:hover,
.btn-quiet:focus, .btn-flat:focus {
  background: var(--hover);
  background-color: var(--hover);
  color: var(--ink);
  text-decoration: none;
  box-shadow: none;
}
.btn-danger {
  background: #fff;
  background-color: #fff;
  color: var(--danger);
  border-color: var(--danger-line);
}
.btn-danger:hover, .btn-danger:focus {
  background: var(--danger-soft);
  background-color: var(--danger-soft);
  color: var(--danger);
  text-decoration: none;
  box-shadow: none;
}
.btn[disabled], .btn-small[disabled], .btn-secondary[disabled], .btn-flat[disabled] {
  opacity: 0.45;
  cursor: default;
  box-shadow: none;
}
.btn-small { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-danger.btn-small { color: var(--danger); }
.btn[hidden], .btn-small[hidden], .btn-secondary[hidden], .btn-quiet[hidden], .btn-danger[hidden], .btn-flat[hidden] {
  display: none !important;
}
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.icon-btn {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink-soft);
  padding: 0;
}
.console-bar .console-menu { display: none; }
.icon-btn:hover { background: var(--hover); color: var(--ink); }
.icon-btn.active { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }

.ico { display: block; }
svg.stroke { fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 28px 0 12px;
}
.section-head h2, .block-title {
  font-size: 16px;
  font-weight: 640;
  letter-spacing: -0.015em;
}
.section-head a { font-size: 13px; }

.usage-strip {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr auto;
  gap: 22px;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
}
.meter-label { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.meter-label b { color: var(--ink); font-weight: 600; }
.meter { height: 4px; background: var(--line); border-radius: 99px; overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.usage-link { font-size: 13px; white-space: nowrap; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
  gap: 16px;
}
.resource {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  min-width: 0;
  position: relative;
}
.resource:hover { border-color: var(--line-strong); text-decoration: none; box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06); }
.thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--line);
  overflow: hidden;
}
.thumb .map-canvas { position: absolute; inset: 0; }
.resource-body { padding: 11px 12px 12px; display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; align-items: start; }
.resource-body h3 { font-size: 14.5px; font-weight: 640; letter-spacing: -0.01em; grid-column: 1; }
.resource-meta { grid-column: 1; color: var(--muted); font-size: 12.5px; }
.resource .more { grid-row: 1 / span 2; grid-column: 2; align-self: center; }
.card-menu {
  position: absolute;
  top: 8px;
  right: 8px;
  opacity: 0;
  background: rgba(255, 255, 255, 0.94);
}
.resource:hover .card-menu, .resource:focus-within .card-menu, .card-menu[aria-expanded="true"] { opacity: 1; }

.pill {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--hover);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 620;
  letter-spacing: 0.01em;
}
.pill.vector { background: var(--accent-soft); color: var(--accent-hover); }
.pill.raster { background: var(--ok-soft); color: var(--ok); }
.pill.public { background: var(--ok-soft); color: var(--ok); }
.pill.private { background: var(--accent-soft); color: var(--accent); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.danger { background: var(--danger-soft); color: var(--danger); }
.pill.neutral { background: var(--hover); color: var(--ink-soft); }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
}
.search {
  position: relative;
  flex: 1 1 220px;
  max-width: 320px;
}
.search svg { position: absolute; left: 10px; top: 8px; color: var(--faint); }
.search input, .field input, .field select, .field textarea, .sort, .ctrl input[type="text"], .ctrl input[type="number"], .ctrl input[type="password"], .ctrl input[type="email"], .ctrl select, .hex {
  height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  padding: 0 10px;
  font-size: 13.5px;
  width: 100%;
}
.search input { padding-left: 32px; }
.field textarea { height: auto; padding: 8px 10px; resize: vertical; }
.segment { display: inline-flex; background: #fff; border: 1px solid var(--line-strong); border-radius: 8px; padding: 2px; }
.segment button {
  height: 28px;
  padding: 0 10px;
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
}
.segment button.on { background: var(--accent-soft); color: var(--accent); }
.sort { width: auto; height: 34px; padding-right: 8px; }
.view-toggle { margin-left: auto; display: inline-flex; gap: 4px; }

.list { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.list-row, .list-head {
  display: grid;
  grid-template-columns: 86px minmax(0, 1.6fr) 90px 110px 90px 130px 40px;
  gap: 10px;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}
.list-head { color: var(--faint); font-size: 12px; font-weight: 650; letter-spacing: 0.02em; background: var(--bg); }
.list-row:last-child { border-bottom: 0; }
.list-row { color: inherit; text-decoration: none; background: #fff; }
.list-row:hover { background: var(--bg); text-decoration: none; }
.mini-thumb { width: 86px; height: 56px; border-radius: 6px; overflow: hidden; background: var(--line); position: relative; }
.mini-thumb .map-canvas { position: absolute; inset: 0; }
.row-name { font-weight: 630; }
.row-sub { color: var(--muted); font-size: 12.5px; }

.data-list .list-row, .data-list .list-head {
  grid-template-columns: 28px minmax(160px, 1.5fr) 110px 90px 140px 88px;
}
.job-list .list-row, .job-list .list-head {
  grid-template-columns: minmax(120px, 1fr) minmax(120px, 1fr) minmax(140px, 1.1fr) 120px 150px 40px;
}
.key-list .list-row, .key-list .list-head {
  grid-template-columns: minmax(140px, 1.2fr) minmax(140px, 1fr) 130px 100px 40px;
}
.dataset-list .list-row, .dataset-list .list-head {
  grid-template-columns: 72px minmax(140px, 1.4fr) 120px 90px 130px 40px;
}

.subnav {
  display: flex;
  gap: 18px;
  align-items: flex-end;
  border-bottom: 1px solid var(--line);
  margin: 6px 0 18px;
  padding: 0;
  background: transparent;
  box-shadow: none;
  height: auto;
  line-height: inherit;
  color: inherit;
}
.subnav a {
  display: inline-block;
  padding: 8px 0 10px;
  margin-bottom: -1px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.3;
  height: auto;
  border-bottom: 2px solid transparent;
  background: transparent;
  box-shadow: none;
}
.subnav a:hover { color: var(--ink); text-decoration: none; background: transparent; }
.subnav a.active { color: var(--ink); border-bottom-color: var(--accent); background: transparent; }

.file-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.file-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumb-btn { border: 0; background: transparent; color: var(--accent); padding: 0; font-weight: 600; }
.toolbar .crumbs { margin: 0; }
button.list-row {
  width: 100%;
  border: 0;
  background: #fff;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: left;
}
.data-list .list-row > span,
.job-list .list-row > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-list .list-row a { color: var(--muted); text-decoration: none; }
.job-list .list-row a:hover { text-decoration: underline; }
.list-row[hidden] { display: none !important; }
.data-list .file-ico { color: var(--muted); display: flex; }
.dataset-list .mini-thumb { width: 56px; height: 40px; }
.dataset-list a.row-name { color: inherit; text-decoration: none; }
.dataset-list a.row-name:hover { text-decoration: underline; }
.swatch-ds { background: var(--line); }
.swatch-ds.geoparquet { background: linear-gradient(145deg, #c5d4e4 0%, #7f9cb8 42%, #d5e3c4 100%); }
.swatch-ds.parquet { background: var(--line); }
.swatch-ds.cog { background: linear-gradient(160deg, #1c4630, #6f9a62 60%, #c9c07a); }
.swatch-ds.pmtiles { background: linear-gradient(135deg, #d9e2ea, #8aa4b8); }
.icon-btn[disabled] { opacity: 0.35; cursor: default; }
.data-pager { margin-top: 12px; }

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px 22px;
  align-items: start;
}
.detail-main { min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.detail-side { position: sticky; top: 16px; }
.map-stage {
  position: relative;
  height: clamp(460px, calc(100vh - 230px), 680px);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #e8eef4;
}
.map-stage .map-canvas,
.map-stage .map,
.map-stage #map { position: absolute; inset: 0; }
.map-stage.is-loading .map-canvas { opacity: 0; }
.map-wait {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 2;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--muted);
}
.map-tools {
  position: absolute;
  z-index: 3;
  top: 12px;
  right: 12px;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  overflow: hidden;
}
.map-tools button {
  width: 32px;
  height: 32px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 0;
  display: grid;
  place-items: center;
}
.map-tools button:last-child { border-bottom: 0; }
.map-tools button:hover, .map-tools button.on { background: var(--hover); }
.map-tools button.on { color: var(--accent); }
.basemap-switch {
  position: absolute;
  z-index: 3;
  top: 12px;
  left: 12px;
  display: flex;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 2px;
}
.basemap-switch button {
  height: 28px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 650;
  padding: 0 9px;
  border-radius: 6px;
}
.basemap-switch button.on { background: var(--ink); color: #fff; }
.legend {
  position: absolute;
  z-index: 3;
  left: 12px;
  bottom: 30px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  min-width: 140px;
  max-width: 220px;
  font-size: 12px;
}
.legend b { display: block; font-size: 12px; margin-bottom: 4px; }
.legend-row { display: flex; align-items: center; gap: 6px; margin-top: 3px; color: var(--ink-soft); }
.swatch { width: 14px; height: 10px; border-radius: 2px; border: 1px solid rgba(0, 0, 0, 0.12); flex: 0 0 auto; }
.maplibregl-ctrl-attrib { font-size: 11px !important; background: rgba(255, 255, 255, 0.88) !important; }
.maplibregl-ctrl-attrib a { color: var(--muted) !important; }
.maplibregl-ctrl-scale { border-color: var(--ink-soft) !important; color: var(--ink) !important; background: rgba(255, 255, 255, 0.8) !important; font-family: inherit !important; }
.maplibregl-popup-content {
  font-family: var(--font);
  border-radius: 10px;
  padding: 10px 12px 10px;
  box-shadow: var(--shadow);
  color: var(--ink);
}
.maplibregl-popup-close-button { color: var(--muted); font-size: 18px; right: 4px; top: 2px; }
.maplibregl-popup-anchor-bottom .maplibregl-popup-tip { border-top-color: #fff; }
.popup-title { font-weight: 680; margin: 0 18px 6px 0; }
.popup-table { border-collapse: collapse; font-size: 12.5px; }
.popup-table th { text-align: left; color: var(--muted); font-weight: 550; padding: 2px 10px 2px 0; }
.popup-table td { padding: 2px 0; }

.side-card, .panel-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 14px 8px;
}
.side-card h2, .publish h2, .examples h2 { font-size: 14px; font-weight: 680; margin-bottom: 8px; }
.kv { display: grid; grid-template-columns: 92px 1fr; gap: 7px 10px; font-size: 13px; padding-bottom: 8px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.tech { border-top: 1px solid var(--line); margin: 4px -14px 0; }
.tech summary {
  list-style: none;
  cursor: pointer;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 650;
  display: flex;
  justify-content: space-between;
}
.tech summary::-webkit-details-marker { display: none; }
.tech summary:after { content: "▸"; color: var(--faint); font-size: 11px; }
.tech[open] summary:after { content: "▾"; }
.tech .kv { padding: 0 14px 12px; }
.mono { font-family: var(--mono); font-size: 12px; }

.endpoint {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}
.endpoint .label { font-size: 13px; font-weight: 620; }
.endpoint code {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: transparent;
}
table.meta .endpoint {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 0;
  border: 0;
}
table.meta .endpoint input,
table.meta .endpoint textarea {
  flex: 1 1 220px;
  min-width: 0;
  font-family: var(--mono);
  font-size: 12px;
}
.int-section {
  border-top: 1px solid var(--line);
  background: #fff;
}
.int-section > summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 16px;
  font-size: 15px;
  font-weight: 700;
}
.int-section > summary::-webkit-details-marker { display: none; }
.int-section[open] > summary { border-bottom: 1px solid var(--line); }
.note { color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.example-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

.plain-list { display: flex; flex-direction: column; }
.plain-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) 120px 120px 40px;
  gap: 12px;
  align-items: center;
  padding: 11px 2px;
  border-bottom: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
}
.plain-row:hover { text-decoration: none; }
.plain-row strong { font-weight: 640; }

.empty {
  padding: 36px 16px;
  text-align: center;
  color: var(--muted);
}
.empty h3 { color: var(--ink); font-size: 16px; margin-bottom: 4px; }

.account-layout { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 28px; align-items: start; }
.account-nav { display: flex; flex-direction: column; position: sticky; top: 18px; }
.account-nav a { padding: 7px 10px; border-radius: 8px; color: var(--ink-soft); text-decoration: none; font-weight: 580; }
.account-nav a.active, .account-nav a:hover { background: var(--hover); text-decoration: none; color: var(--ink); }
.account-section { padding: 4px 0 22px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.account-section h2 { font-size: 16px; margin-bottom: 12px; }
.usage-row { display: grid; grid-template-columns: 180px 1fr 160px; gap: 12px; align-items: center; margin: 0 0 12px; font-size: 13.5px; }
.usage-row span { color: var(--muted); }
.split-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { margin: 0 0 12px; }
.field label { display: block; margin-bottom: 4px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.block {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin: 0 0 16px;
  overflow: hidden;
}
.block h2 {
  margin: 0;
  padding: 14px 16px;
  font-size: 15px;
  font-weight: 680;
  letter-spacing: -0.015em;
  line-height: 1.3;
  border-bottom: 1px solid var(--line);
}
.block .pad { padding: 14px 16px 16px; }
.layout-2 {
  display: grid;
  grid-template-columns: minmax(480px, 540px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
table.console { width: 100%; border-collapse: collapse; background: transparent; }
table.console th, table.console td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 450;
  line-height: 1.4;
}
table.console th { color: var(--muted); font-weight: 600; }
table.meta th { width: 132px; }
table.console tr:last-child th, table.console tr:last-child td { border-bottom: 0; }
.map-frame { position: relative; height: 440px; background: #e8eef4; }
.map-frame .map { position: absolute; inset: 0; }
.map-status {
  position: absolute;
  z-index: 2;
  left: 10px;
  top: 10px;
  max-width: calc(100% - 20px);
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.88);
  color: #fff;
  font-size: 12px;
  line-height: 1.35;
}
.map-status.error { background: var(--danger); }
.map-status[hidden] { display: none !important; }
.readout {
  margin: 0 0 8px;
  padding: 10px 12px;
  background: var(--hover);
  color: var(--ink-soft);
  border-radius: 8px;
  font-family: var(--font);
  font-size: 12.5px;
  line-height: 1.45;
  white-space: pre-wrap;
  max-height: 140px;
  overflow: auto;
}
.usage-bar { height: 6px; background: var(--line); border-radius: 99px; margin-top: 10px; overflow: hidden; }
.usage-bar span { display: block; height: 100%; background: var(--accent); }
.layer-toggles { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 0 0 8px; }
.layer-toggles label { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.credential {
  background: #0f172a;
  color: #f8fafc;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 18px;
}
.credential h2 { font-size: 14px; margin-bottom: 4px; }
.credential .note { color: #94a3b8; }
.cred-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 7px 0; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.cred-row span { color: #94a3b8; font-size: 12.5px; }
.cred-row code { color: #fff; font-family: var(--mono); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.credential .icon-btn { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.2); }
.secret-callout { background: var(--warn-soft); border: 1px solid var(--warn-line); border-radius: 10px; padding: 12px; margin-bottom: 12px; }
.secret-callout strong { display: block; margin-bottom: 4px; }
.progress { height: 4px; background: var(--line); border-radius: 99px; margin-top: 6px; }
.progress span { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.status-line { display: flex; flex-direction: column; gap: 2px; }

.analytics-grid { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 22px; align-items: start; }
.query-card { padding-bottom: 14px; }
.query-card h2 { font-size: 15px; font-weight: 680; letter-spacing: -0.015em; margin: 0 0 12px; }
.query-card .btn { width: 100%; }
.query-card .note { margin: 10px 0 2px; }
.query-card [hidden] { display: none !important; }
.bbox-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.results-map { height: 320px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; position: relative; background: #e8eef4; margin-bottom: 14px; }
.results-map[hidden] { display: none !important; }
.results-map .map-canvas { position: absolute; inset: 0; }
.results-map .map-note {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 18px;
  text-align: center;
  color: var(--muted);
  background: rgba(248, 250, 252, 0.94);
}
.results-map .map-note[hidden] { display: none !important; }
.stats { display: flex; flex-wrap: wrap; gap: 16px 28px; margin-bottom: 12px; }
.stats div { min-width: 80px; }
.stats b { display: block; font-size: 16px; font-weight: 650; }
.stats span { color: var(--muted); font-size: 12px; }
.result-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.result-table th, .result-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); font-size: 13px; }
.result-table th { color: var(--muted); font-weight: 630; font-size: 12px; background: var(--bg); }
.result-table tr:last-child td { border-bottom: 0; }
.analytics-empty {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 28px 16px;
  text-align: center;
  color: var(--muted);
}

.menu {
  position: fixed;
  z-index: 40;
  min-width: 196px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 4px;
}
.menu button, .menu a {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 13.5px;
  color: var(--ink);
  text-decoration: none;
}
.menu button:hover, .menu a:hover { background: var(--hover); }
.menu .danger { color: var(--danger); }
.menu .sep { height: 1px; background: var(--line); margin: 4px 0; }

.modal-back {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(15, 23, 42, 0.4);
  display: grid;
  place-items: center;
  padding: 24px;
}
.modal {
  width: min(520px, 100%);
  background: #fff;
  border-radius: 14px;
  padding: 18px 18px 14px;
  box-shadow: var(--shadow);
}
.modal.wide { width: min(760px, 100%); }
.modal h2 { font-size: 18px; letter-spacing: -0.02em; margin-bottom: 8px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.code {
  margin: 10px 0 0;
  max-height: 320px;
  overflow: auto;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 10px;
  padding: 12px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 70;
  background: var(--ink);
  color: #fff;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13.5px;
  box-shadow: var(--shadow);
  max-width: 320px;
}
.toast[hidden] { display: none !important; }

.backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.32); z-index: 25; }

.editor { height: 100%; display: grid; grid-template-rows: 52px minmax(0, 1fr); background: #fff; }
.editor-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px 0 8px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.editor-title { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 650; }
.editor-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.unsaved { color: var(--warn); font-size: 12.5px; font-weight: 650; display: inline-flex; align-items: center; gap: 6px; }
.unsaved[hidden] { display: none !important; }
.unsaved i { width: 7px; height: 7px; border-radius: 50%; background: var(--warn); display: block; }
.editor-bar .spacer { flex: 1; }
.editor-body { display: grid; grid-template-columns: 260px minmax(0, 1fr) 320px; min-height: 0; position: relative; }
.panel {
  min-height: 0;
  overflow: auto;
  background: #fff;
}
.panel-left { border-right: 1px solid var(--line); }
.panel-right { border-left: 1px solid var(--line); }
.editor-map { position: relative; min-width: 0; background: #e8eef4; }
.editor-map .map-canvas { position: absolute; inset: 0; }
.panel-h {
  padding: 14px 14px 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}
.layer-item, .source-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 8px;
  padding: 7px 8px;
  border-radius: 8px;
  border: 1px solid transparent;
}
.layer-item.active, .source-item.active { background: var(--accent-soft); border-color: var(--accent-line); }
.layer-item .name, .source-item .name { min-width: 0; }
.layer-item .name strong, .source-item strong { display: block; font-size: 13px; font-weight: 640; }
.layer-item .name span, .source-item span { color: var(--muted); font-size: 12px; }
.eye, .handle {
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 6px;
  display: grid;
  place-items: center;
  padding: 0;
}
.eye:hover, .handle:hover { background: rgba(0, 0, 0, 0.04); color: var(--ink); }
.eye.off { color: var(--faint); }
.handle { cursor: grab; }
.panel-pad { padding: 4px 12px 16px; }
.disclosure { border-bottom: 1px solid var(--line); }
.disclosure summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.disclosure summary::-webkit-details-marker { display: none; }
.disclosure summary:after { content: ""; width: 7px; height: 7px; border-right: 1.5px solid var(--faint); border-bottom: 1.5px solid var(--faint); transform: rotate(45deg); margin-top: -3px; }
.disclosure[open] summary:after { transform: rotate(225deg); margin-top: 2px; }
.disclosure .body { padding: 0 14px 12px; }
.ctrl { margin: 0 0 10px; }
.ctrl label, .slider-top span:first-child, .color-row span { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.color-row, .num-row { display: grid; grid-template-columns: 1fr 32px 78px; gap: 8px; align-items: center; margin: 0 0 10px; }
.num-row { grid-template-columns: 1fr 88px auto; }
.num-row em { font-style: normal; color: var(--faint); font-size: 12px; }
.hex { height: 30px; font-family: var(--mono); font-size: 12px; }
input[type="color"] {
  -webkit-appearance: none;
  appearance: none;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
}
input[type="color"]::-webkit-color-swatch-wrapper { padding: 3px; }
input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 4px; }
.slider { margin: 0 0 12px; }
.slider-top { display: flex; justify-content: space-between; margin-bottom: 4px; font-size: 12.5px; }
.slider-top b { font-weight: 620; color: var(--ink); }
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 2px;
  border-radius: 99px;
  background: var(--line);
  padding: 0;
  border: 0;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.45);
  cursor: pointer;
}
.switch { display: flex; align-items: center; gap: 8px; font-size: 13px; margin: 0 0 10px; }
.switch input { appearance: none; width: 32px; height: 18px; border-radius: 99px; background: var(--line-strong); position: relative; margin: 0; cursor: pointer; }
.switch input:checked { background: var(--accent); }
.switch input:before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  transition: left 0.12s ease;
}
.switch input:checked:before { left: 16px; }
.palette { display: flex; height: 10px; border-radius: 99px; overflow: hidden; margin: -4px 0 10px; border: 1px solid var(--line); }
.palette i { flex: 1; }
.class-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.class-table th { text-align: left; color: var(--muted); font-weight: 600; padding: 2px; }
.class-table td { padding: 3px 2px; }
.class-table input[type="text"], .class-table input[type="number"] { height: 28px; font-size: 12px; }
.choice {
  display: flex;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 8px;
  cursor: pointer;
}
.choice.on { border-color: var(--accent-line); background: var(--accent-soft); }
.choice input { margin-top: 2px; accent-color: var(--accent); }
.choice strong { display: block; font-size: 13px; }
.choice span { color: var(--muted); font-size: 12px; }
.basemap-list { display: flex; flex-direction: column; gap: 6px; padding: 0 8px 12px; }
.basemap-option {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 8px;
  align-items: center;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 8px;
  padding: 4px;
  text-align: left;
}
.basemap-option.on { border-color: var(--accent-line); background: var(--accent-soft); }
.swatch-map { height: 36px; border-radius: 6px; border: 1px solid var(--line); }
.swatch-map.none { background: var(--line); }
.swatch-map.muted { background: linear-gradient(180deg, var(--line), #d5dbe0); }
.swatch-map.osm { background: #d5e4c8; }
.panel-tools { display: none; gap: 6px; }

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

@media (max-width: 1180px) {
  .detail-grid, .analytics-grid, .account-layout { grid-template-columns: 1fr; }
  .detail-side, .account-nav { position: static; }
  .account-nav { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .usage-strip { grid-template-columns: 1fr 1fr; }
  .usage-row { grid-template-columns: 1fr; gap: 4px; }
}
@media (max-width: 1040px) {
  .editor-body { grid-template-columns: minmax(0, 1fr); }
  .panel-left, .panel-right {
    position: absolute;
    top: 0;
    bottom: 0;
    width: min(320px, 92vw);
    z-index: 6;
    box-shadow: var(--shadow);
  }
  .panel-left { left: 0; transform: translateX(-105%); }
  .panel-right { right: 0; transform: translateX(105%); }
  .panel-left.open, .panel-right.open { transform: none; }
  .panel-tools { display: inline-flex; }
  .list-row, .list-head { grid-template-columns: 72px minmax(0, 1fr) 40px !important; }
  .list-row .hide-sm, .list-head .hide-sm { display: none; }
}
@media (max-width: 992px) {
  html[data-auth] .console-menu { display: inline-grid; }
  html[data-auth] .console-brand { display: inline; }
  .console-bar img.console-brand { height: 22px; }
  .account-name { max-width: 120px; }
}
@media (max-width: 860px) {
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    transform: translateX(-105%);
    transition: transform 0.16s ease;
  }
  .sidebar.open { transform: none; }
  .page, .page.fluid { padding: 18px 16px 48px; }
  .page-head, .detail-head { flex-direction: column; }
  .page-head h1, .detail-head h1 { font-size: 24px; }
  .endpoint { grid-template-columns: 1fr; gap: 4px; }
  .split-2 { grid-template-columns: 1fr; }
  .plain-row { grid-template-columns: 1fr; }
}


/* === Preserved production workspace / editor / thematic styles === */
.service-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0;
  margin: 0 0 16px;
  padding: 0;
  background: transparent !important;
  border: 0 !important;
  border-bottom: 1px solid var(--line) !important;
  box-shadow: none !important;
  height: auto !important;
  line-height: normal !important;
  color: inherit !important;
}
.service-style-workspace > .service-tabs {
  margin: 0;
  padding: 0 16px;
  background: var(--panel) !important;
}
.service-tabs a,
.service-tabs a:link,
.service-tabs a:visited {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 14px;
  margin: 0;
  color: var(--muted) !important;
  text-decoration: none;
  font-weight: 500;
  font-size: 13px;
  background: transparent !important;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  box-shadow: none !important;
  line-height: 1;
}
.service-tabs a:hover {
  color: var(--ink) !important;
  background: transparent !important;
}
.service-tabs a.active,
.service-tabs a[aria-selected="true"] {
  color: var(--accent) !important;
  border-bottom-color: var(--accent);
  background: transparent !important;
  font-weight: 600;
}

/* Style editor fills the content column beside the sidebar. */
body.style-workspace-active .workspace { overflow: hidden; }
body.style-workspace-active .workspace > main,
body.style-workspace-active #main {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
}
.service-style-root {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.service-style-workspace {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}
.style-workspace-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px 0;
  background: var(--panel);
  flex-shrink: 0;
}
.style-workspace-title h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}
.style-workspace-title p {
  margin: 2px 0 8px;
  color: var(--muted);
  font-size: 12px;
}
.style-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.toolbar-left, .toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.toolbar-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}
.btn-compact {
  height: 32px !important;
  line-height: 32px !important;
  padding: 0 12px !important;
  font-size: 13px;
}
.btn-icon-panel {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  border-radius: 2px;
}
.basemap-select {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 13px;
  color: var(--ink);
}
.basemap-select select.browser-default {
  display: inline-block;
  width: auto;
  min-width: 180px;
  max-width: 280px;
  height: 32px;
  margin: 0;
}
.preview-basemap { margin: 0 0 8px; }
.preview-basemap.overlay {
  position: absolute;
  z-index: 3;
  top: 8px;
  left: 8px;
  margin: 0;
  padding: 4px 6px;
  background: rgba(255, 255, 255, 0.94);
  border-radius: 2px;
}
.map .google-maps-credit,
.map-canvas .google-maps-credit,
.style-map .google-maps-credit {
  position: absolute;
  left: 8px;
  bottom: 6px;
  z-index: 2;
  margin: 0;
  max-width: 70%;
  background: rgba(255, 255, 255, 0.9);
  padding: 2px 6px;
}
.basemap-picker { display: flex; gap: 6px; }
.basemap-chip {
  display: flex !important;
  align-items: center;
  gap: 6px;
  height: auto !important;
  padding: 3px 8px 3px 3px !important;
  border: 1px solid var(--line) !important;
  background: #fff !important;
  border-radius: 3px !important;
  cursor: pointer;
  font-size: 12px;
  color: var(--ink) !important;
  text-transform: none !important;
  box-shadow: none !important;
  line-height: 1.2 !important;
}
.basemap-chip:hover, .basemap-chip:focus {
  background: var(--bg) !important;
  color: var(--ink) !important;
}
.basemap-chip.active {
  border-color: var(--accent) !important;
  box-shadow: inset 0 0 0 1px var(--accent) !important;
}
.basemap-preview {
  width: 28px;
  height: 20px;
  border-radius: 2px;
  border: 1px solid var(--line);
  flex-shrink: 0;
}
.basemap-preview-none {
  background: repeating-linear-gradient(-45deg, #f1f5f9, #f1f5f9 4px, var(--line) 4px, var(--line) 8px);
}
.basemap-preview-osm {
  background:
    linear-gradient(180deg, #dce8d4 0 42%, #f5f1e6 42% 100%),
    linear-gradient(90deg, transparent 40%, #c9d6e8 40% 44%, transparent 44%);
  background-color: #e8e4dc;
}

.style-body {
  flex: 1;
  display: flex;
  min-height: 0;
  overflow: hidden;
}
.style-map-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
  background: #dde2e6;
}
.style-map { position: absolute; inset: 0; }
.style-side {
  width: 340px;
  flex-shrink: 0;
  overflow: auto;
  background: var(--panel);
  border-left: 1px solid var(--line);
  padding: 0;
}
.service-style-workspace.panel-collapsed .style-side { display: none; }
.style-panel-reopen {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 5;
}

.style-section {
  border-bottom: 1px solid var(--line);
  margin: 0;
}
.style-section > summary {
  list-style: none;
  cursor: pointer;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
  user-select: none;
  background: var(--bg);
}
.style-section > summary::-webkit-details-marker { display: none; }
.style-section > summary::after {
  content: "▾";
  float: right;
  color: var(--muted);
  font-size: 11px;
}
.style-section:not([open]) > summary::after { content: "▸"; }
.style-section-body { padding: 8px 14px 12px; }
.style-side-footer { padding: 12px 14px 20px; }

.geom-block { margin: 0 0 12px; padding: 0 0 8px; border-bottom: 1px solid var(--line); }
.geom-block:last-child { border-bottom: 0; margin-bottom: 0; }
.geom-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 8px;
  letter-spacing: 0.02em;
}

.ctrl-row {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  margin: 0 0 8px;
}
.ctrl-row > label {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.2;
}
.ctrl-stack { margin: 0 0 8px; }
.ctrl-caption { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.color-swatch { display: flex; align-items: center; gap: 6px; }
.color-swatch input[type="color"] {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #fff;
  cursor: pointer;
}
.hex-input, .ctrl-text, .number-with-unit input, .ctrl-select {
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0 8px;
  font-size: 12px;
  background: #fff;
  color: var(--ink);
  width: 100%;
  box-sizing: border-box;
}
.hex-input { width: 76px; font-family: ui-monospace, Menlo, Consolas, monospace; }
.slider-with-value { display: flex; align-items: center; gap: 8px; min-width: 0; }
.slider-with-value input[type="range"] { flex: 1; min-width: 0; margin: 0; accent-color: var(--accent); }
.ctrl-value {
  min-width: 40px;
  text-align: right;
  font-size: 12px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.number-with-unit { display: flex; align-items: center; gap: 4px; }
.number-with-unit input { width: 72px; }
.number-with-unit .unit { font-size: 11px; color: var(--muted); }
.note.quiet { font-size: 11px; margin-top: 4px; }
.note.quiet code { font-size: 11px; }

/* Toggle. Materialize paints a checkbox onto the span after every checkbox
   (teal tick, and ::after scaled to 0). These selectors outrank that. */
.switch-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  cursor: pointer;
  font-size: 13px;
  color: var(--ink);
  position: relative;
}
.switch-row > input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
  pointer-events: none;
}
.switch-row > input[type="checkbox"] + .switch-ui {
  width: 34px;
  height: 18px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 999px;
  background: var(--line-strong);
  position: relative;
  display: block;
  flex: 0 0 34px;
  line-height: 0;
  font-size: 0;
  overflow: visible;
  cursor: pointer;
  box-sizing: border-box;
  transition: background 0.15s ease;
}
.switch-row > input[type="checkbox"] + .switch-ui::before {
  content: none;
  display: none;
  border: 0;
  width: 0;
  height: 0;
  transform: none;
}
.switch-row > input[type="checkbox"] + .switch-ui::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  margin: 0;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transform: translateX(0);
  z-index: 1;
  transition: transform 0.15s ease;
}
.switch-row > input[type="checkbox"]:checked + .switch-ui {
  background: var(--accent);
}
.switch-row > input[type="checkbox"]:checked + .switch-ui::before {
  content: none;
  display: none;
  border: 0;
  width: 0;
  height: 0;
  transform: none;
}
.switch-row > input[type="checkbox"]:checked + .switch-ui::after {
  content: "";
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  margin: 0;
  border: 0;
  border-radius: 50%;
  background: #fff;
  transform: translateX(16px);
}
.switch-row > input[type="checkbox"]:focus-visible + .switch-ui {
  outline: 2px solid rgba(37, 99, 235, 0.4);
  outline-offset: 2px;
}

.source-layer-list { display: flex; flex-direction: column; gap: 4px; }
.source-layer-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  padding: 7px 10px;
  border-radius: 3px;
  cursor: pointer;
  width: 100%;
}
.source-layer-chip:hover { border-color: var(--line-strong); }
.source-layer-chip.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent);
}
.chip-name { font-size: 13px; font-weight: 500; color: var(--ink); }
.chip-meta { font-size: 11px; color: var(--muted); }
.attr-checks {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 140px;
  overflow: auto;
  border: 1px solid var(--line);
  padding: 6px 8px;
  border-radius: 2px;
  background: var(--bg);
}
.check-compact {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  margin: 0;
  color: var(--ink);
}

/* MapLibre feature popups */
.maplibregl-popup.sc-map-popup .maplibregl-popup-content {
  padding: 0;
  border-radius: 4px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.12);
  border: 1px solid var(--line);
  min-width: 180px;
  max-width: 300px;
  overflow: hidden;
}
.maplibregl-popup.sc-map-popup .maplibregl-popup-close-button {
  font-size: 16px;
  color: var(--muted);
  padding: 4px 8px;
  right: 0;
  top: 0;
}
.feature-popup { font-size: 12px; color: var(--ink); }
.feature-popup .fp-title {
  font-size: 13px;
  font-weight: 600;
  padding: 10px 28px 8px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.feature-popup .fp-attrs {
  margin: 0;
  padding: 4px 0;
  max-height: 220px;
  overflow: auto;
}
.feature-popup .fp-row {
  display: grid;
  grid-template-columns: minmax(72px, 38%) 1fr;
  gap: 8px;
  padding: 5px 12px;
  border-bottom: 1px solid var(--line);
}
.feature-popup .fp-row:last-child { border-bottom: 0; }
.feature-popup .fp-row dt {
  margin: 0;
  color: var(--muted);
  font-weight: 500;
  word-break: break-word;
}
.feature-popup .fp-row dd {
  margin: 0;
  word-break: break-word;
}
.feature-popup .fp-empty { padding: 8px 12px; color: var(--muted); }

@media (max-width: 992px) {
  .service-style-workspace { left: 0; }
  .style-side { width: 300px; }
  .ctrl-row { grid-template-columns: 1fr; gap: 4px; }
}

/* Map Editor Styles */
.map-editor {
  position: fixed;
  top: 52px;
  left: 220px;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.map-title-input {
  flex: 1;
  max-width: 400px;
  font-size: 16px;
  font-weight: 600;
  border: 1px solid transparent;
  padding: 4px 8px;
  background: transparent;
}

.map-title-input:hover, .map-title-input:focus {
  border-color: var(--line);
  background: white;
}

.toolbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.unsaved-badge {
  color: var(--warn);
  font-size: 12px;
  font-weight: 500;
}

.editor-body {
  flex: 1;
  display: flex;
  overflow: hidden;
}

.editor-panel {
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width 0.3s ease, margin 0.3s ease;
}

.left-panel {
  width: 280px;
  flex-shrink: 0;
}

.left-panel.collapsed {
  width: 0;
  min-width: 0;
  border-right: 0;
  overflow: hidden;
}

.right-panel {
  width: 300px;
  flex-shrink: 0;
  border-right: none;
  border-left: 1px solid var(--line);
}

.right-panel.collapsed {
  width: 0;
  min-width: 0;
  border-left: 0;
  overflow: hidden;
}

.panel-reopen {
  position: absolute;
  top: 12px;
  z-index: 5;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  padding: 8px 10px;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.panel-reopen.left { left: 0; border-left: 0; border-radius: 0 2px 2px 0; }
.panel-reopen.right { right: 0; border-right: 0; border-radius: 2px 0 0 2px; }
.panel-reopen:hover { background: var(--accent-soft); }
.panel-reopen[hidden] { display: none !important; }

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.panel-header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.btn-collapse {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}

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

.panel-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.basemap-section, .layers-section {
  margin-bottom: 16px;
}

.basemap-section h4, .layers-section h4 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.editor-map-container {
  flex: 1;
  position: relative;
  overflow: hidden;
}

#editor-map, #preview-map {
  width: 100%;
  height: 100%;
}

.layer-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  margin-bottom: 4px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.2s;
}

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

.layer-item.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.layer-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.layer-name {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
}

.layer-actions {
  display: flex;
  gap: 4px;
}

.btn-icon {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 2px 6px;
  font-size: 14px;
  color: var(--muted);
}

.btn-icon:hover:not(:disabled) {
  color: var(--ink);
}

.btn-icon:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.property-group {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.property-group:last-child {
  border-bottom: none;
}

.property-group h4 {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.map-preview {
  position: fixed;
  top: 52px;
  left: 220px;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.preview-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.preview-toolbar h2 {
  margin: 0;
  font-size: 18px;
  flex: 1;
}

.preview-map-container {
  flex: 1;
  position: relative;
  overflow: hidden;
}

@media (max-width: 992px) {
  #nav-toggle { display: inline-block; }
  .sidebar { transform: translateX(-100%); transition: transform 0.15s ease; }
  .sidebar.open { transform: none; }
  .app-main { margin-left: 0; padding: 16px; }
  .metrics, .layout-2, .split { grid-template-columns: 1fr; }
  .map-frame { height: 320px; }
  .page-head { flex-direction: column; }
  
  .map-editor, .map-preview {
    left: 0;
  }
  
  .left-panel, .right-panel {
    position: absolute;
    top: 0;
    bottom: 0;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  }
  
  .left-panel.collapsed, .right-panel.collapsed {
    width: 0;
    min-width: 0;
    border: 0;
    box-shadow: none;
    overflow: hidden;
  }
}

/* Stage 3B thematic styling */
.style-legend-host {
  position: absolute;
  left: 12px;
  bottom: 36px;
  z-index: 2;
  max-width: min(280px, 46%);
  max-height: 45%;
  overflow: auto;
  pointer-events: none;
}
.legend-panel {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 8px 10px;
  font-size: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  pointer-events: auto;
}
.legend-block + .legend-block { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.legend-title { font-weight: 600; margin-bottom: 6px; color: var(--ink); }
.legend-row { display: flex; align-items: center; gap: 8px; margin: 3px 0; color: var(--ink); }
.legend-swatch {
  width: 14px; height: 14px; border: 1px solid rgba(0,0,0,0.2); flex: 0 0 auto;
}
.legend-ramp {
  width: 72px; height: 12px; border: 1px solid rgba(0,0,0,0.15); flex: 0 0 auto;
}
.legend-symbol {
  display: inline-block; border: 1px solid rgba(0,0,0,0.25); flex: 0 0 auto;
}
.legend-line {
  width: 28px; border-top-style: solid; flex: 0 0 auto;
}
.palette-preview { display: flex; height: 14px; border: 1px solid var(--line); overflow: hidden; flex: 1; }
.palette-stop { flex: 1; min-width: 8px; }
.palette-row { display: flex; align-items: center; gap: 8px; margin: 6px 0 10px; flex-wrap: wrap; }
.category-list, .class-row, .break-row { display: grid; gap: 6px; }
.category-row, .class-row, .break-row {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  gap: 6px;
  align-items: center;
}
.class-row { grid-template-columns: auto 1fr; }
.break-row { grid-template-columns: 70px 1fr; }
.cat-value { font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 90px; }
.basemap-picker { flex-wrap: wrap; max-width: 70vw; }
.basemap-preview-provider { background: linear-gradient(135deg, #d9e2ec, #9fb3c8); }
.basemap-preview-service { background: linear-gradient(135deg, #e8f0e4, #8fbc8f); }


/* Map editor still covers the window. The service style editor stays in the content column. */
body.map-editor-active .sidebar,
body.map-editor-active .console-bar { display: none !important; }
body.map-editor-active .workspace { height: 100%; overflow: hidden; }
.map-editor { position: fixed; inset: 0; z-index: 30; background: #fff; }
html[data-area="login"] .sidebar,
html[data-area="login"] .console-bar { display: none !important; }
html[data-area="login"] .workspace { margin: 0; }
html[data-area="login"] #main { display: flex; min-height: 100vh; }
.demo-link { display: inline-block; margin-top: 14px; margin-right: 12px; }
.notice { position: fixed; right: 16px; bottom: 16px; z-index: 80; background: var(--ink); color: #fff; border-radius: 10px; padding: 10px 14px; max-width: 360px; }
.notice[hidden] { display: none !important; }
.banner { background: var(--warn-soft); border: 1px solid var(--warn-line); border-radius: 10px; padding: 10px 12px; margin-bottom: 14px; font-size: 13px; }
.brand img { height: 36px !important; }
.brand-text strong { font-size: 16px !important; }
.brand-text span { font-size: 12px !important; }
.app-header { display: none !important; }
html[data-area="demo"] .nav-app,
html[data-area="demo"] .nav-admin,
html[data-area="app"] .nav-demo,
html[data-area="app"] .nav-admin,
html[data-area="admin"] .nav-demo,
html[data-area="admin"] .nav-app,
html[data-area="login"] .nav-demo,
html[data-area="login"] .nav-app,
html[data-area="login"] .nav-admin { display: none !important; }
html[data-area="demo"] .nav-demo,
html[data-area="app"] .nav-app,
html[data-area="admin"] .nav-admin { display: flex !important; flex-direction: column; }
.basemap-switcher { position: absolute; z-index: 2; top: 12px; left: 12px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; }
.basemap-section .check { align-items: flex-start; margin: 12px 0 0; }
.basemap-section .check span {
  height: auto;
  min-height: 25px;
  line-height: 1.35;
  padding-top: 3px;
  white-space: normal;
}
#basemap-switcher-list { margin-top: 12px; }
#basemap-switcher-list .note { display: block; margin: 0 0 8px; }
#basemap-switcher-list label { display: block; margin: 4px 0; }
.google-maps-credit { font-size: 12px; margin-top: 6px; }
/* Authentication pages. Scoped so Materialize and the console control
   heights (34px inputs and buttons) cannot restyle the sign-in card. */
html[data-area="login"] body,
html[data-area="login"] .workspace,
html[data-area="login"] #main {
  background: #f1f5f9;
}
html[data-area="login"] #main {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding: 32px 16px;
  box-sizing: border-box;
}
.auth-page {
  width: min(432px, 100%);
  margin: auto;
}
.auth-page[hidden],
.auth-page [hidden] { display: none !important; }
.auth-card {
  width: 100%;
  background: #fff;
  border: 1px solid #e6ebf2;
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
  padding: 32px;
}
.auth-card form { margin: 0; }
.auth-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 0 0 22px;
}
.auth-lockup {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.auth-lockup img { height: 36px; width: auto; display: block; }
.auth-lockup strong {
  font-size: 31px;
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--ink);
}
.auth-brand > span {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.2;
}
.auth-card h1 {
  margin: 0 0 20px;
  font-size: 26px;
  font-weight: 640;
  letter-spacing: -0.02em;
  line-height: 1.2;
  text-align: center;
  color: var(--ink);
}
.auth-card h1:has(+ .auth-sub),
.auth-card h1:has(+ .auth-copy) { margin-bottom: 0; }
.auth-sub,
.auth-copy {
  margin: 6px 0 22px;
  text-align: center;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.45;
}
.auth-copy { color: var(--ink-soft); }
.auth-field { margin: 0 0 14px; }
.auth-field label,
.auth-card .auth-field label {
  display: block;
  position: static;
  margin: 0 0 6px;
  padding: 0;
  height: auto;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  transform: none;
}
.auth-page .auth-card input:not([type="checkbox"]):not([type="radio"]) {
  display: block;
  width: 100%;
  height: 46px;
  margin: 0;
  padding: 0 14px;
  box-sizing: border-box;
  border: 1px solid #d5dde8;
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
  color: var(--ink);
  font-family: inherit;
  font-size: 16px;
  line-height: 1.2;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.auth-page .auth-card input:not([type="checkbox"]):not([type="radio"]):focus {
  border: 1px solid var(--accent);
  border-bottom: 1px solid var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
  background: #fff;
}
.auth-password { position: relative; }
.auth-password input { padding-right: 46px; }
.auth-eye {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #64748b;
  box-shadow: none;
  line-height: 0;
}
.auth-eye:hover { color: var(--ink); background: #f1f5f9; }
.auth-eye .eye-off { display: none; }
.auth-eye.is-revealed .eye-open { display: none; }
.auth-eye.is-revealed .eye-off { display: block; }
.auth-page .auth-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 2px 0 16px;
  padding: 0;
  height: auto;
  color: var(--ink-soft);
  font-size: 13.5px;
  line-height: 1.45;
  cursor: pointer;
}
.auth-page .auth-check input[type="checkbox"] {
  position: static;
  opacity: 1;
  pointer-events: auto;
  appearance: auto;
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  flex: 0 0 auto;
}
.auth-page .auth-check > span {
  position: static;
  display: inline;
  height: auto;
  padding: 0;
  line-height: 1.45;
  font-size: 13.5px;
  color: var(--ink-soft);
}
.auth-page .auth-check > span::before,
.auth-page .auth-check > span::after { content: none; display: none; }
.auth-alert,
.auth-status {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13.5px;
  line-height: 1.45;
  text-align: center;
}
.auth-alert:empty,
.auth-status:empty { display: none; }
.auth-alert {
  color: #b91c1c;
  background: var(--danger-soft);
  border: 1px solid var(--danger-line);
}
.auth-status {
  color: #166534;
  background: var(--ok-soft);
  border: 1px solid #bbf7d0;
}
.auth-page .auth-submit,
.auth-page .auth-outline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 46px;
  margin: 0;
  padding: 0 16px;
  box-sizing: border-box;
  border-radius: 8px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0;
  line-height: 1;
  text-transform: none;
  text-decoration: none;
  box-shadow: none;
  cursor: pointer;
}
.auth-page .auth-submit {
  border: 0;
  background: var(--accent);
  color: #fff;
}
.auth-page .auth-submit:hover { background: var(--accent-hover); color: #fff; text-decoration: none; }
.auth-page .auth-outline {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: var(--ink);
}
.auth-page .auth-outline:hover { background: #f8fafc; color: var(--ink); text-decoration: none; border-color: #94a3b8; }
.auth-switch {
  margin: 16px 0 0;
  text-align: center;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.4;
}
.auth-switch a { font-weight: 650; color: var(--accent); }
.auth-muted {
  margin: 6px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.4;
}
.auth-rule {
  height: 0;
  margin: 18px 0;
  border: 0;
  border-top: 1px solid #e6ebf2;
}
.auth-tagline {
  margin: 18px 0 0;
  text-align: center;
  color: #64748b;
  font-size: 13px;
  line-height: 1.4;
}
.auth-foot {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 8px;
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.4;
}
.auth-foot a { color: #64748b; }
.auth-foot-links { display: inline-flex; gap: 14px; }
@media (max-width: 480px) {
  html[data-area="login"] #main { padding: 20px 12px 16px; }
  .auth-lockup strong { font-size: 30px; }
}

/* Corporate header: public shared-cloud pages only. The navigation itself
   is styled by /shared/acugis-nav.css. */
.acugis-corp { display: none; }
html[data-shared="1"][data-area="login"] .acugis-corp,
html[data-shared="1"][data-area="demo"] .acugis-corp { display: block; }
html[data-shared="1"][data-area="login"],
html[data-shared="1"][data-area="demo"] { overflow-x: hidden; }
html[data-area="app"] .acugis-corp,
html[data-area="admin"] .acugis-corp { display: none !important; }
html[data-shared="1"][data-area="login"] .app {
  height: auto;
  min-height: calc(100vh - 73px);
}
html[data-shared="1"][data-area="login"] #main {
  min-height: calc(100vh - 73px);
  padding-top: 20px;
}
html[data-shared="1"][data-area="demo"],
html[data-shared="1"][data-area="demo"] body {
  height: 100%;
  overflow: hidden;
}
html[data-shared="1"][data-area="demo"] body {
  display: flex;
  flex-direction: column;
}
html[data-shared="1"][data-area="demo"] .acugis-corp { flex: 0 0 auto; }
html[data-shared="1"][data-area="demo"] .app {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
}
@media (max-width: 720px) {
  html[data-shared="1"][data-area="login"] .app,
  html[data-shared="1"][data-area="login"] #main {
    min-height: calc(100vh - 65px);
  }
  html[data-shared="1"][data-area="login"] #main { padding-top: 12px; }
}
