:root {
  color-scheme: light;
  --bg: oklch(0.982 0.002 260);
  --surface: oklch(1 0 0);
  --surface-subtle: oklch(0.958 0.004 260);
  --surface-strong: oklch(0.925 0.006 260);
  --ink: oklch(0.205 0.018 265);
  --ink-soft: oklch(0.39 0.018 265);
  --ink-muted: oklch(0.49 0.014 265);
  --line: oklch(0.885 0.008 260);
  --line-strong: oklch(0.79 0.012 260);
  --brand: oklch(0.43 0.105 151);
  --brand-hover: oklch(0.37 0.095 151);
  --brand-soft: oklch(0.95 0.025 151);
  --brand-ink: oklch(0.32 0.075 151);
  --good: oklch(0.47 0.105 168);
  --good-soft: oklch(0.945 0.03 168);
  --warning: oklch(0.61 0.13 74);
  --warning-soft: oklch(0.955 0.042 74);
  --critical: oklch(0.51 0.17 25);
  --critical-soft: oklch(0.95 0.035 25);
  --info: oklch(0.5 0.11 247);
  --info-soft: oklch(0.95 0.028 247);
  --shadow-float: 0 8px 24px oklch(0.19 0.02 265 / 0.12);
  --shadow-menu: 0 4px 12px oklch(0.19 0.02 265 / 0.14);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-pill: 999px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --sidebar: 248px;
  --topbar: 68px;
  --content: 1480px;
  font-family: "Aptos", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

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

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button,
a,
input,
select,
textarea,
[tabindex] {
  outline: none;
}

:focus-visible {
  box-shadow: 0 0 0 3px oklch(0.7 0.075 151 / 0.42);
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

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

svg {
  display: block;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3 {
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: white;
  transform: translateY(-160%);
  transition: transform 160ms var(--ease-out);
}

.skip-link:focus {
  transform: translateY(0);
}

.boot-screen {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  min-height: 100dvh;
  color: var(--ink-soft);
}

.brand-mark {
  display: grid;
  grid-template-columns: repeat(3, 7px);
  align-items: end;
  gap: 4px;
  width: 29px;
  height: 28px;
}

.brand-mark span {
  display: block;
  border-radius: 2px 2px 0 0;
  background: var(--brand);
  transform-origin: bottom;
  animation: brand-rise 900ms var(--ease-out) infinite alternate;
}

.brand-mark span:nth-child(1) {
  height: 13px;
}

.brand-mark span:nth-child(2) {
  height: 25px;
  animation-delay: 120ms;
}

.brand-mark span:nth-child(3) {
  height: 18px;
  animation-delay: 240ms;
}

@keyframes brand-rise {
  from { transform: scaleY(0.65); opacity: 0.55; }
  to { transform: scaleY(1); opacity: 1; }
}

/* Authentication */

.auth-shell {
  display: grid;
  grid-template-columns: minmax(420px, 0.82fr) minmax(480px, 1.18fr);
  min-height: 100dvh;
  background: var(--surface);
}

.auth-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 34px clamp(28px, 5vw, 84px);
  background: var(--surface);
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  width: max-content;
  font-size: 17px;
  font-weight: 760;
}

.auth-brand .brand-mark {
  transform: scale(0.72);
}

.auth-copy {
  width: min(100%, 430px);
  margin: auto 0;
  padding: 56px 0;
}

.auth-copy h1 {
  max-width: 12ch;
  font-size: clamp(34px, 4vw, 52px);
  line-height: 1.04;
  letter-spacing: -0.035em;
}

.auth-copy > p {
  max-width: 42ch;
  margin-top: 16px;
  color: var(--ink-soft);
  font-size: 16px;
}

.auth-form {
  display: grid;
  gap: 18px;
  margin-top: 34px;
}

.auth-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.field-control {
  display: grid;
  gap: 7px;
}

.field-control label {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 650;
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background-color 160ms ease;
}

.input,
.select {
  padding: 0 12px;
}

.textarea {
  min-height: 112px;
  padding: 10px 12px;
  resize: vertical;
}

.input::placeholder,
.textarea::placeholder {
  color: oklch(0.49 0.012 265);
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: var(--ink-muted);
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.form-message {
  display: none;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--critical-soft);
  color: oklch(0.37 0.14 25);
  font-size: 13px;
}

.form-message.is-visible {
  display: block;
}

.form-hint {
  margin-top: -7px;
  color: var(--ink-muted);
  font-size: 11px;
  line-height: 1.45;
}

.auth-submit {
  width: 100%;
}

.auth-switch {
  margin-top: 20px;
  color: var(--ink-soft);
  font-size: 14px;
  text-align: center;
}

.auth-switch a {
  color: var(--brand);
  font-weight: 700;
}

.demo-login {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 13px;
}

.auth-scene {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 100dvh;
  overflow: hidden;
  padding: clamp(28px, 5vw, 72px);
  background:
    linear-gradient(oklch(0.18 0.025 265 / 0.12), oklch(0.18 0.025 265 / 0.68)),
    url("/static/web/field-aerial.webp") center / cover;
  color: white;
}

.auth-scene::before {
  content: "";
  position: absolute;
  inset: 0;
  background: oklch(0.22 0.04 145 / 0.16);
  pointer-events: none;
}

.scene-content {
  position: relative;
  z-index: 1;
  width: min(100%, 620px);
}

.scene-content h2 {
  max-width: 14ch;
  font-size: clamp(32px, 4.2vw, 62px);
  line-height: 1.02;
  letter-spacing: -0.035em;
}

.scene-content p {
  max-width: 52ch;
  margin-top: 16px;
  color: oklch(0.96 0.01 145);
  font-size: 16px;
}

.scene-signal {
  display: flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  margin-bottom: 26px;
  padding: 8px 10px;
  border: 1px solid oklch(1 0 0 / 0.34);
  border-radius: var(--radius-sm);
  background: oklch(0.15 0.03 145 / 0.64);
  font-size: 13px;
  font-weight: 650;
}

.signal-live {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: oklch(0.79 0.17 145);
  box-shadow: 0 0 0 5px oklch(0.79 0.17 145 / 0.16);
}

/* App shell */

.app-shell {
  min-height: 100dvh;
}

.sidebar {
  position: fixed;
  z-index: 30;
  inset: 0 auto 0 0;
  display: flex;
  flex-direction: column;
  width: var(--sidebar);
  border-right: 1px solid var(--line);
  background: var(--surface);
  transition: transform 220ms var(--ease-out);
}

.sidebar-head {
  display: flex;
  align-items: center;
  height: var(--topbar);
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 780;
}

.sidebar-brand .brand-mark {
  transform: scale(0.68);
}

.workspace-switch {
  display: grid;
  grid-template-columns: 32px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  margin: 14px 12px 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
  text-align: left;
}

.workspace-avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-size: 12px;
  font-weight: 800;
}

.workspace-meta {
  min-width: 0;
}

.workspace-meta strong,
.workspace-meta span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-meta strong {
  font-size: 13px;
}

.workspace-meta span {
  margin-top: 1px;
  color: var(--ink-muted);
  font-size: 11px;
}

.nav-label {
  padding: 12px 22px 5px;
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 760;
  text-transform: uppercase;
}

.sidebar-nav {
  display: grid;
  gap: 3px;
  padding: 0 10px;
}

.nav-item {
  position: relative;
  display: grid;
  grid-template-columns: 20px 1fr auto;
  align-items: center;
  gap: 11px;
  min-height: 42px;
  padding: 0 11px;
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 580;
  transition:
    color 160ms ease,
    background-color 160ms ease,
    transform 120ms var(--ease-out);
}

.nav-item:hover {
  background: var(--surface-subtle);
  color: var(--ink);
}

.nav-item:active {
  transform: scale(0.985);
}

.nav-item.is-active {
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-weight: 720;
}

.nav-item.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  width: 3px;
  height: 20px;
  border-radius: 0 3px 3px 0;
  background: var(--brand);
}

