@font-face {
  font-family: "DM Sans";
  src: url("/static/assets/fonts/DMSans-Variable.ttf") format("truetype");
  font-style: normal;
  font-weight: 100 1000;
  font-display: swap;
}

:root {
  --hydro-dark: #003c46;
  --hydro-blue: #007c89;
  --bg: #f7f5f2;
  --panel: #ffffff;
  --panel-soft: #fbfaf8;
  --border: #ded8cf;
  --border-strong: #c9c1b6;
  --text: #151515;
  --muted: #666666;
  --shadow: 0 12px 34px rgba(0, 30, 35, 0.08);
}

body.dark-mode {
  --hydro-dark: #d9f7fb;
  --hydro-blue: #27b7c7;
  --bg: #101719;
  --panel: #172123;
  --panel-soft: #1b2729;
  --border: #334144;
  --border-strong: #4a5b5e;
  --text: #eef5f6;
  --muted: #aebabc;
  --shadow: 0 14px 38px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "DM Sans", system-ui, sans-serif;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  text-rendering: optimizeLegibility;
}

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

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

.login-mode .topbar {
  display: none;
}

.login-mode main {
  width: 100%;
  margin: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5000;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(260px, auto) minmax(180px, 1fr);
  align-items: center;
  min-height: 100px;
  padding: 14px clamp(24px, 5vw, 110px);
  background: rgba(247, 245, 242, 0.96);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

body.dark-mode .topbar {
  background: rgba(16, 23, 25, 0.94);
}

.header-logo {
  display: flex;
  align-items: center;
  min-width: 0;
}

.header-logo-left {
  justify-content: flex-start;
  padding-left: clamp(14px, 3vw, 58px);
}

.header-logo-right {
  justify-content: flex-end;
  padding-right: clamp(94px, 8vw, 132px);
}

.header-logo img {
  display: block;
  width: auto;
  object-fit: contain;
}

.header-logo a {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
}

.header-logo-left img {
  max-height: 70px;
  max-width: min(310px, 100%);
}

.header-logo-right img {
  max-height: 76px;
  max-width: min(280px, 100%);
}

.header-title {
  color: var(--hydro-dark);
  font-size: clamp(24px, 2.2vw, 36px);
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.logout-button {
  position: absolute;
  top: 12px;
  right: 18px;
  min-height: 34px;
  padding: 7px 12px;
  font-size: 13px;
}

main {
  width: min(1500px, calc(100vw - 32px));
  margin: 22px auto 34px;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  width: min(1500px, calc(100vw - 32px));
  margin: 0 auto 26px;
  padding: 18px 4px 0;
  border-top: 1px solid var(--border);
  color: #526166;
  font-size: 13px;
}

.site-footer div {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--hydro-dark);
}

.footer-brand img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.site-footer a {
  color: var(--hydro-dark);
  font-weight: 700;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.hidden {
  display: none !important;
}

.login-panel {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 32px;
  background:
    linear-gradient(135deg, rgba(0, 60, 70, 0.08), rgba(0, 124, 137, 0.04)),
    var(--bg);
}

form,
.filters,
.panel,
.summary > div {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

form {
  width: min(420px, 100%);
  padding: 24px;
}

textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 9px 10px;
  color: var(--text);
  font: inherit;
  resize: vertical;
}

textarea:focus {
  border-color: var(--hydro-blue);
  box-shadow: 0 0 0 3px rgba(0, 124, 137, 0.12);
  outline: none;
}

.login-card {
  width: min(470px, calc(100vw - 32px));
  padding: 34px;
}

.login-logo {
  display: block;
  width: min(280px, 82%);
  height: auto;
  margin: 0 auto 22px;
}

.login-title {
  margin-bottom: 28px;
  color: var(--hydro-dark);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-align: center;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0 0 16px;
  color: var(--hydro-dark);
  font-weight: 800;
}

h2 {
  font-size: 17px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

input,
select,
button {
  min-height: 36px;
  border-radius: 6px;
  font: inherit;
}

input,
select {
  width: 100%;
  border: 1px solid var(--border);
  background: #fff;
  padding: 9px 10px;
  color: var(--text);
}

input:focus,
select:focus {
  border-color: var(--hydro-blue);
  box-shadow: 0 0 0 3px rgba(0, 124, 137, 0.12);
  outline: none;
}

button {
  border: 1px solid var(--hydro-blue);
  background: var(--hydro-blue);
  color: #fff;
  padding: 7px 12px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

button:hover {
  filter: brightness(0.96);
}

button.secondary,
button.ghost {
  background: #fff;
  color: var(--hydro-dark);
}

body.dark-mode button.secondary,
body.dark-mode button.ghost,
body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea,
body.dark-mode .picker-button,
body.dark-mode .filter-option,
body.dark-mode .qa-toggle {
  background: #111b1d;
  color: var(--text);
  border-color: var(--border);
}

body.dark-mode table,
body.dark-mode .table-wrap,
body.dark-mode .pipe-info-item,
body.dark-mode .request-queue {
  background: var(--panel-soft);
}

body.dark-mode th {
  background: #182426;
}

body.dark-mode .map-popup,
body.dark-mode .point-label,
body.dark-mode .sgu-point-label,
body.dark-mode .smhi-point-label,
body.dark-mode .groundwater-gradient-legend,
body.dark-mode .map-layer-menu {
  background: rgba(24, 36, 38, 0.96);
  color: var(--text);
  border-color: var(--border);
}


.error {
  min-height: 20px;
  color: #b00020;
}

.filters {
  display: grid;
  gap: 8px;
  align-items: start;
  align-content: start;
  padding: 9px 10px;
  background: var(--panel-soft);
}

.filter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.filter-header h2 {
  margin: 0;
}

.filter-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  align-items: end;
}

.filter-point {
  grid-column: 1 / -1;
}

.filter-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: start;
  align-content: start;
}

.date-shortcuts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 6px;
}

.date-shortcuts button {
  min-height: 32px;
  padding: 6px 8px;
  font-size: 12px;
  white-space: normal;
}

.filter-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
}

.filter-option {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 3px 7px;
  border: 1px solid rgba(222, 216, 207, 0.85);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--hydro-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
}

.filter-option input {
  width: 14px;
  min-height: 14px;
  margin: 0;
  accent-color: var(--hydro-blue);
}

.filter-option span {
  line-height: 1.15;
}

.filters label {
  gap: 5px;
  font-size: 11px;
}

.filters input:not([type="checkbox"]),
.filters select,
.filters .picker-button {
  min-height: 34px;
  padding: 7px 9px;
  font-size: 13px;
}

.groundwater-gradient-legend {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 500;
  width: 172px;
  padding: 8px 9px;
  border: 1px solid rgba(0, 60, 70, 0.18);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 24px rgba(0, 30, 35, 0.14);
  color: var(--hydro-dark);
  font-size: 11px;
  font-weight: 800;
}

.legend-title {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.legend-bar {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgb(35, 95, 190), rgb(240, 55, 45));
}

.legend-scale {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 5px;
}

.qa-toggle {
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--hydro-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
}

.qa-toggle input {
  width: 16px;
  min-height: 16px;
  margin: 0;
}

.filters.collapsed {
  padding: 14px 18px;
}

.filters.collapsed .filter-body {
  display: none;
}

.filter-toggle {
  display: none;
}

.filter-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  min-width: 150px;
}

.filter-actions.compact {
  justify-content: flex-start;
}

.point-picker {
  position: relative;
}

.picker-button {
  width: 100%;
  border-color: var(--border);
  background: #fff;
  color: var(--text);
  font-weight: 600;
  text-align: left;
}

.picker-button::after {
  content: "▾";
  float: right;
  color: var(--muted);
}

