/* Complete Farm Admin: a warm farm-office look. Light by default, dark when the device asks or the person picks it (data-theme). */
:root {
  --bg: #f6f2e8; --bg2: #efe9da; --surface: #ffffff; --surface2: #fbf8f1; --ink: #1f2a22; --muted: #5c6a60; --line: #e2dccd;
  --brand: #24452f; --brand-ink: #ffffff; --accent: #c98a12; --accent-soft: #f6e7c4; --ok: #2e7d3c; --warn: #b7791f; --wet: #2f6fb0;
  --bar: linear-gradient(180deg, #213d2b, #1a3223); --bar-ink: #f4efe1; --bar-hi: rgba(255, 255, 255, .14);
  --shadow: 0 1px 2px rgba(31, 42, 34, .06), 0 6px 20px rgba(31, 42, 34, .07); --shadow-hi: 0 2px 4px rgba(31, 42, 34, .08), 0 14px 34px rgba(31, 42, 34, .12);
  --hero: url("img/hero-day.jpg"); --hero-pos: 60% 62%; --hero-veil-sm: linear-gradient(180deg, rgba(246, 242, 232, .88) 0%, rgba(246, 242, 232, .8) 60%, rgba(246, 242, 232, .15) 82%, rgba(246, 242, 232, 0) 92%); --hero-ink: #1f2a22; --hero-muted: #44523f; --hero-veil: linear-gradient(90deg, rgba(246, 242, 232, .9) 0%, rgba(246, 242, 232, .72) 38%, rgba(246, 242, 232, .15) 62%, rgba(246, 242, 232, 0) 75%);
  --head: "Plus Jakarta Sans", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; --body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1512; --bg2: #121a16; --surface: #172019; --surface2: #1b261f; --ink: #e8eee7; --muted: #9fb0a3; --line: #27352c;
    --brand: #7cc58a; --brand-ink: #0f1512; --accent: #e8b13a; --accent-soft: #3a3020; --ok: #6cc47c; --warn: #e8b13a; --wet: #6aa8e6;
    --bar: linear-gradient(180deg, #0d1510, #0a110d); --bar-ink: #e8eee7; --bar-hi: rgba(255, 255, 255, .1);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25); --shadow-hi: 0 2px 4px rgba(0, 0, 0, .35), 0 14px 34px rgba(0, 0, 0, .4);
    --hero: url("img/hero-night.jpg"); --hero-pos: 62% 22%; --hero-veil-sm: linear-gradient(180deg, rgba(8, 14, 28, .78) 0%, rgba(8, 14, 28, .66) 60%, rgba(8, 14, 28, .1) 85%, rgba(8, 14, 28, 0) 95%); --hero-ink: #f1f5ef; --hero-muted: #c4d1c6; --hero-veil: linear-gradient(90deg, rgba(8, 14, 28, .8) 0%, rgba(8, 14, 28, .5) 42%, rgba(8, 14, 28, .05) 70%, rgba(8, 14, 28, 0) 80%);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1512; --bg2: #121a16; --surface: #172019; --surface2: #1b261f; --ink: #e8eee7; --muted: #9fb0a3; --line: #27352c;
  --brand: #7cc58a; --brand-ink: #0f1512; --accent: #e8b13a; --accent-soft: #3a3020; --ok: #6cc47c; --warn: #e8b13a; --wet: #6aa8e6;
  --bar: linear-gradient(180deg, #0d1510, #0a110d); --bar-ink: #e8eee7; --bar-hi: rgba(255, 255, 255, .1);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25); --shadow-hi: 0 2px 4px rgba(0, 0, 0, .35), 0 14px 34px rgba(0, 0, 0, .4);
  --hero: url("img/hero-night.jpg"); --hero-pos: 62% 22%; --hero-veil-sm: linear-gradient(180deg, rgba(8, 14, 28, .78) 0%, rgba(8, 14, 28, .66) 60%, rgba(8, 14, 28, .1) 85%, rgba(8, 14, 28, 0) 95%); --hero-ink: #f1f5ef; --hero-muted: #c4d1c6; --hero-veil: linear-gradient(90deg, rgba(8, 14, 28, .8) 0%, rgba(8, 14, 28, .5) 42%, rgba(8, 14, 28, .05) 70%, rgba(8, 14, 28, 0) 80%);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 16px/1.55 var(--body); display: flex; flex-direction: column; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--head); font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
h1 { font-size: clamp(1.9rem, 4.4vw, 2.9rem); font-weight: 800; margin: 6px 0 10px; }
h2 { font-size: 1.3rem; margin: 30px 0 12px; }
a { color: inherit; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---- top bar ---- */
.bar { display: flex; align-items: center; gap: 10px; background: var(--bar); color: var(--bar-ink); padding: 8px 10px; padding-top: max(8px, env(safe-area-inset-top)); flex: none; box-shadow: 0 1px 0 rgba(0, 0, 0, .25); position: relative; z-index: 2; }
.brand, .home { display: flex; align-items: center; gap: 9px; color: inherit; text-decoration: none; font-family: var(--head); font-weight: 600; font-size: 1.1rem; padding: 4px 8px 4px 4px; border-radius: 10px; flex: none; background: none; border: 0; cursor: pointer; }
.brand img, .home img { border-radius: 8px; }
.brand:hover, .home:hover { background: var(--bar-hi); }
.tabs { display: flex; gap: 4px; overflow-x: auto; flex: 1; min-width: 0; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: flex; align-items: center; flex: none; gap: 7px; font: 500 .92rem/1 var(--body); color: inherit; background: transparent; border: 0; border-radius: 10px; padding: 9px 12px; cursor: pointer; white-space: nowrap; position: relative; opacity: .86; }
.tab img { border-radius: 5px; background: #fff; }
.tab:hover { background: var(--bar-hi); opacity: 1; }
.tab.on { background: rgba(255, 255, 255, .16); opacity: 1; }
.tab.on::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 3px; border-radius: 3px; background: var(--c, var(--accent)); }
.acts { display: flex; gap: 6px; flex: none; }
.act { background: var(--bar-hi); color: inherit; border: 0; border-radius: 10px; width: 36px; height: 36px; display: grid; place-items: center; font-size: 1.05rem; cursor: pointer; text-decoration: none; }
.act:hover { background: rgba(255, 255, 255, .22); }
.act[hidden] { display: none; }
.act svg { width: 18px; height: 18px; }
.theme .moon { display: none; }
:root[data-theme="dark"] .theme .sun { display: none; }
:root[data-theme="dark"] .theme .moon { display: block; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .theme .sun { display: none; } :root:not([data-theme="light"]) .theme .moon { display: block; } }

/* tools in a tab */
.sub { display: flex; gap: 6px; padding: 8px 10px; overflow-x: auto; background: var(--surface); border-bottom: 1px solid var(--line); flex: none; scrollbar-width: none; box-shadow: inset 0 3px 0 var(--c, var(--accent)); }
.sub::-webkit-scrollbar { display: none; }
.sub[hidden] { display: none; }
.sub button { font: 500 .88rem/1 var(--body); padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface2); color: var(--ink); cursor: pointer; white-space: nowrap; }
.sub button:hover { border-color: var(--c, var(--accent)); }
.sub button.on { background: var(--c, var(--brand)); border-color: var(--c, var(--brand)); color: #fff; }

main { flex: 1; min-height: 0; position: relative; }
#frames, .frame { position: absolute; inset: 0; }
#frames { pointer-events: none; }
.frame { display: flex; flex-direction: column; pointer-events: auto; background: var(--bg); }
.frame[hidden] { display: none; }
.frame iframe { flex: 1; width: 100%; border: 0; background: #fff; }
.home-page { height: 100%; overflow-y: auto; background: var(--bg); }
.home-page[hidden] { display: none; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 18px 40px; }

/* ---- hero ---- */
.hero { position: relative; background: var(--hero) var(--hero-pos) / cover no-repeat, var(--bg2); color: var(--hero-ink); min-height: 420px; display: flex; align-items: center; }
.hero::before { content: ""; position: absolute; inset: 0; background: var(--hero-veil); }
.hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 40px; background: linear-gradient(180deg, transparent, var(--bg)); }
.hero .in { position: relative; z-index: 1; max-width: 1120px; width: 100%; margin: 0 auto; padding: 44px 18px 70px; }
.kicker { display: inline-flex; align-items: center; gap: 8px; font: 600 .78rem/1 var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--hero-ink); background: rgba(255, 255, 255, .55); border: 1px solid rgba(0, 0, 0, .06); padding: 7px 11px; border-radius: 999px; backdrop-filter: blur(4px); }
:root[data-theme="dark"] .kicker { background: rgba(0, 0, 0, .3); border-color: rgba(255, 255, 255, .12); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .kicker { background: rgba(0, 0, 0, .3); border-color: rgba(255, 255, 255, .12); } }
.hero h1 { max-width: 620px; margin-top: 14px; }
.hero .lead { color: var(--hero-muted); max-width: 560px; font-size: 1.06rem; margin: 0 0 20px; }
.hero .go { display: flex; flex-wrap: wrap; gap: 10px; }
.facts { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 20px; font-size: .88rem; color: var(--hero-muted); list-style: none; padding: 0; }
.facts li::before { content: "✓"; color: var(--ok); font-weight: 700; margin-right: 6px; }

/* ---- buttons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 600 .95rem/1 var(--body); padding: 12px 18px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none; transition: transform .12s, box-shadow .12s, background .12s; }
.btn:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.gold { background: var(--accent); border-color: var(--accent); color: #1f1a0e; }
a.btn { display: inline-flex; }
.link { background: none; border: 0; padding: 0; color: inherit; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; font: inherit; }

/* ---- the tab cards ---- */
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 6px 0 14px; }
.section-head h2 { margin: 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.card { display: flex; flex-direction: column; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; box-shadow: var(--shadow); position: relative; overflow: hidden; transition: box-shadow .15s, transform .15s, border-color .15s; }
.card::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 4px; background: var(--c); }
.card:hover { box-shadow: var(--shadow-hi); transform: translateY(-2px); border-color: color-mix(in srgb, var(--c) 40%, var(--line)); }
.card-go { display: flex; gap: 14px; align-items: flex-start; text-align: left; font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.card-go img { flex: none; border-radius: 12px; background: #fff; padding: 4px; box-shadow: 0 0 0 1px var(--line); }
.card-go strong { display: block; font-family: var(--head); font-weight: 600; font-size: 1.2rem; margin-bottom: 2px; }
.card-go small { display: block; color: var(--muted); font-size: .9rem; line-height: 1.45; }
.card-subs { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font: 500 .8rem/1 var(--body); padding: 7px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface2); color: var(--ink); cursor: pointer; }
.chip:hover { border-color: var(--c); color: var(--c); }
:root[data-theme="dark"] .chip:hover { color: var(--ink); }

/* ---- panels: weather, account, the farm's details ---- */
.duo { display: grid; grid-template-columns: 1.8fr 1fr; gap: 16px; margin-top: 26px; }
@media (max-width: 980px) { .duo { grid-template-columns: 1fr; } }
.solo-panel { margin-top: 26px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 6px 20px 18px; box-shadow: var(--shadow); min-width: 0; }
.panel h2 { margin: 16px 0 10px; font-size: 1.2rem; display: flex; align-items: center; gap: 10px; }
.panel h2 .ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); font-size: 1rem; }
.panel .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.panel .row input, .fld input { font: inherit; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface2); color: var(--ink); width: 100%; }
.panel .row input { flex: 1 1 220px; width: auto; }
.panel input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent); }
.panel-wide { margin-top: 16px; }
.conflicts { border-left: 4px solid var(--accent); padding: 4px 14px; margin: 12px 0; background: var(--accent-soft); border-radius: 10px; }
.conflicts[hidden] { display: none; }
.grp { border: 0; padding: 0; margin: 18px 0 0; min-width: 0; }
.grp legend { font: 600 .78rem/1 var(--body); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 0; margin-bottom: 10px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px 14px; }
.fld { display: block; }
.fld span { display: block; font-size: .85rem; font-weight: 500; color: var(--muted); margin-bottom: 4px; }
.ticks { display: flex; flex-wrap: wrap; gap: 8px; }
.tick { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface2); cursor: pointer; font-size: .92rem; }
.tick:has(input:checked) { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, var(--surface)); }
.tick input { accent-color: var(--brand); margin: 0; }

