:root {
  --ink: #08090b;
  --ink-soft: #15171b;
  --paper: #f5f5f7;
  --line: #d9d9df;
  --muted: #70727a;
  --blue: #0071e3;
  --cyan: #4fd1ff;
  --green: #47c272;
  --amber: #ffbd45;
  --radius: 8px;
  --content-width: 980px;
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--ink);
  color: #fff;
}

body.auth-locked {
  min-height: 100svh;
  overflow: hidden;
}

body.auth-locked .site-header,
body.auth-locked main {
  display: none;
}

body.is-authenticated .login-screen {
  display: none;
}

button,
input,
select {
  font: inherit;
}

.login-screen {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: clamp(18px, 5vw, 72px);
  background:
    radial-gradient(circle at 74% 22%, rgba(79, 209, 255, 0.18), transparent 28%),
    radial-gradient(circle at 20% 82%, rgba(255, 189, 69, 0.12), transparent 30%),
    linear-gradient(145deg, #030405 0%, #11151b 48%, #050609 100%);
}

.login-card {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(260px, 1.1fr);
  gap: clamp(18px, 4vw, 38px);
  width: min(100%, 860px);
  padding: clamp(18px, 3vw, 28px);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius);
  box-shadow: 0 42px 120px rgba(0, 0, 0, 0.46);
}

.login-brand {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
}

.login-brand img {
  display: block;
  width: auto;
  max-width: min(48vw, 220px);
  height: 42px;
  object-fit: contain;
}

.login-form {
  display: grid;
  gap: 12px;
}

.login-form h1 {
  color: var(--ink);
  font-size: clamp(34px, 6vw, 64px);
}

.login-form button {
  min-height: 44px;
  color: #fff;
  background: var(--blue);
}

.login-form small {
  color: #5e646d;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.password-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.password-field button {
  min-width: 96px;
  padding: 0 10px;
}

.login-status {
  min-height: 18px;
  margin: 0;
  color: #c13d3d;
  font-size: 13px;
  font-weight: 760;
}

.login-description {
  align-self: end;
  display: grid;
  gap: 10px;
  padding: 14px;
  background: #f5f5f7;
  border: 1px solid #d9d9df;
  border-radius: var(--radius);
}

.login-description h2 {
  color: var(--ink);
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.05;
}

.login-description p {
  margin: 0;
  color: #4c515b;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.45;
}

.login-legal-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 4px;
}

.login-legal-actions a {
  display: grid;
  place-items: center;
  min-height: 36px;
  padding: 0 10px;
  color: #fff;
  text-decoration: none;
  background: var(--ink-soft);
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 760;
}

.login-legal-actions a:hover,
.login-legal-actions a:focus-visible {
  background: var(--blue);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, auto);
  align-items: center;
  gap: clamp(12px, 3vw, 36px);
  min-height: 76px;
  padding: 12px clamp(18px, 4vw, 56px);
  background: #fff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  backdrop-filter: saturate(180%) blur(16px);
}

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

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

.header-logo img {
  display: block;
  width: auto;
  max-width: min(28vw, 210px);
  height: 42px;
  object-fit: contain;
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 1.5vw, 18px);
  padding: 8px 12px;
  background: #111318;
  border-radius: var(--radius);
}

.main-nav a {
  color: #f8f8fb;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.main-nav button {
  min-height: 28px;
  padding: 0 10px;
  color: #111318;
  background: #fff;
  border: 0;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 760;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 1.05fr);
  gap: 32px;
  align-items: center;
  min-height: calc(100svh - 76px);
  padding: clamp(52px, 7vw, 92px) clamp(20px, 6vw, 86px) clamp(34px, 5vw, 58px);
  overflow: hidden;
  background:
    radial-gradient(circle at 73% 42%, rgba(79, 209, 255, 0.2), transparent 28%),
    radial-gradient(circle at 63% 75%, rgba(255, 189, 69, 0.15), transparent 26%),
    linear-gradient(145deg, #030405 0%, #11151b 46%, #050609 100%);
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 28vh;
  background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.66));
  pointer-events: none;
}

.hero-copy {
  position: relative;
  z-index: 2;
}

.eyebrow {
  margin: 0 0 16px;
  color: #9aa3ad;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.eyebrow.dark {
  color: #5e646d;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
  line-height: 0.96;
}

h1 {
  max-width: 760px;
  font-size: clamp(46px, 7vw, 104px);
  font-weight: 800;
}

h2 {
  color: inherit;
  font-size: clamp(34px, 5vw, 72px);
  font-weight: 760;
}

.hero-visual {
  position: relative;
  z-index: 1;
  min-height: 560px;
  perspective: 1000px;
}

