/* ========================================
   JANESOSMART APP - CSS STYLESHEET
   ======================================== */

/* ========================================
   COLOR VARIABLES
   ======================================== */

/* Light mode */
:root {
  --bg-color: #efefef;
  --text-color: #444;
  --card-bg: white;
  --border-color: rgba(0, 0, 0, 0.08);
  --card-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
  --water-height: 50px;
  --water-color: #0066cc;
  --progress-bg: #ffffff80;
  --shadow-color: #222;
  --shadow-color2: #555;
  --bezel-bg: #dddddd;
  --grow-color: #00cc00;
  --bloom-color: #ff66cc;
  --system-color: #94ffff;
  --window-bg: #555555;
  --click-color: #aaff00;
}

/* Dark mode */
body.dark-mode {
  --bg-color: #222;
  --text-color: #ededed;
  --card-bg: #1e1e1e;
  --border-color: rgba(255, 255, 255, 0.15);
  --card-shadow: 0 4px 8px rgba(0, 0, 0, 0.7);
  --water-height: 50px;
  --water-color: #0066cc;
  --progress-bg: #22222280;
  --shadow-color: #777;
  --shadow-color2: #000;
  --bezel-bg: #333;
  --grow-color: #00cc00;
  --bloom-color: #ff66cc;
  --system-color: #98ca34;
  --window-bg: #555555;
  --click-color: #aaff00;
}

/* ========================================
   BASE STYLES
   ======================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
}

html {
  background: var(--bg-color);
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
}

body {
  background: var(--bg-color);
  color: var(--text-color);
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: 'Orbitron', sans-serif;
  padding:
    max(8px, env(safe-area-inset-top))
    max(8px, env(safe-area-inset-right))
    max(8px, env(safe-area-inset-bottom))
    max(8px, env(safe-area-inset-left));
  transition: background 0.3s ease, color 0.3s ease;
  -webkit-tap-highlight-color: transparent;
}

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

input,
select,
button {
  font-family: 'Orbitron', sans-serif;
}

button {
  appearance: none;
  -webkit-appearance: none;
}

/* Numeric entry keeps typing and validation without browser stepper chrome. */
input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input::placeholder {
  color: var(--window-bg);
}

[hidden] {
  display: none !important;
}

/* ========================================
   APP CONTAINER & LAYOUT
   ======================================== */

.app {
  width: min(100%, 600px);
  height: 100%;
  min-height: 0;
  position: relative;
}

.test-bezel {
  width: min(92vw, 560px);
  height: min(94vh, 920px);
  height: min(94dvh, 920px);
  min-height: 0;
  padding: clamp(4px, 1.2vw, 7px);
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bezel-bg);
  border-radius: 6px;
  box-shadow: 0 0 8px 2px rgba(0, 0, 0, 0.44);
  display: flex;
  flex-direction: column;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.test-card {
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: clamp(2px, 0.8vw, 6px) 0;
  margin: auto;
  background: var(--card-bg);
  border-radius: 4px;
  box-shadow: 0 0 8px 2px rgba(0, 0, 0, 0.44), inset 1px 0 2px #222;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  text-align: center;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.test-card::-webkit-scrollbar {
  display: none;
}

/* ========================================
   CARD ROWS & PROGRESS
   ======================================== */

.card-row {
  min-height: clamp(62px, 10.5dvh, 104px);
  flex: 0 0 auto;
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  text-align: center;
  box-sizing: border-box;
  font-size: 1.1rem;
  transition: background 0.3s ease, border-color 0.3s ease;
  cursor: default;
}

.card-row:last-child {
  border-bottom: none;
}

.card-row:empty {
  display: none;
}

.progress-track {
  width: 100%;
  height: 4px;
  background-color: var(--progress-bg);
  border-radius: 2px;
}

.progress-fill {
  height: 100%;
  background-color: var(--water-color);
  border-radius: 2px;
  transition: width 0.4s ease;
}

/* ========================================
   CONTAINERS
   ======================================== */

.windowContainer {
  width: 84%;
  height: 65%;
  padding: 6px;
  margin: auto;
  background-color: var(--bezel-bg);
  border-radius: 6px;
  box-shadow: 0 0 6px #000;
  box-sizing: border-box;
  display: flex;
}

