/* IBM Plex Sans — размещён на своём сервере в /static/fonts, без обращения к Google при загрузке страницы. */
/* cyrillic-ext */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400;
  font-stretch: 100%;
  font-display: swap;
  src: url(/static/fonts/zYXzKVElMYYaJe8bpLHnCwDKr932-G7dytD-Dmu1syxTKYbABA.woff2) format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400;
  font-stretch: 100%;
  font-display: swap;
  src: url(/static/fonts/zYXzKVElMYYaJe8bpLHnCwDKr932-G7dytD-Dmu1syxaKYbABA.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* greek */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400;
  font-stretch: 100%;
  font-display: swap;
  src: url(/static/fonts/zYXzKVElMYYaJe8bpLHnCwDKr932-G7dytD-Dmu1syxdKYbABA.woff2) format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
/* vietnamese */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400;
  font-stretch: 100%;
  font-display: swap;
  src: url(/static/fonts/zYXzKVElMYYaJe8bpLHnCwDKr932-G7dytD-Dmu1syxRKYbABA.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400;
  font-stretch: 100%;
  font-display: swap;
  src: url(/static/fonts/zYXzKVElMYYaJe8bpLHnCwDKr932-G7dytD-Dmu1syxQKYbABA.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400;
  font-stretch: 100%;
  font-display: swap;
  src: url(/static/fonts/zYXzKVElMYYaJe8bpLHnCwDKr932-G7dytD-Dmu1syxeKYY.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* cyrillic-ext */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 500;
  font-stretch: 100%;
  font-display: swap;
  src: url(/static/fonts/zYXzKVElMYYaJe8bpLHnCwDKr932-G7dytD-Dmu1syxTKYbABA.woff2) format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 500;
  font-stretch: 100%;
  font-display: swap;
  src: url(/static/fonts/zYXzKVElMYYaJe8bpLHnCwDKr932-G7dytD-Dmu1syxaKYbABA.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* greek */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 500;
  font-stretch: 100%;
  font-display: swap;
  src: url(/static/fonts/zYXzKVElMYYaJe8bpLHnCwDKr932-G7dytD-Dmu1syxdKYbABA.woff2) format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
/* vietnamese */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 500;
  font-stretch: 100%;
  font-display: swap;
  src: url(/static/fonts/zYXzKVElMYYaJe8bpLHnCwDKr932-G7dytD-Dmu1syxRKYbABA.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 500;
  font-stretch: 100%;
  font-display: swap;
  src: url(/static/fonts/zYXzKVElMYYaJe8bpLHnCwDKr932-G7dytD-Dmu1syxQKYbABA.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 500;
  font-stretch: 100%;
  font-display: swap;
  src: url(/static/fonts/zYXzKVElMYYaJe8bpLHnCwDKr932-G7dytD-Dmu1syxeKYY.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* cyrillic-ext */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 600;
  font-stretch: 100%;
  font-display: swap;
  src: url(/static/fonts/zYXzKVElMYYaJe8bpLHnCwDKr932-G7dytD-Dmu1syxTKYbABA.woff2) format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 600;
  font-stretch: 100%;
  font-display: swap;
  src: url(/static/fonts/zYXzKVElMYYaJe8bpLHnCwDKr932-G7dytD-Dmu1syxaKYbABA.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* greek */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 600;
  font-stretch: 100%;
  font-display: swap;
  src: url(/static/fonts/zYXzKVElMYYaJe8bpLHnCwDKr932-G7dytD-Dmu1syxdKYbABA.woff2) format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
/* vietnamese */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 600;
  font-stretch: 100%;
  font-display: swap;
  src: url(/static/fonts/zYXzKVElMYYaJe8bpLHnCwDKr932-G7dytD-Dmu1syxRKYbABA.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 600;
  font-stretch: 100%;
  font-display: swap;
  src: url(/static/fonts/zYXzKVElMYYaJe8bpLHnCwDKr932-G7dytD-Dmu1syxQKYbABA.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 600;
  font-stretch: 100%;
  font-display: swap;
  src: url(/static/fonts/zYXzKVElMYYaJe8bpLHnCwDKr932-G7dytD-Dmu1syxeKYY.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* cyrillic-ext */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 700;
  font-stretch: 100%;
  font-display: swap;
  src: url(/static/fonts/zYXzKVElMYYaJe8bpLHnCwDKr932-G7dytD-Dmu1syxTKYbABA.woff2) format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 700;
  font-stretch: 100%;
  font-display: swap;
  src: url(/static/fonts/zYXzKVElMYYaJe8bpLHnCwDKr932-G7dytD-Dmu1syxaKYbABA.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* greek */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 700;
  font-stretch: 100%;
  font-display: swap;
  src: url(/static/fonts/zYXzKVElMYYaJe8bpLHnCwDKr932-G7dytD-Dmu1syxdKYbABA.woff2) format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
/* vietnamese */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 700;
  font-stretch: 100%;
  font-display: swap;
  src: url(/static/fonts/zYXzKVElMYYaJe8bpLHnCwDKr932-G7dytD-Dmu1syxRKYbABA.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 700;
  font-stretch: 100%;
  font-display: swap;
  src: url(/static/fonts/zYXzKVElMYYaJe8bpLHnCwDKr932-G7dytD-Dmu1syxQKYbABA.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 700;
  font-stretch: 100%;
  font-display: swap;
  src: url(/static/fonts/zYXzKVElMYYaJe8bpLHnCwDKr932-G7dytD-Dmu1syxeKYY.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/inter-400.ttf') format('truetype');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/static/fonts/inter-500.ttf') format('truetype');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/static/fonts/inter-600.ttf') format('truetype');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/static/fonts/inter-700.ttf') format('truetype');
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/static/fonts/manrope-600.ttf') format('truetype');
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/static/fonts/manrope-700.ttf') format('truetype');
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('/static/fonts/manrope-800.ttf') format('truetype');
}

:root {
  color-scheme: light;
  --canvas: #f3f5ef;
  --surface: #fffef9;
  --surface-soft: #f8faf5;
  --ink: #17342d;
  --muted: #6d7d76;
  --line: #dfe7df;
  --forest: #123c32;
  --forest-2: #1b5546;
  --leaf: #3f7c50;
  --leaf-soft: #dcebdc;
  --water: #168aa0;
  --water-soft: #dff2f4;
  --sand: #ede6d6;
  --danger: #a8453f;
  --danger-soft: #f8e9e5;
  --warning: #a16618;
  --warning-soft: #f8eedb;
  --shadow: 0 18px 45px rgba(24, 57, 46, .08);
  --shadow-strong: 0 26px 70px rgba(12, 45, 35, .18);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--canvas); color: var(--ink); font-family: "Inter", "Segoe UI", Arial, sans-serif; -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: .35rem; font-family: "Manrope", "Inter", sans-serif; font-size: clamp(1.9rem, 3vw, 2.7rem); font-weight: 700; line-height: 1.08; letter-spacing: -.035em; }
h2 { margin-bottom: .35rem; font-family: "Manrope", "Inter", sans-serif; font-size: 1.18rem; font-weight: 700; line-height: 1.25; letter-spacing: -.02em; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }
.subtle { margin-bottom: 0; color: var(--muted); line-height: 1.55; }
.kicker { margin: 0 0 .45rem; color: var(--leaf); font-size: .68rem; font-weight: 800; letter-spacing: .16em; }
.kicker.light { color: rgba(255, 255, 255, .76); }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; display: flex; flex-direction: column; width: 248px; padding: 2rem 1.25rem 1.5rem; color: #f6fbf7; background: var(--forest); }
.brand { display: inline-flex; flex-direction: column; width: fit-content; margin: 0 .75rem 3rem; }
.brand-name { font-size: 1.12rem; font-weight: 900; letter-spacing: .13em; }
.brand-subtitle { margin-top: .25rem; color: rgba(255,255,255,.58); font-size: .67rem; letter-spacing: .08em; text-transform: uppercase; }
.side-nav { display: grid; gap: .25rem; overflow-y: auto; }
.nav-item { display: flex; align-items: center; gap: .8rem; width: 100%; padding: .85rem 1rem; border: 0; border-radius: 12px; background: transparent; color: rgba(255,255,255,.68); cursor: pointer; text-align: left; font-weight: 650; }
.nav-item:hover { background: rgba(255,255,255,.07); color: white; }
.nav-item.is-active { background: rgba(255,255,255,.13); color: white; }
.nav-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; opacity: .7; }
.nav-item.is-active .nav-dot { background: #8ed1a2; opacity: 1; box-shadow: 0 0 0 5px rgba(142,209,162,.12); }
.sidebar-footer { display: grid; gap: 1.2rem; margin-top: auto; padding: 1rem .75rem 0; border-top: 1px solid rgba(255,255,255,.12); }
.connection-mini { display: flex; align-items: center; gap: .75rem; }
.connection-mini strong, .connection-mini small { display: block; }
.connection-mini strong { font-size: .8rem; }
.connection-mini small { margin-top: .2rem; color: rgba(255,255,255,.5); font-size: .68rem; }
.signal-dot { flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%; background: #d3a444; box-shadow: 0 0 0 5px rgba(211,164,68,.13); }
.signal-dot.is-online { background: #75cb8f; box-shadow: 0 0 0 5px rgba(117,203,143,.14); }
.signal-dot.is-offline { background: #d78378; box-shadow: 0 0 0 5px rgba(215,131,120,.13); }
.sidebar .text-button { color: rgba(255,255,255,.62); }

.workspace { min-height: 100vh; margin-left: 248px; padding: 2.35rem clamp(1.25rem, 3.8vw, 4rem) 4rem; }
.workspace > * { width: min(1160px, 100%); margin-inline: auto; }
.mobile-header, .bottom-nav, .mobile-section-title, .stat-icon { display: none; }
.view[hidden] { display: none; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 1.2rem; margin-bottom: 1.45rem; }
.page-heading .subtle { font-size: .9rem; }
.auto-refresh-note { margin: 0; color: var(--leaf); font-size: .76rem; font-weight: 750; white-space: nowrap; }

.button { min-height: 44px; border: 0; border-radius: 12px; padding: .75rem 1rem; cursor: pointer; font-weight: 750; transition: transform .15s ease, background .15s ease, box-shadow .15s ease, opacity .15s ease; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:focus-visible, .nav-item:focus-visible, .bottom-item:focus-visible, .text-button:focus-visible { outline: 3px solid rgba(22,138,160,.24); outline-offset: 2px; }
.button:disabled { cursor: not-allowed; opacity: .42; }
.button.primary { background: var(--forest-2); color: white; box-shadow: 0 10px 22px rgba(27,85,70,.16); }
.button.primary:hover:not(:disabled) { background: var(--forest); }
.button.secondary { background: #e6ece6; color: var(--forest); }
.button.danger-quiet { background: #36564c; color: #fff; box-shadow: 0 8px 18px rgba(25,64,52,.14); }
.button.danger-quiet:hover:not(:disabled) { background: #29473e; }
.button.compact { min-height: 40px; padding: .62rem .9rem; font-size: .83rem; }
.button.wide { width: 100%; }
.text-button { border: 0; padding: 0; background: transparent; color: var(--leaf); cursor: pointer; font-size: .82rem; font-weight: 750; }

.field-hero { position: relative; min-height: 310px; overflow: hidden; border-radius: 24px; background-image: linear-gradient(90deg, rgba(10,45,34,.91) 0%, rgba(10,45,34,.74) 36%, rgba(10,45,34,.18) 74%), url('/static/assets/aqrolife-orchard.png'); background-position: center; background-size: cover; box-shadow: var(--shadow-strong); }
.field-hero-content { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; width: min(540px, 62%); min-height: 310px; padding: clamp(1.5rem, 4vw, 3.2rem); color: white; }
.field-hero h2 { margin-bottom: .45rem; font-size: clamp(1.65rem, 3.5vw, 2.75rem); letter-spacing: -.04em; }
.field-hero p:not(.kicker) { margin-bottom: 1.4rem; color: rgba(255,255,255,.72); }
.live-pill { display: inline-flex; align-items: center; gap: .45rem; margin-bottom: 1.5rem; padding: .42rem .7rem; border-radius: 999px; background: rgba(255,255,255,.14); color: white; font-size: .75rem; font-weight: 750; backdrop-filter: blur(8px); }
.live-pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #f0b86b; }
.live-pill.is-online::before { background: #8ee2a7; box-shadow: 0 0 0 5px rgba(142,226,167,.13); }
.light-button { background: white; color: var(--forest); }
.light-button:hover:not(:disabled) { background: #edf5ed; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .85rem; margin: .9rem 0; }
.stat-card, .content-card { background: var(--surface); border: 1px solid rgba(28,72,58,.09); box-shadow: var(--shadow); }
.stat-card { min-height: 132px; padding: 1.15rem; border-radius: 17px; }
.stat-card.water { background: var(--water-soft); }
.stat-label { display: block; margin-bottom: .8rem; color: var(--muted); font-size: .78rem; }
.stat-card strong { display: block; overflow: hidden; margin-bottom: .4rem; font-size: clamp(1.25rem, 2.3vw, 1.7rem); line-height: 1.05; text-overflow: ellipsis; }
.stat-card small { color: var(--muted); font-size: .72rem; line-height: 1.35; }
.overview-grid { display: grid; grid-template-columns: 1fr; gap: .9rem; }
.content-card { padding: clamp(1.15rem, 2.3vw, 1.6rem); border-radius: 19px; }
.section-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.priority-card { background: linear-gradient(135deg, #fffef9, #f0f6ed); }
.primary-actions { display: flex; gap: .65rem; margin-top: 1.35rem; }
.state-chip { display: inline-flex; flex: 0 0 auto; align-items: center; padding: .38rem .62rem; border-radius: 999px; font-size: .72rem; font-weight: 800; }
.state-chip.closed { background: #e9eeea; color: #53635d; }
.state-chip.open { background: var(--leaf-soft); color: #27663a; }
.state-chip.moving { background: var(--warning-soft); color: var(--warning); }
.state-chip.unknown { background: #eeeae1; color: #716b60; }
.state-chip.warning { background: var(--warning-soft); color: var(--warning); }
.state-chip.saved { background: var(--leaf-soft); color: #27663a; }
.sensor-state-note { margin: .35rem 0 .15rem; font-size: .72rem; }

.irrigation-grid, .monitor-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; }
.program-list { display: grid; gap: .65rem; margin: 1rem 0; }
.program-row, .data-row, .group-draft { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .85rem 0; border-bottom: 1px solid var(--line); }
.program-row strong, .data-row strong, .group-draft strong { display: block; font-size: .86rem; }
.program-row span, .data-row b, .group-draft > span { color: var(--leaf); font-size: .74rem; }
.program-row small, .data-row small, .group-draft small { display: block; margin-top: .24rem; color: var(--muted); font-size: .7rem; line-height: 1.45; }
.empty-state-block { display: grid; place-items: center; min-height: 170px; margin: 1rem 0; border: 1px dashed #cbd8ce; border-radius: 15px; padding: 1.25rem; background: var(--surface-soft); text-align: center; }
.empty-state-block strong { font-size: 1rem; }
.empty-state-block p { max-width: 330px; margin: .4rem 0 0; color: var(--muted); font-size: .78rem; line-height: 1.5; }
.sequence-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .55rem; margin-top: 1rem; }
.sequence-valve { display: grid; min-height: 72px; border: 1px solid var(--line); border-radius: 12px; padding: .75rem; background: var(--surface-soft); color: var(--ink); cursor: pointer; text-align: left; }
.sequence-valve:hover { border-color: #afc5b5; background: #f0f6ed; }
.sequence-valve strong { font-size: .78rem; }
.sequence-valve small { align-self: end; margin-top: .25rem; color: var(--muted); font-size: .65rem; }

.segmented { display: inline-grid; grid-template-columns: repeat(3, auto); gap: .3rem; margin-bottom: .9rem; border: 1px solid var(--line); border-radius: 14px; padding: .3rem; background: #e8eee7; }
.segment { min-height: 38px; border: 0; border-radius: 10px; padding: .55rem .9rem; background: transparent; color: var(--muted); cursor: pointer; font-size: .78rem; font-weight: 750; }
.segment.is-active { background: var(--surface); color: var(--forest); box-shadow: 0 4px 15px rgba(28,72,58,.08); }
.io-panel { min-height: 230px; }
.read-only-note { margin: 1rem 0; border-left: 4px solid #d4a04d; border-radius: 9px; padding: .8rem .9rem; background: var(--warning-soft); color: #704e20; font-size: .76rem; line-height: 1.5; }

.monitor-grid { margin-top: .9rem; }
.data-list { display: grid; margin-top: .7rem; }
.rf-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; margin-top: .8rem; }
.rf-node { min-height: 98px; border: 1px solid var(--line); border-radius: 13px; padding: .8rem; background: var(--surface-soft); }
.rf-node strong, .rf-node span { display: block; }
.rf-node strong { margin-bottom: .45rem; font-size: .82rem; }
.rf-node span { color: var(--muted); font-size: .68rem; line-height: 1.55; }
.accumulations { margin-top: .9rem; }
.accumulation-heading { align-items: center; }
.accumulation-card { overflow: hidden; padding: 0; }
.accumulation-tabs { display: flex; justify-content: center; gap: .25rem; padding: .7rem 1rem; border-bottom: 1px solid var(--line); background: var(--surface-soft); }
.accumulation-tab { min-height: 38px; border: 0; border-radius: 10px; padding: .55rem 1rem; background: transparent; color: var(--muted); cursor: pointer; font-size: .8rem; font-weight: 800; }
.accumulation-tab:hover { color: var(--forest); background: #edf3ed; }
.accumulation-tab.is-active { background: var(--water); color: white; box-shadow: 0 6px 16px rgba(22,138,160,.18); }
.accumulation-tab:focus-visible { outline: 3px solid rgba(22,138,160,.24); outline-offset: 2px; }
.accumulation-columns, .accumulation-row { display: grid; grid-template-columns: minmax(130px, 1fr) 130px 132px; gap: 1rem; align-items: center; }
.accumulation-columns { padding: .7rem 1.25rem; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .68rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.accumulation-columns span:not(:first-child) { text-align: right; }
.accumulation-list { display: grid; }
.accumulation-group h2 { margin: 0; padding: .75rem 1.25rem; background: #eef0f3; color: var(--muted); font-size: .72rem; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.accumulation-row { min-height: 64px; margin: .45rem .55rem 0; border: 1px solid var(--line); border-radius: 12px; padding: .75rem 1rem; background: var(--surface); font-size: .8rem; }
.accumulation-row { width: calc(100% - 1.1rem); color: var(--ink); cursor: pointer; text-align: left; }
.accumulation-row:hover:not(:disabled) { border-color: #aec7b5; background: #f6faf5; box-shadow: 0 7px 18px rgba(28,72,58,.07); }
.accumulation-row:focus-visible { outline: 3px solid rgba(22,138,160,.24); outline-offset: 1px; }
.accumulation-row:disabled { cursor: default; opacity: .72; }
.accumulation-row:last-child { margin-bottom: .55rem; }
.accumulation-row strong { min-width: 0; overflow: hidden; font-size: .84rem; text-overflow: ellipsis; white-space: nowrap; }
.accumulation-row span { color: #456687; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }

.settings-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: .9rem; align-items: start; }
.settings-nav { position: sticky; top: 1rem; display: grid; gap: .25rem; border: 1px solid rgba(28,72,58,.09); border-radius: 17px; padding: .55rem; background: var(--surface); box-shadow: var(--shadow); }
.settings-nav-item { min-height: 43px; border: 0; border-radius: 10px; padding: .65rem .75rem; background: transparent; color: var(--muted); cursor: pointer; text-align: left; font-size: .78rem; font-weight: 700; }
.settings-nav-item:hover { background: var(--surface-soft); color: var(--forest); }
.settings-nav-item.is-active { background: var(--forest-2); color: white; }
.settings-content { min-width: 0; }
.settings-selector { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.settings-selector label { display: grid; gap: .35rem; color: var(--muted); font-size: .7rem; font-weight: 700; }
.settings-selector select { min-width: 180px; min-height: 42px; border: 1px solid #cbd7ce; border-radius: 10px; padding: .55rem .7rem; background: white; color: var(--ink); }
.controller-clock { display: grid; justify-items: end; gap: .45rem; min-width: min(100%, 360px); }
.clock-readout { display: grid; grid-template-columns: auto auto auto; align-items: baseline; justify-content: end; gap: .45rem; color: var(--muted); font-size: .72rem; }
.clock-readout strong { color: var(--forest); font-size: .9rem; }
.clock-readout small { color: var(--muted); font-size: .66rem; }
.clock-actions { display: flex; align-items: end; justify-content: end; gap: .45rem; }
.clock-actions label { min-width: 130px; }
.clock-actions select { min-width: 130px; }
.controller-clock .read-only-note { width: 100%; margin: .1rem 0 0; padding: .55rem .65rem; font-size: .68rem; }
.settings-table { display: grid; margin: .8rem 0 0; }
.settings-table > div:not(.settings-group-title) { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(110px, auto); gap: 1rem; align-items: center; min-height: 47px; border-top: 1px solid var(--line); padding: .65rem .15rem; }
.settings-table dt { color: var(--muted); font-size: .77rem; line-height: 1.4; }
.settings-table dd { margin: 0; color: var(--forest-2); font-size: .78rem; font-weight: 750; text-align: right; overflow-wrap: anywhere; }
.settings-group-title { margin: 1.2rem -.3rem 0; border-radius: 9px; padding: .55rem .7rem; background: #dbe8e7; color: var(--forest); font-size: .72rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.settings-group-title:first-child { margin-top: 0; }
.draft-field { display: grid; gap: .4rem; margin-top: 1rem; color: var(--muted); font-size: .76rem; font-weight: 700; }
.draft-field input { min-height: 44px; border: 1px solid #cbd7ce; border-radius: 11px; padding: .7rem .8rem; background: white; color: var(--ink); }
.group-valve-fieldset { margin: 1rem 0; border: 1px solid var(--line); border-radius: 13px; padding: .8rem; }
.group-valve-fieldset legend { padding: 0 .3rem; color: var(--muted); font-size: .74rem; font-weight: 750; }
.group-valve-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .45rem; }
.group-valve-options label { display: flex; align-items: center; gap: .45rem; min-height: 36px; font-size: .75rem; }
.group-valve-options input { width: 17px; height: 17px; accent-color: var(--forest-2); }
.group-list { display: grid; margin-top: .9rem; }
.panel-form { display: grid; gap: .8rem; margin-top: .8rem; }
.panel-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.panel-field { display: grid; gap: .35rem; color: var(--muted); font-size: .72rem; font-weight: 750; }
.panel-field.wide { grid-column: 1 / -1; }
.panel-field input, .panel-field select, .draft-field select { width: 100%; min-height: 42px; border: 1px solid #cbd7ce; border-radius: 10px; padding: .62rem .72rem; background: white; color: var(--ink); font: inherit; font-weight: 650; }
.panel-check { display: flex; align-items: center; gap: .55rem; min-height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: .55rem .7rem; color: var(--ink); font-size: .72rem; font-weight: 700; }
.panel-check input { width: 17px; height: 17px; accent-color: var(--forest-2); }
.panel-form-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .7rem; border-top: 1px solid var(--line); padding-top: .8rem; }
.sync-copy { color: #8a5b18; font-size: .7rem; line-height: 1.4; }
.sync-copy.saved { color: var(--leaf); }
.sync-copy.synchronized { color: #28653b; font-weight: 750; }
.entity-actions { display: flex; align-items: center; gap: .45rem; }
.entity-actions button { min-height: 34px; }
.wide-dialog { width: min(680px, calc(100vw - 2rem)); }
.sequence-step-options { display: grid; gap: .45rem; }
.sequence-step-option { display: grid; grid-template-columns: auto 1fr 105px; align-items: center; gap: .55rem; min-height: 40px; }
.sequence-step-option > input { width: 17px; height: 17px; accent-color: var(--forest-2); }
.sequence-step-option input[type="number"] { min-height: 36px; border: 1px solid #cbd7ce; border-radius: 9px; padding: .45rem .55rem; }
.day-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .4rem; }
.day-options label { display: flex; align-items: center; gap: .35rem; font-size: .72rem; }
.day-options input { accent-color: var(--forest-2); }

.activity-list { display: grid; margin-top: .6rem; }
.activity-item { display: grid; grid-template-columns: auto 1fr; gap: .8rem; padding: .72rem 0; border-top: 1px solid var(--line); }
.activity-item:first-child { border-top: 0; }
.activity-mark { width: 9px; height: 9px; margin-top: .35rem; border-radius: 50%; background: var(--water); box-shadow: 0 0 0 5px rgba(22,138,160,.09); }
.activity-copy strong { display: block; font-size: .82rem; line-height: 1.35; }
.activity-copy time { color: var(--muted); font-size: .7rem; }
.empty-state { margin: 1rem 0; color: var(--muted); font-size: .86rem; }

.valve-section { padding: 0; overflow: hidden; }
.toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; padding: 1.2rem 1.4rem; border-bottom: 1px solid var(--line); }
.search-field { display: grid; gap: .35rem; width: min(380px, 100%); color: var(--muted); font-size: .72rem; font-weight: 700; }
.search-field input, .login-form input, .custom-duration input { width: 100%; min-height: 44px; border: 1px solid #cbd7ce; border-radius: 11px; background: white; color: var(--ink); padding: .72rem .85rem; outline: 0; }
.search-field input:focus, .login-form input:focus, .custom-duration input:focus { border-color: var(--water); box-shadow: 0 0 0 3px rgba(22,138,160,.13); }
.mode-note { max-width: 430px; color: var(--muted); font-size: .76rem; line-height: 1.45; text-align: right; }
.mode-note.live { color: #2c6d43; }
.valve-list { display: grid; }
.valve-row { display: grid; grid-template-columns: minmax(170px, 1.3fr) minmax(130px, .7fr) auto; align-items: center; gap: 1rem; min-height: 78px; padding: .9rem 1.4rem; border-bottom: 1px solid var(--line); }
.valve-row:last-child { border-bottom: 0; }
.valve-row:hover { background: var(--surface-soft); }
.valve-identity strong { display: block; font-size: .94rem; }
.valve-identity small, .valve-meta small { display: block; margin-top: .25rem; color: var(--muted); font-size: .72rem; }
.valve-meta { text-align: left; }
.valve-meta strong { font-size: .78rem; }
.valve-command { display: flex; justify-content: flex-end; gap: .5rem; }
.valve-command .button { min-height: 38px; padding: .5rem .75rem; font-size: .76rem; }
.valve-command-panel { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.2rem; }
.valve-motion { display: inline-flex; align-items: center; justify-content: flex-end; gap: .6rem; min-height: 38px; color: var(--leaf); font-size: .76rem; }
.motion-ring { width: 20px; height: 20px; border: 3px solid #d8e5dc; border-top-color: var(--leaf); border-radius: 50%; animation: valve-motion-spin .8s linear infinite; }
@keyframes valve-motion-spin { to { transform: rotate(360deg); } }
.locked-label { color: var(--muted); font-size: .74rem; font-weight: 650; }

.event-card { padding-top: .35rem; padding-bottom: .35rem; }
.event-timeline { position: relative; }
.event-row { display: grid; grid-template-columns: 135px 1fr auto; gap: 1.1rem; align-items: start; padding: 1rem .2rem; border-bottom: 1px solid var(--line); }
.event-row:last-child { border-bottom: 0; }
.event-row time { color: var(--muted); font-size: .72rem; line-height: 1.45; }
.event-row strong { display: block; margin-bottom: .2rem; font-size: .86rem; line-height: 1.4; }
.event-row small { color: var(--muted); font-size: .7rem; }
.event-type { padding: .3rem .5rem; border-radius: 999px; background: #edf1ed; color: #596861; font-size: .65rem; font-weight: 800; text-transform: uppercase; }
.event-type.success { background: var(--leaf-soft); color: #28653b; }
.event-type.warning { background: var(--warning-soft); color: var(--warning); }
.journal-tabs { display: inline-flex; gap: .25rem; margin-bottom: .85rem; padding: .3rem; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-soft); }
.journal-tab { min-height: 38px; border: 0; border-radius: 9px; padding: 0 .9rem; background: transparent; color: var(--muted); font-size: .76rem; font-weight: 800; cursor: pointer; }
.journal-tab.is-active { background: var(--forest); color: white; box-shadow: 0 5px 14px rgba(13,68,52,.16); }
.worker-journal-card { padding: 0; overflow: hidden; }
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: .76rem; }
.data-table th { padding: .85rem .75rem; background: var(--surface-soft); color: var(--muted); font-size: .66rem; letter-spacing: .04em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.data-table td { height: 54px; padding: .7rem .75rem; border-top: 1px solid var(--line); vertical-align: middle; }
.data-table td:first-child { color: var(--muted); white-space: nowrap; }
.data-table .empty-table { height: 110px; color: var(--muted); text-align: center; }
.table-pagination { display: flex; align-items: center; justify-content: center; gap: .55rem; padding: .8rem; border-top: 1px solid var(--line); background: var(--surface-soft); color: var(--muted); font-size: .72rem; font-weight: 700; }
.table-pagination button { width: 36px; height: 34px; border: 1px solid var(--line); border-radius: 9px; background: white; color: var(--forest); font-weight: 900; cursor: pointer; }
.table-pagination button:disabled { cursor: default; opacity: .35; }
.table-pagination label { display: flex; align-items: center; gap: .4rem; }
.table-pagination select { min-height: 34px; border: 1px solid var(--line); border-radius: 8px; background: white; padding: 0 .55rem; color: var(--ink); font-weight: 800; }
.table-pagination[hidden] { display: none !important; }
.users-heading { align-items: center; }
.own-password-card { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .9rem; }
.own-password-card h2 { margin-bottom: .25rem; }
.users-card { padding: 0; overflow: hidden; }
.users-table td:last-child { text-align: right; }
.users-security-note { margin-top: .9rem; }

.system-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: .9rem; }
.connection-main { display: flex; align-items: center; gap: 1rem; padding: 1rem 0 1.35rem; }
.signal-orbit { width: 20px; height: 20px; border-radius: 50%; background: #d3a444; box-shadow: 0 0 0 8px rgba(211,164,68,.13), 0 0 0 15px rgba(211,164,68,.06); }
.signal-orbit.is-online { background: #58ac70; box-shadow: 0 0 0 8px rgba(88,172,112,.13), 0 0 0 15px rgba(88,172,112,.06); }
.signal-orbit.is-offline { background: #c96c62; box-shadow: 0 0 0 8px rgba(201,108,98,.13), 0 0 0 15px rgba(201,108,98,.06); }
.connection-main h2 { margin-bottom: .15rem; }
.detail-list, .sensor-list { margin: 0; }
.detail-list div, .sensor-list div { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .9rem 0; border-top: 1px solid var(--line); }
.detail-list dt, .sensor-list dt { color: var(--muted); font-size: .8rem; }
.detail-list dd, .sensor-list dd { margin: 0; text-align: right; font-size: .82rem; font-weight: 750; }
.interface-list { display: grid; margin-top: .7rem; }
.interface-row { display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 1rem; border: 0; border-bottom: 1px solid var(--line); padding: .9rem .2rem; background: transparent; color: var(--ink); text-align: left; }
button.interface-row { cursor: pointer; }
button.interface-row:hover, button.interface-row.is-active { border-radius: 10px; padding-inline: .7rem; background: var(--surface-soft); }
.interface-row strong, .interface-row small { display: block; }
.interface-row strong { font-size: .86rem; }
.interface-row small { margin-top: .24rem; color: var(--muted); font-size: .7rem; }
.interface-row b { color: var(--leaf); font-size: .74rem; }
.interface-row.is-static { cursor: default; }
.rf-node-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .7rem; }
.rf-node-head > div { display: flex; align-items: center; gap: .55rem; }
.rtu-switch { display: inline-flex; align-items: center; gap: .5rem; border: 0; padding: .2rem; background: transparent; color: var(--muted); cursor: pointer; }
.rtu-switch:disabled { cursor: default; opacity: .55; }
.rtu-switch-track { position: relative; display: inline-block; width: 42px; height: 24px; border-radius: 999px; background: #cbd3cf; transition: background .2s ease; }
.rtu-switch-track i { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(8,33,26,.22); transition: transform .2s ease; }
.rtu-switch.is-on .rtu-switch-track { background: var(--leaf); }
.rtu-switch.is-on .rtu-switch-track i { transform: translateX(18px); }
.rtu-switch b { font-size: .72rem; }

.alert, .toast { position: fixed; z-index: 70; right: 1.4rem; top: 1.4rem; width: min(390px, calc(100vw - 2rem)); padding: .9rem 1rem; border-radius: 13px; box-shadow: var(--shadow-strong); font-size: .82rem; line-height: 1.45; }
.alert { border: 1px solid #e3b6af; background: #fff5f2; color: #873c36; }
.toast { border: 1px solid #bdd9c2; background: #f0fbf2; color: #28613a; }

.command-dialog { width: min(540px, calc(100% - 1.5rem)); max-height: calc(100vh - 2rem); overflow: auto; border: 0; border-radius: 22px; padding: 0; background: var(--surface); color: var(--ink); box-shadow: 0 32px 90px rgba(8,33,26,.32); }
.command-dialog::backdrop { background: rgba(7,27,22,.55); backdrop-filter: blur(4px); }
.command-dialog form { padding: 1.45rem; }
.dialog-head { display: flex; justify-content: space-between; gap: 1rem; }
.dialog-close { width: 38px; height: 38px; border: 0; border-radius: 50%; background: #edf1ed; cursor: pointer; font-size: 1.4rem; line-height: 1; }
.duration-fieldset { margin: 1.25rem 0; border: 0; padding: 0; }
.duration-fieldset legend { margin-bottom: .65rem; font-size: .8rem; font-weight: 800; }
.time-picker { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .65rem; }
.time-picker label { display: grid; gap: .4rem; color: var(--muted); font-size: .7rem; font-weight: 750; text-align: center; }
.time-picker input { width: 100%; min-height: 58px; border: 1px solid #cbd7ce; border-radius: 11px; background: white; color: var(--ink); font: inherit; font-size: 1.15rem; font-weight: 800; text-align: center; }
.time-picker input:focus { border-color: var(--water); outline: 0; box-shadow: 0 0 0 3px rgba(22,138,160,.13); }
.accumulation-volume-field { display: grid; gap: .5rem; margin-top: 1.2rem; color: var(--muted); font-size: .76rem; font-weight: 800; }
.accumulation-volume-input { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; overflow: hidden; border: 1px solid #cbd7ce; border-radius: 11px; background: white; }
.accumulation-volume-input:focus-within { border-color: var(--water); box-shadow: 0 0 0 3px rgba(22,138,160,.13); }
.accumulation-volume-input input { min-width: 0; min-height: 54px; border: 0; outline: 0; padding: .75rem .9rem; color: var(--ink); font-size: 1.05rem; font-weight: 800; }
.accumulation-volume-input b { padding: 0 .9rem; color: #456687; font-size: .82rem; }
.duration-options { display: grid; grid-template-columns: repeat(4, 1fr); gap: .45rem; }
.duration-option { position: relative; }
.duration-option input { position: absolute; opacity: 0; pointer-events: none; }
.duration-option span { display: grid; place-items: center; min-height: 44px; border: 1px solid var(--line); border-radius: 11px; cursor: pointer; font-size: .78rem; font-weight: 750; }
.duration-option input:checked + span { border-color: var(--forest-2); background: var(--forest-2); color: white; }
.duration-option input:focus-visible + span { outline: 3px solid rgba(22,138,160,.23); outline-offset: 2px; }
.custom-duration { display: grid; gap: .4rem; margin-top: .8rem; color: var(--muted); font-size: .75rem; font-weight: 700; }
.custom-duration > span { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: .55rem; }
.custom-duration b { color: var(--muted); font-size: .75rem; }
.confirm-check { display: flex; align-items: flex-start; gap: .7rem; padding: .9rem; border-radius: 12px; background: var(--warning-soft); color: #6e4c1c; font-size: .78rem; line-height: 1.45; }
.confirm-check input { flex: 0 0 auto; width: 18px; height: 18px; margin-top: .08rem; accent-color: var(--forest-2); }
.inline-error { margin-top: .7rem; color: var(--danger); font-size: .78rem; }
.dialog-actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1rem; }

.login-body { min-height: 100vh; background: var(--forest); }
.login-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(420px, .85fr); min-height: 100vh; }
.login-scene { position: relative; display: flex; align-items: flex-end; min-height: 100vh; overflow: hidden; background-image: linear-gradient(180deg, rgba(11,48,37,.05) 35%, rgba(11,48,37,.83) 100%), url('/static/assets/aqrolife-orchard.png'); background-position: center; background-size: cover; }
.login-scene-copy { position: relative; z-index: 1; width: min(660px, 90%); padding: clamp(2rem, 5vw, 5rem); color: white; }
.login-scene-copy h2 { max-width: 580px; margin-bottom: .8rem; font-size: clamp(2rem, 4vw, 3.8rem); line-height: 1.03; letter-spacing: -.05em; }
.login-scene-copy p:not(.kicker) { max-width: 530px; margin-bottom: 0; color: rgba(255,255,255,.72); line-height: 1.6; }
.login-panel { display: grid; place-items: center; padding: clamp(1.5rem, 5vw, 4.5rem); background: var(--surface); }
.login-card { width: min(420px, 100%); }
.login-brand { display: inline-flex; flex-direction: column; margin-bottom: clamp(3rem, 10vh, 6rem); color: var(--forest); }
.login-brand .brand-subtitle { color: var(--muted); }
.login-heading { margin-bottom: 1.4rem; }
.login-heading h1 { font-size: clamp(2rem, 4vw, 2.7rem); }
.login-form { display: grid; gap: 1rem; }
.login-form label { display: grid; gap: .45rem; color: var(--ink); font-size: .78rem; font-weight: 750; }
.login-form input { min-height: 50px; background: #fbfcf9; padding-right: .9rem; }
.password-wrap { position: relative; display: block; }
.password-wrap input { padding-right: 5.4rem; }
.password-toggle { position: absolute; right: .35rem; top: 50%; min-height: 36px; transform: translateY(-50%); border: 0; border-radius: 8px; padding: 0 .65rem; background: transparent; color: var(--leaf); cursor: pointer; font-size: .72rem; font-weight: 750; }
.login-submit { min-height: 52px; margin-top: .35rem; }
.login-security { margin: 1.25rem 0 0; color: var(--muted); font-size: .7rem; line-height: 1.5; text-align: center; }
.login-card .alert { position: static; width: 100%; margin-bottom: 1rem; box-shadow: none; }

@media (max-width: 1050px) {
  .sidebar { width: 210px; }
  .workspace { margin-left: 210px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .login-layout { grid-template-columns: 1fr minmax(390px, .9fr); }
}

@media (max-width: 760px) {
  body.app-body { padding-bottom: calc(58px + env(safe-area-inset-bottom)); }
  .sidebar { display: none; }
  .workspace { margin-left: 0; padding: 0 1rem 2rem; }
  .workspace > * { width: 100%; }
  .mobile-header { position: sticky; top: 0; z-index: 30; display: flex; justify-content: space-between; align-items: center; min-height: 58px; margin: 0 -1rem 1.2rem; width: calc(100% + 2rem); padding: calc(.65rem + env(safe-area-inset-top)) 1rem .65rem; border-bottom: 1px solid var(--line); background: rgba(255,254,249,.92); backdrop-filter: blur(14px); }
  .mobile-brand { color: var(--forest); font-size: .86rem; font-weight: 900; letter-spacing: .12em; }
  .compact-status { display: inline-flex; align-items: center; min-height: 28px; padding: .25rem .55rem; border-radius: 999px; background: #edf1ed; color: var(--muted); font-size: .67rem; font-weight: 750; }
  .compact-status.is-online { background: var(--leaf-soft); color: #28653b; }
  .compact-status.is-offline { background: var(--danger-soft); color: var(--danger); }
  .bottom-nav { position: fixed; inset: auto 0 0 0; z-index: 50; display: flex; min-height: calc(64px + env(safe-area-inset-bottom)); padding: .45rem .35rem calc(.35rem + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); overflow-x: auto; background: rgba(255,254,249,.95); backdrop-filter: blur(14px); scrollbar-width: none; }
  .bottom-nav::-webkit-scrollbar { display: none; }
  .bottom-item { display: grid; flex: 0 0 76px; place-items: center; border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; font-size: .64rem; font-weight: 700; }
  .bottom-item::before { content: ''; width: 18px; height: 4px; margin-bottom: .25rem; border-radius: 999px; background: transparent; }
  .bottom-item.is-active { color: var(--forest); }
  .bottom-item.is-active::before { background: var(--leaf); }
  .page-heading { align-items: flex-start; margin-bottom: 1rem; }
  .page-heading h1 { font-size: 1.85rem; }
  .page-heading .button { margin-top: .25rem; }
  .field-hero { min-height: 330px; background-image: linear-gradient(180deg, rgba(9,42,32,.18) 0%, rgba(9,42,32,.88) 72%), url('/static/assets/aqrolife-orchard.png'); background-position: 61% center; }
  .field-hero-content { justify-content: flex-end; width: 100%; min-height: 330px; padding: 1.35rem; }
  .field-hero h2 { font-size: 1.9rem; }
  .live-pill { margin-bottom: auto; }
  .stats-grid { gap: .65rem; }
  .stat-card { min-height: 118px; padding: 1rem; }
  .overview-grid, .system-grid, .irrigation-grid, .monitor-grid { grid-template-columns: 1fr; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { position: static; display: flex; margin: 0 -1rem; border-radius: 0; padding: .5rem 1rem; overflow-x: auto; box-shadow: none; scrollbar-width: none; }
  .settings-nav::-webkit-scrollbar { display: none; }
  .settings-nav-item { flex: 0 0 auto; min-height: 38px; white-space: nowrap; }
  .settings-selector { align-items: stretch; flex-direction: column; }
  .settings-selector select { width: 100%; }
  .controller-clock { justify-items: stretch; min-width: 0; }
  .clock-readout, .clock-actions { justify-content: space-between; }
  .clock-actions label { flex: 1 1 auto; }
  .settings-table > div:not(.settings-group-title) { grid-template-columns: minmax(0, 1fr) minmax(92px, auto); }
  .toolbar { align-items: stretch; flex-direction: column; padding: 1rem; }
  .mode-note { text-align: left; }
  .valve-row { grid-template-columns: 1fr auto; gap: .75rem; padding: .9rem 1rem; }
  .valve-meta { display: none; }
  .valve-command { grid-column: 1 / -1; justify-content: stretch; }
  .valve-command .button { flex: 1; min-height: 42px; }
  .event-row { grid-template-columns: 1fr auto; gap: .45rem .8rem; }
  .event-row time { grid-column: 1 / -1; }
  .journal-tabs { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .journal-tab { padding: 0 .45rem; font-size: .7rem; }
  .worker-journal-table { min-width: 720px; }
  .users-heading { align-items: stretch; }
  .users-heading .button { width: 100%; }
  .own-password-card { align-items: stretch; flex-direction: column; }
  .users-table { min-width: 620px; }
  .alert, .toast { top: calc(68px + env(safe-area-inset-top)); right: 1rem; }
  .login-layout { display: block; min-height: 100vh; background: var(--surface); }
  .login-scene { align-items: flex-end; min-height: 34vh; background-position: 58% center; }
  .login-scene-copy { padding: 1.5rem 1.25rem; }
  .login-scene-copy h2 { max-width: 360px; margin-bottom: .45rem; font-size: 1.85rem; }
  .login-scene-copy p:not(.kicker) { display: none; }
  .login-panel { min-height: 66vh; padding: 1.75rem 1.25rem calc(2rem + env(safe-area-inset-bottom)); place-items: start center; }
  .login-brand { margin-bottom: 2rem; }
}

@media (max-width: 430px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat-card { min-height: 112px; }
  .stat-card strong { font-size: 1.2rem; }
  .primary-actions { display: grid; grid-template-columns: 1fr; }
  .section-heading { align-items: flex-start; }
  .duration-options { grid-template-columns: repeat(2, 1fr); }
  .dialog-actions .button { flex: 1; }
  .segmented { display: grid; grid-template-columns: 1fr; width: 100%; }
  .sequence-grid, .rf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .accumulation-heading { align-items: flex-start; }
  .accumulation-heading .state-chip { margin-top: .2rem; }
  .accumulation-columns, .accumulation-row { grid-template-columns: minmax(82px, 1fr) 82px 96px; gap: .4rem; }
  .accumulation-columns { padding-inline: .7rem; font-size: .59rem; }
  .accumulation-group h2 { padding-inline: .75rem; }
  .accumulation-row { width: calc(100% - .7rem); min-height: 58px; margin-inline: .35rem; padding-inline: .65rem; font-size: .7rem; }
  .accumulation-row strong { font-size: .76rem; }
  .group-valve-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel-form-grid { grid-template-columns: 1fr; }
  .panel-field.wide { grid-column: auto; }
  .day-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* Телефон: +7% к базовому кеглю. Все размеры в rem, поэтому масштабируется
   весь текст сразу, без правки каждого правила. */
@media (max-width: 760px) {
  html { font-size: 107%; }
}

/* Нижнее меню на телефоне заменено выпадающим.
   Исходная полоса рассчитана на короткие русские подписи («Накоп.», «Связь»);
   по-азербайджански сокращения не читаются, а полные слова в неё не влезают.
   Вместо неё — кнопка с названием текущего раздела и лист со всеми разделами
   целиком. Разметку .bottom-nav оставляем в DOM: app.js держит на ней
   обработчики, а пункты листа просто пересылают на них нажатие. */
@media (max-width: 760px) {
  body.app-body { padding-bottom: calc(78px + env(safe-area-inset-bottom)); }
  .bottom-nav { display: none; }

  .nav-trigger {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 60;
    display: flex;
    align-items: center;
    gap: .75rem;
    width: 100%;
    padding: 1rem 1.15rem calc(1rem + env(safe-area-inset-bottom));
    border: 0;
    background: var(--forest);
    color: #fff;
    font-size: 1.05rem;
    font-weight: 700;
    text-align: left;
    box-shadow: 0 -12px 32px rgba(12, 45, 35, .28);
    cursor: pointer;
  }
  .nav-trigger-bars { display: grid; gap: 3px; width: 20px; }
  .nav-trigger-bars i { display: block; height: 2px; border-radius: 2px; background: currentColor; }
  .nav-trigger-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav-trigger-caret { display: block; font-size: 1.1rem; line-height: 1; transition: transform .18s ease; }
  body.nav-sheet-open .nav-trigger-caret { transform: rotate(180deg); }

  .nav-sheet-backdrop {
    position: fixed;
    inset: 0;
    z-index: 58;
    background: rgba(9, 32, 25, .5);
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease;
  }
  body.nav-sheet-open .nav-sheet-backdrop { opacity: 1; pointer-events: auto; }

  .nav-sheet {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 59;
    display: grid;
    gap: .25rem;
    max-height: 78vh;
    padding: .7rem .7rem calc(88px + env(safe-area-inset-bottom));
    border-radius: 20px 20px 0 0;
    background: var(--surface);
    box-shadow: 0 -26px 70px rgba(12, 45, 35, .28);
    overflow-y: auto;
    transform: translateY(102%);
    transition: transform .22s ease;
  }
  body.nav-sheet-open .nav-sheet { transform: translateY(0); }

  .nav-sheet-item {
    display: block;
    width: 100%;
    min-height: 54px;
    padding: .85rem 1rem;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--ink);
    font-size: 1.05rem;
    font-weight: 650;
    text-align: left;
    cursor: pointer;
  }
  .nav-sheet-item.is-active { background: var(--leaf-soft); color: var(--forest); font-weight: 800; }
}

/* На широком экране работает боковое меню, выпадающее не нужно. */
@media (min-width: 761px) {
  .nav-trigger, .nav-sheet, .nav-sheet-backdrop { display: none !important; }
}

/* Aqrolife redesign · выбранное направление «Полевой компас». */
.brand-name, .mobile-brand, .login-brand .brand-name {
  font-family: "Manrope", "Inter", sans-serif;
  font-weight: 800;
}

.button, .nav-item, .state-chip, .live-pill {
  font-family: "Inter", sans-serif;
}

.mobile-dock, .mobile-more-backdrop, .mobile-more-sheet { display: none; }

@media (max-width: 760px) {
  html { font-size: 100%; }
  body.app-body { padding-bottom: calc(82px + env(safe-area-inset-bottom)); }
  body.mobile-more-open { overflow: hidden; }

  .workspace { padding: 0 1rem 1.5rem; }
  .mobile-header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: .65rem;
    min-height: 64px;
    margin-bottom: 1.05rem;
    padding: calc(.7rem + env(safe-area-inset-top)) 1rem .7rem;
  }
  .mobile-brand { font-size: .86rem; letter-spacing: .1em; }
  .compact-status {
    justify-self: end;
    max-width: 104px;
    overflow: hidden;
    min-height: 30px;
    padding: .3rem .62rem;
    font-size: .69rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .view[data-view-panel="status"] .page-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: .5rem;
    margin: .2rem 0 1.05rem;
  }
  .view[data-view-panel="status"] .page-heading .kicker { display: none; }
  .view[data-view-panel="status"] .page-heading h1 {
    margin: 0 0 .2rem;
    font-size: clamp(1.9rem, 9vw, 2.35rem);
    line-height: 1.02;
    letter-spacing: -.045em;
  }
  .view[data-view-panel="status"] .page-heading .subtle {
    font-size: .84rem;
    line-height: 1.45;
  }
  .auto-refresh-note {
    max-width: 115px;
    padding-top: .25rem;
    font-size: .66rem;
    line-height: 1.35;
    text-align: right;
    white-space: normal;
  }

  .field-hero {
    min-height: 128px;
    margin-bottom: 64px;
    overflow: visible;
    border-radius: 17px;
    background-image: linear-gradient(90deg, rgba(8, 43, 32, .9) 0%, rgba(8, 43, 32, .67) 52%, rgba(8, 43, 32, .16) 100%), url('/static/assets/aqrolife-orchard.png');
    background-position: 58% center;
    box-shadow: 0 18px 42px rgba(12, 45, 35, .16);
  }
  .field-hero-content {
    justify-content: flex-end;
    width: 100%;
    min-height: 128px;
    padding: .8rem .9rem;
  }
  .field-hero .live-pill {
    align-self: flex-start;
    margin: 0 0 auto;
    padding: .3rem .5rem;
    font-size: .62rem;
  }
  .field-hero .kicker { display: none; }
  .field-hero h2 { margin-bottom: .12rem; font-size: 1.18rem; }
  .field-hero p:not(.kicker) { margin: 0; font-size: .66rem; }
  .field-hero .button {
    position: absolute;
    right: 0;
    bottom: -56px;
    left: 0;
    display: flex;
    justify-content: space-between;
    width: 100%;
    min-height: 48px;
    border-radius: 13px;
    padding-inline: 1rem;
    background: var(--forest);
    color: white;
    box-shadow: 0 12px 24px rgba(12, 45, 35, .14);
  }
  .field-hero .button::after {
    content: '';
    width: 18px;
    height: 18px;
    background: currentColor;
    -webkit-mask: url('/static/icons/chevron-right.svg') center / contain no-repeat;
    mask: url('/static/icons/chevron-right.svg') center / contain no-repeat;
  }

  .mobile-section-title {
    display: block;
    margin: 1.35rem 0 .7rem;
    font-size: 1.08rem;
  }
  .stats-grid {
    display: block;
    overflow: hidden;
    margin: 0 0 .85rem;
    border: 1px solid rgba(28, 72, 58, .1);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: 0 16px 36px rgba(24, 57, 46, .06);
  }
  .stat-card, .stat-card.water {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: .75rem;
    align-items: center;
    min-height: 78px;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    padding: .78rem .9rem;
    background: transparent;
    box-shadow: none;
  }
  .stat-card:last-child { border-bottom: 0; }
  .stat-icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #eaf1e5;
  }
  .stat-icon img {
    width: 23px;
    height: 23px;
    opacity: .85;
    filter: invert(20%) sepia(23%) saturate(1112%) hue-rotate(111deg) brightness(86%) contrast(93%);
  }
  .stat-copy { min-width: 0; }
  .stat-label {
    margin: 0 0 .22rem;
    color: var(--ink);
    font-size: .82rem;
    font-weight: 650;
  }
  .stat-card small {
    display: block;
    overflow: hidden;
    color: var(--muted);
    font-size: .69rem;
    line-height: 1.35;
    text-overflow: ellipsis;
  }
  .stat-card strong {
    max-width: 112px;
    margin: 0;
    color: var(--forest);
    font-family: "Manrope", "Inter", sans-serif;
    font-size: 1.03rem;
    font-weight: 700;
    line-height: 1.15;
    text-align: right;
    white-space: normal;
  }
  #transport-state { color: var(--danger); }

  .activity-preview { border-radius: 18px; box-shadow: 0 14px 32px rgba(24, 57, 46, .055); }
  .activity-preview .kicker { display: none; }
  .activity-preview h2 { font-size: 1.05rem; }

  .bottom-nav, .nav-trigger, .nav-sheet, .nav-sheet-backdrop { display: none !important; }
  .mobile-dock {
    position: fixed;
    inset: auto 0 0;
    z-index: 60;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    min-height: calc(70px + env(safe-area-inset-bottom));
    padding: .38rem .25rem calc(.28rem + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: rgba(255, 254, 249, .97);
    box-shadow: 0 -10px 30px rgba(12, 45, 35, .08);
    backdrop-filter: blur(16px);
  }
  .mobile-dock-item {
    position: relative;
    display: grid;
    place-items: center;
    gap: .2rem;
    min-width: 0;
    min-height: 58px;
    border: 0;
    border-radius: 12px;
    padding: .35rem .15rem;
    background: transparent;
    color: #65736d;
    cursor: pointer;
    font-size: .61rem;
    font-weight: 600;
    line-height: 1.1;
  }
  .mobile-dock-item::before {
    content: '';
    position: absolute;
    top: -.39rem;
    left: 50%;
    width: 30px;
    height: 3px;
    transform: translateX(-50%);
    border-radius: 999px;
    background: transparent;
  }
  .mobile-dock-item.is-active { color: var(--forest); font-weight: 700; }
  .mobile-dock-item.is-active::before { background: var(--leaf); }
  .mobile-nav-icon {
    width: 22px;
    height: 22px;
    background: currentColor;
    -webkit-mask: var(--mobile-icon) center / contain no-repeat;
    mask: var(--mobile-icon) center / contain no-repeat;
  }
  .mobile-dock-label {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-more-backdrop {
    position: fixed;
    inset: 0;
    z-index: 61;
    display: block;
    background: rgba(9, 32, 25, .48);
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease;
  }
  .mobile-more-sheet {
    position: fixed;
    inset: auto .65rem calc(74px + env(safe-area-inset-bottom));
    z-index: 62;
    display: grid;
    gap: .25rem;
    max-height: min(70vh, 520px);
    overflow-y: auto;
    border: 1px solid rgba(28, 72, 58, .1);
    border-radius: 20px;
    padding: .8rem;
    background: var(--surface);
    box-shadow: 0 24px 70px rgba(12, 45, 35, .25);
    opacity: 0;
    pointer-events: none;
    transform: translateY(16px);
    transition: opacity .18s ease, transform .18s ease;
  }
  body.mobile-more-open .mobile-more-backdrop { opacity: 1; pointer-events: auto; }
  body.mobile-more-open .mobile-more-sheet { opacity: 1; pointer-events: auto; transform: translateY(0); }
  .mobile-more-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 44px;
    padding: .2rem .35rem .55rem;
  }
  .mobile-more-head strong { font-family: "Manrope", "Inter", sans-serif; font-size: 1rem; }
  .mobile-more-close {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: #edf1ed;
    cursor: pointer;
  }
  .mobile-more-close .mobile-nav-icon { width: 19px; height: 19px; }
  .mobile-more-item {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) 18px;
    align-items: center;
    gap: .7rem;
    min-height: 56px;
    border: 0;
    border-radius: 12px;
    padding: .55rem .65rem;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    text-align: left;
    font-size: .86rem;
    font-weight: 600;
  }
  .mobile-more-item:hover, .mobile-more-item.is-active { background: var(--leaf-soft); color: var(--forest); }
  .mobile-more-item > .mobile-nav-icon:first-child {
    width: 22px;
    height: 22px;
    justify-self: center;
  }
  .mobile-more-chevron { width: 17px; height: 17px; justify-self: end; opacity: .55; }

  .login-scene { min-height: 26vh; }
  .login-scene-copy { padding: 1.15rem 1.25rem; }
  .login-scene-copy h2 { max-width: 340px; margin-bottom: 0; font-size: 1.55rem; line-height: 1.08; }
  .login-scene-copy .kicker { margin-bottom: .3rem; }
  .login-panel { min-height: 74vh; padding: 1.25rem 1.25rem calc(1.5rem + env(safe-area-inset-bottom)); }
  .login-brand { margin-bottom: 1.35rem; }
  .login-heading { margin-bottom: 1rem; }
  .login-heading h1 { font-size: 1.85rem; }
  .login-security { margin-top: .9rem; }
}

@media (max-width: 370px) {
  .mobile-header { gap: .4rem; }
  .compact-status { max-width: 88px; padding-inline: .48rem; }
  .mobile-dock-item { font-size: .56rem; }
  .stat-card { grid-template-columns: 40px minmax(0, 1fr) auto; gap: .6rem; padding-inline: .72rem; }
  .stat-icon { width: 40px; height: 40px; }
}

@media (min-width: 761px) {
  .mobile-dock, .mobile-more-backdrop, .mobile-more-sheet { display: none !important; }
}

/* Compact language switch and stable valve rows at every workspace width. */
.sidebar-footer .aq-lang {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
}
.sidebar-footer .aq-lang button {
  width: 100%;
  min-width: 0;
}

.valve-row {
  grid-template-columns: minmax(0, 1fr) minmax(300px, auto);
  grid-template-areas:
    "identity command"
    "meta command";
  gap: .35rem 1rem;
}
.valve-identity { grid-area: identity; min-width: 0; }
.valve-meta {
  grid-area: meta;
  display: flex;
  align-items: center;
  gap: .55rem;
  min-width: 0;
}
.valve-meta small {
  overflow: hidden;
  margin-top: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.valve-command {
  grid-area: command;
  align-self: center;
  display: grid;
  grid-template-columns: minmax(72px, auto) minmax(116px, auto) minmax(72px, auto);
  min-width: 300px;
}
.valve-command .button { white-space: nowrap; }
.valve-command.single-action { grid-template-columns: minmax(0, 1fr); }

@media (max-width: 1100px) {
  .valve-row {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "identity" "meta" "command";
    gap: .45rem;
  }
  .valve-command {
    width: 100%;
    min-width: 0;
    justify-content: start;
  }
}

@media (max-width: 760px) {
  .valve-meta { display: flex; }
  .valve-command { grid-column: auto; justify-content: flex-end; }
}

@media (max-width: 520px) {
  .valve-row {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "identity" "meta" "command";
    gap: .45rem;
  }
  .valve-command {
    width: 100%;
    min-width: 0;
    justify-content: stretch;
  }
  .valve-command .button { flex: 1; min-height: 44px; }
}

@media (max-width: 760px) {
  body.app-body { padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
  .mobile-dock {
    min-height: calc(54px + env(safe-area-inset-bottom));
    padding: .1rem .18rem calc(.08rem + env(safe-area-inset-bottom));
  }
  .mobile-dock-item {
    align-content: center;
    gap: .02rem;
    min-height: 46px;
    padding: .08rem .06rem;
  }
  /* The active line belongs in the item flow. Keeping it absolutely positioned
     above a separately centred icon created a conspicuous empty gap. */
  .mobile-dock-item::before {
    position: static;
    top: auto;
    left: auto;
    width: 26px;
    height: 3px;
    margin: 0 0 .1rem;
    transform: none;
  }
  .mobile-nav-icon {
    display: block;
    width: 17px;
    height: 17px;
  }
  .mobile-dock-label { font-size: .78rem; line-height: 1.05; letter-spacing: -.01em; }
  .mobile-more-sheet { bottom: calc(58px + env(safe-area-inset-bottom)); }
}

@media (max-width: 370px) {
  .mobile-dock-label { font-size: .7rem; }
  .mobile-dock-item { padding-inline: .04rem; }
}
