:root {
  color-scheme: light;
  --bg: #ffffff;
  --text: #07132f;
  --muted: #536079;
  --line: #d2d8e3;
  --line-soft: #e8ebf1;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --accent: #0b4ea2;
  --accent-strong: #073d83;
  --success: #21943b;
  --warning-bg: #fff7ed;
  --warning-line: #fed7aa;
  --warning-text: #7c2d12;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

body.auth-page {
  min-height: 100vh;
  background: var(--surface-soft);
}

.auth-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.auth-panel {
  width: min(460px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 30px;
  background: var(--surface);
}

.auth-panel h1 {
  font-size: 28px;
}

.auth-panel p {
  color: var(--muted);
  line-height: 1.45;
}

.auth-form,
.settings-form {
  display: grid;
  gap: 10px;
}

.auth-form label,
.settings-form label {
  color: var(--text);
  font-size: 14px;
  font-weight: 760;
}

.auth-form input,
.settings-form input {
  min-height: 46px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 14px;
  color: var(--text);
  font: inherit;
  font-size: 16px;
}

.auth-form input:focus,
.settings-form input:focus {
  border-color: var(--accent);
  outline: 2px solid rgba(11, 78, 162, 0.16);
}

.auth-form button,
.settings-form button {
  margin-top: 8px;
}

.auth-status,
.settings-status {
  min-height: 22px;
  color: var(--warning-text);
}

.account-main {
  display: grid;
  gap: 22px;
  max-width: 880px;
}

.home-detail-main {
  display: grid;
  gap: 22px;
}

.settings-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  background: var(--surface);
}

.settings-panel h2 {
  margin: 0 0 10px;
  font-size: 22px;
  line-height: 1.25;
}

.settings-copy,
.settings-panel p {
  color: var(--muted);
  line-height: 1.45;
}

.provider-settings-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.provider-settings-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 54px auto;
  gap: 12px;
  align-items: center;
  border: 1px solid color-mix(in srgb, var(--provider-color, var(--accent)) 40%, var(--line));
  border-left: 5px solid var(--provider-color, var(--accent));
  border-radius: 8px;
  padding: 14px;
  background: color-mix(in srgb, var(--provider-color, var(--accent)) 7%, #ffffff);
}

.provider-settings-row strong,
.provider-settings-row span {
  display: block;
}

.provider-settings-row span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

.provider-settings-row input[type="color"] {
  width: 48px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 3px;
  background: #ffffff;
}

.topbar {
  display: flex;
  min-height: 106px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 38px;
  border-bottom: 1px solid var(--line);
}

h1 {
  margin: 0;
  font-size: 32px;
  font-weight: 760;
  line-height: 1.15;
  letter-spacing: 0;
}

.toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
}

.updated {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.4;
  white-space: nowrap;
}

.updated svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

button {
  display: inline-flex;
  min-height: 58px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 0;
  border-radius: 7px;
  padding: 0 24px;
  background: var(--accent);
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}

button:hover {
  background: var(--accent-strong);
}

button:disabled {
  cursor: wait;
  opacity: 0.7;
}

button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.link-button {
  text-decoration: none;
}

.compact-link {
  min-height: 36px;
  padding: 0 12px;
  font-size: 13px;
}

main {
  padding: 36px 38px 72px;
}

.dashboard-main {
  display: grid;
  gap: 28px;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
}

.metric-card,
.menu-card,
.latest-panel,
.provider-panel,
.bottom-summary {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.metric-card {
  min-height: 128px;
  padding: 20px;
}

.metric-card span,
.bottom-summary span {
  display: block;
  color: var(--muted);
  font-size: 14px;
  font-weight: 740;
  line-height: 1.35;
}

.metric-card strong {
  display: block;
  margin-top: 18px;
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 780;
  line-height: 1.08;
}

.provider-panel {
  padding: 24px;
}

.provider-panel h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
}