.sun-core,
.sun-ring {
  position: absolute;
  left: 50%;
  top: 24%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
}

.sun-core {
  width: clamp(116px, 15vw, 188px);
  aspect-ratio: 1;
  background: radial-gradient(circle at 35% 35%, #fff8c9 0 12%, #ffd46a 30%, #ff8a2f 68%, rgba(255, 138, 47, 0) 72%);
  box-shadow: 0 0 90px rgba(255, 172, 63, 0.62);
}

.sun-ring {
  border: 1px solid rgba(255, 205, 111, 0.26);
  animation: breathe 5s ease-in-out infinite;
}

.ring-one {
  width: 330px;
  aspect-ratio: 1;
}

.ring-two {
  width: 520px;
  aspect-ratio: 1;
  animation-delay: -1.6s;
}

.panel-stage {
  position: absolute;
  left: 50%;
  bottom: 13%;
  width: min(86vw, 620px);
  height: 310px;
  transform: translateX(-50%) rotateX(62deg) rotateZ(-12deg);
  transform-style: preserve-3d;
}

.hero-panel {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  width: 100%;
  height: 100%;
  padding: 16px;
  background: linear-gradient(135deg, #101824, #1d3348 54%, #0f151f);
  border: 1px solid rgba(120, 199, 255, 0.3);
  border-radius: var(--radius);
  box-shadow: 0 52px 120px rgba(0, 0, 0, 0.56), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.hero-panel span {
  background: linear-gradient(145deg, rgba(93, 201, 255, 0.2), rgba(0, 92, 171, 0.42));
  border: 1px solid rgba(160, 219, 255, 0.18);
  border-radius: 4px;
}

.calculator {
  background: var(--paper);
  color: var(--ink);
  min-height: calc(100svh - 76px);
  padding: clamp(24px, 4vw, 42px) clamp(18px, 5vw, 72px);
  display: grid;
  align-items: center;
}

.section-heading {
  width: min(100%, var(--content-width));
  max-width: var(--content-width);
  margin-inline: auto;
  margin-bottom: clamp(16px, 3vw, 30px);
}

.components-section .section-heading h2 {
  max-width: 980px;
  font-size: clamp(26px, 3.8vw, 48px);
  line-height: 1.03;
}

.block-heading {
  margin-bottom: 14px;
}

.block-heading h2 {
  font-size: clamp(26px, 3.2vw, 44px);
}

.setup-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.82fr);
  gap: 24px;
  align-items: stretch;
}

.daily-grid {
  grid-template-columns: minmax(0, 1fr);
  width: min(100%, var(--content-width));
  max-width: var(--content-width);
  margin: 0 auto;
}

.control-panel,
.result-summary {
  display: flex;
  flex-direction: column;
  min-height: 620px;
  padding: clamp(16px, 2.4vw, 24px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.control-panel {
  border-color: rgba(0, 113, 227, 0.16);
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.06);
}

.result-summary {
  border-color: rgba(8, 9, 11, 0.08);
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.07);
}

.control-panel .map-wrap {
  margin-top: auto;
}

.field-row {
  display: grid;
  gap: 12px;
}

.two-columns {
  grid-template-columns: minmax(180px, 0.65fr) minmax(240px, 1.35fr);
}

label {
  display: grid;
  gap: 8px;
  color: #2b2d33;
  font-size: 13px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 40px;
  padding: 8px 11px;
  color: #111318;
  background: #f7f7f9;
  border: 1px solid #cfd1d8;
  border-radius: var(--radius);
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

input:focus,
select:focus {
  background: #fff;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.16);
}

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

button {
  min-height: 40px;
  padding: 0 18px;
  color: #fff;
  font-weight: 750;
  background: #111318;
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
}

button:hover {
  background: #0071e3;
}

button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

button:disabled:hover {
  background: #111318;
}

.location-readout {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  margin: 12px 0;
  color: #4c515b;
  font-size: 14px;
  font-weight: 650;
}

.service-status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  padding: 8px 11px;
  color: #2f3540;
  background: #f7f7f9;
  border: 1px solid #dfe1e7;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 800;
}

.service-status span {
  width: 10px;
  height: 10px;
  background: #8b929d;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(139, 146, 157, 0.14);
}

.service-status.is-checking span {
  background: #ffbd45;
  box-shadow: 0 0 0 4px rgba(255, 189, 69, 0.18);
}

.service-status.is-online span {
  background: #47c272;
  box-shadow: 0 0 0 4px rgba(71, 194, 114, 0.18);
}

.service-status.is-offline span {
  background: #e05252;
  box-shadow: 0 0 0 4px rgba(224, 82, 82, 0.16);
}

.config-section,
.reconcile-section,
.optimization-section,
.report-section,
.legal-section {
  min-height: calc(100svh - 76px);
  padding: clamp(24px, 4vw, 42px) clamp(18px, 5vw, 72px);
  display: grid;
  align-items: center;
  background: var(--paper);
  color: var(--ink);
}

.statistics-section {
  min-height: calc(100svh - 76px);
  padding: clamp(24px, 4vw, 42px) clamp(18px, 5vw, 72px);
  display: grid;
  align-items: center;
  background: var(--paper);
  color: var(--ink);
}

.statistics-tools,
.reconcile-tools,
.optimization-tools,
.report-tools,
.legal-tools {
  display: grid;
  gap: 12px;
  width: min(100%, var(--content-width));
  max-width: var(--content-width);
  margin: 0 auto;
  padding: clamp(16px, 2.4vw, 24px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.statistics-periods {
  display: grid;
  grid-template-columns: repeat(4, minmax(76px, 1fr));
  gap: 8px;
}

.statistics-periods button {
  min-height: 42px;
  padding: 0 12px;
}

.statistics-periods button.is-active {
  background: var(--blue);
}

.statistics-period-readout {
  display: grid;
  gap: 5px;
  padding: 10px 12px;
  color: #111318;
  background: #f3f6f8;
  border: 1px solid #d9dce3;
  border-radius: var(--radius);
}

.statistics-period-readout span {
  color: #6d737c;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.statistics-period-readout strong {
  font-size: clamp(18px, 2vw, 26px);
  line-height: 1.08;
}

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

.statistics-metrics div {
  min-height: 82px;
  padding: 12px;
  color: #fff;
  background: #15171b;
  border-radius: var(--radius);
}

.statistics-metrics span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 700;
}

.statistics-metrics strong {
  display: block;
  margin-top: 10px;
  font-size: clamp(22px, 2.6vw, 36px);
  line-height: 1;
}

.statistics-chart-shell {
  height: 280px;
}

.reconcile-inputs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.actual-entry {
  display: grid;
  gap: 7px;
  padding: 9px;
  background: #f7f7f9;
  border: 1px solid #e3e5ea;
  border-radius: var(--radius);
}

.actual-entry label {
  gap: 4px;
  font-size: 12px;
}

.actual-entry input {
  min-height: 34px;
  padding: 6px 8px;
}

.actual-date-stepper {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 30px;
  gap: 5px;
}

.actual-date-stepper button {
  min-width: 0;
  min-height: 34px;
  padding: 0;
  color: #111318;
  background: #fff;
  border-color: #d7dae0;
  font-size: 20px;
  line-height: 1;
}

.actual-date-stepper button:hover {
  background: #eef2f6;
}

.actual-value-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.actual-entry output {
  display: grid;
  align-items: center;
  min-height: 34px;
  padding: 6px 8px;
  color: #111318;
  background: #fff;
  border: 1px solid #d7dae0;
  border-radius: var(--radius);
  font-weight: 850;
}

.actual-entry.has-actual-data {
  border-color: rgba(71, 194, 114, 0.58);
  box-shadow: inset 0 0 0 1px rgba(71, 194, 114, 0.18);
}

.actual-entry.has-actual-data input:first-child,
.actual-entry input.has-actual-data {
  background: #eefaf3;
  border-color: rgba(71, 194, 114, 0.75);
  box-shadow: 0 0 0 3px rgba(71, 194, 114, 0.14);
}

.actual-history {
  display: flex;
  justify-content: flex-end;
}

.actual-suggestions {
  display: grid;
  gap: 4px;
  max-height: 116px;
  overflow: auto;
  padding: 6px;
  background: #fff;
  border: 1px solid #d7dae0;
  border-radius: var(--radius);
  box-shadow: 0 12px 28px rgba(20, 24, 32, 0.14);
}

.actual-suggestions[hidden] {
  display: none;
}

.actual-suggestions button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 30px;
  padding: 5px 7px;
  color: #111318;
  text-align: left;
  background: #f7f8fa;
  border: 1px solid transparent;
  border-radius: var(--radius);
}

.actual-suggestions button:hover,
.actual-suggestions button:focus-visible {
  background: #eef2f6;
  border-color: #cfd5dd;
}

.actual-suggestions span {
  overflow: hidden;
  font-size: 11px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.actual-suggestions strong {
  color: #5e646d;
  font-size: 11px;
  font-weight: 760;
}

.actual-history button {
  min-height: 34px;
}

.actual-history button {
  padding: 0 10px;
  font-size: 12px;
}

.reconcile-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
}

.reconcile-summary div {
  min-height: 82px;
  padding: 12px;
  color: #fff;
  background: #15171b;
  border-radius: var(--radius);
}

.reconcile-summary span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 700;
}