.nav-badge {
  min-width: 20px;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  background: var(--critical-soft);
  color: var(--critical);
  font-size: 11px;
  font-weight: 760;
  text-align: center;
}

.sidebar-foot {
  margin-top: auto;
  padding: 12px 10px 16px;
  border-top: 1px solid var(--line);
}

.user-summary {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  padding: 6px 8px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--ink);
  color: white;
  font-size: 12px;
  font-weight: 750;
}

.user-meta {
  min-width: 0;
}

.user-meta strong,
.user-meta span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-meta strong {
  font-size: 12px;
}

.user-meta span {
  color: var(--ink-muted);
  font-size: 11px;
}

.app-frame {
  min-height: 100dvh;
  margin-left: var(--sidebar);
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  gap: 16px;
  height: var(--topbar);
  padding: 0 clamp(18px, 3vw, 38px);
  border-bottom: 1px solid var(--line);
  background: oklch(1 0 0 / 0.96);
  backdrop-filter: blur(12px);
}

.topbar-title {
  min-width: 0;
  font-size: 15px;
  font-weight: 720;
}

.topbar-context {
  color: var(--ink-muted);
  font-weight: 500;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.icon-button.mobile-menu {
  display: none;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-soft);
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 120ms var(--ease-out);
}

.icon-button:hover {
  border-color: var(--line);
  background: var(--surface-subtle);
  color: var(--ink);
}