.fortyContainer {
  width: 84%;
  height: 40%;
  padding: 6px;
  margin: 5% auto;
  background-color: var(--bezel-bg);
  border-radius: 6px;
  box-shadow: 0 0 6px #000;
  box-sizing: border-box;
  display: flex;
}

.numberContainer {
  width: 90%;
  height: 65%;
  padding: 6px;
  margin: auto;
  background-color: var(--bezel-bg);
  border-radius: 6px;
  box-sizing: border-box;
  display: flex;
}

.radioContainer {
  width: 84%;
  height: 65%;
  padding: 6px;
  margin: auto;
  background-color: var(--bezel-bg);
  border-radius: 6px;
  box-shadow: 0 0 6px #000;
  box-sizing: border-box;
  display: flex;
  align-items: center;
}

.resultsContainer {
  width: 84%;
  height: 68%;
  padding: 6px;
  margin: auto;
  background-color: var(--bezel-bg);
  border-radius: 6px;
  box-shadow: 0 0 6px #000;
  box-sizing: border-box;
  display: flex;
}

.gardenContainer {
  width: 84%;
  height: 15%;
  padding: 6px;
  margin: 5% auto auto auto;
  background-color: var(--bezel-bg);
  border-radius: 6px;
  box-shadow: 0 0 6px #000;
  box-sizing: border-box;
  display: flex;
}

/* ========================================
   RADIO & FORM ELEMENTS
   ======================================== */

.radioFlat {
  width: 100%;
  height: 100%;
  display: flex;
  flex-wrap: nowrap;
  text-align: center;
  box-sizing: border-box;
  margin: auto;
}

.radioFlat input[type="radio"] {
  display: none;
}

.radioFlat label,
.radioFlat .hardware-button {
  flex: 1 1 0;
  padding: clamp(0.5vw, 1vw, 10px);
  background: var(--card-bg);
  border: clamp(1px, 0.5vw, 1px) solid var(--border-color);
  border-radius: 0;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(0.95rem, 3.8vw, 1.2rem);
  min-height: 44px;
  cursor: pointer;
  color: var(--text-color);
  text-shadow: none;
  box-shadow: 0 0 2px var(--shadow-color), 0 -3px 4px var(--shadow-color2);
  transition: background 0.2s ease, color 0.2s ease;
}

.radioFlat label:first-of-type,
.radioFlat .hardware-button:first-of-type {
  border-top-left-radius: 6px;
  border-bottom-left-radius: 6px;
}

.radioFlat label:last-of-type,
.radioFlat .hardware-button:last-of-type {
  border-top-right-radius: 6px;
  border-bottom-right-radius: 6px;
}

.radioFlat input[type="radio"]:checked + label,
.radioFlat .hardware-button.is-selected {
  border: clamp(1px, 0.5vw, 1px) solid var(--border-color);
  background-color: var(--system-color);
  color: #333;
  font-weight: bold;
  transform: translateY(2px);
  box-shadow: inset 0 0 10px 2px rgba(107, 66, 66, 0.8), inset 1px 2px 4px 4px rgba(0, 0, 0, 0.5);
}

/* ========================================
   DISPLAY WINDOWS
   ======================================== */

.displayWindow {
  width: 100%;
  height: 100%;
  padding: 0;
  background: var(--window-bg);
  border: clamp(1px, 0.5vw, 1px) solid var(--border-color);
  border-radius: 4px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(1rem, 4.4vw, 1.5rem);
  cursor: pointer;
  color: var(--system-color);
  text-shadow: none;
  box-shadow: inset -4px 3px 3px 2px #333, inset 0 -3px 12px #333;
}

.gardenWindow {
  width: 100%;
  height: 100%;
  padding: 0;
  background: var(--window-bg);
  border: clamp(1px, 0.5vw, 1px) solid var(--border-color);
  border-radius: 4px;
  box-sizing: border-box;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-around;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--system-color);
  text-shadow: none;
  box-shadow: inset -4px 3px 3px 2px #333, inset 0 -3px 12px #333;
}