/* weather */
.wxsrc { display: inline-flex; gap: 2px; padding: 3px; margin: 0 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface2); }
.wxsrc button { border: 0; background: none; color: var(--muted); font: 600 .82rem/1 var(--body); padding: 7px 12px; border-radius: 999px; cursor: pointer; }
.wxsrc button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.wxsrc button:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.days { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.day { border: 1px solid var(--line); border-radius: 12px; padding: 10px 11px; display: flex; flex-direction: column; gap: 2px; font-size: .84rem; background: var(--surface2); position: relative; overflow: hidden; }
.day::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--muted); }
.day strong { font-size: .95rem; }
.day em { font-style: normal; font-weight: 600; margin-top: 4px; font-size: .82rem; }
.day.good::before { background: var(--ok); } .day.good em { color: var(--ok); }
.day.windy::before { background: var(--warn); } .day.windy em { color: var(--warn); }
.day.wet::before { background: var(--wet); } .day.wet em { color: var(--wet); }

.note { margin-top: 28px; }

/* ---- footer and the plain pages ---- */
.foot { background: var(--bg2); border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
.foot > * { max-width: 1120px; margin-left: auto; margin-right: auto; padding-left: 18px; padding-right: 18px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 6px 20px; padding-top: 22px; margin-bottom: 8px; }
.foot nav a { text-decoration: none; font-weight: 500; color: var(--ink); }
.foot nav a:hover { text-decoration: underline; }
.foot p { margin: 0; padding-bottom: 28px; }
.page { overflow-y: auto; }
.page .wrap { padding-top: 28px; }
.prose { max-width: 780px; }
.prose li { margin-bottom: 8px; }
.prose .lead { color: var(--muted); font-size: 1.05rem; }
.tool { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 4px 20px 16px; margin-top: 16px; box-shadow: var(--shadow); }
.tool h2 { display: flex; align-items: center; gap: 12px; font-size: 1.25rem; }
.tool h2 img { border-radius: 8px; background: #fff; }
.go { display: flex; flex-wrap: wrap; gap: 10px; }
.prose a.btn.primary { color: var(--brand-ink); }

@media (max-width: 640px) {
  .brand span, .home span { display: none; }
  .tab span { display: none; }
  .tab.on span { display: inline; }
  .hero { min-height: 300px; }
  .hero .in { padding: 30px 16px 120px; }
  .hero::before { background: var(--hero-veil-sm); }
  .panel { padding: 4px 14px 14px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media (max-width: 1240px) { .bar .brand span { display: none; } }
/* phones: every tab in a row of its own under the name, each with its picture and a short name */
.tab .s { display: none; }
@media (max-width: 640px) {
  .bar { flex-wrap: wrap; row-gap: 6px; padding-bottom: 4px; }
  .bar .brand span { display: inline; font-size: 1rem; }
  .brand { flex: 1; min-width: 0; }
  .tabs { order: 3; flex-basis: 100%; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 1px; overflow: visible; }
  .tab { flex-direction: column; justify-content: center; gap: 4px; padding: 7px 0 8px; min-height: 52px; font: 600 .56rem/1 var(--body); letter-spacing: -.03em; border-radius: 9px; }
  .tab span, .tab.on span { display: none; }
  .tab .s, .tab.on .s { display: block; max-width: 100%; overflow: hidden; text-overflow: clip; white-space: nowrap; }
  .tab img { width: 22px; height: 22px; }
  .tab.on::after { left: 10px; right: 10px; bottom: 1px; }
  .chip { padding: 10px 14px; font-size: .86rem; }
}

/* the test copy says so next to the logo */
.test-site .bar .brand::after, .test-site .bar .home::after { content: "Test"; margin-left: 6px; font: 700 .7rem/1 var(--body); padding: 3px 6px; border-radius: 6px; background: #e0a526; color: #1a1a1a; }