.point-picker-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 1000;
  width: 100%;
  max-height: 260px;
  overflow: auto;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.point-option {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.point-option-all {
  background: #fff;
  color: var(--hydro-dark);
  font-weight: 800;
}

.point-picker-divider {
  height: 1px;
  margin: 6px 4px;
  background: var(--border);
}

.point-option:hover {
  background: var(--panel-soft);
}

.point-option-muted {
  color: #6f7c80;
}

.point-option-muted span::after {
  content: " saknar vald parameter";
  color: #8b979b;
  font-size: 11px;
}

.point-option input {
  width: 16px;
  min-height: 16px;
  margin: 0;
}

.qa-cell {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  gap: 6px;
}

.qa-select {
  width: 15px;
  min-height: 15px;
  margin: 0;
  accent-color: var(--hydro-blue);
}

.qa-badge {
  display: inline-flex;
  align-items: center;
  max-width: calc(100% - 24px);
  min-height: 22px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #fff4df;
  color: #7a4a00;
  font-size: 11px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qa-ok {
  color: var(--muted);
}

.summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.workspace-tabs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 12px 0 0;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-soft);
  box-shadow: var(--shadow);
}

.workspace-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 32px;
  padding: 6px 12px;
  border-color: transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.workspace-tab:hover,
.workspace-tab.active {
  border-color: var(--hydro-blue);
  background: var(--panel);
  color: var(--hydro-dark);
  filter: none;
}

.workspace-tab-count {
  display: inline-grid;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--hydro-blue);
  color: #fff;
  font-size: 11px;
  line-height: 20px;
  place-items: center;
}

.top-workspace-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.96fr) minmax(300px, 1fr) minmax(300px, 1fr);
  justify-content: start;
  align-items: stretch;
  gap: 12px;
  margin: 12px 0;
}

.top-workspace-grid .filters,
.top-workspace-grid .project-info-card {
  height: 100%;
}

.top-workspace-grid .filters {
  margin: 0;
}

.project-info-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.44fr) minmax(300px, 0.56fr);
  justify-content: start;
  align-items: start;
  gap: 12px;
  margin: 12px 0;
}

.project-info-card {
  min-width: 0;
  padding: 9px 11px;
  background: var(--panel-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.project-info-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.project-info-header span,
.project-info-list dt,
.pipe-info-item dt {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.project-info-header strong {
  display: block;
  overflow: hidden;
  color: var(--hydro-dark);
  font-size: 18px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-info-list,
.pipe-info-item dl {
  display: grid;
  gap: 0;
  margin: 0;
}

.project-info-list div {
  display: grid;
  grid-template-columns: minmax(118px, 1fr) minmax(90px, auto);
  gap: 10px;
  align-items: baseline;
  padding: 4px 0;
  border-top: 1px solid rgba(222, 216, 207, 0.55);
}

.project-info-list div:first-child {
  border-top: 0;
}

.project-info-list dd,
.pipe-info-item dd {
  margin: 0;
  color: var(--hydro-dark);
  font-size: 13px;
  font-weight: 700;
  text-align: right;
}

.project-overview-card .theme-row {
  grid-column: 1 / -1;
}

.status-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 0 0 6px;
}

.project-archive-button {
  width: 100%;
  min-height: 32px;
  margin: 0 0 6px;
  padding: 5px 9px;
  font-size: 12px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 7px;
  border: 1px solid rgba(0, 124, 137, 0.2);
  border-radius: 999px;
  background: rgba(0, 124, 137, 0.07);
  color: var(--hydro-dark);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.status-chip.muted {
  border-color: rgba(82, 97, 102, 0.18);
  background: rgba(82, 97, 102, 0.07);
  color: var(--muted);
}

.status-chip.external {
  border-color: rgba(123, 44, 191, 0.22);
  background: rgba(123, 44, 191, 0.08);
}

.status-chip.weather {
  border-color: rgba(40, 111, 150, 0.24);
  background: rgba(40, 111, 150, 0.08);
}

.status-chip.error {
  border-color: rgba(180, 75, 75, 0.35);
  background: rgba(180, 75, 75, 0.1);
  color: #9b3030;
}

body.dark-mode .status-chip.error {
  color: #ffb4b4;
}

.loading-target {
  position: relative;
}

.loading-target.is-loading::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.48), transparent);
  background-size: 220% 100%;
  animation: loading-sheen 1.1s linear infinite;
}

.loading-target.is-loading::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  top: 8px;
  z-index: 21;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(0, 124, 137, 0.12), rgba(0, 124, 137, 0.62), rgba(0, 124, 137, 0.12));
  background-size: 220% 100%;
  animation: loading-sheen 1.1s linear infinite;
}

body.dark-mode .loading-target.is-loading::before {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
  background-size: 220% 100%;
}

@keyframes loading-sheen {
  from { background-position: 120% 0; }
  to { background-position: -120% 0; }
}

.theme-row {
  margin-top: 8px;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  color: var(--hydro-dark);
  font-size: 12px;
  font-weight: 800;
  text-transform: none;
}

.theme-toggle input {
  width: 15px;
  min-height: 15px;
  margin: 0;
  accent-color: var(--hydro-blue);
}

.pipe-info-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-bottom: 10px;
}

.pipe-info-actions select {
  width: 100%;
}

.pipe-info-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  max-height: none;
  overflow: visible;
  padding-right: 2px;
}

.pipe-info-item {
  padding: 8px 10px;
  border: 1px solid rgba(222, 216, 207, 0.85);
  border-radius: 8px;
  background: var(--panel-soft);
}

.pipe-info-item h3 {
  margin: 0 0 6px;
  color: var(--hydro-dark);
  font-size: 17px;
}

.pipe-info-item dl {
  position: relative;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 12px;
}

.pipe-info-item dl::after {
  content: "";
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: 50%;
  width: 1px;
  background: rgba(201, 193, 182, 0.55);
  pointer-events: none;
  transform: translateX(-0.5px);
}

body.dark-mode .pipe-info-item dl::after {
  background: rgba(74, 91, 94, 0.72);
}

.pipe-info-item dl div {
  display: grid;
  grid-template-columns: minmax(96px, 1fr) minmax(68px, auto);
  gap: 6px;
  align-items: baseline;
  min-width: 0;
  padding: 2px 0;
  border-top: 1px solid rgba(222, 216, 207, 0.55);
}

.pipe-info-item dt {
  color: var(--muted);
}

.pipe-info-item dd {
  font-size: 13px;
}

.pipe-info-item dl div:first-child {
  border-top: 0;
}

.pipe-info-item dd {
  text-align: right;
}

.pipe-info-empty,
.pipe-info-more {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.summary > div {
  padding: 12px 14px;
}

.summary span {
  display: block;
  color: var(--hydro-dark);
  font-size: 22px;
  font-weight: 800;
}

.summary small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: stretch;
}

.panel {
  display: flex;
  flex-direction: column;
  padding: 16px;
  min-width: 0;
}

.data-request-panel {
  margin: 16px 0;
}