.provider-panel p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.providers-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.provider-card {
  border: 1px solid color-mix(in srgb, var(--provider-color, var(--accent)) 42%, var(--line));
  border-left: 5px solid var(--provider-color, var(--accent));
  border-radius: 8px;
  padding: 16px;
  background: color-mix(in srgb, var(--provider-color, var(--accent)) 7%, #ffffff);
}

.provider-card strong,
.provider-card span {
  display: block;
}

.provider-card strong {
  margin-top: 12px;
  font-size: 21px;
  line-height: 1.2;
}

.provider-card > span:not(.provider-badge) {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
}

.provider-badge {
  display: inline-flex;
  width: fit-content;
  min-height: 28px;
  align-items: center;
  border: 1px solid color-mix(in srgb, var(--provider-color, var(--success)) 55%, var(--line));
  border-radius: 999px;
  padding: 0 10px;
  background: color-mix(in srgb, var(--provider-color, var(--success)) 12%, #ffffff);
  color: var(--text);
  font-size: 13px;
  font-weight: 780;
  line-height: 1;
  white-space: nowrap;
}

.provider-badge::before {
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 999px;
  background: var(--provider-marker-color, var(--provider-color, var(--success)));
  content: "";
}

.dashboard-menu {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.menu-card {
  display: grid;
  gap: 10px;
  min-height: 164px;
  padding: 22px;
  color: inherit;
  text-decoration: none;
}

.menu-card:hover {
  border-color: var(--accent);
  background: var(--surface-soft);
}

.menu-card span {
  color: var(--accent);
  font-size: 14px;
  font-weight: 780;
}

.menu-card strong {
  font-size: 21px;
  line-height: 1.2;
}

.menu-card small {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

.latest-panel {
  padding: 24px;
}

.latest-panel h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
}

.latest-panel p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.latest-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.latest-list li {
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  padding: 14px 16px;
  background: var(--surface-soft);
}

.latest-list strong,
.latest-list span {
  display: block;
}

.latest-list .provider-badge {
  margin-bottom: 10px;
}

.latest-list strong {
  font-size: 16px;
  line-height: 1.3;
}

.latest-list span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.warnings {
  margin: 0 0 20px;
  border: 1px solid var(--warning-line);
  border-radius: 8px;
  padding: 14px 16px;
  background: var(--warning-bg);
  color: var(--warning-text);
  font-size: 15px;
  line-height: 1.45;
}

.warnings p {
  margin: 0;
}

.warnings p + p {
  margin-top: 8px;
}

.home-hero,
.detail-panel,
.detail-metrics article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.home-hero {
  padding: 28px;
}

.home-hero h2,
.detail-panel h2 {
  margin: 12px 0 0;
  font-size: 26px;
  line-height: 1.2;
}

.home-hero p,
.detail-panel p,
.muted-copy {
  color: var(--muted);
  line-height: 1.55;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.detail-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.detail-metrics article {
  min-height: 112px;
  padding: 18px;
}

.detail-metrics span {
  display: block;
  color: var(--muted);
  font-size: 14px;
  font-weight: 740;
}

.detail-metrics strong {
  display: block;
  margin-top: 12px;
  font-size: 25px;
  line-height: 1.15;
}

.detail-panel {
  padding: 24px;
}

.detail-panel h2 {
  margin-top: 0;
  font-size: 22px;
}

.panel-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-heading-row h2 {
  margin: 0;
}

.collapsible-panel.is-collapsed .collapsible-content {
  display: none;
}

.image-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.compact-gallery {
  grid-template-columns: repeat(auto-fit, minmax(140px, 220px));
}

.image-gallery figure {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface-soft);
}

.image-gallery img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.image-gallery figcaption {
  padding: 10px 12px;
  color: var(--muted);
  font-size: 13px;
}

.address-list {
  display: grid;
  gap: 12px;
  overflow-x: auto;
}

.unit-table {
  width: 100%;
  min-width: 860px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  background: var(--surface);
}

.unit-table th,
.unit-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 14px;
  line-height: 1.35;
  vertical-align: top;
}

.unit-table tbody tr:last-child td {
  border-bottom: 0;
}

.unit-table .selected-address td {
  background: #eef6ff;
}

.unit-status {
  display: inline-flex;
  width: fit-content;
  min-height: 28px;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 780;
  white-space: nowrap;
}

.unit-status.signed-up {
  background: color-mix(in srgb, var(--success) 14%, #ffffff);
  color: #12612a;
}

.unit-status.not-signed-up {
  background: #f1f5f9;
  color: var(--muted);
}

.unit-table button:disabled {
  cursor: wait;
}

.room-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.room-filter {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 13px;
  font-weight: 760;
}

.room-filter:hover,
.room-filter.active {
  border-color: var(--accent);
  background: #eef6ff;
  color: var(--accent);
}

.address-card {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 18px;
  background: var(--surface-soft);
}

.address-card.selected-address {
  border-color: var(--accent);
  background: #eef6ff;
}

.address-card > div {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.address-card h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.3;
}

.address-card span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 14px;
  font-weight: 740;
}

.address-card p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.map-panel {
  margin: 0 0 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.map-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
}

.map-header h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 760;
  line-height: 1.25;
}

.map-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

.map-header .map-missing {
  max-width: 820px;
  color: var(--warning-text);
}

.map-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 12px;
}

