/* Login, projects dashboard and the workspace project bar.
   Builds on the tokens defined in style.css. */

.portal-body {
  min-height: 100%;
  height: auto;
  overflow-y: auto;
}

/* ── shared controls ─────────────────────────────────────────────────────── */
.portal-input {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  font-size: 15px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.portal-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(14, 138, 106, 0.16);
}
.portal-label {
  display: block;
  margin: 14px 0 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.portal-error {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: #fdeeee;
  color: var(--danger);
  font-size: 14px;
}
.portal-hint {
  margin: 6px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}
.portal-link-btn {
  border: none;
  background: none;
  padding: 0;
  color: var(--brand-deep);
  font-weight: 600;
  cursor: pointer;
}
.portal-link-btn:hover { text-decoration: underline; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}
.status-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.status-pill.active { background: #e3f5ee; color: var(--brand-deep); }
.status-pill.completed { background: #eef0f6; color: #46507a; }

/* ── login ───────────────────────────────────────────────────────────────── */
.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
}
.auth-card {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 28px 24px;
}
.auth-logo {
  display: block;
  height: 56px;
  margin: 0 auto 6px;
}
.auth-title {
  margin: 4px 0 2px;
  font-family: "Sora", sans-serif;
  font-size: 22px;
  text-align: center;
}
.auth-subtitle {
  margin: 0 0 18px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: var(--panel-alt);
  border: 1px solid var(--line);
}
.auth-tab {
  border: none;
  border-radius: 9px;
  padding: 9px 0;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
}
.auth-tab.active {
  background: #fff;
  color: var(--brand-deep);
  box-shadow: 0 2px 8px rgba(16, 49, 54, 0.08);
}
.auth-submit {
  width: 100%;
  margin-top: 20px;
}
.auth-footer {
  margin: 16px 0 0;
  text-align: center;
  font-size: 13.5px;
  color: var(--muted);
}

/* ── portal top bar ──────────────────────────────────────────────────────── */
.portal-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 24px;
  background: linear-gradient(110deg, #fefefe 0%, #f4fbf8 60%, #eef9f5 100%);
  border-bottom: 1px solid var(--line);
}
.portal-topbar img { height: 40px; display: block; }
.user-menu {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  font-size: 14px;
  color: var(--muted);
}
.user-menu .user-email {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 260px;
}
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.btn-ghost:hover { border-color: var(--brand); color: var(--brand-deep); }
.btn-ghost.danger:hover { border-color: var(--danger); color: var(--danger); }
.btn-ghost:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── projects page ───────────────────────────────────────────────────────── */
.portal-main {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 26px 24px 48px;
}
.portal-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.portal-heading h1 {
  margin: 0;
  font-family: "Sora", sans-serif;
  font-size: 26px;
}
.portal-heading p { margin: 4px 0 0; color: var(--muted); }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 26px;
}
.stat-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: 0 6px 18px rgba(16, 49, 54, 0.05);
}
.stat-card .stat-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.stat-card .stat-label i { color: var(--brand); }
.stat-card .stat-value {
  margin-top: 8px;
  font-family: "Sora", sans-serif;
  font-size: 30px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.stat-card .stat-unit {
  margin-left: 4px;
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
}
.stat-card .stat-sub { margin-top: 4px; font-size: 12.5px; color: var(--muted); }

/* "Running now" is a button that filters the list to running projects. */
.stat-card.stat-running {
  display: block;
  width: 100%;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.stat-card.stat-running:hover { border-color: #9ad6c6; }
.stat-card.stat-running:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(14, 138, 106, 0.25); }
.stat-card.stat-running.busy { border-color: var(--brand); background: #f1faf6; }
.stat-card.stat-running.busy .stat-value { color: var(--brand-deep); }

/* An analysis in progress: shared by the dashboard and the workspace. */
.running-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #fff4d6;
  color: #7a5200;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.status-stack { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.runs-note.running { color: #7a5200; font-weight: 600; }
.runs-note.failed { color: var(--danger); font-weight: 600; }
.project-row.is-running { background: #fffcf2; box-shadow: inset 3px 0 0 #e0a100; }

.project-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.filter-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-tab {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 6px 14px;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--muted);
  cursor: pointer;
}
.filter-tab.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.project-search { width: min(280px, 100%); }

.new-project-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-start;
  margin-bottom: 16px;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.new-project-form .portal-input { flex: 1 1 260px; }

.project-list {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.project-row {
  display: grid;
  grid-template-columns: minmax(0, 2.4fr) 170px 110px 130px 110px 280px;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
}
.project-row:first-child { border-top: none; }
.project-row.header {
  padding-top: 10px;
  padding-bottom: 10px;
  background: var(--panel-alt);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.project-name {
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.project-name:hover { color: var(--brand-deep); text-decoration: underline; }
.project-meta { font-size: 13.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.project-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.cell-label { display: none; }

.empty-state {
  padding: 48px 20px;
  text-align: center;
  color: var(--muted);
}
.empty-state i { font-size: 32px; color: var(--brand); margin-bottom: 10px; }
.empty-state h3 { margin: 6px 0; color: var(--text); font-family: "Sora", sans-serif; }

@media (max-width: 900px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-grid > :last-child { grid-column: 1 / -1; }
  .project-row.header { display: none; }
  .project-row {
    grid-template-columns: 1fr 1fr;
    gap: 8px 12px;
  }
  .project-row > :first-child,
  .project-row .project-actions { grid-column: 1 / -1; }
  .project-actions { justify-content: flex-start; }
  .cell-label {
    display: inline;
    margin-right: 6px;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--muted);
  }
}
@media (max-width: 520px) {
  .portal-main { padding: 18px 16px 40px; }
  .portal-topbar { padding: 8px 16px; }
  .portal-topbar img { height: 32px; }
  .user-menu .user-email { display: none; }
  .stat-card .stat-value { font-size: 24px; }
}

/* ── workspace header: app bar + project bar ───────────────────────────── */
.workspace-header {
  flex: 0 0 auto;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(110deg, #fefefe 0%, #f4fbf8 60%, #eef9f5 100%);
}
.app-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 18px;
  border-bottom: 1px solid var(--line);
}
.app-bar-brand img { height: 36px; display: block; }
.app-bar-actions { display: flex; align-items: center; gap: 10px; min-width: 0; }

.gee-badge { display: none; }
.gee-badge.offline {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 4px 10px;
  border-radius: 999px;
  background: #fff4e5;
  color: #8a4b00;
  font-size: 12.5px;
  font-weight: 600;
}
.gee-badge .dot { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: #f39c2f; }
.gee-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px 3px 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
}
.user-chip:hover, .user-chip[aria-expanded="true"] { border-color: #9ad6c6; }
.user-initials {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.dl-account { display: flex; flex-direction: column; padding: 2px 10px 8px; font-size: 13px; color: var(--muted); }
.dl-account strong { color: var(--text); font-size: 14px; }
.dl-account span, .dl-account strong { overflow-wrap: anywhere; }
.dl-item.danger, .dl-item.danger i { color: var(--danger); }

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

.project-bar { padding: 6px 18px 0; }
.project-bar-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.btn-ghost.icon-only { padding: 7px 10px; }
.btn-ghost .btn-label { margin-left: 2px; }

/* The name is the only part of the row that shrinks; long names end in "…". */
.project-title { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 10px; }
.ws-project-name {
  min-width: 0;
  padding: 2px 4px;
  margin-left: -4px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--text);
  font-family: "Sora", sans-serif;
  font-size: 18px;
  font-weight: 700;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: text;
}
.ws-project-name:hover { background: rgba(14, 138, 106, 0.07); }
.ws-project-name-input {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 640px;
  padding: 4px 8px;
  border: 1px solid #9ad6c6;
  border-radius: 8px;
  font-family: "Sora", sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}
.ws-project-name-input:focus { outline: 2px solid rgba(14, 138, 106, 0.25); }
.project-title .status-pill { flex: 0 0 auto; }

/* Analysis state in the project header: running, or the outcome until seen. */
.run-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.run-chip.running { background: #fff4d6; border-color: #f0c860; color: #7a5200; }
.run-chip.succeeded { background: #e3f5ee; border-color: #9ad6c6; color: var(--brand-deep); }
.run-chip.failed { background: #fdeeee; border-color: #f2b8b8; color: var(--danger); }
.run-chip:hover { filter: brightness(0.97); }
.run-chip:focus-visible { outline: 2px solid rgba(14, 138, 106, 0.35); outline-offset: 2px; }
.project-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; }

/* Workflow steps as tabs: "›" shows the order, the underline the current one. */
.step-indicator { display: flex; align-items: stretch; gap: 0; margin-top: 4px; overflow-x: auto; scrollbar-width: none; }
.step-indicator::-webkit-scrollbar { display: none; }
.step {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 2px 7px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  position: relative;
}
.step:not(.hidden) ~ .step:not(.hidden) { margin-left: 30px; }
.step:not(.hidden) ~ .step:not(.hidden)::before {
  content: "›";
  position: absolute;
  left: -19px;
  color: #9fb8b9;
  font-weight: 400;
  pointer-events: none;
}
.step:hover { color: var(--brand-deep); }
.step-dot { display: none; }
.step.has-running .step-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e0a100;
  animation: run-pulse 1.4s ease-in-out infinite;
}
@keyframes run-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(224, 161, 0, 0.55); }
  50% { box-shadow: 0 0 0 5px rgba(224, 161, 0, 0); }
}
.step.active { color: var(--brand-deep); border-bottom-color: var(--brand); }
.step:focus-visible { outline: 2px solid rgba(14, 138, 106, 0.35); outline-offset: -2px; border-radius: 4px; }

.readonly-banner {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: #eef0f6;
  color: #46507a;
  font-size: 13.5px;
}

@media (max-width: 600px) {
  .app-bar { padding: 5px 12px; }
  .app-bar-brand img { height: 30px; }
  .project-bar { padding: 6px 12px 0; }
  .project-bar-row { gap: 6px; }
  .ws-project-name { font-size: 16px; }
  /* Just the dot; the full status is in the tooltip and the ⋯ menu. */
  .project-title .status-pill { width: 22px; height: 22px; padding: 0; justify-content: center; font-size: 0; }
  #btnProjectDownloads { display: none; }
  /* Spinner or tick only; the tooltip and Results hold the details. */
  .run-chip { padding: 5px 8px; }
  .run-chip .run-chip-text { display: none; }
  .step:not(.hidden) ~ .step:not(.hidden) { margin-left: 22px; }
  .step:not(.hidden) ~ .step:not(.hidden)::before { left: -14px; }
  .step { font-size: 13.5px; }
}

/* ── workspace: steps and saved results ──────────────────────────────────── */
.step-count:empty { display: none; }
.step-count {
  margin-left: 2px;
  padding: 0 7px;
  border-radius: 999px;
  background: #e3f5ee;
  color: var(--brand-deep);
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
}

.results-intro { margin: -4px 0 12px; font-size: 13.5px; color: var(--muted); }
.results-empty { padding: 26px 12px; text-align: center; color: var(--muted); font-size: 14px; }
.results-empty i { font-size: 26px; color: var(--brand); }

.result-group + .result-group { margin-top: 16px; }
.result-group-title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.result-group-title i { color: var(--brand); }
.result-group-count {
  padding: 0 7px;
  border-radius: 999px;
  background: var(--panel-alt);
  border: 1px solid var(--line);
  font-size: 11.5px;
}

.result-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 11px 12px 9px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.result-card + .result-card { margin-top: 8px; }
.result-card.openable { cursor: pointer; }
.result-card.openable:hover { border-color: #9ad6c6; }
.result-card.openable:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(14, 138, 106, 0.25); }
.result-card.current {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(14, 138, 106, 0.12);
}
.result-card.status-failed { background: #fffafa; }
.result-card.status-running {
  background: #fffcf2;
  border-color: #f0c860;
  box-shadow: inset 4px 0 0 #e0a100;
  padding-left: 16px;
}
.result-card.flash { animation: card-flash 1.6s ease-out; }
@keyframes card-flash {
  0% { box-shadow: 0 0 0 4px rgba(224, 161, 0, 0.45); }
  100% { box-shadow: 0 0 0 0 rgba(224, 161, 0, 0); }
}
.result-group.in-progress .result-group-title i { color: #e0a100; }
.result-running {
  margin-top: 6px;
  font-family: "Sora", sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #7a5200;
  font-variant-numeric: tabular-nums;
}
.result-running .fa-spin { color: #e0a100; }
/* Indeterminate: Earth Engine does not report how far along a run is. */
.run-progress {
  position: relative;
  height: 4px;
  margin: 8px 0 2px;
  border-radius: 999px;
  background: #f5e6bd;
  overflow: hidden;
}
.run-progress span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 35%;
  border-radius: 999px;
  background: #e0a100;
  animation: run-progress 1.6s ease-in-out infinite;
}
@keyframes run-progress {
  0% { left: -35%; }
  100% { left: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .run-progress span, .step.has-running .step-dot { animation: none; }
  .run-progress span { width: 100%; opacity: 0.5; }
}

.run-status-line {
  margin: 10px 0 0;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  background: #fff4d6;
  color: #7a5200;
  font-size: 13px;
}
.run-status-line.limit { background: #fdeeee; color: var(--danger); }

.result-head { display: flex; align-items: flex-start; gap: 8px; }
.result-name {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.result-rename { flex: 1; padding: 6px 9px; font-size: 14px; }
.result-badge {
  flex: 0 0 auto;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}
.result-meta { margin-top: 2px; font-size: 12.5px; color: var(--muted); }
.result-error { margin: 6px 0 0; font-size: 12.5px; color: var(--danger); }
.result-card.status-running .result-meta .fa-spin { color: var(--brand); }
.result-hint { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); }

.result-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 6px;
  margin: 9px 0 0;
}
.result-metric {
  padding: 6px 8px;
  border-radius: 8px;
  background: var(--panel-alt);
  min-width: 0;
}
.result-metric dt { font-size: 11.5px; color: var(--muted); }
.result-metric dd {
  margin: 1px 0 0;
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 9px;
}
.result-actions .btn-ghost { padding: 5px 9px; font-size: 12.5px; }
.result-head .result-icon-btn { margin-top: -3px; }
.result-icon-btn {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.result-icon-btn:hover { border-color: var(--line); color: var(--brand-deep); background: #fff; }
.result-icon-btn.danger:hover { color: var(--danger); }

.field-attention {
  outline: 3px solid var(--accent) !important;
  outline-offset: 2px;
  transition: outline-color 0.3s;
}

/* ── download menus ──────────────────────────────────────────────────────── */
.portal-heading-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.dl-menu {
  position: fixed;
  z-index: 3000;
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  font-family: "Source Sans 3", sans-serif;
  color: var(--text);
}
.dl-group + .dl-group { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--line); }
.dl-group-title {
  padding: 6px 10px 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.dl-group-hint { padding: 4px 10px 8px; font-size: 12.5px; color: var(--muted); }
.dl-item {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 7px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.dl-item i { width: 16px; margin-top: 2px; color: var(--brand); text-align: center; }
.dl-item:hover:not(:disabled), .dl-item:focus-visible { background: var(--panel-alt); outline: none; }
.dl-item:disabled { cursor: not-allowed; opacity: 0.55; }
.dl-item-text { display: flex; flex-direction: column; min-width: 0; }
.dl-item-label { font-size: 14px; font-weight: 600; }
.dl-item-hint { font-size: 12px; color: var(--muted); }
.dl-select {
  width: calc(100% - 20px);
  margin: 2px 10px 4px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font: inherit;
  font-size: 13.5px;
}
.result-download { margin-left: auto; }

/* ── background exports ──────────────────────────────────────────────────── */
.exports-box {
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-alt);
}
.export-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.export-row + .export-row { border-top: 1px solid var(--line); }
.export-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.export-text strong { font-size: 13.5px; overflow-wrap: anywhere; }
.export-text span { font-size: 12px; color: var(--muted); }
.export-row.status-failed .export-text span { color: var(--danger); }
.export-row .btn-ghost { padding: 5px 9px; font-size: 12.5px; }


/* ── map search box ──────────────────────────────────────────────────────── */
.map-search {
  position: relative;
  width: 300px;
  max-width: calc(100vw - 90px);
  background: none;
}
.map-search-form {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(16, 49, 54, 0.16);
  overflow: hidden;
}
.map-search-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 8px 10px;
  border: 0;
  background: none;
  color: var(--text);
  font-size: 14px;
  outline: none;
}
.map-search-input::-webkit-search-cancel-button { cursor: pointer; }
.map-search-go, .map-search-toggle {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border: 0;
  background: none;
  color: var(--brand-deep);
  cursor: pointer;
}
.map-search-go:hover, .map-search-toggle:hover { background: var(--panel-alt); }
.map-search-form:focus-within { border-color: #9ad6c6; box-shadow: 0 0 0 3px rgba(14, 138, 106, 0.15); }
.map-search.busy .map-search-go i::before { content: "\f1ce"; }
.map-search.busy .map-search-go i { animation: fa-spin 1s linear infinite; }
.map-search-toggle { display: none; }
.map-search.collapsed { width: auto; }
.map-search.collapsed .map-search-toggle {
  display: block;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(16, 49, 54, 0.16);
}
.map-search.collapsed .map-search-form, .map-search.collapsed .map-search-panel { display: none; }

.map-search-panel {
  margin-top: 4px;
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(16, 49, 54, 0.18);
}
.map-search-status:empty { display: none; }
.map-search-status { margin: 0; padding: 9px 12px; font-size: 13px; color: var(--muted); }
.map-search-status.error { color: var(--danger); }
.map-search-results { list-style: none; margin: 0; padding: 4px; }
.map-search-results:empty { display: none; }
.map-search-result {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 7px 9px;
  border-radius: 8px;
  cursor: pointer;
}
.map-search-result[aria-selected="true"] { background: var(--panel-alt); }
.map-search-name { font-size: 14px; font-weight: 600; color: var(--text); }
.map-search-detail { font-size: 12px; color: var(--muted); }
.map-search-name, .map-search-detail { overflow-wrap: anywhere; }
.map-search-detail::first-letter { text-transform: uppercase; }

.map-search-pin { background: none; border: 0; }
.map-search-pin i {
  display: block;
  font-size: 32px;
  line-height: 36px;
  text-align: center;
  color: #d9480f;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.35));
}
.map-search-popup { display: flex; flex-direction: column; gap: 3px; min-width: 190px; font-size: 13px; }
.map-search-popup strong { font-size: 14px; color: var(--text); }
.map-search-popup-detail { color: var(--muted); }
.map-search-popup-coords { font-variant-numeric: tabular-nums; color: var(--text); }
.map-search-popup-actions { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.map-search-popup-actions .btn-ghost { padding: 4px 8px; font-size: 12.5px; }