.inline-form {
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.request-fields {
  display: grid;
  grid-template-columns: minmax(140px, 0.9fr) minmax(180px, 1fr) minmax(140px, 0.8fr) minmax(120px, 0.7fr) minmax(110px, 0.6fr);
  gap: 14px;
  margin-bottom: 14px;
}

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

.form-status {
  color: var(--hydro-dark);
  font-size: 13px;
  font-weight: 700;
}

.request-queue {
  margin-top: 18px;
}

.request-queue-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.request-queue-header h3 {
  margin: 0;
  color: var(--hydro-dark);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.request-table-wrap {
  max-height: 260px;
}

.mail-import-panel {
  margin-top: 16px;
}

.import-layout {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.import-list-wrap,
.import-detail {
  min-width: 0;
}

.import-detail {
  padding-left: 18px;
  border-left: 1px solid var(--border);
}

.import-batches {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.import-batch {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  display: grid;
  gap: 4px;
  width: 100%;
  min-height: 0;
  padding: 10px 12px;
  border-color: var(--border);
  background: var(--panel-soft);
  color: var(--text);
  text-align: left;
}

.import-batch strong {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  color: var(--hydro-dark);
  font-size: 13px;
}

.import-batch span {
  color: var(--muted);
  font-size: 12px;
}

.import-batch.active {
  border-color: var(--hydro-blue);
  box-shadow: 0 0 0 3px rgba(0, 124, 137, 0.1);
}

.import-detail-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.import-detail-toolbar label {
  flex: 1;
}

.import-detail-summary {
  display: grid;
  justify-items: end;
  gap: 6px;
}

.import-cleanup-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 6px;
}

.danger-button:not(:disabled) {
  border-color: #b44b4b;
  color: #9b3030;
}

.danger-button:not(:disabled):hover {
  background: rgba(180, 75, 75, 0.08);
}

.import-table-wrap {
  max-height: 430px;
}

.import-table-wrap table {
  min-width: 980px;
}

.import-table-wrap input,
.import-table-wrap select {
  width: 100%;
  min-height: 30px;
  padding: 5px 7px;
  font-size: 12px;
}

.import-table-wrap .import-row-checkbox {
  display: block;
  width: 14px;
  height: 14px;
  min-height: 14px;
  margin: 0 auto;
  padding: 0;
}

.import-value-editor {
  display: grid;
  grid-template-columns: 3.5rem minmax(6rem, 1fr);
  gap: 4px;
  align-items: center;
}

.import-table-wrap th:nth-child(6),
.import-table-wrap td:nth-child(6) {
  width: 180px;
}

.import-table-wrap .import-value-editor select,
.import-table-wrap .import-value-editor input {
  min-width: 0;
  width: 100%;
}

.import-row-error {
  background: rgba(244, 197, 66, 0.11);
}

.empty-state {
  padding: 14px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
}

.remove-request-button {
  min-height: 36px;
  padding: 7px 12px;
  font-size: 13px;
}

.chart-panel {
  padding: 14px 12px 10px;
}

.map-panel {
  position: relative;
}

.map-frame {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.panel-title h2 {
  margin: 0;
}

.panel-heading {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.panel-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.panel-subtitle span {
  display: block;
}

.map-tools {
  display: grid;
  grid-template-columns: minmax(150px, 180px);
  align-items: center;
  justify-content: end;
  gap: 8px;
  min-width: 0;
}

.map-tools select {
  width: 100%;
  min-width: 0;
}

.chart-tools {
  display: grid;
  grid-template-columns: minmax(170px, 210px) auto auto;
  align-items: center;
  justify-content: end;
  gap: 8px;
  min-width: 0;
}

.chart-tools select {
  min-width: 0;
}

.analysis-button {
  display: inline-grid;
  position: relative;
  width: 44px;
  min-width: 44px;
  padding-inline: 0;
  place-items: center;
  overflow: hidden;
  border-color: rgba(0, 124, 137, 0.65);
  background: #fff;
  white-space: nowrap;
  font-weight: 800;
  letter-spacing: 0;
  color: var(--hydro-dark);
}

.analysis-button:focus-visible {
  box-shadow: 0 0 0 3px rgba(0, 124, 137, 0.18);
}

.chart-view-status {
  margin: 6px 4px 0;
  padding: 7px 9px;
  border: 1px solid rgba(0, 124, 137, 0.16);
  border-radius: 6px;
  background: #f6fbfb;
  color: #405155;
  font-size: 12px;
  line-height: 1.35;
}

.view-state {
  margin: 0 4px 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.view-state.is-loading {
  border-color: rgba(0, 124, 137, 0.24);
  color: var(--hydro-dark);
}

.view-state.is-error {
  border-color: rgba(180, 75, 75, 0.4);
  background: rgba(180, 75, 75, 0.07);
  color: #9b3030;
}

body.dark-mode .view-state.is-error {
  color: #ffb4b4;
}

.table-icon-button {
  display: inline-grid;
  width: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  place-items: center;
}

.table-icon-button .lucide {
  width: 15px;
  height: 15px;
}

.col-action {
  width: 12%;
}

.measurement-actions,
.correction-status {
  display: inline-flex;
  align-items: center;
}

.measurement-actions {
  gap: 7px;
}

.correction-status {
  min-height: 24px;
  gap: 4px;
  padding: 2px 7px;
  border: 1px solid rgba(0, 124, 137, 0.22);
  border-radius: 999px;
  background: rgba(0, 124, 137, 0.08);
  color: var(--hydro-dark);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.correction-status .lucide {
  width: 13px;
  height: 13px;
}

.correction-card {
  width: min(620px, calc(100vw - 28px));
}

.correction-card h2,
.correction-card h3 {
  margin: 0 0 10px;
  color: var(--hydro-dark);
}

.correction-card h3 {
  margin-top: 18px;
  font-size: 14px;
}

.correction-original {
  margin: 14px 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel-soft);
}

.correction-original div,
.operation-card dl div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.correction-original dt,
.operation-card dt {
  color: var(--muted);
}

.correction-original dd,
.operation-card dd {
  margin: 0;
  color: var(--hydro-dark);
  font-weight: 650;
  text-align: right;
}

.correction-value-fields {
  display: grid;
  grid-template-columns: minmax(130px, 0.35fr) minmax(180px, 1fr);
  gap: 10px;
}

.correction-history {
  display: grid;
  gap: 7px;
  max-height: 190px;
  overflow: auto;
}

.correction-history-item {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  border-left: 3px solid var(--hydro-blue);
  background: var(--panel-soft);
  font-size: 12px;
}

.correction-history-item span,
.correction-history-item small {
  color: var(--muted);
}

.correction-history-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.correction-history-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.correction-history-edit {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  gap: 5px;
  padding: 3px 8px;
  font-size: 11px;
}

.correction-history-edit .lucide {
  width: 13px;
  height: 13px;
}

.correction-history-undo {
  border-color: rgba(180, 75, 75, 0.45);
  color: #9b3030;
}

body.dark-mode .correction-history-undo {
  color: #ffb4b4;
}

.app-notice {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 8000;
  width: min(420px, calc(100vw - 32px));
  padding: 11px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  background: var(--panel);
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.app-notice.is-success {
  border-left: 4px solid #2e8540;
}

.app-notice.is-error {
  border-left: 4px solid #b44b4b;
}

.operations-panel {
  margin-top: 16px;
}

.icon-text-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.icon-text-button .lucide {
  width: 16px;
  height: 16px;
}

.operations-project-summary,
.operations-cards {
  display: grid;
  gap: 10px;
}

.operations-cards {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 10px;
}

.operation-card {
  min-width: 0;
  padding: 12px 13px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel-soft);
}

.operation-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.operation-card dl {
  display: grid;
  gap: 5px;
  margin: 8px 0 0;
  font-size: 12px;
}

.operation-card p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.operation-kicker {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 11px;
}

.operation-badge {
  flex: 0 0 auto;
  padding: 3px 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.operation-badge.is-success {
  border-color: rgba(46, 133, 64, 0.32);
  background: rgba(46, 133, 64, 0.08);
  color: #246b34;
}

.operation-badge.is-failed,
.operation-badge.is-stale {
  border-color: rgba(180, 75, 75, 0.35);
  background: rgba(180, 75, 75, 0.08);
  color: #9b3030;
}

.operations-issues {
  margin-top: 14px;
}

.operations-issues h3 {
  margin: 0 0 7px;
  color: var(--hydro-dark);
  font-size: 14px;
}

.operation-issue,
.operation-all-clear {
  margin: 5px 0;
  padding: 8px 10px;
  border-left: 3px solid var(--border-strong);
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 12px;
}

.operation-issue.is-failed,
.operation-issue.is-stale {
  border-left-color: #b44b4b;
}

.operation-all-clear {
  border-left-color: #2e8540;
}

body.dark-mode .operation-badge.is-success {
  color: #a8e3b3;
}

body.dark-mode .operation-badge.is-failed,
body.dark-mode .operation-badge.is-stale {
  color: #ffb4b4;
}

@media (max-width: 1080px) {
  .operations-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .operations-cards,
  .correction-value-fields {
    grid-template-columns: 1fr;
  }

  .app-notice {
    right: 12px;
    bottom: 12px;
    width: calc(100vw - 24px);
  }
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 7000;
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 35, 40, 0.34);
  backdrop-filter: blur(3px);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(760px, calc(100vw - 28px));
  max-height: min(780px, calc(100vh - 36px));
  overflow: auto;
  padding: 20px 22px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 26px 80px rgba(0, 35, 40, 0.28);
  color: var(--text);
  font-size: 14px;
}

body.dark-mode .modal-card {
  background: var(--panel);
  border-color: var(--border);
  color: var(--text);
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.55);
}

.modal-close {
  position: sticky;
  top: 0;
  float: right;
  width: 34px;
  height: 34px;
  min-height: 34px;
  margin: -8px -8px 4px 12px;
  padding: 0;
  border-color: var(--border);
  border-radius: 50%;
  background: #fff;
  color: var(--hydro-dark);
  font-size: 22px;
  line-height: 1;
}

body.dark-mode .modal-close,
body.dark-mode .analysis-export-button {
  background: #111b1d;
  color: var(--hydro-dark);
}

.analysis-modal-card {
  line-height: 1.45;
}

.analysis-scope-card {
  display: grid;
  gap: 12px;
  width: min(520px, calc(100vw - 28px));
}

.analysis-scope-card h3 {
  margin: 0;
  color: var(--hydro-dark);
  text-transform: uppercase;
}

.analysis-scope-card p {
  margin: 0;
  color: #405155;
  line-height: 1.45;
}

.analysis-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.analysis-title-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.analysis-export-button {
  display: inline-grid;
  width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  place-items: center;
  border-color: var(--hydro-blue);
  border-radius: 6px;
  background: #fff;
  color: var(--hydro-dark);
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
}

.analysis-modal-card h3,
.analysis-modal-card h4 {
  margin: 0 0 6px;
  color: var(--hydro-dark);
  text-transform: uppercase;
}

.analysis-modal-card h4 {
  margin-top: 10px;
  font-size: 12px;
}

.analysis-note {
  margin: 8px 0 10px;
  color: #405155;
}

.analysis-modal-card ul {
  margin: 0;
  padding-left: 18px;
}

.analysis-modal-card li {
  margin: 4px 0;
}

.analysis-disclaimer {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(0, 124, 137, 0.2);
  border-radius: 8px;
  background: #f6fbfb;
  color: #405155;
  font-size: 13px;
}

.analysis-disclaimer strong {
  display: block;
  margin-bottom: 4px;
  color: var(--hydro-dark);
}

.analysis-disclaimer p {
  margin: 0;
  line-height: 1.45;
}

.export-modal-card {
  display: grid;
  gap: 12px;
  width: min(430px, calc(100vw - 28px));
}

.password-change-card {
  display: grid;
  gap: 9px;
  width: min(430px, calc(100vw - 28px));
}

.password-change-card h3,
.password-change-card p {
  margin: 0;
}

.password-change-card h3,
.password-change-card label {
  color: var(--hydro-dark);
  font-weight: 800;
}

.password-change-card h3 {
  text-transform: uppercase;
}

.password-change-card small {
  margin-top: -5px;
  color: var(--muted);
}

.password-change-card .error {
  min-height: 18px;
}

.export-modal-card h3 {
  margin: 0 0 2px;
  color: var(--hydro-dark);
  text-transform: uppercase;
}

.export-modal-card label,
.export-modal-card legend {
  color: var(--hydro-dark);
  font-size: 13px;
  font-weight: 800;
}

.export-modal-card fieldset {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.export-modal-card legend {
  grid-column: 1 / -1;
  margin-bottom: 2px;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

body.dark-mode .radio-option {
  background: #111b1d;
  border-color: var(--border);
  color: var(--text);
}

.radio-option input {
  width: auto;
  margin: 0;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

body.map-expanded {
  overflow: hidden;
}

.map-panel-expanded {
  position: fixed;
  inset: 76px 18px 18px;
  z-index: 2000;
  padding: 16px;
  background: var(--panel);
  box-shadow: 0 28px 80px rgba(0, 35, 40, 0.32);
}

.map-panel-expanded #map {
  height: calc(100vh - 172px);
  flex-basis: calc(100vh - 172px);
}

.map-panel-expanded .map-frame {
  flex: 1 1 auto;
}

.table-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

button:disabled {
  cursor: default;
  opacity: 0.45;
}

#map,
#chart {
  width: 100%;
  height: clamp(520px, 36vw, 590px);
  flex: 1 1 clamp(520px, 36vw, 590px);
}

#chart {
  height: clamp(520px, 36vw, 590px);
  flex-basis: clamp(520px, 36vw, 590px);
}

#map {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.map-control-strip {
  position: absolute;
  top: 152px;
  left: 12px;
  z-index: 600;
  display: flex;
  flex-direction: column;
  border: 2px solid rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  background: #fff;
  background-clip: padding-box;
}

.map-icon-button {
  display: inline-grid;
  position: relative;
  width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  place-items: center;
  border: 0;
  border-bottom: 1px solid #ccc;
  border-radius: 0;
  background: #fff;
  color: #111;
  font: 700 18px/1 Arial, Helvetica, sans-serif;
  line-height: 1;
}

.map-icon-button .lucide {
  width: 16px;
  height: 16px;
  stroke: currentColor;
}

.map-icon-button::after {
  content: attr(data-tooltip);
  position: absolute;
  top: 50%;
  left: calc(100% + 9px);
  z-index: 3;
  padding: 5px 7px;
  border-radius: 5px;
  background: rgba(18, 28, 31, 0.94);
  color: #fff;
  font: 600 11px/1.2 "DM Sans", system-ui, sans-serif;
  opacity: 0;
  pointer-events: none;
  transform: translate(-3px, -50%);
  transition: opacity 120ms ease, transform 120ms ease;
  white-space: nowrap;
}

.map-icon-button:hover::after,
.map-icon-button:focus-visible::after {
  opacity: 1;
  transform: translate(0, -50%);
}

.map-icon-button:last-of-type {
  border-bottom: 0;
}

.map-icon-button:hover,
.map-icon-button.active {
  background: #f4f4f4;
}

.map-layer-menu {
  position: absolute;
  top: 31px;
  left: 36px;
  display: grid;
  min-width: 190px;
  gap: 4px;
  padding: 6px;
  border: 1px solid rgba(0, 60, 70, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 14px 34px rgba(0, 35, 40, 0.18);
}

.map-layer-heading {
  padding: 4px 7px 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.map-layer-menu button {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 6px 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--hydro-dark);
  font-size: 13px;
  font-weight: 700;
  text-align: left;
}

.map-layer-menu button::before {
  content: "";
  display: inline-grid;
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--hydro-dark);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.map-layer-menu button.active::before {
  content: "✓";
  border-color: var(--hydro-blue);
  background: rgba(0, 124, 137, 0.09);
}

.map-layer-menu button:hover,
.map-layer-menu button.active {
  background: var(--panel-soft);
}

#chart {
  border: 0;
  border-radius: 0;
  overflow: visible;
}

#chart .js-plotly-plot,
#chart .plot-container {
  width: 100%;
}

.mobile-chart-legend {
  display: none;
}

.leaflet-container {
  font-family: "DM Sans", system-ui, sans-serif;
}

.map-status {
  position: absolute;
  left: 28px;
  bottom: 24px;
  z-index: 500;
  max-width: calc(100% - 56px);
  margin: 0;
  padding: 6px 9px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 60, 70, 0.12);
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
}

.map-status:empty {
  display: none;
}

.user-location-icon {
  position: relative;
  width: 34px;
  height: 34px;
}

.user-location-dot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 14px;
  border: 3px solid #ffffff;
  border-radius: 50%;
  background: #2f80ed;
  box-shadow: 0 2px 10px rgba(0, 50, 120, 0.34);
  transform: translate(-50%, -50%);
}

.user-location-heading {
  position: absolute;
  left: 50%;
  top: 2px;
  width: 0;
  height: 0;
  border-right: 7px solid transparent;
  border-bottom: 19px solid rgba(47, 128, 237, 0.62);
  border-left: 7px solid transparent;
  transform-origin: 50% 15px;
  translate: -50% 0;
  filter: drop-shadow(0 1px 2px rgba(0, 50, 120, 0.28));
}

.user-location-heading.hidden {
  display: none;
}

.point-label {
  display: inline-block;
  box-sizing: border-box;
  width: max-content !important;
  height: auto !important;
  min-width: 40px;
  max-width: 96px;
  min-height: 22px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(0, 60, 70, 0.24);
  border-radius: 6px;
  color: var(--hydro-dark);
  font-size: 12px;
  font-weight: 800;
  line-height: 16px;
  overflow: hidden;
  padding: 3px 7px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: 0 2px 10px rgba(0, 30, 35, 0.12);
}

.sgu-point-label {
  display: inline-block;
  box-sizing: border-box;
  width: max-content !important;
  height: auto !important;
  min-width: 48px;
  max-width: 116px;
  min-height: 22px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(123, 44, 191, 0.35);
  border-radius: 6px;
  color: #53208d;
  font-size: 11px;
  font-weight: 800;
  line-height: 16px;
  overflow: hidden;
  padding: 3px 7px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: 0 2px 10px rgba(0, 30, 35, 0.12);
}

.sgu-marker {
  width: 20px !important;
  height: 20px !important;
  margin: 0 !important;
  border: 0;
  background: transparent;
}

.sgu-marker span {
  display: block;
  width: 14px;
  height: 14px;
  margin: 3px;
  transform: rotate(45deg);
  border: 2px solid #53208d;
  border-radius: 3px;
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(0, 30, 35, 0.18);
}

.sgu-marker-selected span {
  background: #7b2cbf;
  border-color: #ffffff;
  outline: 2px solid #53208d;
}

.smhi-marker {
  width: 22px !important;
  height: 22px !important;
  margin: 0 !important;
  border: 0;
  background: transparent;
}

.smhi-marker span {
  display: block;
  width: 16px;
  height: 16px;
  margin: 3px;
  border: 2px solid #ffffff;
  border-radius: 50% 50% 50% 0;
  background: #286f96;
  transform: rotate(-45deg);
  box-shadow: 0 2px 10px rgba(0, 30, 35, 0.18);
}

.smhi-point-label {
  display: inline-block;
  box-sizing: border-box;
  width: max-content !important;
  height: auto !important;
  min-width: 52px;
  max-width: 132px;
  min-height: 22px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(40, 111, 150, 0.35);
  border-radius: 6px;
  color: #17546f;
  font-size: 11px;
  font-weight: 800;
  line-height: 16px;
  overflow: hidden;
  padding: 3px 7px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: 0 2px 10px rgba(0, 30, 35, 0.12);
}

.map-popup {
  display: grid;
  gap: 4px;
  min-width: 160px;
  color: var(--text);
}

.map-popup strong {
  color: var(--hydro-dark);
  font-size: 14px;
}

.map-popup span {
  font-size: 13px;
}

.map-popup small {
  color: var(--muted);
  font-size: 11px;
}

.table-wrap {
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 14px;
}

.col-ror {
  width: 8%;
}

.col-date {
  width: 21%;
}

.col-parameter {
  width: 23%;
}

.col-value {
  width: 12%;
}

.col-unit {
  width: 9%;
}

.col-qa {
  width: 15%;
}

.empty-table-row td {
  padding: 22px 14px;
  color: var(--muted);
  text-align: center;
  white-space: normal;
}

th,
td {
  padding: 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  background: var(--panel-soft);
  color: var(--hydro-dark);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sort-button {
  min-height: 0;
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  text-align: left;
  font-size: inherit;
  font-weight: 800;
  letter-spacing: inherit;
  text-transform: inherit;
}

.sort-button:hover,
.sort-button.active {
  filter: none;
  color: var(--hydro-blue);
}

@media (max-width: 1400px) {
  .topbar {
    min-height: 96px;
    padding-inline: clamp(18px, 3vw, 42px);
  }

  .header-logo-left {
    padding-left: clamp(0px, 1vw, 16px);
  }

  .header-logo-right {
    padding-right: clamp(78px, 7vw, 104px);
  }

  .header-logo-left img {
    max-height: 56px;
    max-width: 230px;
  }

  .header-logo-right img {
    max-height: 60px;
    max-width: 210px;
  }
}

@media (max-width: 1220px) {
  .topbar {
    grid-template-columns: minmax(150px, 1fr) minmax(230px, auto) minmax(150px, 1fr);
  }

  .header-logo-left img {
    max-height: 48px;
    max-width: 190px;
  }

  .header-logo-right img {
    max-height: 52px;
    max-width: 175px;
  }

  .header-title {
    padding: 7px 14px;
    font-size: 22px;
  }
}

@media (max-width: 1080px) {
  .topbar {
    grid-template-columns: 1fr auto 1fr;
    gap: 10px;
    padding: 12px 18px;
  }

  .header-logo,
  .header-logo-left,
  .header-logo-right {
    padding-left: 0;
    padding-right: 0;
  }

  .header-logo-left {
    justify-content: flex-start;
  }

  .header-logo-right {
    justify-content: flex-end;
  }

  .header-title {
    font-size: 20px;
    white-space: normal;
  }

  .header-logo-left img,
  .header-logo-right img {
    max-width: min(260px, 78vw);
  }

  .logout-button {
    top: auto;
    right: 12px;
    bottom: 6px;
  }

  .top-workspace-grid,
  .filters,
  .filter-body,
  .filter-fields,
    .request-fields,
    .grid,
    .project-info-grid,
    .summary,
    .table-controls {
      grid-template-columns: 1fr;
  }

  .filter-actions {
    justify-content: flex-start;
  }

  .panel-title {
    align-items: stretch;
    flex-direction: column;
  }

  .import-layout {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .import-detail {
    padding-top: 14px;
    padding-left: 0;
    border-top: 1px solid var(--border);
    border-left: 0;
  }

  .import-detail-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .filter-header {
    align-items: baseline;
    flex-direction: row;
  }

  .map-tools {
    display: grid;
    grid-template-columns: minmax(145px, 1fr);
    align-items: center;
    width: 100%;
  }

  .map-tools select {
    width: 100%;
    min-width: 0;
  }

  .request-queue-header {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 720px) {
  main {
    width: min(100%, calc(100vw - 18px));
    margin: 10px auto 22px;
  }

  .topbar {
    position: static;
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "left right"
      "title title"
      "logout logout";
    gap: 10px 14px;
    min-height: 0;
    padding: 11px 12px 16px;
  }

  .header-logo-left {
    grid-area: left;
  }

  .header-logo-right {
    grid-area: right;
  }

  .header-logo-left img {
    max-height: 30px;
    max-width: min(160px, 42vw);
  }

  .header-logo-right img {
    max-height: 32px;
    max-width: min(150px, 40vw);
  }

  .header-title {
    grid-area: title;
    justify-self: center;
    padding: 7px 13px;
    font-size: 18px;
    line-height: 1.2;
  }

  .logout-button {
    grid-area: logout;
    justify-self: center;
    position: static;
    min-height: 30px;
    padding: 5px 10px;
    font-size: 12px;
  }

  .site-footer {
    align-items: center;
    flex-direction: column;
    gap: 8px;
    width: min(100%, calc(100vw - 18px));
    margin-bottom: 18px;
    padding-top: 14px;
    font-size: 12px;
    text-align: center;
  }

  .site-footer div {
    justify-content: center;
    gap: 8px 12px;
  }

  .summary {
    gap: 8px;
  }

  .top-workspace-grid,
  .project-info-grid {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 8px;
  }

  .workspace-tabs {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .workspace-tab {
    width: 100%;
  }

  .top-workspace-grid .filters,
  .top-workspace-grid .project-info-card {
    height: auto;
  }

  .summary > div,
  .project-info-card,
  .panel,
  .filters {
    padding: 10px;
  }

  .project-info-header strong {
    font-size: 17px;
  }

  .project-info-list div {
    grid-template-columns: minmax(88px, 0.7fr) minmax(0, 1fr);
    gap: 6px;
  }

  .project-overview-card .project-info-list div {
    grid-template-columns: minmax(88px, 0.7fr) minmax(0, 1fr);
    gap: 6px;
    min-height: 0;
  }

  .project-overview-card .project-info-list dd {
    overflow-wrap: anywhere;
    text-align: right;
  }

  .status-chips {
    gap: 4px;
  }

  .status-chip {
    min-height: 20px;
    padding: 3px 6px;
    font-size: 10px;
  }

  .filter-fields,
  .date-shortcuts {
    grid-template-columns: 1fr;
  }

  .pipe-info-content {
    max-height: none;
    overflow: visible;
  }

  .pipe-info-actions {
    grid-template-columns: 1fr;
  }

  .summary span {
    font-size: 20px;
  }

  .map-tools {
    grid-template-columns: minmax(132px, 1fr);
    gap: 6px;
  }

  .chart-tools {
    width: 100%;
    grid-template-columns: 1fr 1fr;
  }

  .chart-tools select {
    grid-column: 1 / -1;
  }

  .map-tools select {
    min-height: 36px;
    padding: 7px 8px;
    font-size: 12px;
  }

  #map,
  #chart {
    height: 360px;
    flex-basis: 360px;
  }

  #chart {
    height: 340px;
    flex-basis: 340px;
  }

  .mobile-chart-legend {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    padding: 8px 4px 2px;
    color: var(--hydro-dark);
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }

  .mobile-legend-item {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 5px;
    min-height: 24px;
    padding: 3px 7px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #fff;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
  }

  .mobile-legend-swatch {
    width: 18px;
    height: 3px;
    border-radius: 999px;
  }

  #expandMapButton {
    display: none;
  }

  .map-control-strip {
    top: 146px;
    left: 9px;
  }

  .map-layer-menu {
    top: 31px;
    left: 36px;
    min-width: 174px;
  }

  .map-icon-button {
    width: 31px;
    height: 31px;
    min-height: 31px;
    font-size: 15px;
  }

  .chart-panel {
    padding-left: 6px;
    padding-right: 6px;
  }

  .table-controls {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    justify-content: stretch;
    gap: 6px;
  }

  #tablePageInfo {
    grid-column: 1 / -1;
    margin-right: 0;
  }

  .table-controls .secondary {
    width: 100%;
    min-height: 36px;
    padding: 7px 12px;
  }

  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table {
    min-width: 760px;
  }

  th,
  td {
    padding: 9px 10px;
  }

  #exportCsvButton {
    grid-column: 1;
  }

  #exportShapeButton {
    grid-column: 2;
  }

  #prevPageButton,
  #nextPageButton {
    width: 100%;
    min-width: 0;
    max-width: none;
    height: 34px;
    padding: 4px 0;
    border-color: var(--hydro-blue);
    border-radius: 6px;
    color: var(--hydro-dark);
    background: #fff;
    overflow: hidden;
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
  }

  #prevPageButton {
    grid-column: 1;
  }

  #nextPageButton {
    grid-column: 2;
  }

  .compact-page-button {
    border-radius: 6px;
  }

  .compact-page-button::before {
    content: none;
    color: var(--hydro-dark);
    font-size: 18px;
    font-weight: 900;
    line-height: 1;
  }

  #prevPageButton.compact-page-button::before {
    content: "\2190";
  }

  #nextPageButton.compact-page-button::before {
    content: "\2192";
  }

  #chart {
    min-width: 0;
  }

  .table-wrap {
    max-height: 430px;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
  }

  table {
    display: table;
    min-width: 680px;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 12px;
  }

  colgroup {
    display: table-column-group;
  }

  thead {
    display: table-header-group;
  }

  tbody {
    display: table-row-group;
  }

  tbody tr {
    display: table-row;
    background: transparent;
  }

  th,
  td {
    display: table-cell;
    padding: 7px 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  th {
    font-size: 10px;
  }

  td::before {
    content: none;
  }

  .col-ror {
    width: 9%;
  }

  .col-date {
    width: 20%;
  }

  .col-parameter {
    width: 20%;
  }

  .col-value {
    width: 11%;
  }

  .col-unit {
    width: 7%;
  }

  .col-qa {
    width: 17%;
  }

  .col-action {
    width: 16%;
  }

  .qa-cell {
    justify-content: flex-start;
  }

  .correction-status .lucide {
    display: none;
  }
}

