
    :root {
      color-scheme: dark;
      font-family: Inter, "Segoe UI", "Microsoft YaHei", sans-serif;
      color: #edf5ef;
      background: #101a19;
      font-synthesis: none;
      text-rendering: optimizeLegibility;
      --panel: #192624;
      --panel-soft: #1e2d2a;
      --line: rgba(215, 235, 219, .12);
      --muted: #9cafa5;
      --mint: #83e1bd;
      --blue: #79b9ef;
      --amber: #ffca76;
      --red: #ff897d;
      --green: #83e1bd;
    }

    * { box-sizing: border-box; }
    body { min-height: 100vh; margin: 0; }
    button, input, select { font: inherit; }
    button, select { color: inherit; }
    button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; }

    .page { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 27px 0 34px; }
    .topbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
    .brand { display: flex; align-items: center; gap: 12px; }
    .brand-mark {
      display: grid;
      width: 40px;
      height: 40px;
      place-items: center;
      border: 1px solid rgba(131, 225, 189, .4);
      border-radius: 12px;
      background: rgba(131, 225, 189, .09);
      color: var(--mint);
      font-size: 19px;
      font-weight: 850;
    }
    .brand-name { margin: 0; font-size: 14px; font-weight: 800; letter-spacing: .12em; }
    .brand-subtitle { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
    .top-meta { display: flex; align-items: center; gap: 16px; color: var(--muted); font-size: 10px; }
    .online { display: inline-flex; align-items: center; gap: 7px; }
    .online-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 11px rgba(131, 225, 189, .7); }
    .panel { border: 1px solid var(--line); border-radius: 18px; background: var(--panel); box-shadow: 0 22px 65px rgba(0, 0, 0, .2); }

    .hero {
      display: grid;
      grid-template-columns: minmax(0, 1fr) 236px;
      align-items: center;
      gap: 20px;
      padding: 22px 26px;
      margin-bottom: 15px;
    }
    .eyebrow { margin: 0 0 7px; color: var(--mint); font-size: 9px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
    h1 { margin: 0; font-size: clamp(24px, 3vw, 32px); letter-spacing: -.035em; }
    .hero-copy { max-width: 650px; margin: 9px 0 0; color: var(--muted); font-size: 11px; line-height: 1.65; }
    .status-card { padding: 13px 15px; border: 1px solid var(--line); border-radius: 12px; background: rgba(0, 0, 0, .15); }
    .status-caption { margin: 0 0 7px; color: var(--muted); font-size: 9px; font-weight: 730; letter-spacing: .12em; text-transform: uppercase; }
    .status-line { display: flex; align-items: center; gap: 9px; }
    .status-light { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; background: #58645e; box-shadow: 0 0 0 4px rgba(255,255,255,.035); }
    .status-light[data-state="running"] { background: var(--green); box-shadow: 0 0 12px rgba(131,225,189,.65); }
    .status-light[data-state="rain"], .status-light[data-state="low-pressure"] { background: var(--amber); box-shadow: 0 0 12px rgba(255,202,118,.55); }
    .status-light[data-state="stopped"] { background: var(--red); box-shadow: 0 0 12px rgba(255,137,125,.5); }
    .status-text { margin: 0; font-size: 15px; font-weight: 780; }
    .status-note { margin: 7px 0 0 18px; color: var(--muted); font-size: 9px; }

    .dashboard { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(340px, .85fr); gap: 15px; align-items: stretch; }
    .monitor, .controls { padding: 20px; }
    .section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
    .section-heading h2 { margin: 0; font-size: 13px; font-weight: 760; }
    .section-heading p { margin: 5px 0 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
    .badge { padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); font-size: 8px; font-weight: 760; letter-spacing: .1em; white-space: nowrap; }

    .field {
      position: relative;
      display: grid;
      min-height: 276px;
      place-items: center;
      overflow: hidden;
      border: 1px solid var(--line);
      border-radius: 14px;
      background:
        radial-gradient(ellipse at 50% 50%, rgba(52, 126, 91, .2), transparent 66%),
        repeating-linear-gradient(0deg, transparent 0 34px, rgba(210, 235, 215, .035) 35px 36px),
        repeating-linear-gradient(90deg, transparent 0 34px, rgba(210, 235, 215, .035) 35px 36px),
        #14211e;
    }
    .field::after { position: absolute; inset: 12px; border: 1px dashed rgba(215, 235, 219, .11); border-radius: 10px; content: ""; pointer-events: none; }
    .field-svg { position: relative; z-index: 1; display: block; width: min(100%, 400px); height: auto; overflow: visible; }
    .field-boundary { fill: rgba(50, 93, 70, .12); stroke: rgba(155, 204, 168, .35); stroke-width: 1.5; stroke-dasharray: 4 5; }
    .zone-sector { fill: rgba(121, 185, 239, .025); stroke: rgba(215, 235, 219, .12); stroke-width: 1; transition: fill .2s, stroke .2s; }
    .zone-sector.active { fill: rgba(121, 185, 239, .2); stroke: var(--blue); stroke-width: 2; }
    .zone-label { fill: #81958a; font: 9px "Segoe UI", sans-serif; text-anchor: middle; dominant-baseline: middle; }
    .zone-label.active { fill: #d7efff; font-weight: 700; }
    .sprinkler-base { fill: #263b34; stroke: #8ca69a; stroke-width: 2; }
    .sprinkler-head { fill: #83e1bd; stroke: #d5fff0; stroke-width: 1; }
    .spray { opacity: 0; }
    .field[data-running="true"] .spray { opacity: 1; }
    .spray-line { fill: none; stroke: #79b9ef; stroke-linecap: round; }
    .spray-dot { fill: #b7e5ff; }
    .field[data-running="true"] .spray-dot { animation: water-pulse 1.1s ease-in-out infinite alternate; }
    .spray-dot:nth-child(2) { animation-delay: .18s; }
    .spray-dot:nth-child(3) { animation-delay: .37s; }
    @keyframes water-pulse { to { opacity: .35; transform: translateY(3px); } }
    .north-label { fill: #91a198; font: 8px "Segoe UI", sans-serif; text-anchor: middle; }
    .field-caption { position: absolute; z-index: 2; right: 12px; bottom: 10px; color: #82948a; font-size: 8px; letter-spacing: .1em; }

    .zone-summary { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 11px; }
    .summary-cell { padding: 10px 11px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.025); }
    .summary-label { margin: 0; color: var(--muted); font-size: 8px; line-height: 1.4; }
    .summary-value { margin: 5px 0 0; color: #e6f4eb; font-size: 12px; font-weight: 780; font-variant-numeric: tabular-nums; }

    .zone-indicators { display: flex; flex-wrap: wrap; gap: 6px; min-height: 29px; margin-top: 12px; }
    .zone-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); font-size: 8px; }
    .zone-chip[data-active="true"] { border-color: rgba(121,185,239,.5); background: rgba(121,185,239,.12); color: #d7efff; }
    .zone-chip-dot { width: 6px; height: 6px; border-radius: 50%; background: #52645a; }
    .zone-chip[data-active="true"] .zone-chip-dot { background: var(--blue); box-shadow: 0 0 8px rgba(121,185,239,.75); }

    .timer-row { display: flex; align-items: center; gap: 10px; margin-top: 13px; }
    .timer-label { color: var(--muted); font-size: 9px; font-weight: 700; white-space: nowrap; }
    .progress { height: 5px; flex: 1; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.08); }
    .progress-fill { width: 0; height: 100%; border-radius: inherit; background: var(--blue); transition: width .15s linear; }
    .timer-readout { display: flex; align-items: baseline; gap: 4px; font-variant-numeric: tabular-nums; }
    .timer-value { min-width: 25px; color: var(--blue); font-size: 17px; font-weight: 820; text-align: right; }
    .timer-unit { color: var(--muted); font-size: 8px; }

    .controls { display: flex; flex-direction: column; gap: 11px; }
    .controls .section-heading { margin-bottom: 0; }
    .control-card { padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.025); }
    .control-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
    .control-name { margin: 0; font-size: 10px; font-weight: 750; }
    .control-hint { margin: 5px 0 0; color: var(--muted); font-size: 8px; line-height: 1.5; }

    .mode-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 9px; background: rgba(0,0,0,.15); }
    .mode-button { min-height: 31px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 9px; font-weight: 720; cursor: pointer; }
    .mode-button[aria-pressed="true"] { background: #2b3c36; color: var(--mint); box-shadow: inset 0 0 0 1px rgba(131,225,189,.2); }
    .mode-button:disabled { cursor: not-allowed; opacity: .45; }

    .switch {
      position: relative;
      width: 40px;
      height: 23px;
      flex: 0 0 auto;
      padding: 0;
      border: 1px solid rgba(255,255,255,.17);
      border-radius: 99px;
      background: #303c38;
      cursor: pointer;
      transition: background .2s, border-color .2s;
    }
    .switch::after { position: absolute; top: 3px; left: 3px; width: 15px; height: 15px; border-radius: 50%; background: #c1ccc4; content: ""; transition: transform .2s, background .2s; }
    .switch[aria-checked="true"] { border-color: rgba(131,225,189,.55); background: rgba(131,225,189,.24); }
    .switch[aria-checked="true"]::after { transform: translateX(17px); background: var(--mint); }
    .switch:disabled { cursor: not-allowed; opacity: .45; }
    input[type="range"] { display: block; width: 100%; margin: 12px 0 0; accent-color: var(--blue); cursor: pointer; }
    input[type="range"]:disabled { cursor: not-allowed; opacity: .45; }
    .pressure-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
    .pressure-value { color: var(--blue); font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums; }
    .pressure-value[data-low="true"] { color: var(--amber); }
    .range-scale { display: flex; justify-content: space-between; margin-top: 5px; color: #82958b; font-size: 8px; }
    .threshold { margin: 7px 0 0; color: var(--muted); font-size: 8px; }
    .sensor-warning { display: none; margin-top: 8px; padding: 7px 8px; border-radius: 7px; background: rgba(255,202,118,.08); color: var(--amber); font-size: 8px; line-height: 1.5; }
    .sensor-warning[data-visible="true"] { display: block; }

    .setup-panel { display: none; padding: 12px; border: 1px solid rgba(131,225,189,.22); border-radius: 11px; background: rgba(131,225,189,.035); }
    .setup-panel[data-open="true"] { display: block; }
    .setup-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
    .setup-heading h3 { margin: 0; font-size: 10px; }
    .setup-heading span { color: var(--muted); font-size: 8px; }
    .zone-table { display: grid; gap: 6px; max-height: 190px; overflow-y: auto; }
    .zone-row { display: grid; grid-template-columns: 31px minmax(0,1fr) minmax(0,1fr) 26px; align-items: center; gap: 6px; }
    .zone-number { color: var(--muted); font-size: 8px; text-align: center; }
    .zone-select, .zone-time { width: 100%; min-width: 0; height: 30px; padding: 0 7px; border: 1px solid var(--line); border-radius: 7px; background: #172321; font-size: 8px; }
    .zone-remove { width: 25px; height: 25px; border: 1px solid var(--line); border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer; }
    .zone-remove:hover:not(:disabled) { border-color: rgba(255,137,125,.5); color: var(--red); }
    .zone-remove:disabled { opacity: .35; cursor: not-allowed; }
    .setup-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 9px; }
    .text-button { padding: 4px 0; border: 0; background: transparent; color: var(--mint); font-size: 8px; font-weight: 700; cursor: pointer; }
    .text-button:disabled { opacity: .4; cursor: not-allowed; }

    .action-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: auto; }
    .action { min-height: 39px; padding: 0 9px; border: 1px solid var(--line); border-radius: 8px; background: #263531; color: #e8f0e9; font-size: 9px; font-weight: 750; cursor: pointer; transition: background .15s, border-color .15s, transform .15s, opacity .15s; }
    .action:hover:not(:disabled) { border-color: rgba(131,225,189,.43); background: #30443c; }
    .action:active:not(:disabled) { transform: translateY(1px); }
    .action:disabled { opacity: .42; cursor: not-allowed; }
    .action.primary { border-color: rgba(131,225,189,.4); background: var(--mint); color: #14251e; }
    .action.primary:hover:not(:disabled) { background: #a1edcf; }
    .action.stop { color: #ffaaa1; }
    .footer { display: flex; justify-content: space-between; gap: 15px; margin-top: 13px; color: #809189; font-size: 8px; line-height: 1.5; }
    .footer p { margin: 0; }
    .message { color: var(--muted); text-align: right; }
    .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

    @media (max-width: 850px) {
      .dashboard { grid-template-columns: 1fr; }
      .controls { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); }
      .controls .section-heading, .controls .action-row, .setup-panel { grid-column: 1 / -1; }
      .action-row { margin-top: 0; }
    }
    @media (max-width: 560px) {
      .page { width: calc(100% - 22px); padding-top: 15px; }
      .topbar { align-items: flex-start; margin-bottom: 14px; }
      .top-meta { flex-direction: column; align-items: flex-end; gap: 5px; padding-top: 5px; font-size: 8px; }
      .brand-mark { width: 35px; height: 35px; }
      .brand-name { font-size: 12px; }
      .hero { grid-template-columns: 1fr; gap: 13px; padding: 17px; }
      .status-card { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 3px 8px; }
      .status-caption { grid-column: 1 / -1; margin: 0; }
      .status-note { margin: 0; text-align: right; }
      .monitor, .controls { padding: 14px; }
      .field { min-height: 235px; }
      .zone-summary { gap: 5px; }
      .summary-cell { padding: 8px; }
      .summary-value { font-size: 10px; }
      .controls { gap: 8px; }
      .control-card { padding: 10px; }
      .footer { flex-direction: column; }
      .message { text-align: left; }
    }

    @media (prefers-reduced-motion: reduce) {
      *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
    }
  