.status-bar {
  padding: calc(10px + var(--safe-top)) 14px 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  background: rgba(238, 243, 240, 0.92);
  border-bottom: 1px solid rgba(217, 208, 189, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.ui-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  overflow: visible;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.section-title .ui-icon {
  color: var(--leaf);
}

.section-title.forecast .ui-icon,
.weather-icon {
  color: var(--cold);
}

.weather-sun {
  color: #c98720;
}

.weather-sunrise {
  color: #d4911f;
}

.weather-sunset {
  color: #b06a89;
}

.weather-cloud {
  color: #577f91;
}

.weather-rain {
  color: #2f6f90;
}

.weather-drizzle {
  color: #3a8aa2;
}

.weather-snow {
  color: #5795c5;
}

.weather-wind,
.weather-fog {
  color: #6f7f87;
}

.weather-hail {
  color: #346f9d;
}

.weather-storm {
  color: #7c5aa4;
}

.weather-moon {
  color: #5c678f;
}

.weather-cloud-sun {
  color: #ba8a2f;
}

.section-title.sat .ui-icon {
  color: var(--sun);
}

.section-title.danger .ui-icon {
  color: var(--danger);
}

.status-main {
  min-width: 0;
}

.status-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-brand .ui-icon {
  color: var(--leaf);
}

.status-label,
.section-label {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.status-time {
  margin-top: 1px;
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
}

.status-side {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ring {
  position: relative;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: var(--leaf);
}

.ring svg {
  position: absolute;
  inset: 0;
  transform: rotate(-90deg);
}

.ring span {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 900;
}

.alert {
  border: 1px solid #d4a59a;
  background: var(--danger-2);
  color: #782f27;
  border-radius: 8px;
  padding: 11px 12px;
  font-size: 14px;
  font-weight: 850;
}

.card {
  min-width: 0;
  max-width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  box-shadow: var(--shadow);
}

.field-overview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  box-shadow: none;
  background: rgba(255, 255, 255, 0.72);
}

.field-overview strong {
  display: block;
  margin-top: 2px;
  font-size: 18px;
}

.field-chips {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

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

.sensor-card {
  position: relative;
  overflow: hidden;
  min-height: 132px;
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 10px;
}

.sensor-card.primary {
  min-height: 182px;
  padding: 18px;
  background:
    linear-gradient(145deg, rgba(47, 125, 77, 0.16), rgba(255, 255, 255, 0.96) 54%),
    var(--surface);
  border-color: #abc4a9;
}

.sensor-card.sensor-0 {
  border-color: #abc4a9;
  background: linear-gradient(145deg, rgba(220, 235, 217, 0.78), var(--surface) 64%);
}

.sensor-card.sensor-1 {
  border-color: #9bb8c3;
  background: linear-gradient(145deg, rgba(219, 233, 239, 0.86), var(--surface) 64%);
}

.sensor-card.sensor-2 {
  border-color: #d8bd77;
  background: linear-gradient(145deg, rgba(241, 225, 189, 0.82), var(--surface) 64%);
}

.sensor-card.secondary {
  box-shadow: none;
}

.sensor-top,
.row-between,
.variety-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.sensor-top > *,
.row-between > *,
.variety-head > * {
  min-width: 0;
}

.sensor-name {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 20px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  overflow: visible;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sensor-name span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sensor-name .ui-icon {
  width: 16px;
  height: 18px;
  margin-block: -1px;
  color: var(--leaf);
}

.sensor-reading {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  max-width: 100%;
  margin-top: 10px;
  white-space: nowrap;
}

.sensor-card.primary .sensor-reading {
  margin-top: 26px;
}

.sensor-card.secondary .sensor-reading {
  margin-top: 12px;
}

.sensor-temp {
  display: inline;
  margin-top: 0;
  font-family: var(--mono);
  font-size: 64px;
  font-weight: 900;
  line-height: 0.92;
  letter-spacing: 0;
  color: var(--ink);
  max-width: 100%;
}

.sensor-unit {
  color: var(--muted);
  font-size: 16px;
  font-weight: 800;
  white-space: nowrap;
}

.secondary .sensor-temp {
  font-size: 42px;
}

.secondary .sensor-unit {
  font-size: 14px;
}

.sensor-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 5px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
}

.heater-badge,
.pill {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 8px;
  padding: 5px 9px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.heater-badge.on {
  background: var(--danger-2);
  border-color: #d4a59a;
  color: #7b3128;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.scroll-row {
  display: flex;
  min-width: 0;
  max-width: 100%;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 1px 4px;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.scroll-row::-webkit-scrollbar {
  display: none;
}

.hour-tile {
  flex: 0 0 68px;
  width: 68px;
  display: grid;
  grid-template-rows: auto 22px auto auto;
  align-content: start;
  gap: 4px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 7px;
  background: var(--surface-2);
}

.hour-tile.is-sun {
  background: #fff3d4;
  border-color: #e7c06c;
}

.hour-tile.is-cloud {
  background: #eaf3f5;
  border-color: #b8ccd3;
}

.hour-tile.is-cloud-sun {
  background: #f6edd7;
  border-color: #d6bc76;
}

.hour-tile.is-rain {
  background: #dbe9ef;
  border-color: #9bb8c3;
}

.hour-tile.is-drizzle {
  background: #e0eef0;
  border-color: #9bc0c9;
}

.hour-tile.is-snow {
  background: #e6f2fb;
  border-color: #a8c7dc;
}

.hour-tile.is-hail {
  background: #dcebf7;
  border-color: #8eb3cd;
}

.hour-tile.is-storm {
  background: #ebe3f5;
  border-color: #b6a0ce;
}

.hour-tile.is-fog {
  background: #edf0ee;
  border-color: #bdc6c1;
}

.hour-tile.is-moon {
  background: #e8eaf3;
  border-color: #b9bfd5;
}

.hour-tile.is-sunrise {
  background: #fff0c6;
  border-color: #d9b45a;
}

.hour-tile.is-sunset {
  background: #f3e3ed;
  border-color: #c49bb4;
}

.solar-tile {
  flex-basis: 58px;
  width: 58px;
}

.solar-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.forecast-card {
  overflow: hidden;
}

.rail-viewport {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  margin-top: 12px;
}

.forecast-rail {
  width: 100%;
  max-width: 100%;
}

.hour-tile .temp {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 900;
  color: var(--cold);
}

.hour-tile .weather-icon {
  width: 18px;
  height: 18px;
  justify-self: center;
}

.rain-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 18px;
  border-radius: 6px;
  padding: 0 4px;
  background: var(--cold-2);
  color: var(--cold);
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}

.wind-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 18px;
  border-radius: 6px;
  padding: 0 4px;
  background: rgba(255, 255, 255, 0.66);
  color: #5f7078;
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}

.wind-chip .ui-icon,
.forecast-meta .ui-icon {
  width: 13px;
  height: 13px;
}

.forecast-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.forecast-meta span {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  border-radius: 7px;
  padding: 2px 7px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid var(--line);
}

.sat-summary,
.today-forecast {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  min-width: 0;
}

.sat-summary > *,
.today-forecast > * {
  min-width: 0;
}

.sat-summary {
  background: linear-gradient(145deg, var(--sun-2), var(--surface) 62%);
}

.today-forecast {
  background: linear-gradient(145deg, var(--cold-2), var(--surface) 62%);
  border-color: #9bb8c3;
}

.big-number {
  font-family: var(--mono);
  font-size: 50px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.bar {
  height: 9px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(23, 32, 27, 0.1);
}

.bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--leaf), var(--sun));
}

.segmented,
.button-row {
  display: flex;
  gap: 8px;
}

.segmented {
  padding: 4px;
  border-radius: 8px;
  background: var(--paper-2);
  border: 1px solid var(--line);
}

.seg-btn,
.action-btn,
.icon-btn {
  min-height: 44px;
  border-radius: 8px;
  padding: 0 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-weight: 900;
  cursor: pointer;
}

.seg-btn {
  flex: 1;
}

.seg-btn.active,
.action-btn.primary {
  color: white;
  background: var(--leaf);
  border-color: var(--leaf);
}

.action-btn.warn {
  background: var(--danger-2);
  border-color: #d4a59a;
  color: #7b3128;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.field input,
.field select,
.console-input,
.variety-sat,
#sat-start-date {
  min-height: 44px;
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink);
  padding: 0 11px;
  outline: none;
}

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

.output-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}