.selectWindow {
  width: 100%;
  height: 100%;
  padding: 0;
  background: var(--system-color);
  border: clamp(1px, 0.5vw, 1px) solid var(--border-color);
  border-radius: 4px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  text-align: center;
  justify-content: center;
  font-size: clamp(1rem, 4.4vw, 1.5rem);
  cursor: pointer;
  color: var(--window-bg);
  text-shadow: none;
  font-family: 'Orbitron', sans-serif;
  box-shadow: inset -1px 2px 2px 2px #333, inset 0 -2px 12px #333;
}

/* ========================================
   RESULT & LOGO WINDOWS
   ======================================== */

.resultWindow {
  width: 100%;
  height: 100%;
  padding: 6px;
  background-color: var(--window-bg);
  border-radius: 6px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: auto;
  overflow-y: scroll;
  color: var(--system-color);
  box-shadow: inset -3px 3px 3px 2px #333, inset 0 -2px 12px #333;
}

.logoWindow {
  width: 100%;
  height: 100%;
  padding: 8px;
  background-color: var(--window-bg);
  border-radius: 6px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: auto;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
  color: var(--system-color);
  font-size: 1rem;
  font-weight: bold;
  box-shadow: inset -3px 3px 3px 2px #333, inset 0 -2px 12px #333;
}

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

.logoWindow {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* ========================================
   NUTRIENTS
   ======================================== */

.nutrient-row {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  text-align: center;
  font-size: clamp(1rem, 4.2vw, 1.5rem);
  width: 100%;
  min-height: 48px;
  height: auto;
  cursor: default;
}

.nutrient-row:empty {
  display: none;
}

.nutrientName {
  display: flex;
  justify-content: flex-start;
  width: 85%;
  margin: auto;
}

.nutrientAmount {
  display: flex;
  justify-content: flex-end;
  width: 15%;
  height: 100%;
  align-items: center;
}

/* ========================================
   MENU & BUTTONS
   ======================================== */

.menuContainer {
  width: 84%;
  height: 9%;
  padding: 6px;
  margin: auto auto 4%;
  background-color: var(--bezel-bg);
  border-radius: 6px;
  box-shadow: 0 0 6px #000;
  box-sizing: border-box;
  display: flex;
}

.menu-button {
  flex: 1 1 0;
  font-family: 'Orbitron', sans-serif;
  text-decoration: none;
  padding: 0;
  margin: 0;
  background: var(--card-bg);
  border: clamp(1px, 0.5vw, 1px) solid var(--border-color);
  border-radius: 0;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(0.95rem, 3.8vw, 1.2rem);
  min-height: 44px;
  cursor: pointer;
  color: var(--text-color);
  text-shadow: none;
  box-shadow: 0 0 2px var(--shadow-color), 0 -3px 4px var(--shadow-color2);
  transition: background 0.2s ease, color 0.2s ease;
}

.menu-button:active {
  border: clamp(1px, 0.5vw, 1px) solid var(--border-color);
  background: var(--system-color);
  color: #444;
  font-weight: bold;
  box-shadow: inset 0 0 10px 2px rgba(107, 66, 66, 0.8), inset 1px 2px 4px 4px rgba(0, 0, 0, 0.5);
}

.menu-button:first-child {
  border-top-left-radius: 6px;
  border-bottom-left-radius: 6px;
}

.menu-button:last-child {
  border-top-right-radius: 6px;
  border-bottom-right-radius: 6px;
}

.menu-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ========================================
   INPUT FIELDS
   ======================================== */

.input-wrapper {
  position: relative;
  display: inline-block;
  width: 30%;
  height: 65%;
  padding: 4px;
  margin: auto;
  background-color: var(--bezel-bg);
  border-radius: 6px;
  box-shadow: 0 0 6px #000;
  box-sizing: border-box;
}

.water-input {
  width: 100%;
  height: 100%;
  padding: 0;
  margin: auto;
  text-align: center;
  font-size: clamp(1.25rem, 6vw, 2rem);
  font-weight: bold;
  background-color: var(--system-color);
  color: var(--window-bg);
  border: none;
  border-radius: 6px;
  box-sizing: border-box;
  box-shadow: inset -1px 2px 2px 2px #333, inset 0 -2px 12px #333;
}

.week-input {
  width: 100%;
  height: 100%;
  padding: 0;
  margin: auto;
  padding-bottom: 6px;
  text-align: center;
  font-size: clamp(1.15rem, 5vw, 1.8rem);
  font-weight: bold;
  background-color: var(--system-color);
  color: var(--window-bg);
  border: none;
  border-radius: 6px;
  box-sizing: border-box;
  box-shadow: inset -1px 2px 2px 2px #333, inset 0 -2px 12px #333;
}

.ph-input-wrapper {
  position: relative;
  display: inline-block;
  width: 30%;
  height: 100%;
  margin: auto 0 auto 4px;
  background-color: transparent;
  border-radius: 6px;
  box-shadow: 0 0 1px #000;
  box-sizing: border-box;
}

.ph-input {
  width: 100%;
  height: 100%;
  padding: 0;
  margin: auto;
  text-align: center;
  font-size: clamp(1.15rem, 5vw, 1.8rem);
  color: var(--system-color);
  background-color: #555;
  border: none;
  border-radius: 6px;
  box-sizing: border-box;
  box-shadow: inset -1px 2px 2px 2px #333, inset 0 -2px 12px #333;
}

.label-row {
  display: flex;
  flex-direction: row;
  margin: 1px auto;
  padding: 0 8px;
  justify-content: space-between;
  font-size: 1rem;
}

/* ========================================
   DYNAMIC LABELS
   ======================================== */

.week-field-label,
.cycle-label,
.selectedSpoon,
.selectedBucket,
#selectedSpoon,
#selectedBucket,
.reservoir-input-unit,
.reservoir-unit {
  position: absolute;
  pointer-events: none;
  color: #333;
  text-align: center;
  margin: auto;
  font-weight: bold;
}

.week-field-label {
  bottom: 10px;
  font-size: 0.75rem;
  width: 100%;
}

.selectedSpoon,
#selectedSpoon {
  bottom: 2px;
  right: 24px;
  font-size: 0.65rem;
  width: 100%;
  color: var(--system-color);
}

