:root {
  --ink: #241f1c;
  --ink-2: #3a342f;
  --muted: #7a7169;
  --stone: #e4ddd4;
  --mist: #f2eee8;
  --paper: #fbf9f6;
  --brand: #e25b2a;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-md: 0.95rem;

  --radius: 8px;
  --radius-sm: 6px;
  --radius-xs: 4px;
  --radius-full: 9999px;

  --panel-border: 1px solid var(--stone);
  --shadow: 0 1px 2px rgba(36, 31, 28, 0.08), 0 4px 12px rgba(36, 31, 28, 0.08);
  --shadow-pop: 0 8px 24px rgba(36, 31, 28, 0.16);

  --paper-20: rgba(251, 249, 246, 0.2);
  --paper-30: rgba(251, 249, 246, 0.3);
  --paper-70: rgba(251, 249, 246, 0.7);
  --paper-veil: rgba(251, 249, 246, 0.82);
  --ink-wash: rgba(36, 31, 28, 0.045);

  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --ease-default: cubic-bezier(0.4, 0, 0.2, 1);

  /* Hazard colours used by the analysis chart. */
  --peril-lethal-heat: #b34947;
  --peril-daytime: #d16532;
  --peril-wildfire: #b83c32;
  --peril-drought: #8e3f46;
  --peril-rain: #06548b;
  --benefit-forest: #3b7d3e;
  --benefit-carbon: #4e5a2b;
  --benefit-biodiversity: #23799c;
}

* { box-sizing: border-box; }

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

body {
  background-color: var(--paper);
  color: var(--ink);
  font-family: "Source Sans 3", system-ui, sans-serif;
  display: flex;
  flex-direction: column;
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.hidden { display: none !important; }

.app-header {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  height: 60px;
  padding: 0 1.25rem 0 1.1rem;
  background: var(--ink);
  color: var(--paper);
  box-shadow: inset 0 -1px 0 rgba(251, 249, 246, 0.08);
  flex-shrink: 0;
}

.app-header-brand {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  min-width: 0;
}

.app-header-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
  border-radius: var(--radius-xs);
  transition: opacity var(--duration-fast) var(--ease-default);
}

.app-header-logo:hover {
  opacity: 0.85;
}

/* COICA and EDF logos are full-colour artwork on white, so they sit on a white plate. */
.app-header-plate {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  height: 46px;
  padding: 0 0.7rem;
  border-radius: var(--radius-sm);
  background: #fff;
  transition: opacity var(--duration-fast) var(--ease-default);
}

.app-header-plate--edf {
  height: 38px;
  padding: 0 0.55rem;
}

.app-header-plate:hover {
  opacity: 0.85;
}

.app-header-plate img {
  display: block;
  height: auto;
}

.app-header-coica { width: 98px; }
.app-header-edf { width: 87px; }

.app-header-end {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-shrink: 0;
}

.app-header-partners {
  display: flex;
  align-items: center;
  gap: 1.1rem;
}

.app-header-mark {
  display: block;
  width: 26px;
  height: auto;
}

.app-header-wordmark {
  display: block;
  width: 130px;
  height: auto;
}

.app-header-divider {
  flex-shrink: 0;
  width: 1px;
  height: 1.5rem;
  background: var(--paper-20);
}

.app-header-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  margin: 0;
  min-width: 0;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.005em;
  text-wrap: balance;
  overflow: hidden;
}

.lang-menu {
  position: relative;
  flex-shrink: 0;
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0.4rem 0.6rem 0.4rem 0.7rem;
  border: 1px solid var(--paper-20);
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--paper);
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-default), border-color var(--duration-fast) var(--ease-default);
}

.lang-switch:hover,
.lang-switch.is-open {
  border-color: var(--paper-30);
  background: rgba(251, 249, 246, 0.08);
}

.lang-icon {
  width: 15px;
  height: 15px;
  color: var(--paper-70);
}

.lang-chevron {
  width: 14px;
  height: 14px;
  color: var(--paper-70);
  transition: transform var(--duration-fast) var(--ease-default);
}

.lang-switch.is-open .lang-chevron {
  transform: rotate(180deg);
}

.lang-list {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  width: max-content;
  margin: 0;
  padding: 0.3rem;
  list-style: none;
  border: var(--panel-border);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow-pop);
}

.lang-option {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.45rem 0.65rem;
  white-space: nowrap;
  border: 0;
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}

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

.lang-option.is-active {
  font-weight: 600;
}

.lang-option[aria-disabled="true"] {
  color: var(--muted);
  cursor: default;
}

