@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  color-scheme: light;

  /* Neutrals */
  --gray-50:  #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;

  /* Brand accent */
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-subtle: #eef2ff;
  --accent-border: #c7d2fe;

  /* Semantic */
  --success: #15803d;
  --success-subtle: #f0fdf4;
  --success-border: #bbf7d0;
  --danger: #dc2626;
  --danger-subtle: #fef2f2;
  --danger-border: #fecaca;
  --warning: #b45309;
  --warning-subtle: #fffbeb;
  --warning-border: #fde68a;
  --info: #0369a1;
  --info-subtle: #f0f9ff;
  --info-border: #bae6fd;

  /* Surfaces */
  --bg: var(--gray-50);
  --surface: #ffffff;
  --border: var(--gray-200);
  --text: var(--gray-900);
  --muted: var(--gray-500);

  /* Legacy alias kept so any stray reference keeps working */
  --bg-subtle: var(--gray-50);

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.10);

  --font-sans: "Inter", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  font-size: 0.9375rem;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Topbar & navigation ---------- */

.topbar {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  padding: 0 1.5rem;
  height: 58px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: var(--shadow-sm);
}

.topbar .brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.topbar .brand:hover { text-decoration: none; }
.brand-mark {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--accent), #818cf8);
  flex-shrink: 0;
}

.topbar nav.primary-nav {
  display: flex;
  align-items: center;
  gap: 0.125rem;
  height: 100%;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  height: 100%;
  padding: 0 0.7rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.nav-link:hover { color: var(--text); text-decoration: none; }
.nav-link.active { color: var(--accent); border-bottom-color: var(--accent); }

details.nav-dropdown {
  height: 100%;
  display: flex;
  align-items: center;
  position: relative;
}
details.nav-dropdown > summary {
  list-style: none;
  cursor: pointer;
}
details.nav-dropdown > summary::-webkit-details-marker { display: none; }
details.nav-dropdown > summary::after {
  content: "";
  display: inline-block;
  margin-left: 0.3rem;
  border: 4px solid transparent;
  border-top-color: currentColor;
  opacity: 0.6;
  transform: translateY(2px);
}
details.nav-dropdown[open] > summary { color: var(--accent); }
.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 190px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
}
.nav-dropdown-menu a {
  padding: 0.5rem 0.6rem;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 500;
}
.nav-dropdown-menu a:hover { background: var(--gray-50); text-decoration: none; }
.nav-dropdown-menu a.active { color: var(--accent); background: var(--accent-subtle); }

.spacer { flex: 1; }

.topbar-right { display: flex; align-items: center; gap: 0.9rem; }
.company-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.7rem;
  background: var(--gray-50);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--gray-700);
}
.topbar-right a { font-size: 0.875rem; font-weight: 500; color: var(--muted); }
.topbar-right a:hover { color: var(--text); }

/* ---------- Layout ---------- */

main {
  max-width: 1040px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

h1 { font-size: 1.5rem; margin: 0 0 0.3rem; letter-spacing: -0.015em; font-weight: 700; }
h2 { font-size: 1.05rem; margin: 2rem 0 0.85rem; font-weight: 600; letter-spacing: -0.01em; }
h3 { font-size: 0.8rem; margin: 1.1rem 0 0.5rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }

.page-intro { color: var(--muted); margin: 0 0 1.5rem; font-size: 0.9375rem; }
.weather-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-left: 0.6rem;
  padding: 0.15rem 0.6rem;
  background: var(--info-subtle);
  color: var(--info);
  border: 1px solid var(--info-border);
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
}
.back-link { display: inline-block; margin-bottom: 1rem; font-size: 0.875rem; color: var(--muted); font-weight: 500; }
.back-link:hover { color: var(--accent); }

/* ---------- Stat tiles ---------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.9rem;
  margin-bottom: 1.75rem;
}
.stat-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow-sm);
}
.stat-tile .stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.stat-tile .stat-value { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; }
.stat-tile.stat-danger .stat-value { color: var(--danger); }
.stat-tile.stat-warning .stat-value { color: var(--warning); }
.stat-tile.stat-success .stat-value { color: var(--success); }

/* ---------- Cards ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  margin-bottom: 1.1rem;
  box-shadow: var(--shadow-sm);
}
.card > h2:first-child { margin-top: 0; }

/* ---------- Tables ---------- */

table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; font-size: 0.9rem; }
th, td { text-align: left; padding: 0.65rem 0.7rem; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.03em; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--gray-50); }
tr[onclick] { cursor: pointer; }