.reference-form {
  max-width: 820px;
  margin: 16px 0 0;
}

.reference-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 8px;
}

.reference-form label {
  display: block;
  margin: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 760;
}

.reference-form.is-collapsed .reference-row {
  display: none;
}

.reference-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 10px;
}

.reference-row input {
  min-height: 44px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 14px;
  color: var(--text);
  font: inherit;
  font-size: 15px;
}

.reference-row input:focus {
  border-color: var(--accent);
  outline: 2px solid rgba(11, 78, 162, 0.16);
}

.reference-status {
  min-height: 22px;
}

.ghost-button {
  background: var(--surface-soft);
}

.ghost-button:hover {
  background: var(--line-soft);
}

.secondary-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  padding: 0 18px;
  background: #ffffff;
  color: var(--text);
  font-size: 15px;
  font-weight: 720;
}

.secondary-button:hover {
  background: var(--surface-soft);
}

#map {
  height: 460px;
  overflow: hidden;
  background: var(--surface-soft);
}

.leaflet-container {
  position: relative;
  overflow: hidden;
  outline: 0;
  font-family: inherit;
}

.leaflet-container img {
  max-width: none;
}

.leaflet-pane,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-tile-container,
.leaflet-pane > svg,
.leaflet-pane > canvas,
.leaflet-zoom-box,
.leaflet-image-layer,
.leaflet-layer {
  position: absolute;
  top: 0;
  left: 0;
}

.leaflet-tile-pane {
  z-index: 200;
}

.leaflet-overlay-pane {
  z-index: 400;
}

.leaflet-marker-pane {
  z-index: 600;
}

.leaflet-tooltip-pane {
  z-index: 650;
}

.leaflet-popup-pane {
  z-index: 700;
}

.leaflet-pane > svg path {
  pointer-events: auto;
}

.leaflet-top,
.leaflet-bottom {
  position: absolute;
  z-index: 1000;
  pointer-events: none;
}

.leaflet-top {
  top: 0;
}

.leaflet-bottom {
  bottom: 0;
}

.leaflet-left {
  left: 0;
}

.leaflet-right {
  right: 0;
}

.leaflet-control {
  position: relative;
  z-index: 800;
  float: left;
  clear: both;
  pointer-events: auto;
}

.leaflet-right .leaflet-control {
  float: right;
}

.leaflet-top .leaflet-control {
  margin-top: 10px;
}

.leaflet-bottom .leaflet-control {
  margin-bottom: 10px;
}

