/* UniGOU Domicilios — Minimalist Swiss Operational Dispatch (Light)
 * Governed by DESIGN.md & Modern Web Guidance (Baseline 2024+)
 */

:root {
  color-scheme: light;
  --canvas: #FAF8F4;
  --surface-1: #FFFFFF;
  --surface-2: #F3F1EB;
  --surface-3: #EAE6DC;

  --accent: #F5A60A;
  --accent-hover: #DC9000;
  --accent-soft: #FEF5DC;
  --accent-border: #E5A00D;
  --accent-fg: #121215;

  --ink: #121215;
  --ink-secondary: #52525B;
  --ink-muted: #71717A;

  --border-subtle: #E5E2DA;
  --border-strong: #C8C3B8;

  --pending: #B45309;
  --pending-soft: #FEF3C7;
  --active: #1D4ED8;
  --active-soft: #DBEAFE;
  --transit: #4338CA;
  --transit-soft: #E0E7FF;
  --success: #15803D;
  --success-soft: #DCFCE7;
  --error: #B91C1C;
  --error-soft: #FEE2E2;

  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --font-display: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;

  --shadow-float: 0 12px 32px rgba(18, 18, 21, 0.08), 0 2px 6px rgba(18, 18, 21, 0.04);
  --shadow-sticky: 0 -6px 24px rgba(18, 18, 21, 0.06);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  background-color: var(--canvas);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  min-height: 100dvh;
  background-color: var(--canvas);
  color: var(--ink);
  line-height: 1.5;
  accent-color: var(--ink);
}

h1, h2, h3, h4, .font-display {
  font-family: var(--font-display);
  letter-spacing: -0.025em;
  text-wrap: balance;
  margin: 0;
}

.tabular {
  font-variant-numeric: tabular-nums;
}

a {
  color: inherit;
  text-decoration: none;
}

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

/* ==========================================================================
   Top Navigation Bar (Swiss Minimal)
   ========================================================================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(250, 248, 244, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-subtle);
}

.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}

.brand-logo {
  height: 30px;
  width: auto;
  display: block;
}

.brand-divider {
  width: 1px;
  height: 18px;
  background: var(--border-strong);
}

.brand-tag {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.nav-links {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--surface-2);
  padding: 0.25rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
}

.nav-link {
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-secondary);
  transition: background-color 160ms ease-out, color 160ms ease-out;
}

.nav-link:hover {
  color: var(--ink);
}

.nav-link[aria-current="page"] {
  background: var(--surface-1);
  color: var(--ink);
  border: 1px solid var(--border-subtle);
}

.city-pill {
  display: none;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-secondary);
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  flex-shrink: 0;
}

@media (min-width: 820px) {
  .city-pill {
    display: inline-flex;
  }
}

/* ==========================================================================
   Main Container & Split Layout
   ========================================================================== */
.page-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 6.5rem;
}

@media (min-width: 960px) {
  .page-shell {
    padding: 2rem 1.25rem 3.5rem;
  }
}

.page-header {
  margin-bottom: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}

.page-kicker {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  margin-bottom: 0.35rem;
}

.page-title {
  font-size: clamp(1.6rem, 2.6vw, 2.25rem);
  font-weight: 700;
  line-height: 1.12;
  color: var(--ink);
}

.page-subtitle {
  margin: 0.4rem 0 0;
  color: var(--ink-secondary);
  font-size: 0.95rem;
  max-width: 58ch;
}

.split-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  align-items: start;
}

@media (min-width: 960px) {
  .split-grid {
    grid-template-columns: minmax(0, 1.38fr) minmax(320px, 0.92fr);
    gap: 1.75rem;
  }
}

/* ==========================================================================
   Cards & Modular Panels (Container Query Ready)
   ========================================================================== */
.panel {
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  container-type: inline-size;
}

@media (min-width: 640px) {
  .panel {
    padding: 1.5rem;
  }
}