.output-cell {
  min-height: 52px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  padding: 6px 2px;
  transition: transform .16s ease, border-color .16s ease, background .16s ease, color .16s ease;
}

.output-cell:active {
  transform: scale(.97);
}

.output-cell:focus-visible {
  outline: 2px solid var(--cold);
  outline-offset: 2px;
}

.output-cell:disabled {
  cursor: wait;
}

.output-cell .ui-icon {
  width: 16px;
  height: 16px;
}

.output-cell.on {
  background: var(--cold-2);
  border-color: #9bb8c3;
  color: var(--cold);
}

.output-cell.heater-on {
  background: var(--danger-2);
  border-color: #cc8c80;
  color: var(--danger);
}

.output-cell.pending {
  background: #fff3d4;
  border-color: #d6bc76;
  color: #9a6713;
}

.output-cell.pending .ui-icon {
  animation: pending-pulse 1s ease-in-out infinite;
}

@keyframes pending-pulse {
  0%, 100% {
    opacity: .55;
    transform: scale(.92);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

.chart-card canvas {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  margin-top: 8px;
  border-radius: 8px;
  background: var(--surface-2);
}

.chart-note {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.analysis-entry {
  min-height: 64px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #9bb8c3;
  background: linear-gradient(145deg, var(--cold-2), var(--surface));
  color: var(--ink);
  text-align: left;
}

.analysis-entry .ui-icon {
  color: var(--cold);
}

.analysis-entry span {
  display: grid;
  gap: 2px;
}

.analysis-entry small,
.bias-intro,
.bias-kpi small,
.bias-note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

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

.bias-kpi {
  display: grid;
  gap: 4px;
}

.bias-kpi span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.bias-kpi strong {
  color: var(--cold);
  font-family: var(--mono);
  font-size: 26px;
}

.bias-intro {
  margin-top: 10px;
}

.bias-note {
  margin-top: 10px;
  line-height: 1.45;
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin-top: 8px;
}

.stats-table th,
.stats-table td {
  padding: 10px 6px;
  border-bottom: 1px solid var(--line);
  text-align: right;
}

.stats-table th:first-child,
.stats-table td:first-child {
  text-align: left;
}

.variety-list {
  display: grid;
  gap: 10px;
}

.variety-card {
  display: grid;
  gap: 10px;
  box-shadow: none;
}

.forecast-day {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.forecast-day > * {
  min-width: 0;
}

.forecast-day strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.day-cell {
  display: flex;
  align-items: center;
  gap: 6px;
}

.day-cell .ui-icon {
  width: 16px;
  height: 16px;
}

.forecast-day .mono {
  white-space: nowrap;
  font-size: 13px;
}

.forecast-day-values {
  display: grid;
  justify-items: end;
  gap: 2px;
  white-space: nowrap;
}

.forecast-day-values small {
  color: var(--cold);
  font-size: 11px;
  font-weight: 900;
}

@media (max-width: 390px) {
  .page {
    padding-inline: 12px;
  }

  .sensor-card.primary {
    padding: 16px;
  }

  .secondary .sensor-temp {
    font-size: 42px;
  }

  .big-number {
    font-size: 44px;
  }

  .hour-tile {
    flex-basis: 64px;
    width: 64px;
  }

  .pill,
  .heater-badge {
    padding-inline: 7px;
    font-size: 10px;
  }
}

.forecast-day:last-child {
  border-bottom: 0;
}

.console-log {
  display: grid;
  gap: 8px;
  max-height: 300px;
  overflow: auto;
  padding: 11px;
  border-radius: 8px;
  background: #18221c;
  border: 1px solid #253328;
  color: #d7ead8;
  font-family: var(--mono);
  font-size: 12px;
}

.console-line {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 7px;
  align-items: start;
  padding: 7px 8px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  overflow-wrap: anywhere;
}

.console-line.in {
  color: #d7ead8;
}

.console-line.out {
  color: #ffe1a5;
}

.console-line.is-new {
  animation: console-new 1.2s ease-out;
}

.console-dir {
  display: inline-flex;
  justify-content: center;
  min-width: 28px;
  border-radius: 5px;
  padding: 1px 3px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.82);
  font-size: 10px;
  font-weight: 900;
}

@keyframes console-new {
  0% {
    background: rgba(71, 209, 140, 0.24);
    transform: translateY(-6px);
  }
  100% {
    background: rgba(255, 255, 255, 0.04);
    transform: translateY(0);
  }
}

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

.dim {
  color: var(--muted);
}