/* Visual refresh: calm typography, lighter surfaces and clearer hierarchy. */
:root {
  --hydro-dark: #073f47;
  --hydro-blue: #087f8c;
  --bg: #f4f6f5;
  --panel: #ffffff;
  --panel-soft: #fbfcfb;
  --border: #dce3df;
  --border-strong: #bcc9c4;
  --text: #17201f;
  --muted: #65706d;
  --shadow: 0 4px 16px rgba(10, 48, 49, 0.055);
}

body.dark-mode {
  --hydro-dark: #d9f7f8;
  --hydro-blue: #42bdc9;
  --bg: #101718;
  --panel: #172021;
  --panel-soft: #1a2425;
  --border: #344243;
  --border-strong: #536365;
  --text: #f0f5f4;
  --muted: #aeb9b7;
  --shadow: 0 5px 18px rgba(0, 0, 0, 0.2);
}

body {
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 15px;
  font-feature-settings: normal;
  letter-spacing: 0;
  line-height: 1.45;
}

.topbar {
  grid-template-columns: minmax(190px, 1fr) auto minmax(240px, 1fr);
  min-height: 82px;
  padding: 10px clamp(20px, 3.5vw, 64px);
  background: rgba(244, 246, 245, 0.95);
  box-shadow: 0 1px 10px rgba(10, 48, 49, 0.035);
}