.icon-button:active,
.button:active {
  transform: scale(0.97);
}

.main-content {
  width: min(100%, var(--content));
  margin: 0 auto;
  padding: 30px clamp(18px, 3vw, 38px) 64px;
}

.page-enter {
  animation: page-enter 240ms var(--ease-out) both;
}

@keyframes page-enter {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-head {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 26px;
}

.page-head-copy {
  min-width: 0;
}

.page-head h1 {
  font-size: 27px;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.page-head p {
  max-width: 66ch;
  margin-top: 7px;
  color: var(--ink-soft);
  font-size: 14px;
}

.page-actions {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 720;
  white-space: nowrap;
  transition:
    transform 120ms var(--ease-out),
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    opacity 160ms ease;
}

.button-primary {
  border-color: var(--brand);
  background: var(--brand);
  color: white;
}

.button-primary:hover {
  border-color: var(--brand-hover);
  background: var(--brand-hover);
}

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

.button-secondary:hover {
  border-color: var(--ink-muted);
  background: var(--surface-subtle);
}

.button-ghost {
  color: var(--ink-soft);
}

.button-ghost:hover {
  background: var(--surface-subtle);
  color: var(--ink);
}

.button-danger {
  border-color: oklch(0.83 0.06 25);
  background: var(--critical-soft);
  color: oklch(0.39 0.15 25);
}

.button[aria-busy="true"] {
  opacity: 0.7;
  pointer-events: none;
}

.button-sm {
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
}

.section {
  margin-top: 30px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  gap: 18px;
  margin-bottom: 13px;
}

.section-head h2 {
  font-size: 17px;
  letter-spacing: -0.012em;
}

.section-head p {
  margin-top: 3px;
  color: var(--ink-muted);
  font-size: 13px;
}

.section-head > :last-child:not(:first-child) {
  margin-left: auto;
}

/* Product surfaces */

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--line);
}

.metrics-grid.is-four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric {
  min-width: 0;
  padding: 18px;
  background: var(--surface);
}

.metric-head {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-muted);
  font-size: 12px;
  font-weight: 650;
}

.metric-value {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 10px;
  font-size: 27px;
  font-weight: 730;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.025em;
}

.metric-value small {
  color: var(--ink-muted);
  font-size: 12px;
  font-weight: 600;
}

.metric-foot {
  margin-top: 4px;
  color: var(--ink-muted);
  font-size: 11px;
}

.metric.is-critical .metric-value {
  color: var(--critical);
}

.metric.is-warning .metric-value {
  color: var(--warning);
}

.metric.is-good .metric-value {
  color: var(--good);
}

.distribution-group + .distribution-group {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.distribution-group h3 {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 12px;
  color: var(--ink-soft);
  font-size: 12px;
}

.distribution-group > p {
  color: var(--ink-muted);
  font-size: 12px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(310px, 0.75fr);
  gap: 20px;
}

.surface {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.surface-head {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 56px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
}

.surface-head h2,
.surface-head h3 {
  font-size: 14px;
}

.surface-head > :last-child:not(:first-child) {
  margin-left: auto;
}

.surface-body {
  padding: 18px;
}

.surface-head p {
  margin-top: 3px;
  color: var(--ink-muted);
  font-size: 12px;
}

/* Maps */

.map-section {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.operational-map {
  width: 100%;
  height: 380px;
  background: var(--surface-strong);
}

.operational-map.is-large {
  height: 460px;
}

.operational-map.is-field {
  height: 340px;
}

.operational-map.map-editor {
  height: 300px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.operational-map .leaflet-control-attribution {
  max-width: calc(100% - 12px);
  background: oklch(1 0 0 / 0.9);
  color: var(--ink-muted);
  font-size: 10px;
}

.operational-map .leaflet-control-attribution a {
  color: var(--brand-ink);
}

.operational-map .leaflet-control-zoom a {
  color: var(--ink);
}

.operational-map .leaflet-tooltip {
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-menu);
  color: var(--ink);
  font: 650 12px/1.3 "Aptos", "Segoe UI", system-ui, sans-serif;
}

.map-popup {
  display: grid;
  gap: 3px;
  min-width: 170px;
  font-family: "Aptos", "Segoe UI", system-ui, sans-serif;
}

.map-popup strong {
  color: var(--ink);
  font-size: 13px;
}

.map-popup span,
.map-popup small {
  color: var(--ink-soft);
  font-size: 11px;
}

.operational-map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border-top: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 10px;
}

.operational-map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.operational-map-legend i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--good);
}