.selectedBucket,
#selectedBucket {
  bottom: 2px;
  right: 5px;
  font-size: 0.65rem;
  width: 100%;
  color: var(--system-color);
}

.reservoir-input-unit {
  bottom: 16px;
  left: 80px;
  font-size: 1rem;
  width: 100%;
}

/* ========================================
   ANIMATIONS
   ======================================== */

.sparkle-glow {
  font-size: clamp(1.25rem, 6vw, 2rem);
  color: #ffffff;
  text-align: center;
  animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
  from {
    text-shadow: 0 0 10px #fff, 0 0 10px #fff, 0 0 15px #6495ed, 0 0 20px #6495ed;
  }
  to {
    text-shadow: 0 0 20px #fff, 0 0 23px #6495ed, 0 0 30px #6495ed, 0 0 40px #6495ed, 0 0 50px #6495ed;
  }
}

/* ========================================
   LIQUID HARDWARE COMPONENT STATES
   ======================================== */

/*
  Blueprint rule:
  - IDs identify stable Jane hardware.
  - Classes identify reusable hardware and visual state.
  - data-* carries durable record/runtime context.
  - The machine may change state; its physical position remains meaningful.
*/

body.is-editing .test-bezel,
body.is-confirming-destructive-action .test-bezel {
  box-shadow: 0 0 8px 2px rgba(0, 0, 0, 0.44);
}

.hardware-selector input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.is-selected,
.is-armed {
  transform: translateY(2px);
}

.menu-button.is-selected,
.menu-button.is-armed {
  background: var(--system-color);
  color: #333;
  font-weight: bold;
  box-shadow:
    inset 0 0 10px 2px rgba(107, 66, 66, 0.8),
    inset 1px 2px 4px 4px rgba(0, 0, 0, 0.5);
}

.is-disabled,
[aria-disabled="true"] {
  opacity: 0.6;
  pointer-events: none;
}

.is-error {
  outline: 2px solid var(--click-color);
  outline-offset: 1px;
}

.is-destructive {
  opacity: 0.82;
}

.provider-status.is-connected,
.auth-method.is-connected {
  filter: drop-shadow(0 0 5px currentColor);
}

.provider-status.is-connected i {
  text-shadow: 0 0 7px currentColor, 0 0 12px currentColor;
}

/* ========================================
   LIQUID HARDWARE FIELD HELPERS
   ======================================== */

.cycle-separator {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: auto 1%;
}