body.dark-mode .topbar {
  background: rgba(16, 23, 24, 0.95);
}

.header-logo-left,
.header-logo-right {
  padding: 0;
}

.header-logo-left img {
  max-height: 50px;
  max-width: min(240px, 100%);
}

.header-logo-right img {
  max-height: 52px;
  max-width: min(210px, 100%);
}

.header-title {
  font-size: clamp(24px, 2vw, 30px);
  font-weight: 590;
  letter-spacing: 0;
  line-height: 1.1;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  min-width: 0;
}

.header-actions .header-logo-right {
  min-width: 0;
}

.logout-button {
  position: static;
  flex: 0 0 auto;
  min-height: 34px;
  padding: 6px 11px;
  font-size: 12.5px;
}

main {
  width: min(1580px, calc(100vw - 36px));
  margin: 18px auto 38px;
}

.site-footer {
  width: min(1580px, calc(100vw - 36px));
  color: var(--muted);
  font-size: 13px;
}

.site-footer a,
.footer-brand {
  font-weight: 620;
}

form,
.filters,
.panel,
.summary > div,
.project-info-card {
  border-color: var(--border);
  border-radius: 7px;
  box-shadow: var(--shadow);
}

.login-panel {
  background: var(--bg);
}

.login-card {
  padding: 36px;
}

