:root {
  color-scheme: dark;
  --bg: #111219;
  --surface: #1b1d27;
  --surface-raised: #242733;
  --surface-soft: #2d3040;
  --border: #3a3e50;
  --border-bright: #555b73;
  --text: #f4f5fb;
  --muted: #aeb3c6;
  --accent: #6f76ff;
  --accent-strong: #858bff;
  --accent-soft: rgba(111, 118, 255, 0.18);
  --danger: #ff6b76;
  --success: #53d69c;
  --warning: #ffd166;
  --radius: 10px;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(133, 139, 255, 0.42);
  outline-offset: 2px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  font-size: 1.25rem;
  line-height: 1.15;
  margin-bottom: 0;
}

h2 {
  font-size: 1.05rem;
  margin-bottom: 0.85rem;
}

.eyebrow,
.step-label {
  color: var(--accent-strong);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.095em;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
}

.muted,
.hint,
.optional {
  color: var(--muted);
}

.compact {
  margin-bottom: 0;
}

.brand-mark {
  align-items: center;
  background: linear-gradient(135deg, #ffffff 0 48%, #ef3340 49% 100%);
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 14px;
  color: #151621;
  display: flex;
  font-size: 1rem;
  font-weight: 900;
  height: 52px;
  justify-content: center;
  margin-bottom: 1.2rem;
  width: 52px;
}

.brand-mark.small {
  border-radius: 9px;
  flex: 0 0 auto;
  font-size: 0.7rem;
  height: 38px;
  margin: 0;
  width: 38px;
}

.button {
  align-items: center;
  background: var(--surface-soft);
  border: 1px solid var(--border-bright);
  border-radius: 7px;
  display: inline-flex;
  font-weight: 750;
  justify-content: center;
  min-height: 40px;
  padding: 0.55rem 0.85rem;
}

.button:hover:not(:disabled) {
  border-color: #777e9d;
  filter: brightness(1.08);
}

.button.primary {
  background: var(--accent);
  border-color: var(--accent-strong);
  color: #fff;
}

.button.secondary {
  background: var(--accent-soft);
  border-color: rgba(133, 139, 255, 0.6);
}

.button.quiet {
  background: transparent;
}

.button.danger {
  color: #ff9aa2;
}

.button:disabled,
.segment:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.button.full {
  width: 100%;
}

.proposal-actions {
  display: grid;
  gap: 0.55rem;
}

.submission-trap {
  height: 1px;
  left: -10000px;
  overflow: hidden;
  position: absolute;
  top: auto;
  width: 1px;
}

.turnstile-container {
  margin-top: 0.85rem;
  min-height: 1px;
}

.anti-spam-status {
  color: var(--muted);
  font-size: 0.76rem;
  margin: 0.45rem 0 0;
}

.anti-spam-status.error {
  color: #ff9aa2;
}

.anti-spam-status.success {
  color: var(--success);
}

.inline-retry {
  background: transparent;
  border: 0;
  color: #bec1ff;
  font-size: 0.76rem;
  font-weight: 800;
  margin: 0.2rem 0 0;
  padding: 0;
  text-decoration: underline;
}

.inline-retry[hidden] {
  display: none;
}

.submission-result {
  font-size: 0.82rem;
  margin: 0 0 0.8rem;
}

.submission-result:empty {
  display: none;
}

.submission-result a {
  color: #bec1ff;
  font-weight: 800;
}

.button[aria-busy="true"] {
  cursor: wait;
}

label {
  display: block;
  font-size: 0.82rem;
  font-weight: 750;
  margin: 0.85rem 0 0.35rem;
}

input,
select,
textarea {
  background: #151720;
  border: 1px solid var(--border);
  border-radius: 7px;
  min-height: 42px;
  padding: 0.6rem 0.7rem;
  width: 100%;
}

textarea {
  min-height: 78px;
  resize: vertical;
}

.editor-page {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  overflow: hidden;
}

.app-header {
  align-items: center;
  background: rgba(27, 29, 39, 0.98);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex: 0 0 64px;
  justify-content: space-between;
  padding: 0 1rem;
  position: relative;
  z-index: 1001;
}

.brand-lockup,
.account,
.panel-title-row,
.button-row {
  align-items: center;
  display: flex;
}

.brand-lockup {
  gap: 0.7rem;
}

.account {
  color: var(--muted);
  gap: 0.8rem;
  font-size: 0.82rem;
}

.editor-layout {
  display: grid;
  flex: 1 1 auto;
  grid-template-columns: minmax(320px, 390px) minmax(0, 1fr);
  min-height: 0;
}

.editor-sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 1rem;
}