.cycle-label {
  position: absolute;
  pointer-events: none;
  bottom: 10px;
  width: 100%;
  color: #333;
  text-align: center;
  font-size: 0.75rem;
  font-weight: bold;
}

.reservoir-editor {
  width: 84%;
}

.reservoir-unit {
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  color: #333;
  font-weight: bold;
}

.ph-calibration-separator {
  display: inline-flex;
  align-items: center;
}

/* ========================================
   RESULTS / MIXING STATES
   ======================================== */

.mix-item {
  cursor: pointer;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.mix-item.is-added {
  opacity: 0.32;
}

.mix-item:focus-visible,
.menu-button:focus-visible,
.hardware-button:focus-visible,
.selectWindow:focus-visible,
.water-input:focus-visible,
.week-input:focus-visible,
.ph-input:focus-visible {
  outline: 2px solid var(--click-color);
  outline-offset: 2px;
}

.ph-row {
  margin-top: auto;
}

/* ========================================
   FARMER STATION BANK
   ======================================== */

.garden-station,
.add-garden-station {
  text-decoration: none;
}

.farmerStationLine {
  width: 100%;
  display: flex;
  justify-content: space-around;
  align-items: center;
}

.farmerStationLineCentered {
  justify-content: center;
}

.farmerGardenStation.is-empty,
.gardenWindow.is-empty {
  opacity: 0.72;
}

.farmerGardenStation.is-due,
.gardenWindow.is-due {
  transform: translateY(1px);
}

.add-garden-station {
  cursor: pointer;
  color: var(--system-color);
}

/* ========================================
   ACCOUNT / AUTH HARDWARE
   ======================================== */

.auth-method {
  width: 100%;
  height: 100%;
}

.provider-status {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ========================================
   RESPONSIVE LIQUID HARDWARE
   ======================================== */

@media (max-width: 420px) {
  .displayWindow,
  .selectWindow {
    font-size: 1.2rem;
  }

  .nutrient-row {
    font-size: 1.15rem;
  }

  .menu-button,
  .radioFlat label,
  .radioFlat .hardware-button {
    font-size: 1rem;
  }

  .label-row {
    font-size: 0.82rem;
  }
}

/* ========================================
   CONSISTENCY ALIASES / REPEATED HARDWARE
   ======================================== */

.selectedWeek,
.selectedTotal {
  pointer-events: none;
}

.bucketSelect {
  pointer-events: none;
}

.unit-button {
  border: clamp(1px, 0.5vw, 1px) solid var(--border-color);
}

.destructive-button {
  font-family: 'Orbitron', sans-serif;
}

.farmerGardenContainer {
  flex: 0 0 auto;
}

.gardenCluster {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
}

.farmerGardenName,
.farmerGardenPhase,
.farmerGardenWeek,
.farmerGardenTotal {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ========================================
   MOBILE LIQUID HARDWARE FOUNDATION
   ======================================== */

:root {
  --jane-touch-min: 44px;
  --jane-gap: clamp(4px, 1.4vw, 10px);
  --jane-control-height: clamp(48px, 8.2dvh, 76px);
  --jane-menu-height: clamp(54px, 8.5dvh, 78px);
}

.windowContainer,
.radioContainer,
.numberContainer,
.input-wrapper {
  min-height: var(--jane-control-height);
  height: var(--jane-control-height);
}

.menuContainer {
  min-height: var(--jane-menu-height);
  height: var(--jane-menu-height);
  flex: 0 0 auto;
}

.menu-button,
.hardware-button,
.radioFlat label,
button,
select,
input {
  min-width: 0;
  min-height: var(--jane-touch-min);
}

select,
input[type="number"],
input[type="time"] {
  font-size: max(16px, 1rem);
}

.displayWindow,
.selectWindow,
.gardenWindow,
.nutrientName,
.nutrientAmount,
.menu-button,
.radioFlat label,
.radioFlat .hardware-button {
  overflow-wrap: anywhere;
}

.label-row-spaced {
  margin-top: 8px;
}

.label-row-section {
  margin-top: 18px;
}

.results-instruction {
  min-height: 40px;
  height: auto;
  justify-content: center;
  color: #fff;
  font-size: clamp(0.78rem, 3.2vw, 1rem);
}

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

@media (max-width: 420px) {
  .test-bezel {
    width: min(94vw, 560px);
    height: min(96vh, 920px);
    height: min(96dvh, 920px);
  }

  .windowContainer,
  .radioContainer,
  .gardenContainer,
  .resultsContainer,
  .menuContainer {
    width: 88%;
  }

  .card-row {
    min-height: clamp(58px, 9.8dvh, 88px);
  }

  .label-row {
    width: 90%;
    padding-inline: 4px;
    font-size: clamp(0.72rem, 3.1vw, 0.88rem);
  }

  .gardenWindow {
    font-size: clamp(0.8rem, 3.2vw, 1rem);
  }

  .nutrientName {
    width: 72%;
  }

  .nutrientAmount {
    width: 28%;
  }
}

@media (max-width: 350px) {
  body {
    padding-inline:
      max(4px, env(safe-area-inset-left))
      max(4px, env(safe-area-inset-right));
  }

  .test-bezel {
    width: 96vw;
  }

  .windowContainer,
  .radioContainer,
  .gardenContainer,
  .resultsContainer,
  .menuContainer {
    width: 92%;
  }

  .displayWindow,
  .selectWindow {
    font-size: 1rem;
  }

  .radioFlat label,
  .radioFlat .hardware-button,
  .menu-button {
    font-size: 0.9rem;
  }
}

@media (max-height: 650px) {
  :root {
    --jane-control-height: 48px;
    --jane-menu-height: 52px;
  }

  .test-bezel {
    height: 96vh;
    height: 96dvh;
  }

  .card-row {
    min-height: 56px;
  }

  .label-row {
    font-size: 0.74rem;
    line-height: 1.15;
  }

  .gardenContainer {
    min-height: 64px;
    margin-top: 2%;
  }
}

@media (orientation: landscape) and (max-height: 520px) {
  .test-bezel {
    width: min(76vw, 620px);
    height: 96dvh;
  }

  .test-card {
    padding-block: 2px;
  }

  .card-row {
    min-height: 52px;
  }

  .windowContainer,
  .radioContainer,
  .input-wrapper {
    min-height: 44px;
    height: 44px;
  }

  .menuContainer {
    min-height: 48px;
    height: 48px;
    margin-bottom: 2%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Hobby/Free inline reservoir hardware */
.reservoir-select-window {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 2.5vw, 18px);
  padding-inline: clamp(10px, 3vw, 20px);
  box-sizing: border-box;
}

.reservoir-inline-input {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  height: 100%;
  margin: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: #333;
  text-align: center;
}

.reservoir-inline-unit {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 3.4em;
  color: #333;
  font-weight: bold;
  pointer-events: none;
}

/* ========================================
   ACCOUNT MACHINE
   ======================================== */

.account-provider-bank {
  display: flex;
  width: 100%;
  height: 100%;
}

.account-provider-bank .auth-method {
  flex: 1 1 0;
  min-width: 0;
  border-radius: 0;
  font-size: clamp(1.2rem, 6vw, 2rem);
}

.account-provider-bank .auth-method:first-child {
  border-top-left-radius: 6px;
  border-bottom-left-radius: 6px;
}

.account-provider-bank .auth-method:last-child {
  border-top-right-radius: 6px;
  border-bottom-right-radius: 6px;
}

.account-provider-bank .auth-method.is-connected {
  background: var(--system-color);
  color: #333;
  transform: translateY(2px);
  box-shadow:
    inset 0 0 10px 2px rgba(107, 66, 66, 0.8),
    inset 1px 2px 4px 4px rgba(0, 0, 0, 0.5);
}

.account-provider-bank .provider-status {
  width: 100%;
  height: 100%;
}

.account-membership-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(6px, 2vw, 12px);
  white-space: nowrap;
  font-size: clamp(0.9rem, 3.5vw, 1.3rem);
}

.account-membership-divider {
  opacity: 0.72;
}

.account-delete-state {
  min-height: auto;
  flex-direction: column;
  gap: var(--jane-gap);
}

.account-delete-state .windowContainer,
.account-delete-state .menuContainer {
  flex: 0 0 auto;
}



/* ========================================
   GARDEN MANAGEMENT STATE
   ======================================== */

.garden-management-panel {
  width: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 2.5dvh, 22px);
  padding-block: clamp(12px, 3dvh, 28px);
  box-sizing: border-box;
}

.garden-management-panel[hidden] {
  display: none !important;
}

.garden-management-panel .card-row,
.garden-management-panel .menuContainer,
.garden-management-panel .label-row {
  flex: 0 0 auto;
}

#gardenNameDisplay[role="button"] {
  cursor: pointer;
}

#gardenClearButton.is-armed {
  transform: translateY(2px);
  box-shadow:
    inset 0 0 10px 2px rgba(107, 66, 66, 0.7),
    inset 1px 2px 4px 4px rgba(0, 0, 0, 0.48);
}