.login-title {
  color: var(--muted);
  font-size: 15px;
  font-weight: 570;
  letter-spacing: 0;
  text-transform: none;
}

h1,
h2 {
  font-weight: 620;
  letter-spacing: 0;
}

h2 {
  font-size: 18px;
  text-transform: none;
}

label,
.filters label,
.project-info-header span,
.project-info-list dt,
.pipe-info-item dt,
.summary small,
.map-layer-heading,
th {
  font-weight: 620;
  letter-spacing: 0;
}

label,
.filters label {
  font-size: 11.5px;
  text-transform: none;
}

input,
select,
button {
  min-height: 38px;
  border-radius: 7px;
}

input,
select,
textarea,
.picker-button {
  background: var(--panel);
}

button {
  padding: 7px 13px;
  font-size: 13.5px;
  font-weight: 640;
  transition: border-color 140ms ease, background-color 140ms ease, color 140ms ease;
}

button:hover {
  filter: none;
}

button.secondary:hover,
button.ghost:hover {
  border-color: var(--hydro-dark);
  background: var(--panel-soft);
}

.workspace-tabs {
  gap: 18px;
  margin: 4px 0 2px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.workspace-tab {
  min-height: 40px;
  padding: 7px 2px 6px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  font-size: 14px;
  font-weight: 590;
  letter-spacing: 0;
}

.workspace-tab:hover,
.workspace-tab.active {
  border-color: var(--hydro-blue);
  background: transparent;
}

.top-workspace-grid {
  grid-template-columns: minmax(320px, 0.9fr) minmax(300px, 0.9fr) minmax(390px, 1.2fr);
  gap: 10px;
  margin: 10px 0 12px;
}

.filters,
.project-info-card {
  padding: 12px 13px;
  background: var(--panel);
}

.filter-header {
  min-height: 28px;
}

.filter-body {
  gap: 7px;
}

.filter-fields {
  gap: 7px 8px;
}

.filters input:not([type="checkbox"]),
.filters select,
.filters .picker-button {
  min-height: 36px;
  padding: 7px 10px;
  font-size: 13.5px;
}

.date-shortcuts {
  gap: 5px;
}

.date-shortcuts button {
  min-height: 31px;
  padding: 5px 7px;
  font-size: 12px;
}

.filter-options {
  gap: 4px;
}

.filter-option {
  min-height: 29px;
  padding: 4px 8px;
  border-color: var(--border);
  background: var(--panel-soft);
  font-size: 12px;
  font-weight: 610;
}

.filter-option input {
  width: 14px;
  min-height: 14px;
}

.project-info-header {
  min-height: 26px;
  margin-bottom: 7px;
}

.project-info-header span,
.project-info-list dt,
.pipe-info-item dt {
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none;
}

.project-info-header strong {
  font-size: 20px;
  font-weight: 620;
}

.project-info-list div {
  min-height: 27px;
  padding: 4px 0;
  border-color: rgba(220, 227, 223, 0.72);
}

.pipe-info-item dl div {
  min-height: 24px;
  padding: 2px 0;
  border-color: rgba(220, 227, 223, 0.72);
}

.pipe-info-item dt {
  font-size: 10.5px;
}

.pipe-info-item dd {
  font-size: 12.5px;
}

.project-info-list dd,
.pipe-info-item dd {
  font-size: 13.5px;
  font-weight: 590;
}

.pipe-info-item {
  border-color: var(--border);
  background: var(--panel-soft);
}

.pipe-info-item h3 {
  font-size: 18px;
  font-weight: 620;
}

.status-chips {
  margin-bottom: 7px;
}

.status-chip {
  min-height: 22px;
  font-weight: 590;
}

.project-archive-button {
  width: auto;
  min-height: 31px;
  margin-bottom: 7px;
  font-size: 12px;
}

.theme-toggle,
.qa-toggle,
.filter-option,
.point-option-all {
  font-weight: 610;
}

.grid {
  gap: 12px;
}

.panel {
  padding: 14px;
}

.chart-panel {
  padding: 14px 12px 11px;
}

.panel-title {
  min-height: 40px;
  margin-bottom: 8px;
}

.chart-tools {
  gap: 7px;
}

.analysis-button {
  font-weight: 640;
}

#map,
#chart {
  height: clamp(540px, 38vw, 620px);
  flex-basis: clamp(540px, 38vw, 620px);
}