.panel {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.8rem;
  padding: 1rem;
}

.intro-panel {
  background: linear-gradient(135deg, rgba(111, 118, 255, 0.12), rgba(36, 39, 51, 0.7));
}

.panel-title-row {
  justify-content: space-between;
}

.panel-title-row h2 {
  margin-bottom: 0;
}

.status-line,
.hint {
  font-size: 0.78rem;
  margin: 0.6rem 0 0;
}

.status-line.error,
.validation-message.error {
  color: #ff9aa2;
}

.status-line.success,
.validation-message.success {
  color: var(--success);
}

.shared-area-note {
  display: grid;
  gap: 0.18rem;
  margin-top: 0.75rem;
  padding: 0.7rem;
  border: 1px solid rgba(133, 139, 255, 0.42);
  border-radius: 8px;
  background: var(--accent-soft);
}

.shared-area-note strong {
  font-size: 0.8rem;
}

.shared-area-note span,
.shared-area-note a {
  color: var(--muted);
  font-size: 0.76rem;
}

.shared-area-note a {
  color: #bec1ff;
  font-weight: 750;
}

.segmented {
  background: #151720;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 0.9rem;
  padding: 3px;
}

.segment {
  background: transparent;
  border: 0;
  border-radius: 5px;
  color: var(--muted);
  font-weight: 750;
  min-height: 35px;
}

.segment.active {
  background: var(--surface-soft);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  color: var(--text);
}

.details-list {
  margin: 0 0 0.9rem;
}

.details-list div {
  border-bottom: 1px solid rgba(85, 91, 115, 0.45);
  display: grid;
  gap: 0.5rem;
  grid-template-columns: 7.2rem 1fr;
  padding: 0.5rem 0;
}

.details-list dt {
  color: var(--muted);
  font-size: 0.76rem;
}

.details-list dd {
  font-size: 0.8rem;
  font-weight: 700;
  margin: 0;
  overflow-wrap: anywhere;
  text-align: right;
}

.count-badge {
  background: var(--accent-soft);
  border: 1px solid rgba(133, 139, 255, 0.35);
  border-radius: 999px;
  color: #c5c8ff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.22rem 0.55rem;
}

.button-row {
  gap: 0.45rem;
  margin-top: 0.9rem;
}

.button-row .button {
  flex: 1 1 auto;
}

.optional {
  font-size: 0.72rem;
  font-weight: 500;
}

.validation-message {
  font-size: 0.79rem;
  min-height: 1.4em;
  margin: 0.8rem 0;
}

.map-shell {
  background: #151820;
  min-height: 0;
  position: relative;
}

#editor-map {
  height: 100%;
  min-height: 440px;
  width: 100%;
}

.map-toolbar {
  align-items: center;
  background: rgba(27, 29, 39, 0.94);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.24);
  display: flex;
  justify-content: space-between;
  left: 56px;
  padding: 0.6rem 0.8rem;
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 800;
}

#map-heading {
  font-weight: 800;
}

.map-help {
  color: var(--muted);
  font-size: 0.74rem;
}

.map-legend {
  align-items: center;
  background: rgba(27, 29, 39, 0.94);
  border: 1px solid var(--border);
  border-radius: 8px;
  bottom: 24px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.24);
  color: var(--muted);
  display: flex;
  font-size: 0.72rem;
  gap: 0.9rem;
  left: 12px;
  padding: 0.45rem 0.65rem;
  position: absolute;
  z-index: 800;
}