.empty {
  color: var(--muted);
  padding: 1.25rem 1rem;
  text-align: center;
  background: var(--gray-50);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.hint { color: var(--muted); font-size: 0.8125rem; font-weight: normal; }

/* ---------- Forms ---------- */

form.stacked label { display: block; margin-bottom: 1rem; font-size: 0.875rem; font-weight: 500; }
form.stacked label span { display: block; margin-bottom: 0.35rem; color: var(--gray-700); }
form.stacked input,
form.stacked select,
form.stacked textarea {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
form.stacked input:focus,
form.stacked select:focus,
form.stacked textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}
.field-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.field-row > label { flex: 1; min-width: 160px; }

/* ---------- Toggle group (2-option choices) ---------- */
/* A dropdown is for picking one of several — a binary choice should read
   as a switch, not a menu. Real radio inputs underneath (no JS, keyboard-
   and no-JS-friendly), styled as a segmented pill. Use this for any
   exactly-2-option choice; a <select> stays correct for 3+ options. */
.toggle-group { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.toggle-group .toggle-option { display: block; margin: 0; cursor: pointer; }
.toggle-group .toggle-option:not(:first-child) { border-left: 1px solid var(--border); }
.toggle-group .toggle-option input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-group .toggle-option span {
  display: block;
  margin: 0;
  padding: 0.4rem 0.8rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  transition: background 0.12s ease, color 0.12s ease;
}
.toggle-group .toggle-option input:checked + span { background: var(--accent); color: #fff; }
.toggle-group .toggle-option input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -2px; }
.toggle-group .toggle-option:hover span { background: var(--gray-50); }
.toggle-group .toggle-option input:checked:hover + span { background: var(--accent-hover); }

/* ---------- Buttons ---------- */

button, .button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.12s ease, box-shadow 0.12s ease, transform 0.05s ease;
}
button:hover, .button:hover { background: var(--accent-hover); border-color: var(--accent-hover); text-decoration: none; }
button:active, .button:active { transform: translateY(1px); }

.button-secondary {
  background: var(--surface);
  color: var(--gray-700);
  border: 1px solid var(--border);
}
.button-secondary:hover { background: var(--gray-50); border-color: var(--gray-300); color: var(--text); }

button.link, .link {
  background: none;
  border: none;
  padding: 0;
  color: var(--muted);
  font-size: inherit;
  font-weight: 500;
  cursor: pointer;
}
button.link:hover, .link:hover { color: var(--accent); text-decoration: underline; background: none; }

.actions { display: flex; gap: 0.75rem; margin-top: 1.1rem; align-items: center; }

/* ---------- Flash messages ---------- */

.flashes { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.flashes li { padding: 0.65rem 0.95rem; border-radius: var(--radius-sm); margin-bottom: 0.5rem; font-size: 0.875rem; font-weight: 500; }
.flash-error { background: var(--danger-subtle); color: var(--danger); border: 1px solid var(--danger-border); }
.flash-success { background: var(--success-subtle); color: var(--success); border: 1px solid var(--success-border); }

/* ---------- Company picker ---------- */

.company-list { list-style: none; padding: 0; }
.company-list li {
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
}
.company-list form { display: flex; align-items: center; gap: 0.6rem; }
.company-list button.link {
  background: none; border: none; color: var(--text); padding: 0; font-size: 0.95rem; font-weight: 600; cursor: pointer;
}
.company-list button.link:hover { color: var(--accent); text-decoration: underline; }

/* ---------- Badges ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--gray-100);
  color: var(--gray-600);
  text-transform: capitalize;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
}
.badge-success, .badge-active { background: var(--success-subtle); color: var(--success); border-color: var(--success-border); }
.badge-danger { background: var(--danger-subtle); color: var(--danger); border-color: var(--danger-border); }
.badge-warning { background: var(--warning-subtle); color: var(--warning); border-color: var(--warning-border); }
.badge-info { background: var(--info-subtle); color: var(--info); border-color: var(--info-border); }
.badge-neutral { background: var(--gray-100); color: var(--gray-600); }

/* ---------- Tabs ---------- */

.tabs { margin-top: 0.5rem; }
.tabs > .tab-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}
.tabs > .tab-list > .tab-btn {
  appearance: none;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0.65rem 0.9rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  margin-bottom: -1px;
}
.tabs > .tab-list > .tab-btn:hover { color: var(--text); }
.tabs > .tab-list > .tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.tabs > .tab-panels > .tab-panel { display: none; }
.tabs > .tab-panels > .tab-panel.active { display: block; animation: tab-fade 0.12s ease; }
@keyframes tab-fade { from { opacity: 0; } to { opacity: 1; } }
.tab-panel > h2:first-child { margin-top: 0; }

/* ---------- Card headers ---------- */
/* card-grid/entity-card (the old card-based Units/Tenants layouts) were
   retired 2026-08-22 in favor of dense status tables everywhere — see
   CLAUDE.md's "Unit/Building Utilities, Fixtures & Amenities" section.
   entity-card-head lives on: still used by every detail page's "General"
   card header (Building, Contractor, Tenant, ...). */
.entity-card-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.4rem; font-weight: 600; }