.operational-map-legend i.is-warning {
  background: var(--warning);
}

.operational-map-legend i.is-critical {
  background: var(--critical);
}

.map-editor-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.map-editor-head > div:first-child {
  display: grid;
  gap: 2px;
}

.map-editor-head strong {
  font-size: 13px;
}

.map-editor-head span {
  color: var(--ink-muted);
  font-size: 11px;
}

.map-editor-actions {
  display: flex;
  margin-left: auto;
}

.attention-list {
  display: grid;
}

.attention-item {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 12px;
  align-items: start;
  min-width: 0;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  transition: background-color 160ms ease;
}

.attention-item:last-child {
  border-bottom: 0;
}

.attention-item:hover {
  background: var(--surface-subtle);
}

.attention-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--warning-soft);
  color: var(--warning);
}

.attention-item.is-critical .attention-icon {
  background: var(--critical-soft);
  color: var(--critical);
}

.attention-copy {
  min-width: 0;
}

.attention-copy strong {
  display: block;
  font-size: 13px;
  line-height: 1.35;
}

.attention-copy p {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 4px;
  color: var(--ink-muted);
  font-size: 12px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.attention-meta {
  margin-top: 5px;
  color: var(--ink-muted);
  font-size: 11px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--surface-strong);
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.status-chip::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status-chip.is-good,
.status-chip.is-online,
.status-chip.is-normal,
.status-chip.is-active,
.status-chip.is-done,
.status-chip.is-resolved {
  background: var(--good-soft);
  color: var(--good);
}

.status-chip.is-warning,
.status-chip.is-attention,
.status-chip.is-in_progress,
.status-chip.is-snoozed {
  background: var(--warning-soft);
  color: oklch(0.49 0.12 74);
}

.status-chip.is-critical,
.status-chip.is-error,
.status-chip.is-offline,
.status-chip.is-new,
.status-chip.is-blocked,
.status-chip.is-cancelled {
  background: var(--critical-soft);
  color: var(--critical);
}

.status-chip.is-info,
.status-chip.is-viewed,
.status-chip.is-acknowledged,
.status-chip.is-todo {
  background: var(--info-soft);
  color: var(--info);
}

.data-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.search-control {
  position: relative;
  width: min(100%, 320px);
}

.search-control svg {
  position: absolute;
  top: 50%;
  left: 11px;
  color: var(--ink-muted);
  transform: translateY(-50%);
  pointer-events: none;
}

.search-control .input {
  padding-left: 36px;
}

.toolbar-count {
  margin-left: auto;
  color: var(--ink-muted);
  font-size: 12px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  height: 42px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-subtle);
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 720;
  text-align: left;
  white-space: nowrap;
}

.data-table td {
  height: 54px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  vertical-align: middle;
}

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

.data-table tbody tr {
  transition: background-color 140ms ease;
}

.data-table tbody tr:hover {
  background: var(--surface-subtle);
}

.data-table .primary-cell {
  color: var(--ink);
  font-weight: 650;
}

.cell-note {
  display: block;
  max-width: 42ch;
  margin-top: 3px;
  overflow: hidden;
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-table .num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.table-link {
  color: var(--ink);
  font-weight: 680;
}

.table-link:hover {
  color: var(--brand);
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
}

.task-table {
  min-width: 900px;
}

.task-title-cell {
  display: grid;
  min-width: 220px;
}

.task-title-cell strong {
  color: var(--ink);
  font-size: 13px;
}

.task-title-cell span {
  margin-top: 2px;
  color: var(--ink-muted);
  font-size: 11px;
}

.priority-label {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface-subtle);
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.priority-label.is-high {
  border-color: oklch(0.84 0.06 74);
  background: var(--warning-soft);
  color: oklch(0.45 0.12 74);
}

.priority-label.is-critical {
  border-color: oklch(0.84 0.06 25);
  background: var(--critical-soft);
  color: var(--critical);
}

.is-overdue {
  color: var(--critical) !important;
  font-weight: 700;
}

.task-context-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--ink-muted);
  font-size: 11px;
}