.map-legend span {
  align-items: center;
  display: flex;
  gap: 0.35rem;
}

.legend-swatch {
  background: rgba(111, 118, 255, 0.42);
  border: 1px solid #858bff;
  display: inline-block;
  height: 12px;
  width: 18px;
}

.legend-swatch.changed {
  background: rgba(255, 209, 102, 0.25);
  border: 2px solid var(--warning);
}

.leaflet-container {
  background: #171b23;
  font-family: inherit;
}

.leaflet-bar a,
.leaflet-bar a:hover {
  background: var(--surface-raised);
  border-bottom-color: var(--border);
  color: var(--text);
}

.leaflet-control-attribution {
  background: rgba(27, 29, 39, 0.86) !important;
  color: var(--muted);
}

.leaflet-control-attribution a {
  color: #bec1ff;
}

.leaflet-tooltip.mcc-cell-tooltip {
  background: var(--surface-raised);
  border: 1px solid var(--border-bright);
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 0.75rem;
}

.leaflet-tooltip-top.mcc-cell-tooltip::before {
  border-top-color: var(--border-bright);
}

@media (max-width: 860px) {
  .editor-page {
    overflow: auto;
  }

  .app-header {
    min-height: 64px;
  }

  .account span {
    display: none;
  }

  .editor-layout {
    display: flex;
    flex-direction: column;
  }

  .editor-sidebar {
    border-bottom: 1px solid var(--border);
    border-right: 0;
    max-height: none;
    overflow: visible;
  }

  .map-shell,
  #editor-map {
    height: 70vh;
    min-height: 520px;
  }

  .map-help {
    display: none;
  }
}

@media (max-width: 480px) {
  .app-header {
    padding: 0 0.7rem;
  }

  .brand-lockup h1 {
    font-size: 1rem;
  }

  .editor-sidebar {
    padding: 0.7rem;
  }
}

.new-region-fields {
  border-left: 3px solid var(--accent);
  margin-top: 0.75rem;
  padding-left: 0.75rem;
}

.new-region-fields[hidden],
.anchor-button[hidden],
#anchor-status[hidden] {
  display: none;
}

.anchor-button {
  margin-top: 0.55rem;
}

.skip-link {
  background: var(--text);
  border-radius: 0 0 7px 0;
  color: var(--bg);
  font-weight: 800;
  left: 0;
  padding: 0.65rem 0.85rem;
  position: fixed;
  top: -5rem;
  z-index: 2000;
}

.skip-link:focus {
  top: 0;
}

.utility-nav {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.utility-nav a,
.intro-panel a {
  color: #c5c8ff;
  font-weight: 750;
}


.utility-nav .language-link {
  border: 1px solid var(--border-bright);
  border-radius: 999px;
  padding: 0.25rem 0.55rem;
  text-decoration: none;
}

.utility-nav .language-link[aria-current="page"] {
  background: var(--accent-soft);
  border-color: var(--accent-strong);
  color: var(--text);
}

.utility-nav__divider {
  border-left: 1px solid var(--border-bright);
  height: 1.4rem;
}

.lifecycle-list {
  display: grid;
  font-size: 0.78rem;
  gap: 0.2rem;
  grid-template-columns: 1fr 1fr;
  margin: 0.75rem 0;
  padding-left: 1.2rem;
}

.proposal-type-options {
  border: 0;
  display: grid;
  gap: 0.65rem;
  margin: 0;
  padding: 0;
}

.choice-card {
  align-items: flex-start;
  background: #151720;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  gap: 0.65rem;
  margin: 0;
  padding: 0.75rem;
}

.choice-card:has(input:checked) {
  background: var(--accent-soft);
  border-color: var(--accent-strong);
}

.choice-card input,
.acknowledgement input {
  flex: 0 0 auto;
  margin: 0.18rem 0 0;
  min-height: auto;
  width: auto;
}

.choice-card span,
.choice-card small {
  display: block;
}

.choice-card small {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 500;
  margin-top: 0.2rem;
}

.advanced-choice strong {
  color: #d7d9ff;
}

.panel[aria-disabled="true"] {
  opacity: 0.64;
}

.draft-status,
.field-message {
  color: var(--muted);
  font-size: 0.76rem;
  margin: 0.45rem 0 0;
}

.draft-status.saved,
.field-message.success {
  color: var(--success);
}

.draft-status.error,
.field-message.error {
  color: #ff9aa2;
}

.field-message:empty,
.changes-table-note:empty {
  display: none;
}

.suggestion-row {
  align-items: center;
  background: rgba(111, 118, 255, 0.1);
  border-radius: 7px;
  display: flex;
  font-size: 0.76rem;
  justify-content: space-between;
  margin-top: 0.5rem;
  padding: 0.55rem;
}

.suggestion-row[hidden],
#anchor-controls[hidden] {
  display: none;
}