.lang-option[aria-disabled="true"]:hover {
  background: transparent;
}

.lang-soon {
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-full);
  background: var(--mist);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
}

@media (max-width: 720px) {
  .app-header-wordmark,
  .app-header-divider,
  .app-header-plate--edf {
    display: none;
  }
}

.assess-layout {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.assess-map-area {
  flex: 1;
  position: relative;
  min-width: 0;
}

.assess-map {
  width: 100%;
  height: 100%;
  background: var(--mist);
}

body.is-loading {
  cursor: progress;
}

.load-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(251, 249, 246, 0.42);
  transition: opacity var(--duration-normal) var(--ease-default), visibility var(--duration-normal);
}

.load-screen.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.load-card {
  width: min(22rem, 100%);
  padding: 1.05rem 1.15rem 1rem;
  background: var(--paper);
  border: var(--panel-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-pop);
  cursor: default;
}

.load-head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.load-spinner {
  flex-shrink: 0;
  width: 1.15rem;
  height: 1.15rem;
  border: 2px solid var(--stone);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: load-spin 0.7s linear infinite;
}

.load-screen.is-error .load-spinner { display: none; }

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

.load-title {
  margin: 0;
  font-size: var(--text-md);
  font-weight: 600;
}

.load-bar {
  height: 3px;
  margin: 0.85rem 0 0.7rem;
  overflow: hidden;
  background: var(--mist);
  border-radius: var(--radius-full);
}

.load-bar span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--brand);
  transition: width var(--duration-normal) var(--ease-default);
}

.load-status {
  margin: 0 0 0.7rem;
  font-size: var(--text-sm);
  color: var(--ink-2);
}

.load-steps {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.load-steps li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--text-sm);
  color: var(--muted);
}

.load-steps li[data-state="active"],
.load-steps li[data-state="done"] {
  color: var(--ink);
}

.load-mark {
  position: relative;
  flex-shrink: 0;
  width: 0.85rem;
  height: 0.85rem;
  border: 2px solid var(--stone);
  border-radius: 50%;
}

.load-steps li[data-state="active"] .load-mark {
  border-color: var(--brand);
  box-shadow: inset 0 0 0 3px var(--brand);
}

.load-steps li[data-state="done"] .load-mark {
  border-color: var(--brand);
  background: var(--brand);
}

