/* App shell additions that the artifact didn't need: sign-in, no-farm screen, account button, roles. */
body.booting #shell, body.booting .gate { visibility: hidden; }

.gate[hidden], #shell[hidden] { display: none !important; }
.gate { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; box-sizing: border-box; }
.gate-card { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 12px; text-align: center; padding: 28px 24px; }
.gate-card h1 { font-family: Fraunces, Georgia, serif; font-weight: 600; font-size: 1.7rem; }
.gate-card .sub { color: var(--muted); margin: 0; }
.gate-icon { align-self: center; border-radius: 16px; }
.gate-form { display: flex; flex-direction: column; gap: 8px; text-align: left; margin-top: 6px; }
.gate-form label { font-size: 14px; font-weight: 600; }
.gate-form input { min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); font-size: 16px; }
.gate-form .btn, .gate-card > .btn { min-height: 44px; justify-content: center; }
.gate-or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.gate-or::before, .gate-or::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* Only owners see farm settings; viewers see no editing controls (rules enforce both). */
body.not-owner .needs-owner { display: none !important; }

.farm-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.farm-list button { width: 100%; text-align: left; min-height: 44px; }
.farm-list .on { border-color: var(--accent); font-weight: 600; }
.placeholder-view { padding: 48px 16px; text-align: center; color: var(--muted); }

/* No logo uploaded yet: hide the logo box rather than show a solid block. */
.no-logo .brand-logo { display: none; }
/* Quick-add bars stay hidden until a module adds buttons to them. */
.mobile-bar:empty { display: none !important; }

/* Admin page */
.admin-sec { margin-bottom: 14px; display: flex; flex-direction: column; gap: 10px; }
.admin-sec h3 { font-family: Fraunces, Georgia, serif; font-size: 1.2rem; }
.admin-slot { border-top: 1px solid var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.admin-slot h4 { margin: 0; font-size: 14px; }
.admin-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.admin-thumb { margin: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--panel); }
.admin-thumb img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--line); }
.admin-thumb figcaption { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 12px; padding: 4px 4px 4px 8px; color: var(--muted); }
.admin-upload { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.admin-upload input[type=text], .admin-upload input:not([type]) { flex: 1 1 180px; min-height: 40px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }

/* Uploaded logo as an image (instead of the two-tone mask used by imported logos) */
.logo-img .brand-logo > span { display: none; }
.brand-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* Farm settings */
.set-sec { margin-bottom: 14px; display: flex; flex-direction: column; gap: 10px; }
.set-sec h3 { font-family: Fraunces, Georgia, serif; font-size: 1.2rem; }
.set-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; }
.set-mods { display: grid; gap: 8px; }
.set-mods .check-row { align-items: flex-start; }
.set-mods small { display: block; color: var(--muted); font-weight: 400; }
.set-imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.set-img { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; }
.set-img .pv { aspect-ratio: 16 / 9; background: var(--deep) center / cover no-repeat; }
.set-img .pv.logo { background-color: var(--panel); background-size: contain; }
.set-img .meta { padding: 6px 8px; font-size: 12px; display: flex; flex-direction: column; gap: 6px; }
.set-img .meta b { font-size: 13px; }
.set-img .acts { display: flex; gap: 6px; flex-wrap: wrap; }
.set-lists textarea { min-height: 110px; }
.set-mods input[type=checkbox] { flex: none; width: 22px; height: 22px; margin-top: 2px; }

/* People */
.people-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.person { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.person:last-child { border-bottom: 0; }
.person .avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 600; flex: none; }
.person-name { flex: 1 1 140px; display: flex; flex-direction: column; min-width: 0; }
.person-name small { color: var(--muted); font-size: 12px; }
.person select { min-height: 40px; }
.link-pick { display: flex; gap: 8px; align-items: center; }
.link-pick select { max-width: 170px; font-size: 14px; }

/* Sign-up steps */
.ob-card { text-align: left; max-width: 520px; }
.ob-card h1 { text-align: left; }
.ob-step { margin: 0; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.ob-bar { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.ob-bar span { display: block; height: 100%; background: var(--accent); }
.ob-fields { display: flex; flex-direction: column; gap: 10px; }
.ob-fields .gate-form { margin-top: 0; }
.ob-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 4px; }
.ob-actions .btn { min-height: 44px; }
.ob-mods { max-height: 50dvh; overflow: auto; padding-right: 4px; }
.ob-inv-row { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: end; }
.ob-inv-row select { min-height: 44px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); padding: 0 8px; }
.ob-inv-row .btn { min-height: 44px; }
@media (max-width: 420px) { .ob-inv-row { grid-template-columns: 1fr 1fr; } .ob-inv-row .gate-form:first-child { grid-column: 1 / -1; } }
.ob-look { flex-direction: row; flex-wrap: wrap; }
.ob-look .btn { min-height: 44px; }
.ob-look .sec-note { flex-basis: 100%; }
.ob-wrap { width: 100%; max-width: 520px; display: flex; flex-direction: column; gap: 8px; }
.ob-foot { text-align: center; margin: 0; }
.ob-terms { margin: 4px 0 0; text-align: left; }