.leaflet-left .leaflet-control {
  margin-left: 10px;
}

.leaflet-right .leaflet-control {
  margin-right: 10px;
}

.leaflet-control-zoom {
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 4px;
  background: #ffffff;
}

.leaflet-control-zoom a {
  display: block;
  width: 30px;
  height: 30px;
  color: var(--text);
  font-size: 20px;
  font-weight: 700;
  line-height: 30px;
  text-align: center;
  text-decoration: none;
}

.leaflet-control-zoom a + a {
  border-top: 1px solid var(--line);
}

.leaflet-popup {
  position: absolute;
  margin-bottom: 20px;
  text-align: center;
}

.leaflet-popup-content-wrapper {
  border-radius: 6px;
  padding: 1px;
  background: #ffffff;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.22);
}

.leaflet-popup-content {
  min-width: 190px;
  margin: 13px 19px;
  text-align: left;
}

.leaflet-popup-tip-container {
  position: absolute;
  left: 50%;
  width: 40px;
  height: 20px;
  margin-left: -20px;
  overflow: hidden;
  pointer-events: none;
}

.leaflet-popup-tip {
  width: 17px;
  height: 17px;
  margin: -10px auto 0;
  transform: rotate(45deg);
  background: #ffffff;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.18);
}

.leaflet-popup-close-button {
  position: absolute;
  top: 0;
  right: 0;
  width: 24px;
  height: 24px;
  color: var(--muted);
  font: 18px/24px Arial, sans-serif;
  text-align: center;
  text-decoration: none;
}

.leaflet-popup-close-button:hover {
  color: var(--text);
}

.leaflet-tooltip {
  position: absolute;
  padding: 4px 8px;
  border: 1px solid rgba(7, 19, 47, 0.18);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 2px 8px rgba(7, 19, 47, 0.16);
  color: var(--text);
  font-size: 12px;
  font-weight: 760;
  line-height: 1.2;
  pointer-events: none;
  white-space: nowrap;
}

.place-label {
  transform: translateY(-2px);
}

.map-popup-muted {
  color: var(--muted);
}

.map-detail-link {
  display: inline-flex;
  margin: 8px 0 0;
  color: var(--accent);
  font-weight: 760;
}

.leaflet-popup-content {
  color: var(--text);
  font: 14px/1.4 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.leaflet-popup-content p {
  margin: 5px 0;
}

.popup-provider {
  margin: 0 0 8px;
}

.map-address-list {
  max-height: 180px;
  margin: 10px 0 0;
  padding: 0 0 0 18px;
  overflow: auto;
}

.map-address-list li {
  margin: 6px 0;
}

.map-address-list span,
.map-address-list small {
  display: block;
}

.map-address-list small {
  color: var(--muted);
}

.travel-box {
  margin: 12px 0;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  padding: 10px;
  background: var(--surface-soft);
}

.travel-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 8px 0;
}

.travel-grid span {
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  padding: 8px;
  background: #ffffff;
}

.travel-grid b,
.travel-grid small {
  display: block;
}

.travel-grid small {
  color: var(--muted);
}

.travel-box a {
  color: var(--accent);
  font-weight: 760;
}

.reference-cross-marker {
  position: relative;
}

.reference-cross-marker span {
  position: absolute;
  inset: 0;
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: #dc2626;
  box-shadow: 0 2px 8px rgba(7, 19, 47, 0.28);
}

.reference-cross-marker span::before,
.reference-cross-marker span::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 13px;
  height: 2px;
  border-radius: 999px;
  background: #ffffff;
  content: "";
}

.reference-cross-marker span::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.reference-cross-marker span::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

body.fullscreen-map-page {
  height: 100vh;
  min-width: 320px;
  overflow: hidden;
}

.fullscreen-shell {
  position: fixed;
  inset: 0;
  padding: 0;
}

#fullscreen-map {
  position: absolute;
  inset: 0;
  background: var(--surface-soft);
}