.load-steps li[data-state="done"] .load-mark::after {
  content: "";
  position: absolute;
  left: 0.2rem;
  top: 0.02rem;
  width: 0.2rem;
  height: 0.38rem;
  border: solid var(--paper);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.load-error {
  margin: 0.75rem 0 0;
  font-size: var(--text-sm);
  color: var(--ink);
}

.load-retry {
  margin-top: 0.75rem;
  padding: 0.4rem 0.8rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: var(--paper);
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
}

.load-retry:hover { background: var(--ink-2); }

.map-controls {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 8;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 15.5rem;
  /* --legend-space is set by app.js; the 1.25rem covers this panel's top offset and a gap above the legend. */
  max-height: calc(100% - var(--legend-space, 7.75rem) - 1.25rem);
}

.map-search {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
}

.map-view {
  display: flex;
  flex: 0 0 auto;
  width: 100%;
  padding: 0.2rem;
  background: var(--paper);
  border: var(--panel-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.map-view-option {
  flex: 1 1 0;
  min-width: 0;
  margin: 0;
  padding: 0.38rem 0.2rem;
  border: 0;
  border-radius: calc(var(--radius) - 0.2rem);
  background: transparent;
  color: var(--ink-2);
  font-family: inherit;
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1.15;
  cursor: pointer;
}

.map-view-option:hover:not(.is-active) { background: var(--mist); color: var(--ink); }

.map-view-option.is-active {
  background: var(--ink);
  color: var(--paper);
}

.map-boundary-toggle {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  margin: 0;
  padding: 0.5rem 0.75rem;
  background: var(--paper);
  border: var(--panel-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--ink-2);
  font-family: inherit;
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1.15;
  text-align: left;
  cursor: pointer;
}

.map-boundary-toggle:hover { background: var(--mist); color: var(--ink); }

.map-boundary-check {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 0.95rem;
  height: 0.95rem;
  border: 1.5px solid var(--ink-2);
  border-radius: var(--radius-xs);
  color: transparent;
}

.map-boundary-check svg { width: 0.7rem; height: 0.7rem; stroke-width: 3; }

.map-boundary-toggle.is-active .map-boundary-check {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

/* Matches the dashed outline of protected areas on the map. */
.map-boundary-swatch {
  flex: 0 0 auto;
  width: 1.6rem;
  margin-left: auto;
  border-top: 2px dashed var(--ink-2);
}

.map-search-field {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  height: 2.5rem;
  margin: 0;
  padding: 0 0.75rem;
  background: var(--paper);
  border: var(--panel-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.map-search-field:focus-within {
  border-color: #cfc6bb;
}

.map-search-input {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: var(--text-sm);
  line-height: 1.3;
}

.map-search-input:focus,
.map-search-input:focus-visible {
  outline: none;
}

.map-search-field:has(:focus-visible) {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.map-search-input::placeholder { color: #968c83; }

.map-search-input::-webkit-search-cancel-button,
.map-search-input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

.map-search-icon {
  display: flex;
  flex-shrink: 0;
  color: #574f48;
}

.map-search-icon svg {
  width: 16px;
  height: 16px;
}

.hazard-panel {
  position: relative;
  flex: 0 1 auto;
  min-height: 0;
  width: 100%;
  overflow: auto;
  background: var(--paper);
  border: var(--panel-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hazard-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  margin: 0;
  padding: 0.7rem 0.75rem;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font-family: inherit;
  font-size: var(--text-md);
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.hazard-toggle:hover { background: var(--mist); }

.hazard-toggle > span:first-child { flex-shrink: 0; }

.hazard-current {
  min-width: 0;
  margin-left: auto;
  overflow: hidden;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hazard-panel:not(.is-collapsed) .hazard-current { display: none; }

.hazard-chevron {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-left: auto;
  transition: transform var(--duration-fast) var(--ease-default);
}

.hazard-panel:not(.is-collapsed) .hazard-chevron {
  transform: rotate(180deg);
}

.hazard-panel.is-collapsed .hazard-chevron {
  margin-left: 0.15rem;
}

.panel-label {
  display: block;
  margin: 0 0 0.45rem;
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--ink-2);
}

.territory-search-results {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  z-index: 3;
  max-height: 16rem;
  margin: 0;
  padding: 0.25rem 0;
  list-style: none;
  overflow: auto;
  background: var(--paper);
  border: var(--panel-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-pop);
}

.territory-search-option,
.territory-search-empty {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  width: 100%;
  padding: 0.4rem 0.7rem;
  text-align: left;
}

.territory-search-option {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
}

.territory-search-option:hover,
.territory-search-option.is-active { background: var(--mist); }

.territory-search-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink);
}

.territory-search-meta,
.territory-search-empty {
  font-size: var(--text-xs);
  color: var(--muted);
}

.hazard-list {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  padding: 0 0.4rem 0.5rem;
}

.hazard-panel.is-collapsed .hazard-list { display: none; }

.hazard-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.38rem 0.5rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: var(--text-sm);
  text-align: left;
  cursor: pointer;
}

.hazard-option:hover:not(:disabled):not(.is-active) { background: var(--mist); }

.hazard-option.is-active {
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
}

.hazard-option:disabled {
  color: var(--muted);
  cursor: not-allowed;
}

.hazard-group {
  margin: 0.35rem 0.5rem 0.15rem;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

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

.hazard-soon {
  flex-shrink: 0;
  margin-left: auto;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-full);
  background: var(--mist);
  font-size: 0.7rem;
  font-weight: 500;
  white-space: nowrap;
}

.hazard-description {
  margin: 0.2rem 0.5rem 0.35rem;
  font-size: var(--text-xs);
  line-height: 1.4;
  color: var(--ink-2);
}

.warming-options {
  display: flex;
  gap: 0.35rem;
}

.warming-option {
  display: flex;
  flex: 1 0 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 4.6rem;
  min-height: 3.15rem;
  margin: 0;
  padding: 0.3rem 0.45rem;
  border: 1px solid var(--stone);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  cursor: pointer;
}

.warming-option:hover:not(.is-active) {
  background: var(--mist);
}

.warming-option.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.warming-tick {
  display: block;
  font-size: var(--text-md);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  white-space: nowrap;
}

.warming-note {
  display: block;
  margin-bottom: 0.08rem;
  font-size: var(--text-md);
  font-weight: 500;
  line-height: 1.1;
  color: var(--muted);
  white-space: nowrap;
}

.warming-option.is-active .warming-note {
  color: var(--paper);
}

.warming-panel {
  position: absolute;
  z-index: 6;
  bottom: 0.75rem;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 21.5rem);
  padding: 0.7rem 0.75rem 0.75rem;
  background: var(--paper);
  border: var(--panel-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* The analysis panel narrows the map, so keep warming in the gap beside the legend. */
.assess-layout:has(.assess-results.open) .warming-panel {
  left: 18.25rem;
  right: 3.5rem;
  width: fit-content;
  max-width: calc(100% - 21.75rem);
  margin-inline: auto;
  transform: none;
}

.assess-layout:has(.assess-results.open) .warming-option {
  min-width: 0;
  flex: 1 1 0;
}

.map-tools {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  z-index: 6;
  display: flex;
  flex-direction: column;
  width: 32px;
  background: var(--paper);
  border: var(--panel-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.map-tool {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.map-tools > .map-tool + .map-tool,
.map-tools > .map-type {
  border-top: 1px solid var(--stone);
}

.map-tools > .map-tool:first-child {
  border-radius: var(--radius) var(--radius) 0 0;
}

.map-tools > .map-type .map-tool {
  border-radius: 0 0 var(--radius) var(--radius);
}

.map-tool:hover:not(:disabled),
.map-tool.is-open {
  background: var(--mist);
}

.map-tool:disabled {
  opacity: 0.35;
  cursor: default;
}

.map-tool svg {
  width: 16px;
  height: 16px;
}

.map-type {
  position: relative;
}

.map-type-menu {
  position: absolute;
  right: calc(100% + 6px);
  bottom: 0;
  display: flex;
  flex-direction: column;
  min-width: 7.25rem;
  background: var(--paper);
  border: var(--panel-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.map-type-option {
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font-family: inherit;
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1;
  text-align: left;
  white-space: nowrap;
  padding: 0.55rem 0.75rem;
  cursor: pointer;
}

.map-type-option + .map-type-option {
  border-top: 1px solid var(--stone);
}

.map-type-option:hover { background: var(--mist); color: var(--ink); }

.map-type-option.is-active {
  background: var(--ink);
  color: var(--paper);
}

.map-corner-left {
  position: absolute;
  left: 0.75rem;
  bottom: 0.75rem;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.4rem;
  width: min(16.5rem, calc(100% - 4.5rem));
  pointer-events: none;
}

.assess-basemap-credit {
  margin: 0;
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-xs);
  background: var(--paper-veil);
  font-size: var(--text-xs);
  line-height: 1.3;
  color: var(--ink-2);
  pointer-events: none;
}

.cop-map-legend {
  width: 100%;
  padding: 0.55rem 0.7rem 0.45rem;
  background: var(--paper);
  border: var(--panel-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  pointer-events: auto;
}

.cop-map-legend-title {
  margin: 0 0 0.4rem;
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--ink);
}

.cop-scale-track {
  display: flex;
  height: 10px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.cop-scale-block {
  flex: 1 1 0;
  height: 100%;
}

.cop-scale-ticks {
  position: relative;
  height: 1.5rem;
  margin-top: 0.28rem;
}

.cop-scale-tick {
  position: absolute;
  top: 0;
  padding: 0;
  border: 0;
  background: none;
  font-family: inherit;
  font-size: var(--text-md);
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  transform: translateX(-50%);
  white-space: nowrap;
}

.cop-scale-tick.is-start {
  left: 0;
  transform: none;
}

.cop-scale-tick.is-end {
  right: 0;
  left: auto;
  transform: none;
}

.cop-opacity {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.2rem;
  padding-top: 0.4rem;
  border-top: 1px solid var(--stone);
  font-size: var(--text-md);
  color: var(--muted);
}

.cop-opacity-input {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  accent-color: var(--brand);
  cursor: pointer;
}

.cop-opacity-value {
  min-width: 2.6rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.assess-results {
  width: 0;
  min-width: 0;
  overflow: hidden;
  background-color: var(--paper);
  border-left: 0 solid var(--stone);
  display: flex;
  flex-direction: column;
  transition: width var(--duration-normal) var(--ease-default),
              min-width var(--duration-normal) var(--ease-default),
              border-left-width var(--duration-normal) var(--ease-default);
}

.assess-results.open {
  width: 320px;
  min-width: 320px;
  border-left-width: 1px;
}

.assess-results-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 1rem 1rem 0.9rem 1.15rem;
  border-bottom: 1px solid var(--stone);
  flex-shrink: 0;
  min-width: 320px;
}

.assess-results-heading {
  min-width: 0;
  flex: 1;
}

.assess-results-title {
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.35;
  margin: 0;
}

.assess-results-category {
  margin: 0.2rem 0 0;
  font-size: var(--text-xs);
  line-height: 1.35;
  color: var(--muted);
}

.assess-results-category:empty { display: none; }

.assess-results-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.15rem 1.25rem;
  min-width: 320px;
}

.panel-scenario {
  margin: 0 0 0.3rem;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.panel-sentence {
  margin: 0 0 1rem;
  font-size: var(--text-sm);
  line-height: 1.45;
  color: var(--ink);
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
}

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

.cop-chart-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.cop-chart-title {
  margin: 0;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--ink-2);
}

.cop-chart-now {
  margin: 0;
  font-family: inherit;
  font-size: var(--text-xs);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  white-space: nowrap;
}

.cop-chart-svg {
  display: block;
  width: 100%;
  height: auto;
}

.cop-chart-grid {
  stroke: var(--stone);
  stroke-width: 1;
}

.cop-chart-grid.is-zero { stroke: var(--muted); }

.cop-chart-ylabel {
  fill: var(--muted);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  text-anchor: end;
  dominant-baseline: middle;
}

.cop-chart-marker {
  stroke: var(--muted);
  stroke-width: 1;
  stroke-dasharray: 2 3;
  pointer-events: none;
}

.cop-chart-band {
  stroke: none;
  opacity: 0.22;
  pointer-events: none;
}

.cop-chart-whisker {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  opacity: 0.45;
  pointer-events: none;
}

.cop-chart-line {
  fill: none;
  stroke-width: 1.75;
  stroke-linejoin: round;
  stroke-linecap: round;
  opacity: 0.9;
  pointer-events: none;
}

.cop-chart-line.is-selected {
  stroke-width: 2.6;
  opacity: 1;
}

.cop-chart-dot {
  stroke: var(--paper);
  stroke-width: 1.5;
  pointer-events: none;
}

.cop-chart-hit {
  fill: transparent;
  cursor: pointer;
}

.cop-chart-hit:hover {
  fill: var(--ink-wash);
}

.cop-chart-axis {
  position: relative;
  height: 2.1rem;
  margin-top: 0.15rem;
}

.cop-chart-tick {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.05rem;
  max-width: 4.6rem;
  border: 0;
  background: none;
  padding: 0.15rem 0;
  font: inherit;
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  text-align: center;
  white-space: nowrap;
  color: var(--muted);
  cursor: pointer;
}

.cop-chart-tick-note {
  font-weight: 600;
}

.cop-chart-tick:hover,
.cop-chart-tick.is-current {
  color: var(--ink);
}

.cop-chart-tick.is-current {
  font-weight: 600;
}

.cell-popup .maplibregl-popup-content {
  padding: 0;
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow-pop);
  color: var(--ink);
}

.cell-popup .maplibregl-popup-tip {
  border-bottom-color: var(--paper);
}

.cell-range {
  width: 280px;
  padding: 0.65rem 0.8rem 0.75rem;
}

.cell-range-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.cell-place {
  margin: 0;
  font-size: var(--text-sm);
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
}

.cell-category {
  margin: 0.15rem 1.4rem 0 0;
  font-size: var(--text-xs);
  line-height: 1.35;
  color: var(--muted);
}

.cell-range-close {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  margin: -2px -4px 0 0;
  border: 0;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.cell-range-close:hover {
  color: var(--ink);
  background: var(--mist);
}

.cell-sentence {
  margin: 0.55rem 0 0;
  font-size: var(--text-xs);
  line-height: 1.4;
  color: var(--ink-2);
}

.maplibregl-ctrl-bottom-left { display: none; }

@media (max-width: 900px) {
  .assess-layout { position: relative; }

  .assess-results.open {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 6;
    width: min(88vw, 320px);
    min-width: 0;
    border-left-width: 1px;
    box-shadow: var(--shadow-pop);
  }

  .assess-results-header,
  .assess-results-body { min-width: 0; }
}

@media (max-width: 640px) {
  .app-header-org,
  .app-header-divider { display: none; }

  .app-header,
  .app-header-end {
    gap: 0.6rem;
  }

  .app-header {
    padding: 0 0.75rem;
  }

  .map-controls {
    left: 0.5rem;
    right: 0.5rem;
    width: auto;
    max-height: calc(100% - 12.5rem);
  }

  .warming-panel {
    left: 0.5rem;
    right: 3.25rem;
    bottom: 0.5rem;
    width: auto;
    max-width: none;
    transform: none;
  }

  .warming-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .warming-option {
    min-width: 0;
    padding: 0.3rem 0.25rem;
  }

  .map-corner-left {
    left: 0.5rem;
    bottom: 0.5rem;
    width: min(16.5rem, calc(100% - 3.75rem));
  }

  .map-tools {
    right: 0.5rem;
    bottom: 0.5rem;
  }
}