.reconcile-summary strong {
  display: block;
  margin-top: 10px;
  font-size: clamp(22px, 2.6vw, 36px);
  line-height: 1;
}

.reconcile-summary small {
  display: block;
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.66);
  font-size: 11px;
  font-weight: 750;
}

.reconciliation-chart-shell {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: minmax(0, 1fr);
  gap: 8px;
  height: 260px;
}

.reconciliation-chart-card {
  min-width: 0;
  min-height: 0;
  padding: 8px;
  background: #090b0f;
  border-radius: var(--radius);
}

.reconcile-save-button {
  justify-self: center;
  min-width: 180px;
}

.ai-suggestions {
  display: grid;
  gap: 8px;
  padding: 12px;
  background: #f7f7f9;
  border: 1px solid #e3e5ea;
  border-radius: var(--radius);
}

.ai-suggestions h3 {
  margin: 0;
  color: #15171b;
  font-size: 17px;
}

.ai-suggestions ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
  color: #3b4049;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
}

.report-description {
  display: grid;
  gap: 4px;
  width: 100%;
  margin: 0;
  color: #4c515b;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.45;
}

.report-directory-field {
  display: grid;
  grid-template-columns: max-content minmax(120px, 1fr);
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 46px;
  padding: 8px 10px;
  background: #f7f8fa;
  border: 1px solid #d7dae0;
  border-radius: var(--radius);
  color: #3b4049;
  font-size: 13px;
  font-weight: 760;
}