/* ========================================
   REVIEW 9 — SYSTEM CONSISTENCY / CLEANUP
   ======================================== */

/* Interactive display windows advertise interaction; passive displays do not. */
.displayWindow,
.selectWindow,
.gardenWindow {
  cursor: default;
}

.windowContainer[data-field] .displayWindow,
.windowContainer[data-field] .selectWindow,
.garden-identity-display[role="button"] {
  cursor: pointer;
}

/* Free unit state reuses the original outer display window. The nested container
   is layout only, not a second visible piece of hardware. */
#freeUnitPanel > .windowContainer > .radioContainer {
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
}

#freeUnitSelector {
  width: 100%;
  height: 100%;
  min-width: 0;
}

#freeUnitSelector .unit-button {
  min-width: 0;
  padding-inline: clamp(2px, 0.8vw, 7px);
  font-size: clamp(0.78rem, 3vw, 1rem);
  white-space: nowrap;
}

/* Garden Management is a mode of the same machine, with the same control bank. */
#gardenManagementMenu {
  flex: 0 0 auto;
}

/* Disabled JANE buttons are structural center controls, not visually "unavailable". */
.menu-button[data-action="home"]:disabled {
  opacity: 1;
  cursor: default;
}



/* ========================================
   ACCOUNT FIXED HARDWARE STATE
   ======================================== */