.task-context-line > span:last-child {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.task-audit {
  color: var(--ink-muted);
  font-size: 11px;
}

.dialog-kicker {
  margin-top: 2px;
  color: var(--ink-muted);
  font-size: 11px;
}

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

.field-card {
  position: relative;
  display: grid;
  grid-template-rows: 104px auto;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  transition: border-color 160ms ease, transform 180ms var(--ease-out);
}

.field-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

.field-visual {
  position: relative;
  overflow: hidden;
  background: oklch(0.935 0.02 145);
}

.field-visual::before,
.field-visual::after {
  content: "";
  position: absolute;
  inset: 18px 12%;
  border: 1px solid oklch(0.5 0.08 145 / 0.24);
  transform: rotate(-5deg);
}

.field-visual::after {
  inset: 34px 8%;
  transform: rotate(7deg);
}

.field-boundary {
  position: absolute;
  inset: 13px 26%;
  background: oklch(0.69 0.11 145);
  clip-path: polygon(9% 10%, 89% 4%, 100% 65%, 71% 98%, 10% 84%, 0 35%);
  opacity: 0.86;
}

.field-card:nth-child(2n) .field-boundary {
  clip-path: polygon(22% 0, 97% 20%, 82% 91%, 9% 100%, 0 31%);
  background: oklch(0.72 0.12 101);
}

.field-card:nth-child(3n) .field-boundary {
  clip-path: polygon(0 20%, 68% 0, 100% 50%, 78% 100%, 17% 85%);
  background: oklch(0.66 0.1 75);
}

.field-visual .status-chip {
  position: absolute;
  top: 10px;
  right: 10px;
  box-shadow: var(--shadow-menu);
}

.field-card-body {
  padding: 15px;
}

.field-card-title {
  display: flex;
  align-items: start;
  gap: 10px;
}

.field-card-title h3 {
  font-size: 15px;
}

.field-card-title > :last-child {
  margin-left: auto;
}

.field-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 11px;
  color: var(--ink-muted);
  font-size: 12px;
}

.field-card-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(310px, 0.7fr);
  gap: 20px;
}

.catalog-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.check-control {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
}

.check-control input {
  width: 17px;
  height: 17px;
  accent-color: var(--brand);
}

.detail-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 20px;
  margin-bottom: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.detail-hero h1 {
  font-size: 25px;
  letter-spacing: -0.025em;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 9px;
  color: var(--ink-muted);
  font-size: 12px;
}

.detail-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.agronomic-profile {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--line);
}

.profile-record {
  display: flex;
  min-width: 0;
  min-height: 126px;
  flex-direction: column;
  align-items: flex-start;
  padding: 15px;
  background: var(--surface);
}

.profile-record > span:first-child {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 700;
}

.profile-record strong {
  margin-top: 13px;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.3;
}

.profile-record small {
  display: -webkit-box;
  margin-top: 5px;
  overflow: hidden;
  color: var(--ink-muted);
  font-size: 11px;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.profile-record .status-chip {
  margin-top: auto;
}

.profile-notice {
  margin-top: 10px;
}

.tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  margin-bottom: 18px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
  scrollbar-width: none;
}

.period-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.period-bar > span,
.control-label {
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.segmented-control {
  display: inline-flex;
  gap: 2px;
  min-width: 0;
  padding: 3px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  scrollbar-width: none;
}

.segmented-control::-webkit-scrollbar {
  display: none;
}

.segmented-control button {
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 680;
  white-space: nowrap;
}

.segmented-control button:hover {
  color: var(--ink);
}

.segmented-control button.is-active {
  background: var(--surface);
  box-shadow: 0 1px 3px oklch(0.2 0.02 265 / 0.1);
  color: var(--brand-ink);
}

.segmented-control.is-compact button {
  min-height: 30px;
}

.telemetry-controls {
  display: grid;
  grid-template-columns: minmax(340px, 1.7fr) repeat(2, minmax(170px, 0.65fr));
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.telemetry-controls .control-group {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.telemetry-chart-surface .chart {
  min-height: 300px;
}

.telemetry-chart-surface .chart svg {
  height: 300px;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
  transition: background-color 160ms ease, color 160ms ease;
}

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

.tab.is-active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 3px oklch(0.2 0.02 265 / 0.1);
}

.chart {
  position: relative;
  min-height: 240px;
}

.chart svg {
  width: 100%;
  height: 240px;
  overflow: visible;
}

.chart-grid {
  stroke: var(--line);
  stroke-width: 1;
}

.chart-line {
  fill: none;
  stroke: var(--brand);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
  vector-effect: non-scaling-stroke;
}

.chart-area {
  fill: var(--brand-soft);
  opacity: 0.75;
}

.chart-point {
  fill: var(--surface);
  stroke: var(--brand);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.chart-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  color: var(--ink-muted);
  font-size: 10px;
}

.field-map {
  position: relative;
  min-height: 300px;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: oklch(0.925 0.025 145);
}

.field-map::before,
.field-map::after {
  content: "";
  position: absolute;
  border: 1px solid oklch(0.44 0.05 145 / 0.2);
}

.field-map::before {
  inset: 12% -5%;
  transform: rotate(8deg);
}

.field-map::after {
  inset: 38% -5%;
  transform: rotate(-4deg);
}

.map-boundary {
  position: absolute;
  inset: 12% 16%;
  border: 2px solid oklch(0.43 0.11 145);
  background: oklch(0.68 0.1 145 / 0.5);
  clip-path: polygon(8% 6%, 88% 0, 100% 64%, 72% 98%, 12% 86%, 0 34%);
}

.map-device {
  position: absolute;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 3px solid var(--surface);
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 2px 5px oklch(0.2 0.02 265 / 0.24);
  transform: translate(-50%, -50%);
}

.map-device.is-offline {
  background: var(--critical);
}

.map-device.is-warning {
  background: var(--warning);
}

.map-device:nth-child(2) { left: 35%; top: 30%; }
.map-device:nth-child(3) { left: 63%; top: 39%; }
.map-device:nth-child(4) { left: 45%; top: 67%; }
.map-device:nth-child(5) { left: 74%; top: 66%; }

.map-legend {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: flex;
  gap: 10px;
  padding: 7px 9px;
  border-radius: var(--radius-sm);
  background: oklch(1 0 0 / 0.92);
  color: var(--ink-soft);
  font-size: 10px;
}

.map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.map-legend i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--good);
}