.fullscreen-controls {
  position: absolute;
  z-index: 1200;
  top: 16px;
  left: 16px;
  width: min(620px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 34px rgba(7, 19, 47, 0.18);
}

.panel-toggle {
  width: 100%;
  margin: 0 0 12px;
}

.fullscreen-controls.is-panel-collapsed {
  width: auto;
  max-width: calc(100vw - 32px);
  overflow: visible;
  padding: 8px;
}

.fullscreen-controls.is-panel-collapsed .fullscreen-content {
  display: none;
}

.fullscreen-controls.is-panel-collapsed .panel-toggle {
  width: auto;
  margin: 0;
}

.fullscreen-heading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.fullscreen-heading h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}

.fullscreen-heading p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.fullscreen-heading .map-missing {
  color: var(--warning-text);
}

.fullscreen-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.fullscreen-actions p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.map-filter-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 12px;
  background: rgba(248, 250, 252, 0.86);
}

.map-filter-panel label,
.map-filter-panel legend {
  color: var(--text);
  font-size: 13px;
  font-weight: 760;
}

.map-filter-panel select {
  display: block;
  width: 100%;
  min-height: 40px;
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 10px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  font-size: 14px;
}

.map-filter-panel fieldset {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 0;
  margin: 0;
  border: 0;
  padding: 0;
}

.map-filter-panel fieldset label {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 9px;
  background: #ffffff;
  font-size: 12px;
}

.map-filter-panel > button {
  grid-column: 1 / -1;
}

.filter-panel {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) minmax(260px, 1.4fr) auto;
  gap: 14px;
  align-items: end;
  margin: 0 0 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--surface);
}

.filter-panel label,
.filter-panel legend {
  color: var(--text);
  font-size: 14px;
  font-weight: 760;
}

.filter-panel select {
  display: block;
  width: 100%;
  min-height: 44px;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 12px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  font-size: 15px;
}

.filter-panel fieldset {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
  margin: 0;
  border: 0;
  padding: 0;
}

.filter-panel fieldset label {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  background: var(--surface-soft);
  font-size: 13px;
  font-weight: 740;
}