/* ---------- Documents ---------- */

.doc-gallery { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1rem; }
.doc-card {
  width: 140px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem;
  text-align: center;
  background: var(--surface);
}
.doc-card img { width: 100%; height: 110px; object-fit: cover; border-radius: var(--radius-sm); display: block; }
.doc-file-link {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 110px;
  font-size: 0.85rem;
  word-break: break-word;
  padding: 0.5rem;
  background: var(--gray-50);
  border-radius: var(--radius-sm);
}
.doc-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 0.5rem; gap: 0.4rem; }
.doc-meta .badge { font-size: 0.65rem; }
.doc-meta button.link { color: var(--danger); font-size: 0.8rem; }

/* ---------- Scheduler calendar ---------- */

.scheduler-layout { display: flex; gap: 1.5rem; align-items: flex-start; }
.cal-main { flex: 2; min-width: 0; }
.cal-sidebar { flex: 1; min-width: 260px; }

.cal-nav { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-bottom: 1rem; }
.cal-nav .button { padding: 0.4rem 0.75rem; }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.cal-head {
  background: var(--gray-50);
  padding: 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  text-align: center;
}
.cal-cell {
  background: var(--surface);
  min-height: 88px;
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.cal-cell-out { background: var(--gray-50); }
.cal-cell-out .cal-daynum { color: var(--gray-300); }
.cal-cell-today { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-daynum { font-size: 0.78rem; font-weight: 600; color: var(--gray-500); }
.cal-event {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  background: var(--accent-subtle);
  color: var(--accent-hover);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-event:hover { text-decoration: none; opacity: 0.85; }
.cal-event-done { background: var(--success-subtle); color: var(--success); text-decoration: line-through; }
.cal-event-overdue { background: var(--danger-subtle); color: var(--danger); }

.cal-rent { font-weight: 600; }
.cal-rent-paid { background: var(--success-subtle); color: var(--success); }
.cal-rent-upcoming { background: var(--info-subtle); color: var(--info); }
.cal-rent-late { background: var(--danger-subtle); color: var(--danger); }
.cal-legend { display: inline-block; width: 0.65rem; height: 0.65rem; border-radius: 3px; vertical-align: middle; }
.cal-legend.cal-rent-paid { background: var(--success); }
.cal-legend.cal-rent-upcoming { background: var(--info); }
.cal-legend.cal-rent-late { background: var(--danger); }

.event-row { padding: 0.85rem 1rem; margin-bottom: 0.6rem; display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.event-row-overdue { border-color: var(--danger-border); }
.event-row-actions { display: flex; flex-direction: column; gap: 0.35rem; align-items: flex-end; font-size: 0.8rem; }

/* ---------- Map drawer ---------- */
/* A left-side slide-out panel, toggled from the Buildings list (2026-08-22
   rework — the map used to be its own /properties/map page). Leaflet
   mis-sizes a map initialized while its container is off-screen/hidden, so
   buildings/list.html lazy-inits L.map() on first open and calls
   invalidateSize() every time the drawer opens. */
.map-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  z-index: 29;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}
.map-drawer-backdrop.open { opacity: 1; pointer-events: auto; }

.map-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(640px, 92vw);
  background: var(--surface);
  border-right: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  z-index: 30;
  transform: translateX(-100%);
  transition: transform 0.2s ease;
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
}
.map-drawer.open { transform: translateX(0); }
.map-drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; }
.map-drawer-head h2 { margin: 0; }
#buildings-map { flex: 1; min-height: 0; border-radius: var(--radius); border: 1px solid var(--border); }
.leaflet-popup-content a.button { margin-top: 0.35rem; }

/* ---------- Financials charts ---------- */
/* Hand-rolled, no chart library/CDN (Leaflet remains the one deliberate
   exception, for the map only) — plain SVG for the line chart, styled divs
   for bars. Mark specs: 2px lines, >=8px end markers with a 2px surface
   ring, rounded bar data-ends, a legend for any 2+-series chart, direct
   labels used sparingly (endpoints/extremes, not every point). */

.chart-legend { display: flex; gap: 1.25rem; margin-bottom: 0.85rem; font-size: 0.8125rem; }
.chart-legend-item { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--muted); font-weight: 500; }
.chart-legend-swatch { width: 12px; height: 3px; border-radius: 2px; display: inline-block; }
.chart-legend-swatch.dashed { background-image: linear-gradient(90deg, var(--gray-400) 60%, transparent 0%); background-size: 6px 3px; }