.map-legend .offline {
  background: var(--critical);
}

.recommendation-list,
.alert-list,
.note-list {
  display: grid;
  gap: 10px;
}

.recommendation-item,
.alert-item,
.note-item {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.recommendation-item {
  display: grid;
  grid-template-columns: 5px minmax(0, 1fr);
  overflow: hidden;
}

.recommendation-rail {
  background: var(--good);
}

.recommendation-item.is-warning .recommendation-rail {
  background: var(--warning);
}

.recommendation-item.is-critical .recommendation-rail {
  background: var(--critical);
}

.recommendation-content {
  padding: 16px 18px;
}

.recommendation-head,
.alert-head,
.note-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.recommendation-head h3,
.alert-head h3 {
  font-size: 14px;
  line-height: 1.35;
}

.recommendation-head > :last-child,
.alert-head > :last-child,
.note-head > :last-child {
  margin-left: auto;
}

.recommendation-content > p,
.alert-item > p {
  max-width: 76ch;
  margin-top: 7px;
  color: var(--ink-soft);
  font-size: 13px;
}

.recommendation-values {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.value-token {
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  color: var(--ink-soft);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.action-plan {
  margin-top: 12px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  background: var(--info-soft);
  color: oklch(0.36 0.07 247);
  font-size: 12px;
  white-space: pre-line;
}

.alert-item {
  padding: 15px 16px;
}

.alert-item.is-new {
  border-color: oklch(0.83 0.06 25);
}

.alert-meta,
.note-meta {
  margin-top: 7px;
  color: var(--ink-muted);
  font-size: 11px;
}

.alert-actions,
.recommendation-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.recommendation-actions {
  margin-top: 13px;
}

.note-item {
  padding: 14px 16px;
}

.note-item p {
  max-width: 80ch;
  color: var(--ink-soft);
  font-size: 13px;
}

.note-item.is-important {
  border-color: oklch(0.83 0.06 74);
  background: var(--warning-soft);
}

.member-list {
  display: grid;
}

.team-metrics {
  margin-bottom: 4px;
}

.team-table {
  min-width: 760px;
}

.team-table th:last-child,
.team-table td:last-child {
  width: 58px;
  padding-right: 8px;
}

.member-cell,
.member-dialog-title {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.member-cell .avatar,
.member-dialog-title .avatar {
  flex: 0 0 34px;
  background: var(--brand-soft);
  color: var(--brand);
}

.member-info small {
  display: inline-block;
  margin-left: 5px;
  color: var(--brand);
  font-size: 10px;
  font-weight: 720;
  vertical-align: 1px;
}

.team-empty-filter {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink-muted);
  font-size: 13px;
  text-align: center;
}

.permission-table .data-table {
  min-width: 640px;
}

.member-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 150px 100px;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--line);
}

.member-item:last-child {
  border-bottom: 0;
}

.member-info {
  min-width: 0;
}

.member-info strong,
.member-info span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-info strong {
  font-size: 13px;
}

.member-info span {
  color: var(--ink-muted);
  font-size: 11px;
}

.role-label {
  color: var(--ink-soft);
  font-size: 12px;
}

.member-dialog-title {
  min-width: 0;
}

.member-dialog-title > div {
  min-width: 0;
}

.member-dialog-title h2,
.member-dialog-title p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-dialog-title p {
  margin-top: 2px;
  color: var(--ink-muted);
  font-size: 11px;
}

.member-dialog-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  color: var(--ink-muted);
  font-size: 11px;
}