.hierarchy-card,
.readiness-card,
.text-summary {
  background: #151720;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-top: 0.85rem;
  padding: 0.75rem;
}

.hierarchy-card p,
.text-summary p {
  font-size: 0.78rem;
  margin: 0.35rem 0 0;
}

.hierarchy-path {
  color: #d7d9ff;
  font-weight: 750;
}

.geography-list {
  border-top: 1px solid var(--border);
  margin-top: 0.9rem;
  padding-top: 0.25rem;
}

.geography-list .button {
  margin-top: 0.55rem;
}

.advanced-map-controls {
  border-top: 1px solid var(--border);
  margin-top: 0.85rem;
  padding-top: 0.75rem;
}

.advanced-map-controls summary {
  color: #d7d9ff;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 800;
}

.acknowledgement {
  align-items: flex-start;
  display: flex;
  font-size: 0.76rem;
  gap: 0.55rem;
}

.segmented.three-way {
  grid-template-columns: repeat(3, 1fr);
}

.text-summary h3,
.readiness-card h3 {
  font-size: 0.88rem;
  margin: 0;
}

.summary-list {
  display: grid;
  gap: 0.35rem;
  margin: 0.55rem 0 0;
  padding-left: 1rem;
}

.changes-table-shell {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-top: 0.7rem;
  max-height: 20rem;
  overflow: auto;
}

.changes-table {
  border-collapse: collapse;
  font-size: 0.73rem;
  width: 100%;
}

.changes-table caption {
  color: var(--muted);
  padding: 0.55rem;
  text-align: left;
}

.changes-table th,
.changes-table td {
  border-top: 1px solid var(--border);
  padding: 0.55rem;
  text-align: left;
  vertical-align: top;
}

.changes-table th {
  background: var(--surface-soft);
  position: sticky;
  top: 0;
}

.table-action {
  background: transparent;
  border: 0;
  color: #ff9aa2;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0;
  text-decoration: underline;
}

.readiness-list {
  display: grid;
  font-size: 0.77rem;
  gap: 0.3rem;
  list-style: none;
  margin: 0.55rem 0 0;
  padding: 0;
}

.readiness-list li::before {
  color: var(--muted);
  content: "○";
  display: inline-block;
  margin-right: 0.45rem;
}

.readiness-list li.ready {
  color: var(--success);
}

.readiness-list li.ready::before {
  content: "✓";
}

.dialog-backdrop {
  align-items: center;
  background: rgba(8, 9, 14, 0.76);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 1rem;
  position: fixed;
  z-index: 3000;
}

.dialog-backdrop[hidden] {
  display: none;
}

.discard-dialog {
  background: var(--surface-raised);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-width: 32rem;
  padding: 1.1rem;
  width: 100%;
}

.dialog-actions {
  display: flex;
  gap: 0.65rem;
  justify-content: flex-end;
}

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

@media (max-width: 680px) {
  .utility-nav {
    gap: 0.5rem;
  }

  .utility-nav a {
    font-size: 0.72rem;
  }

  .lifecycle-list {
    grid-template-columns: 1fr;
  }

  .changes-table {
    min-width: 36rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* End editor-only styles. */