.line-chart-svg { width: 100%; height: auto; display: block; }
.line-chart-scheduled { fill: none; stroke: var(--gray-400); stroke-width: 2; stroke-dasharray: 5 4; }
.line-chart-collected { fill: none; stroke: var(--success); stroke-width: 2; }
.line-chart-dot { stroke: var(--surface); stroke-width: 2; }

.bar-chart-row { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 0.55rem; }
.bar-chart-row:last-child { margin-bottom: 0; }
.bar-chart-label { width: 150px; flex-shrink: 0; font-size: 0.8125rem; color: var(--text); }
.bar-chart-track { flex: 1; background: var(--gray-100); border-radius: var(--radius-sm); height: 20px; overflow: hidden; }
.bar-chart-fill { height: 100%; border-radius: 0 4px 4px 0; min-width: 2px; }
.bar-chart-value { width: 95px; text-align: right; font-size: 0.8125rem; font-weight: 600; flex-shrink: 0; font-variant-numeric: tabular-nums; }

.stacked-bar { display: flex; height: 26px; border-radius: var(--radius-sm); overflow: hidden; background: var(--gray-100); }
.stacked-bar-segment:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.stacked-bar-segment + .stacked-bar-segment { margin-left: 2px; }

/* ---------- Escalation policy canvas ---------- */

.escalation-canvas {
  display: flex;
  align-items: flex-start;
  gap: 0;
  overflow-x: auto;
  padding: 1.5rem 0.5rem 1rem;
}

.escalation-anchor, .escalation-block { flex-shrink: 0; position: relative; }

.escalation-anchor {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 0 1.75rem 0 0.25rem;
  color: var(--muted);
}
.escalation-anchor-dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 4px var(--accent-subtle);
  margin-top: 0.6rem;
}
.escalation-anchor-label { font-size: 0.75rem; font-weight: 600; white-space: nowrap; }

.escalation-anchor::after, .escalation-block::after {
  content: "";
  position: absolute;
  top: 50%; right: -1.1rem;
  transform: translateY(-50%);
  width: 0; height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 8px solid var(--gray-300);
}

.escalation-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 0.75rem 0.9rem;
  margin-right: 1.75rem;
  width: 190px;
  cursor: grab;
}
.escalation-block.dragging { opacity: 0.4; cursor: grabbing; }
.escalation-block label { display: block; margin-top: 0.5rem; }
.escalation-block label:first-of-type { margin-top: 0.6rem; }
.escalation-block label span { display: block; font-size: 0.72rem; color: var(--muted); margin-bottom: 0.2rem; }
.escalation-block input, .escalation-block select {
  width: 100%; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 0.35rem 0.5rem; font-size: 0.8125rem; font-family: inherit;
}

.escalation-block.timer { width: 130px; background: var(--bg-subtle); }

.escalation-block-head { display: flex; align-items: center; gap: 0.4rem; }
.escalation-drag-handle { color: var(--gray-400); cursor: grab; font-size: 0.9rem; line-height: 1; }
.escalation-block-kind {
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
  color: var(--accent);
}
.escalation-block.timer .escalation-block-kind { color: var(--gray-500); }
.escalation-remove {
  font-size: 1.1rem; line-height: 1; padding: 0 0.15rem; color: var(--gray-400);
}
.escalation-remove:hover { color: var(--danger); }

.escalation-add-buttons { display: flex; flex-direction: column; gap: 0.5rem; flex-shrink: 0; }

/* ---------- Responsive ---------- */

@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; height: auto; padding: 0.75rem 1rem; gap: 0.75rem; }
  .topbar nav.primary-nav { order: 3; width: 100%; overflow-x: auto; height: auto; }
  main { padding: 1.5rem 1rem 3rem; }
  .field-row { flex-direction: column; }
}