#map {
  border-radius: 6px;
}

.leaflet-container {
  font-family: "DM Sans", system-ui, sans-serif;
}

.chart-view-status {
  border-color: var(--border);
  background: var(--panel-soft);
}

.table-wrap {
  border-color: var(--border);
  border-radius: 7px;
}

th {
  font-size: 11px;
  text-transform: none;
}

td {
  font-size: 13.5px;
}

.modal-card {
  border-radius: 7px;
  box-shadow: 0 18px 48px rgba(7, 40, 43, 0.16);
}

@media (max-width: 1220px) {
  .topbar {
    grid-template-columns: minmax(150px, 1fr) auto minmax(190px, 1fr);
    min-height: 76px;
    padding: 9px 18px;
  }

  .header-logo-left img {
    max-height: 43px;
    max-width: 190px;
  }

  .header-logo-right img {
    max-height: 44px;
    max-width: 165px;
  }

  .header-title {
    padding: 0;
    font-size: 23px;
  }

  .header-actions {
    gap: 9px;
  }
}

@media (max-width: 1080px) {
  .topbar {
    grid-template-columns: minmax(140px, 1fr) auto minmax(170px, 1fr);
  }

  .top-workspace-grid,
  .grid {
    grid-template-columns: 1fr;
  }

  .top-workspace-grid .filters,
  .top-workspace-grid .project-info-card {
    height: auto;
  }

  .panel-title {
    align-items: center;
    flex-direction: row;
  }
}

@media (max-width: 720px) {
  main {
    width: min(100%, calc(100vw - 16px));
    margin: 8px auto 24px;
  }

  .topbar {
    position: static;
    grid-template-columns: minmax(90px, 1fr) auto;
    grid-template-areas:
      "left actions"
      "title title";
    gap: 3px 8px;
    min-height: 68px;
    padding: 7px 10px 9px;
  }

  .header-logo-left {
    grid-area: left;
  }

  .header-logo-left img {
    max-height: 28px;
    max-width: min(118px, 29vw);
  }

  .header-title {
    grid-area: title;
    padding: 0;
    font-size: 16px;
    line-height: 1.1;
    white-space: nowrap;
  }

  .header-actions {
    grid-area: actions;
    gap: 5px;
  }

  .header-logo-right img {
    max-height: 25px;
    max-width: min(74px, 20vw);
  }

  .logout-button {
    min-height: 28px;
    padding: 4px 7px;
    font-size: 11px;
  }

  .workspace-tabs {
    display: inline-flex;
    width: auto;
    gap: 14px;
  }

  .workspace-tab {
    width: auto;
    min-height: 36px;
    font-size: 13px;
  }

  .top-workspace-grid {
    gap: 8px;
  }

  .filter-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-point {
    grid-column: 1 / -1;
  }

  .date-shortcuts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .date-shortcuts button {
    font-size: 10.5px;
  }

  .summary > div,
  .project-info-card,
  .panel,
  .filters {
    padding: 10px;
  }

  h2 {
    font-size: 17px;
  }

  .project-info-header strong {
    font-size: 18px;
  }

  .project-info-list div,
  .pipe-info-item dl div {
    min-height: 25px;
  }

  .filter-options {
    gap: 3px;
  }

  .filter-option {
    min-height: 28px;
    padding: 3px 7px;
  }

  .panel-title {
    align-items: stretch;
    flex-direction: column;
  }

  #map,
  #chart {
    height: 370px;
    flex-basis: 370px;
  }

  #chart {
    height: 350px;
    flex-basis: 350px;
  }

  .chart-panel {
    padding-right: 7px;
    padding-left: 7px;
  }

  .site-footer {
    width: min(100%, calc(100vw - 16px));
  }

  .pipe-info-item dl {
    grid-template-columns: 1fr;
  }

  .pipe-info-item dl::after,
  .map-icon-button::after {
    display: none;
  }
}

@media (max-width: 430px) {
  .topbar {
    grid-template-columns: minmax(80px, 1fr) auto;
  }

  .header-logo-left img {
    max-width: 92px;
  }

  .header-logo-right img {
    max-width: 58px;
  }

  .header-title {
    font-size: 16px;
  }

  .logout-button {
    padding-inline: 6px;
  }
}
.manual-import-form {
  display: grid;
  grid-template-columns: minmax(180px, 220px) minmax(240px, 380px) auto;
  gap: 10px;
  align-items: end;
  justify-content: start;
  padding: 0;
  margin-bottom: 12px;
  border: 0;
  background: transparent;
  border-radius: 0;
}