/* About, Privacy, Terms */
#signin { align-content: center; gap: 14px; }
.legal-links { margin: 0; text-align: center; font-size: 14px; color: var(--muted); }
.legal-links a, .ob-terms a, .terms-note a, .acct-legal a { color: var(--accent-ink, var(--accent)); font-weight: 600; }
.legal-screen { min-height: 100dvh; padding: 12px 16px 32px; box-sizing: border-box; background: var(--bg); }
.legal-screen[hidden] { display: none !important; }
.legal-wrap { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.legal-back { align-self: flex-start; min-height: 44px; font-size: 15px; }
.legal { padding: 20px 18px; line-height: 1.6; overflow-wrap: anywhere; }
.legal h2 { font-family: Fraunces, Georgia, serif; font-weight: 600; font-size: 1.6rem; margin: 0 0 12px; line-height: 1.25; }
.legal h3 { font-family: Fraunces, Georgia, serif; font-weight: 600; font-size: 1.2rem; margin: 22px 0 6px; }
.legal h2:focus { outline: none; }
.legal p { margin: 0 0 12px; }
.legal ul { margin: 0 0 14px; padding-left: 22px; }
.legal li { margin-bottom: 6px; }
.legal a { color: var(--accent); }

/* One-time terms notice for people who joined before the terms existed */
.terms-note { display: flex; gap: 12px; align-items: center; justify-content: space-between; margin: 8px auto 0; max-width: 1148px;
  padding: 10px 14px; border-radius: 10px; font-size: 14px; background: color-mix(in srgb, var(--accent) 10%, var(--panel)); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.terms-note p { margin: 0; }
.terms-note .btn { flex: none; min-height: 40px; }
@media (max-width: 700px) { .terms-note { margin: 8px 12px 0; } }

/* Account sheet: help and info */
.acct-h { margin: 18px 0 8px; }
.acct-help { display: flex; flex-direction: column; gap: 8px; }
.acct-help .btn { justify-content: center; min-height: 44px; text-align: center; }
.acct-legal { text-align: center; font-size: 14px; color: var(--muted); padding-top: 4px; }

/* Feedback */
.fb-head { display: flex; flex-direction: column; gap: 6px; }
.fb-head .sec-note { margin: 0; }
.fb-answer textarea { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: var(--panel); color: var(--fg); font: inherit; font-size: 16px; }
.fb-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.fb-item { display: flex; flex-direction: column; gap: 6px; }
.fb-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); }
.fb-title { margin: 0; font-size: 1.05rem; overflow-wrap: anywhere; }
.fb-body { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.fb-note { margin: 0; padding: 8px 10px; border-radius: 8px; background: color-mix(in srgb, var(--accent) 8%, var(--panel)); white-space: pre-wrap; }
.fb-status { flex: none; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--fg); }
.fb-planned { background: color-mix(in srgb, var(--accent-2) 30%, var(--panel)); }
.fb-done { background: color-mix(in srgb, #2E7D4F 25%, var(--panel)); }
.fb-notnow { color: var(--muted); }
.fb-shot-row { flex-direction: row !important; align-items: center; gap: 10px; flex-wrap: wrap; }
.fb-shot img { display: block; max-width: 100%; max-height: 220px; border-radius: 8px; border: 1px solid var(--line); }
.fb-admin-list { display: flex; flex-direction: column; gap: 10px; }
.fb-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.fb-filters select { min-height: 40px; }
.fb-answer { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: start; }
.fb-answer select { min-height: 40px; }
.fb-answer textarea { min-height: 40px; width: 100%; box-sizing: border-box; }
@media (max-width: 560px) { .fb-answer { grid-template-columns: 1fr auto; } .fb-answer textarea { grid-column: 1 / -1; grid-row: 2; } }
.adm-tabs { display: flex; gap: 8px; }
.adm-tabs .chip { text-decoration: none; color: var(--fg); min-height: 40px; display: inline-flex; align-items: center; padding: 6px 16px; }
.adm-tabs .chip.on { color: #fff; }
[data-view=admin] #adm-platform { display: flex; flex-direction: column; }
[data-view=admin] #adm-platform[hidden], #adm-feedback[hidden] { display: none; }

/* Admin: All farms */
.adm-farm-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.adm-farm-tools input { flex: 1 1 200px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); font-size: 16px; }
.adm-farm-tools select { min-height: 44px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); font-size: 15px; }
.adm-farm-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.adm-farm { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--panel); }
.adm-farm-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.adm-farm-top h4 { margin: 0; font-size: 16px; }
.adm-farm-top .sec-note { margin: 2px 0 0; }
.adm-farm-top .btn { flex: none; min-height: 40px; }
.adm-farm-meta { display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; margin: 8px 0 0; font-size: 14px; }
.adm-farm-meta dt { color: var(--muted); }
.adm-farm-meta dd { margin: 0; overflow-wrap: anywhere; }

/* Admin view of a farm: a bar inside the sticky top nav, so it stays on screen */
.admin-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between;
  padding: 6px 14px; font-size: 14px; font-weight: 600; background: var(--deep); color: #fff; }
.admin-bar.viewing { padding: 8px 14px; }
.admin-bar.editing { background: var(--bad); }
.admin-bar p { margin: 0; }
.admin-bar .bar-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-bar .btn { min-height: 36px; background: #fff; color: var(--fg); border-color: transparent; }

/* Farm settings: support changes */
.support-log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.support-log li { border-top: 1px solid var(--line); padding-top: 6px; }
.support-log .sec-note { display: block; }