.report-directory-field input {
  min-width: 0;
}

.report-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
}

.report-actions button {
  width: 100%;
  min-width: 0;
}

.legal-copy {
  margin: 0;
  color: #4c515b;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.45;
}

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

.legal-actions a {
  display: grid;
  place-items: center;
  min-height: 42px;
  padding: 0 14px;
  color: #fff;
  text-decoration: none;
  background: var(--ink-soft);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 760;
}

.legal-actions a:hover,
.legal-actions a:focus-visible {
  background: var(--blue);
}

.config-tools {
  display: grid;
  gap: 14px;
  width: min(100%, var(--content-width));
  max-width: var(--content-width);
  margin: 0 auto;
  padding: clamp(16px, 2.4vw, 24px);
  background: transparent;
  border: 0;
  border-radius: 0;
}

.config-card-grid {
  display: grid;
  grid-template-columns: minmax(420px, 1.5fr) minmax(260px, 0.72fr);
  gap: 12px;
}

.data-card {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 0;
  padding: 12px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius);
  box-shadow: 0 22px 58px rgba(0, 0, 0, 0.07);
}

.data-card-wide {
  min-height: 0;
}

.archive-card {
  align-content: start;
}

.data-card-divider {
  height: 1px;
  margin: 2px 0;
  background: #e3e5ea;
}

.data-card-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.plant-data-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(170px, 0.72fr);
  gap: 12px;
  align-items: stretch;
}

.plant-image-preview {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 168px;
  margin: 0;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(0, 113, 227, 0.09), rgba(71, 194, 114, 0.08)),
    #f3f5f8;
  border: 1px solid #d7dae0;
  border-radius: var(--radius);
}

.plant-image-preview img {
  width: 100%;
  height: 100%;
  min-height: 168px;
  object-fit: cover;
}

.plant-image-preview figcaption {
  color: #7b828c;
  font-size: 13px;
  font-weight: 800;
}