.panel + .panel {
  margin-top: 1rem;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-subtle);
}

.panel-step {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.step-badge {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
}

.panel-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
}

.panel:has(:user-invalid) {
  border-color: rgba(185, 28, 28, 0.45);
}

.summary-sticky {
  position: relative;
}

@media (min-width: 960px) {
  .summary-sticky {
    position: sticky;
    top: 5.1rem;
  }
}

/* ==========================================================================
   Segmented Radio Pills (Modern :has(input:checked))
   ========================================================================== */
.segment-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
}

@container (min-width: 480px) {
  .segment-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.segment-option {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.85rem 0.95rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color 160ms ease-out, background-color 160ms ease-out;
}

.segment-option:hover {
  border-color: var(--border-strong);
  background: var(--surface-1);
}

.segment-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segment-option:has(input:checked) {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  box-shadow: inset 0 0 0 1px var(--accent-border);
}

.segment-option:has(input:focus-visible) {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.segment-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--ink);
}

.segment-desc {
  font-size: 0.78rem;
  color: var(--ink-secondary);
  line-height: 1.35;
}

.payment-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

@container (min-width: 460px) {
  .payment-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.payment-chip {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0.65rem 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--surface-2);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-secondary);
  cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease;
}

.payment-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.payment-chip:has(input:checked) {
  background: var(--ink);
  border-color: var(--ink);
  color: #FFFFFF;
}

.payment-chip:has(input:focus-visible) {
  outline: 2px solid var(--accent-border);
  outline-offset: 2px;
}

/* ==========================================================================
   Form Controls & Progressive Validation (:user-invalid / :user-valid)
   ========================================================================== */
.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.9rem;
}

@container (min-width: 480px) {
  .form-grid.cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.field {
  display: flex;
  flex-direction: column;
  position: relative;
}

.field.span-2 {
  grid-column: 1 / -1;
}

.field label {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

/* Hints ALWAYS above input (Modern Web Guidance) */
.field-hint {
  font-size: 0.76rem;
  color: var(--ink-muted);
  margin-bottom: 0.35rem;
  line-height: 1.35;
}

.input, .select, .textarea {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-1);
  padding: 0.68rem 0.85rem;
  font-size: 0.94rem;
  color: var(--ink);
  transition: border-color 150ms ease-out, box-shadow 150ms ease-out, background-color 150ms ease-out;
}

.input::placeholder, .textarea::placeholder {
  color: var(--ink-muted);
}

.input:hover, .select:hover, .textarea:hover {
  border-color: #9E988C;
}

.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(245, 166, 10, 0.28);
}

/* Modern auto-sizing textarea (Baseline 2024+ progressive enhancement) */
.textarea {
  field-sizing: content;
  height: auto;
  min-block-size: 3lh;
  max-block-size: 8lh;
  resize: vertical;
}

.field-error {
  display: none;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--error);
  margin-top: 0.3rem;
}

.input:user-invalid,
.textarea:user-invalid,
.input.user-invalid-fallback,
.textarea.user-invalid-fallback {
  border-color: var(--error);
  background-color: #FFF7F7;
}

.input:user-invalid + .field-error,
.textarea:user-invalid + .field-error,
.input.user-invalid-fallback + .field-error,
.textarea.user-invalid-fallback + .field-error {
  display: block;
}

.input:user-valid,
.textarea:user-valid {
  border-color: var(--border-strong);
}

.field:has(:user-invalid) > label {
  color: var(--error);
}

/* Checkbox remember business */
.toggle-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-secondary);
  cursor: pointer;
  user-select: none;
}

.toggle-inline input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  cursor: pointer;
}

@supports not (accent-color: #121215) {
  .toggle-inline input[type="checkbox"] {
    outline: 1px solid var(--border-strong);
  }
}

/* ==========================================================================
   Santa Marta Neighborhood Autocomplete Dropdown
   ========================================================================== */
