/* Shared visual system for the map, sign-in and account screens. */
:root {
  color-scheme: dark;
  --bg: #151618;
  --panel: #202225;
  --panel-2: #292c30;
  --line: #383c41;
  --text: #f1f2f3;
  --muted: #a5abb2;
  --amber: #d9dee5;
  --amber-soft: rgba(217,222,229,.1);
  --ui-panel: rgba(16,31,44,.96);
  --ui-panel-strong: #202225;
  --ui-border: #3b4047;
  --ui-border-soft: rgba(159,188,208,.18);
  --ui-text: #f1f2f3;
  --ui-muted: #a5abb2;
  --ui-accent: #596879;
  --ui-accent-soft: rgba(217,222,229,.1);
  --ui-hover: rgba(159,188,208,.09);
  --ui-blur: blur(18px);
}
[hidden] { display: none !important; }
button, input, select, textarea { font-family: "Segoe UI", Arial, sans-serif; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid #d9dee5;
  outline-offset: 3px;
}
button:disabled { cursor: wait; }
.auth-page, .admin-page {
  background: #151618;
  font-size: 16px;
}
.auth-grid {
  width: min(100%, 1060px);
  grid-template-columns: 1.12fr 1fr;
  border-color: #383c41;
  border-radius: 18px;
  background: #202225;
  box-shadow: 0 24px 70px #0003;
}
.auth-visual {
  min-height: 600px;
  padding: 48px;
  background: #1b1d20;
}
.auth-visual::before { width: 370px; height: 370px; right: -130px; top: 90px; border-color: #ffffff0b; }
.auth-visual::after { width: 240px; height: 240px; right: -65px; top: 155px; border-color: #ffffff0b; }
.brand-kicker { color: #d9dee5; letter-spacing: .14em; font-size: 12px; }
.brand-name { margin-top: 24px; font-size: 64px; font-weight: 650; letter-spacing: -.06em; }
.brand-name span { color: #a5abb2; font-size: 13px; letter-spacing: .12em; }
.visual-copy { left: 48px; right: 42px; bottom: 48px; }
.visual-copy strong { font-size: 32px; font-weight: 500; letter-spacing: -.035em; line-height: 1.25; }
.visual-copy p { max-width: 300px; font-size: 16px; color: #a5abb2; }
.auth-card { padding: 48px; }
.section-kicker { color: #d9dee5; font-size: 12px; letter-spacing: .12em; }
.auth-card h1 { font-size: 32px; line-height: 1.15; margin: 14px 0 18px; }
.lead { font-size: 16px; color: #a5abb2; margin-bottom: 32px; }
.field span, .check-row, .panel-note { font-size: 14px; }
.field input, .field textarea { background: #191b1e; border-color: #3b4047; border-radius: 12px; padding: 15px; }
#code { min-height: 60px; font-size: 22px; letter-spacing: .12em; }
#code::placeholder { font-size: 16px; letter-spacing: 0; color: #8d949e; }
.primary { min-height: 48px; color: #202225; background: #d9dee5; border-radius: 12px; }
.primary:hover { background: #ffffff; }
.secondary { min-height: 40px; background: #292c30; border-color: #3b4047; }
.auth-hint { color: #a5abb2; font-size: 13px; line-height: 1.7; border-color: #383c41; }
.message { font-size: 14px; }
.language-switch { background: #25282c; border-color: #3b4047; border-radius: 10px; min-height: 38px; }
.admin-header { background: #1b1d20ee; border-color: #3b4047; }
.admin-header a { display: inline-flex; align-items: center; text-decoration: none; }
.panel { border-radius: 18px; }
.panel h2 { font-size: 20px; }
.admin-card { border-radius: 12px; }
.meta { font-size: 13px; }

/* Map chrome. Geographic data and map interactions are unchanged. */
body > .workspace-bar, body > .account-panel, body > .place-search { visibility: hidden; }
.map-loading { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 5; padding: 14px 20px; color: #a5abb2; background: #202225; border: 1px solid #383c41; border-radius: 10px; font-size: 14px; pointer-events: none; }
body.map-ready .map-loading { display: none; }
.map-brand {
  position: fixed; top: 16px; left: 16px; z-index: 25;
  display: flex; gap: 10px; align-items: center;
  height: 40px; box-sizing: border-box; padding: 0 14px;
  color: #f1f2f3; background: #202225f5;
  border: 1px solid #3b4047; border-radius: 12px;
  box-shadow: 0 4px 16px #0003; pointer-events: none;
}
.brand-symbol { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: #e4e7eb; color: #202225; font-size: 21px; font-weight: 750; }
.map-brand strong { display: block; font-size: 15px; letter-spacing: .09em; }
.map-brand > span:not(.map-brand-divider) { color: #a5abb2; font-size: 13px; }
.map-brand-divider { height: 16px; width: 1px; background: #ffffff25; }
.map-menu-button { position: fixed; top: 16px; right: 16px; z-index: 37; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; color: #e4e7eb; background: #202225f5; border: 1px solid #3b4047; border-radius: 10px; cursor: pointer; font-size: 14px; }
.map-menu-button svg { width: 18px; height: 18px; }
.map-menu-button:hover, .map-menu-button.active { background: #30343a; }
.map-brand div > span { display: block; margin-top: 3px; font-size: 12px; color: #a5abb2; }
.bottom-dock { padding: 6px; bottom: 16px; gap: 2px; background: #202225f5; border-color: #3b4047; border-radius: 14px; box-shadow: 0 8px 28px #0004; }
.dock-button { width: 66px; height: 56px; gap: 6px; border-radius: 9px; color: #a5abb2; }
.dock-button svg { width: 21px; height: 21px; }
.dock-button span { font-size: 12px; letter-spacing: 0; }
.dock-button.active { color: #f1f2f3; background: #ffffff10; border-color: #ffffff22; }
.dock-button:hover { color: #f1f2f3; background: #a5abb215; }
.system-popover, .layer-popover, .editor-toolbar, .workspace-panel, .marker-quick-panel { background: #202225f5; border-color: #3b4047; border-radius: 12px; box-shadow: 0 10px 32px #0004; }
.system-popover, .layer-popover { bottom: 102px; max-height: calc(100dvh - 126px); overflow-y: auto; box-sizing: border-box; }
.system-popover { top: 68px; right: 16px; left: auto; bottom: auto; padding: 14px 16px; width: min(420px, calc(100vw - 32px)); transform: translateY(-8px); }
.system-popover.open { transform: translateY(0); }
.system-popover-header, .layer-popover-header { font-size: 14px; height: 42px; color: #f1f2f3; letter-spacing: .03em; }
.system-section-title, .toolbar-section-title { font-size: 12px; color: #a5abb2; letter-spacing: .06em; }
.system-popover .workspace-button, .system-popover #account-name, .layer-action, .tool-button[data-label] { font-size: 14px; }
.system-popover .workspace-button { height: 44px; }
.system-popover .account-panel a, .system-popover .account-panel button, .system-popover .account-panel select { height: 40px; font-size: 13px; }
.layer-popover { width: min(360px, calc(100vw - 32px)); padding: 12px 16px; }
.layer-popover p { font-size: 13px; line-height: 1.6; margin-top: 12px; }
.toolbar-header { background: #202225; }
.toolbar-heading { font-size: 14px; color: #f1f2f3; letter-spacing: .04em; }
.editor-toolbar { bottom: 102px; max-width: calc(100vw - 32px); }
.editor-toolbar[data-panel="route"] { top: 108px; max-height: calc(100dvh - 216px); }
.editor-toolbar[data-panel="marker"] { width: 420px; }
.editor-toolbar[data-panel="text"] { top: 80px; right: 16px; left: auto; bottom: auto; width: 320px; max-height: calc(100dvh - 184px); transform: translateX(12px); }
body.toolbar-open .editor-toolbar[data-panel="text"] { transform: translateX(0); }
.editor-panel-help { margin: 12px 2px; color: #a5abb2; font-size: 13px; line-height: 1.6; }
.text-details { gap: 12px; padding: 8px 2px 14px; }
.editor-toolbar[data-panel="text"]:has(.text-details.visible) .editor-panel-help { display: none; }
.text-details .placement-control { grid-template-columns: 58px 1fr 28px; gap: 8px; font-size: 14px; }
.text-property { display: grid; gap: 8px; color: #c7ccd2; font-size: 14px; }
.text-property textarea { width: 100%; box-sizing: border-box; min-height: 88px; padding: 12px; resize: vertical; color: #eef0f3; background: #191b1e; border: 1px solid #3b4047; border-radius: 8px; font: 16px/1.5 "Segoe UI",Arial,sans-serif; }
.text-color-property { display: flex; align-items: center; justify-content: space-between; }
.text-color-property input { width: 64px; height: 36px; padding: 3px; border: 1px solid #3b4047; border-radius: 6px; background: #191b1e; cursor: pointer; }
.marker-quick-panel { top: 90px; left: 16px; width: 230px; padding: 12px; }
.marker-quick-header { font-size: 12px; letter-spacing: .04em; height: 32px; }
.marker-quick-header button { width: 32px; height: 32px; }
.marker-quick-icon { height: 40px; font-size: 14px; }
.marker-quick-hint { font-size: 12px; line-height: 1.7; }
.marker-quick-actions button { font-size: 14px; height: 38px; }
.marker-quick-colors { min-height: 36px; gap: 10px; }
.marker-quick-colors button { width: 22px; height: 22px; }
.icon-category-title { font-size: 12px; color: #a5abb2; }
.icon-library-search, .place-search input, .place-search button { font-size: 14px; }
.editor-toolbar { overflow-x: hidden; }
.editor-toolbar > * { flex-shrink: 0; min-width: 0; }
.editor-toolbar[data-panel] .icon-library {
  flex: 0 0 auto;
  width: 100%; min-width: 0; max-height: min(300px, 40dvh);
  box-sizing: border-box; padding: 10px; overflow-x: hidden; overflow-y: auto;
  scrollbar-gutter: stable; background: #191c20; isolation: isolate;
}
.editor-toolbar[data-panel] .icon-library-search {
  position: sticky; top: 0; z-index: 3; display: block;
  width: 100%; height: 40px; margin: 0 0 12px; padding: 0 10px;
  color: #eef0f3; background: #25292e; border: 1px solid #444c57;
  border-radius: 8px; box-shadow: 0 0 0 10px #191c20;
}
.editor-toolbar[data-panel] .icon-category-grid {
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px;
  min-width: 0;
}
.editor-toolbar[data-panel] .icon-library .marker-button {
  width: 100%; height: 44px; min-width: 0; padding: 8px;
  box-sizing: border-box; border: 1px solid #3b424b; border-radius: 8px;
  background: #22262b;
}
.editor-toolbar[data-panel] .icon-library .marker-button img {
  display: block; width: 26px; height: 26px; max-width: 100%; object-fit: contain;
}
.editor-toolbar[data-panel] .icon-library .marker-button:hover { background: #343c45; }
.editor-toolbar[data-panel] .icon-library .marker-button.active {
  background: #3b4a5b; border-color: #99b3cf; box-shadow: inset 0 0 0 1px #99b3cf;
}
.system-popover .place-search-form { background: #191b1e; padding: 6px; border-radius: 10px; }
.editor-status { bottom: 110px; font-size: 14px; background: #202225; border-color: #3b4047; }
.map-legend { top: 68px; right: 16px; bottom: auto; left: auto; max-width: min(310px, calc(100vw - 32px)); border-radius: 10px; padding: 10px 12px; font-size: 12px; background: #202225de; color: #b8bfc7; line-height: 1.4; }
body:has(.system-popover.open) .map-legend { visibility: hidden; }
.integration-card, .area-dialog-panel, .export-panel { border-radius: 18px; padding: 24px; }
.integration-card h2, .export-panel h2 { font-size: 22px; }
.integration-card p, .export-panel-note { font-size: 14px; line-height: 1.6; }
.integration-actions button, .export-actions button { min-height: 44px; font-size: 14px; border-radius: 10px; }
@media (max-width: 840px) {
  .auth-grid { max-width: 480px; grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .auth-card { padding: 40px 32px; }
  .map-legend { top: auto; right: auto; left: 16px; bottom: 100px; max-width: calc(100vw - 56px); }
}
@media (max-width: 600px) {
  .auth-page { padding: 72px 16px 24px; }
  .auth-card { padding: 32px 24px; }
  .auth-card h1 { font-size: 28px; }
  .auth-grid { border-radius: 22px; }
  .map-brand { top: 12px; left: 12px; padding: 0 12px; border-radius: 10px; }
  .map-menu-button { top: 12px; right: 12px; }
  .brand-symbol { width: 34px; height: 34px; font-size: 21px; border-radius: 9px; }
  .map-brand div > span { font-size: 11px; }
  .bottom-dock { display: grid; grid-template-columns: repeat(4, 1fr); width: calc(100vw - 24px); box-sizing: border-box; bottom: max(12px, env(safe-area-inset-bottom)); padding: 5px; gap: 2px; border-radius: 14px; }
  .dock-button { min-width: 0; width: auto; height: 50px; border-radius: 8px; gap: 4px; }
  .dock-button span { font-size: 12px; }
  .dock-button svg { width: 19px; height: 19px; }
  .system-popover, .layer-popover { bottom: 138px; max-height: calc(100dvh - 220px); }
  .system-popover { top: 64px; right: 12px; bottom: auto; max-height: calc(100dvh - 204px); width: calc(100vw - 24px); }
  .editor-toolbar, .editor-toolbar[data-panel="route"], .editor-toolbar[data-panel="marker"], .editor-toolbar[data-panel="text"] { top: auto; left: 50%; right: auto; bottom: 138px; width: calc(100vw - 24px); max-width: 420px; max-height: calc(100dvh - 220px); transform: translate(-50%, 12px); }
  body.toolbar-open .editor-toolbar, body.toolbar-open .editor-toolbar[data-panel="route"], body.toolbar-open .editor-toolbar[data-panel="text"] { transform: translate(-50%, 0); }
  .map-legend { left: 12px; bottom: 138px; max-width: calc(100vw - 52px); }
  body:has(.system-popover.open) .map-legend, body:has(.layer-popover.open) .map-legend, body.toolbar-open .map-legend { visibility: hidden; }
  .marker-quick-panel { top: 86px; left: 12px; width: min(250px, calc(100vw - 50px)); max-height: calc(100dvh - 250px); overflow: auto; }
  .editor-status { bottom: 142px; }
  .admin-header { padding: 12px 16px; flex-wrap: wrap; gap: 12px; }
  .header-actions { flex-wrap: wrap; }
  .ban-form { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