.manual-import-form label,
.manual-file-field {
  display: grid;
  gap: 4px;
}

.manual-file-picker {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  color: inherit;
}

.manual-import-form > .status-text {
  grid-column: 1 / -1;
}

.import-header-actions {
  display: grid;
  grid-template-columns: minmax(190px, auto);
  align-items: stretch;
}

.import-header-actions button {
  width: 100%;
}

.manual-file-picker button {
  min-height: 32px;
  padding: 5px 10px;
  flex: 0 0 auto;
}

.manual-file-selection {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}

.manual-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 900px) {
  .manual-import-form {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .manual-file-picker {
    width: 100%;
  }

  .import-detail-summary,
  .import-cleanup-actions {
    width: 100%;
    justify-items: stretch;
    justify-content: stretch;
  }

  .import-cleanup-actions > button {
    flex: 1 1 150px;
  }
}

/* Mobile field view reuses the portal API but keeps the field workflow focused. */
.field-workspace-tab,
.field-view {
  display: none;
}

.field-workspace-tab svg,
.field-map-button svg,
.field-sheet-close svg,
.field-point-sheet button svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

@media (max-width: 900px) {
  body.field-mode main {
    width: 100%;
    max-width: none;
    margin: 0;
  }

  body.field-mode .site-footer {
    display: none;
  }

  body.field-mode .workspace-tabs {
    width: calc(100% - 16px);
    margin: 6px auto;
  }

  .field-workspace-tab {
    display: inline-flex;
  }

  .field-view:not(.hidden) {
    display: block;
  }

  .field-view {
    padding: 0 8px 8px;
  }

  .field-view-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 10px;
    padding: 7px 2px 9px;
  }

  .field-view-header > div {
    display: grid;
    min-width: 0;
    gap: 1px;
  }

  .field-view-kicker {
    color: var(--muted);
    font-size: 11px;
    font-weight: 620;
  }

  .field-view-header strong {
    overflow: hidden;
    color: var(--hydro-dark);
    font-size: 20px;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #fieldProjectField {
    width: min(52%, 240px);
  }

  #fieldProjectField.hidden {
    display: none;
  }

  #fieldProjectSelect {
    width: 100%;
    min-height: 36px;
    padding: 6px 9px;
  }

  .field-map-shell {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--panel);
    box-shadow: var(--shadow);
  }

  #fieldMap {
    width: 100%;
    height: calc(100dvh - 206px);
    min-height: 500px;
    background: #e8eeee;
  }

  .field-map-button,
  .field-sheet-close {
    display: inline-grid;
    place-items: center;
    padding: 0;
    background: var(--panel);
    color: var(--hydro-dark);
  }

  .field-map-button {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 900;
    width: 42px;
    height: 42px;
    min-height: 42px;
    border-color: var(--border-strong);
    box-shadow: 0 3px 12px rgba(0, 35, 40, 0.18);
  }

  .field-map-button.active {
    border-color: #2f80ed;
    background: #eef6ff;
    color: #1f67c2;
  }

  .field-basemap-button {
    top: 62px;
  }

  body.dark-mode .field-map-button.active {
    background: #153451;
    color: #8fc4ff;
  }

  .field-map-status {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 850;
    max-width: calc(100% - 72px);
    padding: 7px 9px;
    border: 1px solid rgba(0, 60, 70, 0.12);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.94);
    color: #405155;
    font-size: 11px;
    line-height: 1.3;
    box-shadow: 0 3px 12px rgba(0, 35, 40, 0.12);
  }

  .field-map-status:empty {
    display: none;
  }

  body.dark-mode .field-map-status {
    background: rgba(17, 27, 29, 0.94);
    border-color: var(--border);
    color: var(--text);
  }

  .field-point-sheet {
    position: absolute;
    right: 10px;
    bottom: 10px;
    left: 10px;
    z-index: 900;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 10px;
    padding: 13px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.97);
    color: var(--text);
    box-shadow: 0 12px 34px rgba(0, 35, 40, 0.24);
    backdrop-filter: blur(8px);
  }

  body.dark-mode .field-point-sheet {
    background: rgba(23, 32, 33, 0.97);
  }

  .field-point-sheet.hidden {
    display: none;
  }

  .field-point-type {
    align-self: end;
    color: var(--muted);
    font-size: 11px;
    font-weight: 620;
  }

  .field-point-sheet > strong {
    grid-column: 1;
    color: var(--hydro-dark);
    font-size: 22px;
    font-weight: 650;
  }

  .field-sheet-close {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: start;
    width: 32px;
    height: 32px;
    min-height: 32px;
    border-color: var(--border);
  }

  .field-point-meta {
    display: flex;
    grid-column: 1 / -1;
    flex-wrap: wrap;
    gap: 4px 14px;
    color: var(--muted);
    font-size: 12px;
  }

  .field-point-latest {
    display: grid;
    grid-column: 1 / -1;
    gap: 1px;
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
  }

  .field-point-latest > span,
  .field-point-latest > small {
    color: var(--muted);
    font-size: 11px;
  }

  .field-point-latest > strong {
    overflow-wrap: anywhere;
    color: var(--hydro-dark);
    font-size: 14px;
    font-weight: 650;
  }

  .field-point-sheet > #fieldReportButton {
    display: inline-flex;
    grid-column: 1 / -1;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    margin-top: 5px;
  }

  .field-point-marker {
    width: 38px !important;
    height: 38px !important;
    margin: 0 !important;
    border: 0;
    background: transparent;
  }

  .field-point-marker span {
    display: block;
    width: 18px;
    height: 18px;
    margin: 10px;
    border: 3px solid #ffffff;
    border-radius: 50%;
    background: #087f8c;
    box-shadow: 0 2px 9px rgba(0, 35, 40, 0.4);
  }

  .field-point-marker.selected span {
    background: #f4c542;
    outline: 3px solid #073f47;
  }

  .field-point-label {
    display: inline-block;
    box-sizing: border-box;
    width: max-content !important;
    height: auto !important;
    min-width: 38px;
    max-width: 110px;
    padding: 2px 6px;
    overflow: hidden;
    border: 1px solid rgba(0, 60, 70, 0.25);
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.94);
    color: #073f47;
    font-size: 9px;
    font-weight: 650;
    line-height: 16px;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 35, 40, 0.14);
  }

  #fieldMap.field-labels-overview .field-point-label {
    min-width: 34px;
    max-width: 92px;
    padding: 2px 5px;
    opacity: 0.9;
    line-height: 15px;
  }

  #fieldMap.field-labels-detailed .field-point-label {
    min-width: 38px;
    max-width: 116px;
    padding: 3px 7px;
    opacity: 1;
    font-size: 11px;
    line-height: 16px;
  }

  .field-report-modal {
    align-items: end;
    padding: 0;
  }

  .field-report-card {
    display: grid;
    width: 100%;
    max-height: 92dvh;
    gap: 9px;
    padding: 16px;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 8px 8px 0 0;
  }

  .field-report-card h3 {
    margin: -2px 0 3px;
    color: var(--hydro-dark);
    font-size: 22px;
  }

  .field-report-card label {
    display: grid;
    gap: 4px;
  }

  .field-report-card input,
  .field-report-card select,
  .field-report-card textarea {
    width: 100%;
  }

  .field-report-card .modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    margin: 0;
    border-radius: 7px;
  }

  .field-report-calculation,
  .field-report-card .form-status {
    min-height: 17px;
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
  }

  .field-report-card .modal-actions {
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
  }
}
.light-map-tiles {
  filter: saturate(0.55) brightness(1.08) contrast(0.86);
}

.dark-map-tiles {
  filter: brightness(0.62) invert(1) contrast(0.9) hue-rotate(180deg) saturate(0.5);
}