.field-help {
  color: var(--ink-muted);
  font-size: 11px;
  line-height: 1.45;
}

.access-toggle {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  cursor: pointer;
}

.access-toggle input {
  width: 17px;
  height: 17px;
  margin-top: 1px;
  accent-color: var(--brand);
}

.access-toggle strong,
.access-toggle small {
  display: block;
}

.access-toggle strong {
  font-size: 13px;
}

.access-toggle small {
  margin-top: 3px;
  color: var(--ink-muted);
  font-size: 11px;
  line-height: 1.45;
}

.readonly-notice {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.45;
}

.readonly-notice svg {
  flex: 0 0 auto;
  color: var(--brand);
}

.dialog-actions-split {
  justify-content: space-between;
}

.dialog-actions-group {
  display: flex;
  gap: 8px;
}

.settings-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 720px);
  gap: 28px;
}

.settings-nav {
  display: grid;
  align-content: start;
  gap: 3px;
}

.settings-nav button {
  min-height: 38px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-soft);
  font-size: 13px;
  text-align: left;
}

.settings-nav button.is-active {
  background: var(--surface-strong);
  color: var(--ink);
  font-weight: 700;
}

.settings-form {
  display: grid;
  gap: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.settings-form h2 {
  font-size: 17px;
}

.settings-form > p {
  margin-top: -12px;
  color: var(--ink-muted);
  font-size: 13px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 4px;
}

/* State and feedback */

.empty-state {
  display: grid;
  place-items: center;
  min-height: 240px;
  padding: 36px 20px;
  color: var(--ink-soft);
  text-align: center;
}

.empty-state-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 13px;
  border-radius: var(--radius-md);
  background: var(--surface-strong);
  color: var(--ink-muted);
}

.empty-state h3 {
  font-size: 15px;
}

.empty-state p {
  max-width: 42ch;
  margin-top: 5px;
  color: var(--ink-muted);
  font-size: 13px;
}

.empty-state .button {
  margin-top: 16px;
}

.error-state {
  min-height: 320px;
}

.skeleton {
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--surface-strong);
}

.skeleton::after {
  content: "";
  display: block;
  width: 45%;
  height: 100%;
  background: linear-gradient(90deg, transparent, oklch(1 0 0 / 0.7), transparent);
  animation: shimmer 1.2s linear infinite;
  transform: translateX(-100%);
}

@keyframes shimmer {
  to { transform: translateX(300%); }
}

.skeleton-line {
  width: 100%;
  height: 12px;
}

.skeleton-line.short {
  width: 60%;
}

.skeleton-block {
  height: 160px;
}

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

.loading-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.toast-region {
  position: fixed;
  z-index: 70;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 8px;
  width: min(360px, calc(100vw - 36px));
  pointer-events: none;
}

.toast {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  align-items: start;
  gap: 10px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-float);
  color: var(--ink-soft);
  font-size: 13px;
  pointer-events: auto;
  transition: opacity 180ms ease, transform 180ms var(--ease-out);
  @starting-style {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
}

.toast.is-leaving {
  opacity: 0;
  transform: translateY(8px) scale(0.98);
}

.toast strong {
  display: block;
  color: var(--ink);
}

.toast p {
  margin-top: 2px;
  font-size: 12px;
}

.toast.is-success > svg {
  color: var(--good);
}

.toast.is-error > svg {
  color: var(--critical);
}

.dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: min(760px, calc(100dvh - 40px));
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-float);
  color: var(--ink);
}

.dialog:has(.map-editor) {
  width: min(760px, calc(100vw - 32px));
}

.dialog::backdrop {
  background: oklch(0.16 0.02 265 / 0.48);
  backdrop-filter: blur(2px);
}

.dialog[open] {
  animation: dialog-enter 200ms var(--ease-out);
}

@keyframes dialog-enter {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.dialog-head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
}

.dialog-head h2 {
  font-size: 16px;
}

.dialog-head > :last-child {
  margin-left: auto;
}

.dialog-body {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
}

.sidebar-backdrop {
  display: none;
}

.mobile-nav {
  display: none;
}

@media (hover: hover) and (pointer: fine) {
  .field-card:hover .field-boundary {
    transform: scale(1.035);
  }

  .field-boundary {
    transition: transform 220ms var(--ease-out);
  }
}