/*
  Delete confirmation morphs the existing bottom control bank.
  It must never insert/remove physical rows that shift Membership or Upgrade.
*/
.account-action-bank {
  position: relative;
}

.account-menu-state {
  width: 100%;
  height: 100%;
  display: flex;
}

.account-menu-state[hidden] {
  display: none !important;
}

.account-menu-state .menu-button {
  flex: 1 1 0;
}

/* Preserve outer-bank corner geometry when the state is wrapped. */
.account-menu-state .menu-button:first-child {
  border-top-left-radius: 6px;
  border-bottom-left-radius: 6px;
}

.account-menu-state .menu-button:last-child {
  border-top-right-radius: 6px;
  border-bottom-right-radius: 6px;
}


/* ========================================
   REVIEW 11 — FREE UNIT READOUT / SELECT CONSISTENCY
   ======================================== */

/* Dependency state changes behavior, not the physical display color. */
#freeSeriesSelect:disabled,
#freeLevelSelect:disabled {
  opacity: 1;
  background: var(--system-color);
  color: var(--window-bg);
  -webkit-text-fill-color: var(--window-bg);
  cursor: default;
}

/* Free/Hobby: Bucket and Spoon stay visible in the existing reservoir hardware. */
.free-unit-readout {
  flex: 0 0 auto;
  display: flex;
  align-items: stretch;
  align-self: stretch;
  min-width: clamp(64px, 18vw, 92px);
  margin-block: clamp(3px, 0.8vw, 6px);
  border-left: 1px solid rgba(51, 51, 51, 0.32);
}

.free-unit-state {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-inline: clamp(3px, 0.8vw, 6px);
  color: #333;
  line-height: 1;
  pointer-events: none;
}

.free-unit-state + .free-unit-state {
  border-left: 1px solid rgba(51, 51, 51, 0.22);
}

.free-unit-value {
  font-size: clamp(0.78rem, 3vw, 1rem);
  font-weight: 700;
}

.free-unit-kind {
  margin-top: 3px;
  font-size: clamp(0.46rem, 1.8vw, 0.6rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.72;
}


/* Hobby uses the same physical unit readout as Free.
   Values come from remembered preferences instead of session-only state. */
.hobby-unit-readout {
  flex: 0 0 auto;
}