.image-dropzone {
  display: grid;
  gap: 4px;
  place-items: center;
  min-height: 76px;
  padding: 10px;
  color: #3b4049;
  text-align: center;
  background: #f7f8fa;
  border: 1px dashed #b8c0ca;
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.image-dropzone strong {
  font-size: 13px;
}

.image-dropzone span {
  color: #70727a;
  font-size: 12px;
  font-weight: 700;
}

.image-dropzone:hover,
.image-dropzone:focus-visible,
.image-dropzone.is-dragging {
  background: #eef5ff;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.12);
}

.data-card .location-readout {
  margin: 0;
  padding: 8px 10px;
  background: #f7f7f9;
  border: 1px solid #e3e5ea;
  border-radius: var(--radius);
}

.data-card .map-wrap {
  height: 220px;
}

.data-card h3 {
  margin: 0;
  color: #15171b;
  font-size: 17px;
  line-height: 1.2;
}

.config-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.config-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.config-data-row {
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
}

.config-tools button {
  white-space: nowrap;
}

.map-wrap {
  overflow: hidden;
  height: 300px;
  border: 1px solid #cfd1d8;
  border-radius: var(--radius);
}

#map {
  width: 100%;
  height: 100%;
  background:
    linear-gradient(90deg, rgba(0, 113, 227, 0.08) 1px, transparent 1px),
    linear-gradient(180deg, rgba(0, 113, 227, 0.08) 1px, transparent 1px),
    linear-gradient(135deg, #e5edf2, #f6f7f9);
  background-size: 38px 38px, 38px 38px, 100% 100%;
}

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

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

.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow {
  user-select: none;
  -webkit-user-drag: none;
}

.leaflet-tile {
  visibility: hidden;
  border: 0;
}

.leaflet-tile-loaded {
  visibility: inherit;
}

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

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

.leaflet-top {
  top: 0;
}

.leaflet-right {
  right: 0;
}

.leaflet-bottom {
  bottom: 0;
}

.leaflet-left {
  left: 0;
}

.leaflet-control-zoom {
  margin: 10px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
}

.leaflet-control-zoom a {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: #111318;
  background: #fff;
  text-decoration: none;
  font-weight: 800;
}

.leaflet-control-attribution {
  margin: 0;
  padding: 3px 7px;
  color: #4c515b;
  background: rgba(255, 255, 255, 0.78);
  font-size: 11px;
}

.leaflet-control-attribution a {
  color: #111318;
}

.map-message {
  display: grid;
  place-items: center;
  height: 100%;
  padding: 24px;
  color: #5d6673;
  font-size: 14px;
  font-weight: 800;
  text-align: center;
}

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

.day-field {
  margin: 0;
}

.date-picker-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 38px auto;
  gap: 8px;
}

.date-step-button {
  min-width: 0;
  min-height: 40px;
  padding: 0;
  color: #111318;
  background: #f4f6f8;
  border-color: #d7dbe2;
  font-size: 24px;
  line-height: 1;
}

.date-step-button:hover {
  background: #e9edf3;
}

.daily-control-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.74fr);
  gap: 12px;
  align-items: end;
  margin-top: 12px;
}

.daily-control-row .service-status {
  min-height: 40px;
}

.calendar-popover {
  margin-top: 10px;
  padding: 12px;
  background: #f7f8fa;
  border: 1px solid #dfe2e8;
  border-radius: var(--radius);
}

.calendar-head {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.calendar-head button {
  display: grid;
  place-items: center;
  min-height: 34px;
  padding: 0;
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
}

.calendar-head strong {
  color: #15171b;
  font-size: 14px;
  text-align: center;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
}

.calendar-weekdays {
  margin-bottom: 5px;
}

.calendar-weekdays span {
  color: #6b7280;
  font-size: 10px;
  font-weight: 850;
  text-align: center;
}

.calendar-day {
  min-height: 31px;
  padding: 0;
  color: #111318;
  background: #fff;
  border: 1px solid #e0e4ea;
  font-size: 12px;
  font-weight: 800;
}

.calendar-day.is-past {
  color: #075fa8;
  background: rgba(0, 113, 227, 0.1);
  border-color: rgba(0, 113, 227, 0.2);
}

.calendar-day.is-future {
  color: #825300;
  background: rgba(255, 189, 69, 0.16);
  border-color: rgba(255, 189, 69, 0.32);
}

.calendar-day.is-today {
  color: #0a5c2a;
  background: rgba(71, 194, 114, 0.16);
  border-color: rgba(71, 194, 114, 0.38);
}

.calendar-day.is-selected {
  color: #fff;
  background: #111318;
  border-color: #111318;
}

.calendar-day.is-muted {
  opacity: 0.42;
}

.calendar-day:disabled {
  opacity: 0.22;
}

.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
  color: #5e646d;
  font-size: 11px;
  font-weight: 800;
}

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