@media (max-width: 1180px) {
  .metrics-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .metrics-grid.is-four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid,
  .split-layout {
    grid-template-columns: 1fr;
  }

  .telemetry-controls {
    grid-template-columns: 1fr 1fr;
  }

  .telemetry-controls .is-wide {
    grid-column: 1 / -1;
  }
}

@media (max-width: 920px) {
  .agronomic-profile {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .catalog-columns {
    grid-template-columns: 1fr;
    gap: 0;
  }

  :root {
    --sidebar: 228px;
  }

  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.is-open {
    transform: translateX(0);
    box-shadow: var(--shadow-float);
  }

  .sidebar-backdrop {
    position: fixed;
    z-index: 25;
    inset: 0;
    display: block;
    border: 0;
    background: oklch(0.16 0.02 265 / 0.42);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
  }

  .sidebar-backdrop.is-visible {
    opacity: 1;
    pointer-events: auto;
  }

  .app-frame {
    margin-left: 0;
  }

  .icon-button.mobile-menu {
    display: inline-grid;
  }

  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-scene {
    display: none;
  }

  .auth-panel {
    min-height: 100dvh;
  }

  .settings-layout {
    grid-template-columns: 1fr;
  }

  .settings-nav {
    display: flex;
    overflow-x: auto;
  }

  .settings-nav button {
    white-space: nowrap;
  }
}

@media (max-width: 680px) {
  .agronomic-profile {
    grid-template-columns: 1fr;
  }

  .profile-record {
    min-height: 108px;
  }

  body {
    padding-bottom: 64px;
  }

  .topbar {
    height: 60px;
    padding: 0 14px;
  }

  .topbar-context,
  .topbar-actions .button span {
    display: none;
  }

  .main-content {
    padding: 22px 14px 36px;
  }

  .page-head {
    display: grid;
    gap: 16px;
  }

  .page-head h1 {
    font-size: 23px;
  }

  .page-actions {
    justify-content: flex-start;
    margin-left: 0;
  }

  .period-bar {
    display: grid;
    gap: 7px;
  }

  .segmented-control {
    width: 100%;
  }

  .telemetry-controls {
    grid-template-columns: 1fr;
  }

  .telemetry-controls .is-wide {
    grid-column: auto;
  }

  .operational-map,
  .operational-map.is-large,
  .operational-map.is-field {
    height: 340px;
  }

  .operational-map.map-editor {
    height: 260px;
  }

  .metrics-grid {
    grid-template-columns: 1fr 1fr;
  }

  .metric {
    padding: 14px;
  }

  .metric-value {
    font-size: 23px;
  }

  .field-list {
    grid-template-columns: 1fr;
  }

  .detail-hero {
    grid-template-columns: 1fr;
  }

  .member-item {
    grid-template-columns: 38px minmax(0, 1fr) auto;
  }

  .member-item .role-label {
    grid-column: 2;
  }

  .form-row,
  .auth-form-grid {
    grid-template-columns: 1fr;
  }

  .table-wrap {
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .table-wrap.edge-to-edge {
    margin-right: -14px;
    margin-left: -14px;
  }

  .data-table th,
  .data-table td {
    padding-right: 11px;
    padding-left: 11px;
  }

  .team-table-wrap {
    margin-right: -14px;
    margin-left: -14px;
  }

  .dialog-actions-split {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .dialog-actions-split > .button,
  .dialog-actions-group,
  .dialog-actions-group .button {
    width: 100%;
  }

  .mobile-nav {
    position: fixed;
    z-index: 35;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    min-height: 62px;
    padding: 5px max(6px, env(safe-area-inset-right)) max(5px, env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
    border-top: 1px solid var(--line);
    background: oklch(1 0 0 / 0.97);
    backdrop-filter: blur(12px);
  }

  .mobile-nav a {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 2px;
    min-width: 0;
    color: var(--ink-muted);
    font-size: 9px;
  }

  .mobile-nav a.is-active {
    color: var(--brand);
    font-weight: 700;
  }

  .sidebar {
    padding-bottom: 70px;
  }
}

@media (max-width: 420px) {
  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .metrics-grid.is-four,
  .metrics-grid.team-metrics {
    grid-template-columns: 1fr 1fr;
  }

  .team-metrics .metric {
    min-height: 154px;
  }

  .attention-item {
    grid-template-columns: 32px 1fr;
  }

  .attention-item > .status-chip {
    grid-column: 2;
    width: max-content;
  }

  .demo-login {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }

  .page-enter {
    animation: none;
  }
}