.autocomplete-wrap {
  position: relative;
}

.autocomplete-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 40;
  background: var(--surface-1);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-float);
  max-height: 240px;
  overflow-y: auto;
  padding: 0.3rem;
  display: none;
}

.autocomplete-list.is-open {
  display: block;
}

.autocomplete-item {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 0.55rem 0.7rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.autocomplete-item:hover,
.autocomplete-item[aria-selected="true"] {
  background: var(--accent-soft);
}

.autocomplete-name {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--ink);
}

.autocomplete-cat {
  font-size: 0.74rem;
  color: var(--ink-muted);
  white-space: nowrap;
}

.quick-zones {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.45rem;
}

.zone-chip {
  border: 1px solid var(--border-subtle);
  background: var(--surface-2);
  color: var(--ink-secondary);
  border-radius: var(--radius-full);
  padding: 0.22rem 0.65rem;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.zone-chip:hover {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--ink);
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.78rem 1.25rem;
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color 160ms ease-out, border-color 160ms ease-out, transform 120ms ease-out;
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

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

.btn-primary {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent-border);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--surface-1);
  color: var(--ink);
  border-color: var(--border-strong);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--surface-2);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-secondary);
  border-color: transparent;
  padding: 0.45rem 0.75rem;
  font-size: 0.84rem;
}

.btn-ghost:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--ink);
}

.btn-danger {
  background: var(--error-soft);
  color: var(--error);
  border-color: rgba(185, 28, 28, 0.25);
}

.btn-danger:hover:not(:disabled) {
  background: #FECACA;
}

.btn-sm {
  padding: 0.46rem 0.8rem;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
}

.btn-block {
  width: 100%;
}

/* ==========================================================================
   Live Quote Summary Panel
   ========================================================================== */
.route-preview {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.95rem;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  margin-bottom: 1rem;
}

.route-point {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

.route-marker {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 0.32rem;
  flex-shrink: 0;
}

.route-marker.pickup {
  background: var(--ink);
}

.route-marker.delivery {
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-border);
}

.route-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
}

.route-value {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  word-break: break-word;
}

.quote-rows {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 0.9rem;
}

.quote-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.88rem;
  color: var(--ink-secondary);
}

.quote-row strong {
  color: var(--ink);
  font-weight: 600;
}

.quote-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.quote-total-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-secondary);
}

.quote-total-price {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
}

.quote-meta-bar {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.meta-box {
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
}

.meta-box-label {
  font-size: 0.72rem;
  color: var(--ink-muted);
  font-weight: 600;
}

.meta-box-val {
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--ink);
}

/* Mobile Sticky Action Bar */
.mobile-sticky-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 25;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sticky);
  padding: 0.7rem 1rem calc(0.7rem + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
}

@media (min-width: 960px) {
  .mobile-sticky-bar {
    display: none;
  }
}