.calendar-legend i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.calendar-legend .is-past { background: #0071e3; }
.calendar-legend .is-today { background: #47c272; }
.calendar-legend .is-future { background: #ffbd45; }

.metric {
  display: grid;
  align-content: end;
  min-height: 92px;
  padding: 12px;
  color: #fff;
  background: #15171b;
  border-radius: var(--radius);
}

.metric.primary {
  background: linear-gradient(140deg, #10151d, #003f7d);
}

.metric span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 700;
}

.metric strong {
  margin-top: 8px;
  font-size: clamp(24px, 3vw, 42px);
  line-height: 1;
}

.detail-list {
  display: grid;
  gap: 3px;
  margin: 0;
}

.detail-list div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 7px 0;
  border-bottom: 1px solid #ececf1;
}

.daily-info-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(260px, 1.18fr);
  gap: 12px;
  align-items: start;
  margin: 0 0 10px;
}

.component-yield-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.component-yield-item {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  min-height: 30px;
  padding: 6px 8px;
  background: #f7f7f9;
  border: 1px solid #e3e5ea;
  border-radius: var(--radius);
  font-size: 11px;
  font-weight: 800;
}

.component-yield-item i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.component-yield-item span {
  min-width: 0;
  overflow: hidden;
  color: #4b515c;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.component-yield-item strong {
  color: #111318;
}

dt {
  color: #5e646d;
  font-weight: 650;
}

dd {
  margin: 0;
  color: #111318;
  font-weight: 800;
}

.chart-shell {
  height: 175px;
  padding: 8px;
  background: #090b0f;
  border-radius: var(--radius);
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.status-line {
  min-height: 20px;
  margin: 12px 0 0;
  color: #686d76;
  font-size: 13px;
  font-weight: 650;
}

.components-section {
  min-height: calc(100svh - 76px);
  padding: clamp(24px, 4vw, 42px) clamp(18px, 5vw, 72px);
  display: grid;
  align-content: center;
  background:
    linear-gradient(180deg, #08090b, #101115 52%, #08090b);
}

.component-manage {
  display: grid;
  grid-template-columns: 44px minmax(72px, auto) 44px;
  gap: 4px 12px;
  align-items: center;
  justify-content: center;
  width: min(100%, var(--content-width));
  max-width: var(--content-width);
  margin: 10px auto 0;
}

.component-manage button {
  display: grid;
  place-items: center;
  width: 40px;
  min-height: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  font-size: 27px;
  line-height: 1;
}

.carousel-count {
  color: #fff;
  font-size: 16px;
  font-weight: 850;
  text-align: center;
}

.component-manage-label {
  color: rgba(255, 255, 255, 0.62);
  font-size: 11px;
  font-weight: 750;
  text-align: center;
}

.save-panel-row {
  display: grid;
  grid-template-columns: minmax(118px, 0.42fr) minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
}

.component-save-count {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 44px;
  margin: 0;
  padding: 0 12px;
  color: #111318;
  background: #f3f6f8;
  border: 1px solid #d9d9df;
  border-radius: 8px;
}

.component-save-count span {
  color: #686d76;
  font-size: 12px;
  font-weight: 780;
}

.component-save-count strong {
  font-size: 20px;
  font-weight: 900;
}

.components-carousel {
  position: relative;
  width: min(100%, var(--content-width));
  max-width: var(--content-width);
  min-height: 430px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: var(--radius);
  mask-image: linear-gradient(90deg, transparent 0, #000 9%, #000 91%, transparent 100%);
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 44px;
  min-height: 44px;
  height: 44px;
  padding: 0;
  color: #111318;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
  font-size: 34px;
  font-weight: 450;
  line-height: 1;
  transform: translateY(-50%);
  backdrop-filter: blur(12px);
}

.carousel-arrow:hover {
  color: #fff;
  background: #0071e3;
}

.carousel-arrow:disabled {
  opacity: 0.22;
}

.carousel-arrow-prev {
  left: 14px;
}

.carousel-arrow-next {
  right: 14px;
}

.components-grid {
  display: flex;
  gap: clamp(14px, 2vw, 22px);
  transition: transform 320ms ease;
  will-change: transform;
}

.component-card {
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 12px;
  flex: 0 0 74%;
  width: 74%;
  min-width: 74%;
  min-height: 430px;
  padding: clamp(14px, 2.1vw, 24px) clamp(16px, 4vw, 54px);
  background: #f8f8fb;
  color: var(--ink);
  border-radius: var(--radius);
  filter: blur(7px);
  opacity: 0.34;
  pointer-events: none;
  transform: scale(0.93);
  transition: filter 320ms ease, opacity 320ms ease, transform 320ms ease;
}

.component-card.is-neighbor {
  opacity: 0.54;
  transform: scale(0.95);
}

.component-card.is-active {
  filter: none;
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.component-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.component-title h3 {
  margin: 0;
  font-size: clamp(20px, 2.4vw, 28px);
  line-height: 1.1;
}

.value-pill {
  padding: 5px 8px;
  color: #fff;
  background: #111318;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 800;
}

.component-body {
  display: grid;
  grid-template-columns: minmax(230px, 1fr) minmax(150px, 0.58fr);
  gap: clamp(12px, 2vw, 18px);
  align-items: start;
}

.component-inputs {
  display: grid;
  gap: 8px;
}

.component-inputs label {
  grid-template-columns: minmax(118px, 0.72fr) minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 38px;
  font-size: 12px;
}

.component-inputs input {
  min-height: 38px;
  padding: 8px 10px;
}

.shading-editor {
  display: grid;
  gap: 10px;
  padding-top: 2px;
}

.shading-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #2b2d33;
  font-size: 13px;
  font-weight: 800;
}

.shading-title strong {
  padding: 4px 7px;
  color: #fff;
  background: #111318;
  border-radius: var(--radius);
  font-size: 12px;
}

.shading-chart {
  --shade-average: 1;
  overflow: hidden;
  aspect-ratio: 3.15;
  background:
    linear-gradient(180deg, rgba(0, 113, 227, 0.09), rgba(71, 194, 114, calc(var(--shade-average) * 0.12))),
    #eceff4;
  border: 1px solid #d8dbe2;
  border-radius: var(--radius);
  cursor: default;
  touch-action: none;
}

.shading-chart svg {
  display: block;
  width: 100%;
  height: 100%;
}

.shading-chart text {
  fill: #59616d;
  font-size: 12px;
  font-weight: 850;
  pointer-events: none;
}

.shade-grid {
  stroke: rgba(36, 42, 52, 0.36);
  stroke-width: 2;
}

.shade-grid.faint {
  stroke: rgba(36, 42, 52, 0.14);
}

.shade-line {
  fill: none;
  stroke: #0071e3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 5;
  filter: drop-shadow(0 4px 8px rgba(0, 113, 227, 0.22));
  pointer-events: none;
}

.shade-handle {
  fill: #47c272;
  stroke: #fff;
  stroke-width: 3;
  filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.28));
  cursor: grab;
  pointer-events: auto;
}

.shade-handle:active {
  cursor: grabbing;
}

.shade-tooltip {
  pointer-events: none;
}

.shade-tooltip rect {
  fill: rgba(17, 19, 24, 0.92);
}

.shade-tooltip text {
  fill: #fff;
  font-size: 13px;
  font-weight: 850;
}

.shade-reset {
  width: 100%;
}

.compass-visual {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  width: min(100%, 170px);
  min-height: 170px;
  justify-self: center;
  overflow: hidden;
  background:
    radial-gradient(circle at center, #202834 0 2px, transparent 3px),
    radial-gradient(circle at center, #f6f7f9 0 47%, #e8ebf0 48% 49%, transparent 50%),
    conic-gradient(from 0deg, rgba(0, 113, 227, 0.11), rgba(71, 194, 114, 0.12), rgba(255, 189, 69, 0.14), rgba(0, 113, 227, 0.11));
  border: 1px solid #d8dbe2;
  border-radius: var(--radius);
}

.direction {
  position: absolute;
  color: #2b3038;
  font-size: 10px;
  font-weight: 900;
}

.dir-n { top: 7px; left: 50%; transform: translateX(-50%); }
.dir-e { right: 8px; top: 50%; transform: translateY(-50%); }
.dir-s { bottom: 7px; left: 50%; transform: translateX(-50%); }
.dir-w { left: 8px; top: 50%; transform: translateY(-50%); }

.azimuth-needle {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 3px;
  height: 42%;
  transform-origin: 50% 100%;
  transform: translate(-50%, -100%) rotate(180deg);
  background: linear-gradient(#0071e3, #47c272);
  border-radius: 999px;
  transition: transform 260ms ease;
}

.azimuth-needle::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -7px;
  width: 0;
  height: 0;
  transform: translateX(-50%);
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 12px solid #0071e3;
}

.mini-panel-wrap {
  position: relative;
  width: 58%;
  aspect-ratio: 1.3;
  transform-style: preserve-3d;
  perspective: 520px;
}

.mini-panel {
  position: absolute;
  inset: 17% 4%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 6px;
  background: linear-gradient(135deg, #102033, #1a5c83);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 6px;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.22);
  transform: rotateZ(180deg) rotateX(35deg);
  transition: transform 260ms ease;
}

.mini-panel span {
  background: rgba(116, 206, 255, 0.28);
  border: 1px solid rgba(215, 242, 255, 0.32);
  border-radius: 3px;
}

.elevation-scale {
  position: absolute;
  right: 9px;
  bottom: 9px;
  width: 42px;
  height: 42px;
  border-left: 2px solid #5b6470;
  border-bottom: 2px solid #5b6470;
  border-bottom-left-radius: 4px;
}

.elevation-scale::before {
  content: "90°";
  position: absolute;
  left: 4px;
  top: -8px;
  color: #5b6470;
  font-size: 10px;
  font-weight: 800;
}

.elevation-scale::after {
  content: "0°";
  position: absolute;
  right: -2px;
  bottom: 2px;
  color: #5b6470;
  font-size: 10px;
  font-weight: 800;
}

@keyframes breathe {
  0%, 100% {
    opacity: 0.45;
    transform: translate(-50%, -50%) scale(0.96);
  }
  50% {
    opacity: 0.9;
    transform: translate(-50%, -50%) scale(1.04);
  }
}

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

  .hero {
    min-height: auto;
  }

  .hero-visual {
    min-height: 420px;
  }

  .component-body {
    grid-template-columns: minmax(150px, 0.9fr) minmax(170px, 1.1fr);
  }
}

@media (max-width: 720px) {
  .login-card {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .login-brand {
    justify-content: flex-start;
  }

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

  .site-header {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
  }

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

  .header-logo img {
    height: 34px;
    max-width: 42vw;
  }

  .main-nav {
    grid-column: 1 / -1;
    justify-content: space-between;
  }

  .hero {
    padding-top: 56px;
  }

  h1 {
    font-size: clamp(42px, 13vw, 62px);
  }

  .two-columns,
  .search-row,
  .config-row,
  .data-card-fields {
    grid-template-columns: 1fr;
  }

  .config-section {
    padding: 12px 10px;
  }

  .config-tools {
    gap: 8px;
    padding: 8px;
  }

  .config-card-grid {
    grid-template-columns: minmax(0, 1.28fr) minmax(0, 0.82fr);
    gap: 8px;
  }

  .plant-data-layout {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .data-card {
    gap: 8px;
    padding: 8px;
  }

  .data-card h3 {
    font-size: 14px;
  }

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

  .data-card input,
  .data-card select,
  .data-card button {
    min-height: 32px;
    padding: 5px 7px;
    font-size: 11px;
  }

  .plant-image-preview,
  .plant-image-preview img {
    min-height: 112px;
  }

  .image-dropzone {
    min-height: 58px;
    padding: 7px;
  }

  .image-dropzone strong,
  .image-dropzone span {
    font-size: 11px;
  }

  .data-card .map-wrap {
    height: 145px;
  }

  .setup-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .control-panel,
  .result-summary {
    min-height: auto;
    padding: 12px;
  }

  .metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

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

  .daily-control-row,
  .component-yield-list {
    grid-template-columns: 1fr;
  }

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

  .reconcile-inputs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .reconciliation-chart-shell {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 6px;
    height: 200px;
  }

  .reconciliation-chart-card {
    padding: 6px;
  }

  .reconcile-section {
    min-height: calc(100svh - 64px);
    padding: 12px 10px;
  }

  .reconcile-summary {
    grid-template-columns: 1fr;
  }

  .reconcile-tools {
    gap: 6px;
    padding: 8px;
  }

  .reconcile-section .block-heading {
    margin-bottom: 6px;
  }

  .reconcile-section .block-heading h2 {
    font-size: 24px;
    line-height: 1.02;
  }

  .actual-entry {
    gap: 4px;
    padding: 5px;
  }

  .actual-entry label {
    font-size: 10px;
  }

  .actual-entry input,
  .actual-entry output,
  .actual-history button,
  .actual-date-stepper button,
  .actual-suggestions button {
    min-height: 30px;
    padding: 4px 6px;
    font-size: 10px;
  }

  .actual-suggestions {
    max-height: 88px;
    padding: 4px;
  }

  .actual-suggestions span,
  .actual-suggestions strong {
    font-size: 10px;
  }

  .actual-date-stepper {
    grid-template-columns: 26px minmax(0, 1fr) 26px;
    gap: 4px;
  }

  .actual-value-pair {
    gap: 4px;
  }

  .reconcile-save-button {
    min-height: 30px;
  }

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

  .report-directory-field,
  .report-actions,
  .legal-actions {
    width: 100%;
  }

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

  .component-card {
    flex-basis: 74%;
    width: 74%;
    min-width: 74%;
    min-height: 430px;
    padding: 10px;
  }

  .component-inputs label {
    grid-template-columns: minmax(92px, 0.62fr) minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    font-size: 11px;
  }

  .components-carousel {
    min-height: 430px;
  }

  .compass-visual {
    width: min(100%, 150px);
    min-height: 150px;
  }

  .component-title h3 {
    font-size: 20px;
  }

  .component-inputs label {
    min-height: 34px;
  }

  .component-inputs input {
    min-height: 34px;
    padding: 6px 8px;
  }

  .shading-chart {
    aspect-ratio: 3.8;
  }

  .carousel-arrow {
    width: 38px;
    min-height: 38px;
    height: 38px;
    font-size: 28px;
  }

  .metric {
    min-height: 76px;
    padding: 8px;
  }

  .metric span,
  .statistics-metrics span {
    font-size: 10px;
  }

  .metric strong,
  .statistics-metrics strong {
    font-size: 20px;
  }

  .map-wrap {
    height: 300px;
    min-height: 300px;
  }

  .data-card .map-wrap {
    height: 145px;
    min-height: 145px;
  }

  .chart-shell {
    height: 160px;
  }

  .statistics-chart-shell {
    height: 220px;
  }

}