.table-frame {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.table-scroll {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

th,
td {
  padding: 30px 22px;
  text-align: left;
  vertical-align: middle;
  font-size: 18px;
  line-height: 1.4;
}

th {
  border-bottom: 1px solid var(--line);
  font-weight: 760;
}

tbody tr {
  border-bottom: 1px solid var(--line);
}

tbody tr:last-child {
  border-bottom: 0;
}

.home-button {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 18px;
  font-weight: 760;
}

.home-info-link {
  display: inline-flex;
  margin-left: 12px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 760;
  text-decoration: none;
}

.home-info-link:hover {
  text-decoration: underline;
}

.home-button:hover {
  background: transparent;
  color: var(--accent);
}

.home-button svg {
  width: 22px;
  height: 22px;
  transition: transform 160ms ease;
}

.home-button[aria-expanded="true"] svg {
  transform: rotate(90deg);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.status::before {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--success);
  content: "";
}

.detail-cell {
  padding: 0 22px 28px;
}

.detail-table {
  min-width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.detail-table th,
.detail-table td {
  padding: 24px 42px;
  font-size: 17px;
}

.detail-table th {
  background: var(--surface-soft);
  color: #334055;
  font-weight: 720;
}

.empty-row td {
  padding: 46px 22px;
  color: var(--muted);
  text-align: center;
}

.footnote {
  margin: 46px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
}

.bottom-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  margin-top: 18px;
  overflow: hidden;
  background: var(--line);
}

.bottom-summary div {
  min-height: 104px;
  padding: 18px;
  background: var(--surface);
}

.bottom-summary strong {
  display: block;
  margin-top: 10px;
  font-size: 24px;
  line-height: 1.18;
}

@media (max-width: 760px) {
  .topbar {
    min-height: auto;
    flex-direction: column;
    align-items: stretch;
    padding: 22px 18px;
  }

  h1 {
    font-size: 27px;
  }

  .toolbar {
    align-items: stretch;
    justify-content: stretch;
    gap: 14px;
  }

  .toolbar > * {
    width: 100%;
  }

  .updated {
    min-width: 0;
    font-size: 15px;
    white-space: normal;
  }

  button {
    min-height: 50px;
    padding: 0 18px;
    font-size: 16px;
  }

  main {
    padding: 24px 14px 48px;
  }

  .overview-grid,
  .dashboard-menu,
  .latest-list,
  .providers-list,
  .provider-settings-row,
  .detail-metrics,
  .image-gallery,
  .bottom-summary {
    grid-template-columns: 1fr;
  }

  .filter-panel {
    grid-template-columns: 1fr;
  }

  .provider-settings-row {
    align-items: stretch;
  }

  .home-hero,
  .detail-panel {
    padding: 18px;
  }

  .home-actions,
  .address-card > div {
    flex-direction: column;
    align-items: stretch;
  }

  .map-header {
    flex-direction: column;
    align-items: stretch;
    padding: 18px;
  }

  .map-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .reference-row {
    grid-template-columns: 1fr;
  }

  #map {
    height: 420px;
  }

  th,
  td {
    padding: 22px 18px;
    font-size: 16px;
  }

  .table-scroll {
    overflow-x: visible;
  }

  table,
  thead,
  tbody,
  tr,
  td {
    display: block;
  }

  table {
    min-width: 0;
  }

  thead {
    display: none;
  }

  tbody tr {
    padding: 20px 18px;
  }

  tbody tr:not(.detail-row) td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 7px 0;
    font-size: 16px;
  }

  tbody tr:not(.detail-row) td::before {
    flex: 0 0 auto;
    color: var(--muted);
    content: attr(data-label);
    font-size: 13px;
    font-weight: 740;
  }

  tbody tr:not(.detail-row) td:first-child::before {
    display: none;
  }

  .home-button {
    width: 100%;
    min-height: auto;
    justify-content: flex-start;
    gap: 14px;
    font-size: 18px;
  }

  .home-info-link {
    margin: 8px 0 0 36px;
  }

  .detail-row {
    padding: 0 18px 22px;
  }

  .detail-cell {
    padding: 0;
  }

  .detail-table {
    min-width: 0;
    border-radius: 7px;
  }

  .detail-table thead {
    display: none;
  }

  .detail-table tbody tr {
    padding: 14px 16px;
  }

  .detail-table th,
  .detail-table td {
    padding: 8px 0;
    font-size: 15px;
  }

  .detail-table td {
    display: grid;
    grid-template-columns: minmax(96px, 34%) minmax(0, 1fr);
    gap: 12px;
  }

  .detail-table td::before {
    color: var(--muted);
    content: attr(data-label);
    font-size: 12px;
    font-weight: 740;
  }

  .unit-table {
    min-width: 0;
  }

  .unit-table th,
  .unit-table td {
    padding: 8px 0;
    font-size: 14px;
  }

  .unit-table td {
    display: grid;
    grid-template-columns: minmax(98px, 34%) minmax(0, 1fr);
    gap: 12px;
  }

  .unit-table td::before {
    color: var(--muted);
    content: attr(data-label);
    font-size: 12px;
    font-weight: 740;
  }

  .unit-table td:first-child::before {
    display: block;
  }

  .fullscreen-controls {
    top: 12px;
    left: 12px;
    width: calc(100vw - 24px);
    max-height: min(52vh, 520px);
    padding: 14px;
  }

  .fullscreen-heading {
    grid-template-columns: 1fr;
  }

  .map-filter-panel {
    grid-template-columns: 1fr;
  }

  .fullscreen-actions {
    flex-direction: column;
    align-items: stretch;
  }
}