/* ==========================================================================
   Status Badges & Tracking Timeline
   ========================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.24rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.badge-pending { background: var(--pending-soft); color: var(--pending); }
.badge-active { background: var(--active-soft); color: var(--active); }
.badge-transit { background: var(--transit-soft); color: var(--transit); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-error { background: var(--error-soft); color: var(--error); }
.badge-neutral { background: var(--surface-2); color: var(--ink-secondary); }

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.timeline-step {
  position: relative;
  padding: 0 0 1.35rem 2.15rem;
}

.timeline-step:last-child {
  padding-bottom: 0;
}

.timeline-step::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 22px;
  bottom: 0;
  width: 2px;
  background: var(--border-subtle);
}

.timeline-step:last-child::before {
  display: none;
}

.timeline-step.is-done::before {
  background: var(--success);
}

.timeline-dot {
  position: absolute;
  left: 0;
  top: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  background: var(--surface-1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 700;
}

.timeline-step.is-done .timeline-dot {
  background: var(--success);
  border-color: var(--success);
  color: #FFFFFF;
}

.timeline-step.is-current .timeline-dot {
  background: var(--accent);
  border-color: var(--accent-border);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.timeline-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.96rem;
  color: var(--ink);
}

.timeline-desc {
  font-size: 0.82rem;
  color: var(--ink-secondary);
  margin-top: 0.1rem;
}

/* ==========================================================================
   Dispatch KPI Grid & Order Cards (Container Queries)
   ========================================================================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

@media (min-width: 760px) {
  .kpi-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

.kpi-card {
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.95rem 1rem;
}

.kpi-label {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
}

.kpi-value {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.15;
  margin-top: 0.25rem;
  color: var(--ink);
}

.dispatch-order-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.order-row-wrap {
  container-type: inline-size;
}

.order-row {
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem 1.1rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.9rem;
  transition: border-color 150ms ease;
}

.order-row:hover {
  border-color: var(--border-strong);
}

@container (min-width: 760px) {
  .order-row {
    grid-template-columns: minmax(150px, 0.9fr) minmax(240px, 1.6fr) minmax(220px, 1.1fr);
    align-items: center;
  }
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.filter-tab {
  border: 1px solid var(--border-subtle);
  background: var(--surface-1);
  color: var(--ink-secondary);
  padding: 0.42rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.filter-tab[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: #FFFFFF;
}

/* ==========================================================================
   Alerts, Recent Orders & Top-Layer Dialogs / Popovers
   ========================================================================== */
.alert {
  padding: 0.8rem 0.95rem;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  font-weight: 500;
  border: 1px solid transparent;
  margin-bottom: 0.9rem;
}

.alert-error {
  background: var(--error-soft);
  color: var(--error);
  border-color: rgba(185, 28, 28, 0.22);
}

.alert-success {
  background: var(--success-soft);
  color: var(--success);
  border-color: rgba(21, 128, 61, 0.22);
}

.recent-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.recent-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.8rem;
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.83rem;
}

.recent-item:hover {
  border-color: var(--border-strong);
  background: var(--surface-1);
}

/* Native Dialog & Popover with @starting-style + allow-discrete + overlay */
dialog,
[popover] {
  opacity: 0;
  transform: translateY(8px) scale(0.98);
  transition-property: opacity, transform, display, overlay;
  transition-duration: 0.22s;
  transition-timing-function: ease-out;
  transition-behavior: allow-discrete;
}

dialog[open],
[popover]:is(:popover-open, .\:popover-open) {
  opacity: 1;
  transform: translateY(0) scale(1);

  @starting-style {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
}

dialog {
  width: min(560px, calc(100vw - 2rem));
  max-height: calc(100dvh - 2.5rem);
  overflow-y: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--surface-1);
  color: var(--ink);
  padding: 1.4rem;
  box-shadow: var(--shadow-float);
}

dialog::backdrop {
  background-color: rgba(18, 18, 21, 0);
  transition:
    display 0.22s allow-discrete,
    overlay 0.22s allow-discrete,
    background-color 0.22s ease-out;
}

dialog[open]::backdrop {
  background-color: rgba(18, 18, 21, 0.42);
  backdrop-filter: blur(2px);

  @starting-style {
    background-color: rgba(18, 18, 21, 0);
  }
}

.info-popover {
  max-width: 340px;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface-1);
  color: var(--ink);
  box-shadow: var(--shadow-float);
  font-size: 0.84rem;
  line-height: 1.45;
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.85rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

@media (prefers-reduced-motion: reduce) {
  dialog, [popover] {
    transform: none;
    transition-duration: 0.08s;
  }
  @starting-style {
    dialog[open],
    [popover]:is(:popover-open, .\:popover-open) {
      transform: none;
    }
  }
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--ink-muted);
}

.secondary {
  color: var(--ink-secondary);
}

.footer-mini {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.25rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: var(--ink-muted);
}
