:root { color-scheme: light; --green:#217a4b; --green-dark:#165c38; --bg:#f3f6f4; --card:#fff; --text:#17211b; --muted:#637068; --border:#d7dfda; --danger:#9f2929; --warning:#a76700; }
* { box-sizing:border-box; }
body { margin:0; font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; background:var(--bg); color:var(--text); }
a { color:var(--green-dark); }
.shell { width:min(1120px, calc(100% - 28px)); margin:0 auto; }
.topbar { background:#fff; border-bottom:1px solid var(--border); position:sticky; top:0; z-index:10; }
.topbar-inner { min-height:64px; display:flex; align-items:center; gap:22px; }
.brand { font-weight:800; font-size:1.05rem; text-decoration:none; color:var(--text); white-space:nowrap; }
.main-nav { display:flex; gap:4px; flex:1; }
.main-nav a { padding:9px 11px; border-radius:7px; text-decoration:none; color:var(--muted); font-weight:650; }
.main-nav a.active,.main-nav a:hover { background:#edf4ef; color:var(--green-dark); }
.nav-user { color:var(--muted); font-size:.92rem; display:flex; align-items:center; gap:12px; }
.nav-user form { margin:0; }
main { padding:24px 0 48px; }
.card { background:var(--card); border:1px solid var(--border); border-radius:12px; padding:22px; box-shadow:0 2px 8px rgba(20,40,28,.04); }
.auth-wrap { width:min(430px, calc(100% - 28px)); margin:8vh auto; }
h1 { margin:0 0 8px; font-size:1.65rem; }
h2 { margin-top:0; }
p { line-height:1.55; }
.muted { color:var(--muted); }
label { display:block; font-weight:650; margin:14px 0 6px; }
input,select,textarea { width:100%; padding:11px 12px; border:1px solid #bfcac3; border-radius:8px; font-size:16px; font-family:inherit; background:#fff; }
textarea { min-height:104px; resize:vertical; line-height:1.45; }
button,.button { appearance:none; display:inline-block; border:0; border-radius:8px; background:var(--green); color:#fff; padding:11px 16px; font-weight:700; cursor:pointer; text-decoration:none; font-size:.95rem; }
button:hover,.button:hover { background:var(--green-dark); }
.button.secondary { background:#e7eee9; color:var(--text); }
.button.danger { background:var(--danger); }
.button.small { padding:8px 11px; font-size:.86rem; }
.error { background:#fdeaea; color:#781b1b; border:1px solid #eabcbc; padding:11px 12px; border-radius:8px; margin:12px 0; }
.success { background:#e7f6ec; color:#175a34; border:1px solid #b8dfc6; padding:11px 12px; border-radius:8px; margin:12px 0; }
.notice { background:#fff7df; color:#6a4700; border:1px solid #ead394; padding:11px 12px; border-radius:8px; margin:12px 0; }
.grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(210px,1fr)); gap:16px; margin-top:18px; }
.stat { background:#fff; border:1px solid var(--border); border-radius:10px; padding:18px; }
.stat strong { display:block; font-size:1.8rem; margin-top:4px; }
.actions { display:flex; flex-wrap:wrap; gap:10px; margin-top:18px; align-items:center; }
.toolbar { display:flex; gap:10px; align-items:end; flex-wrap:wrap; margin:18px 0; }
.toolbar .field { flex:1 1 180px; }
.toolbar label { margin-top:0; }
.code { font-family:ui-monospace,SFMono-Regular,Menlo,monospace; background:#eef2ef; padding:2px 5px; border-radius:4px; }
.checklist { padding-left:20px; line-height:1.7; }
.plant-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(255px,1fr)); gap:16px; }
.plant-card { display:block; background:#fff; border:1px solid var(--border); border-radius:11px; overflow:hidden; text-decoration:none; color:var(--text); transition:transform .08s,box-shadow .08s; }
.plant-card:hover { transform:translateY(-1px); box-shadow:0 5px 14px rgba(20,40,28,.09); }
.plant-photo { width:100%; height:145px; object-fit:cover; display:block; background:#e8ede9; }
.photo-placeholder { height:145px; display:flex; align-items:center; justify-content:center; color:var(--muted); background:#e8ede9; }
.plant-card-body { padding:14px; }
.plant-name { font-size:1.05rem; font-weight:750; margin-bottom:3px; }
.plant-species { color:var(--muted); font-size:.88rem; min-height:2.3em; }
.meta-row { display:flex; justify-content:space-between; gap:10px; align-items:center; margin-top:12px; }
.badge { display:inline-flex; align-items:center; gap:5px; border-radius:999px; padding:5px 9px; font-size:.78rem; font-weight:750; }
.badge.healthy { background:#dff2e5; color:#195b34; }
.badge.monitor { background:#fff0c7; color:#805400; }
.badge.treatment { background:#f7dddd; color:#792020; }
.badge.inactive { background:#e8e8e8; color:#555; }
.location { color:var(--muted); font-size:.82rem; }
.empty { text-align:center; padding:40px 20px; color:var(--muted); }
.form-grid { display:grid; grid-template-columns:1fr 1fr; gap:0 18px; }
.form-grid .full { grid-column:1 / -1; }
.detail-layout { display:grid; grid-template-columns:minmax(250px,360px) 1fr; gap:22px; }
.detail-photo { width:100%; max-height:350px; object-fit:cover; border-radius:10px; background:#e8ede9; }
.definition-grid { display:grid; grid-template-columns:140px 1fr; gap:10px 14px; margin:18px 0; }
.definition-grid dt { font-weight:700; }
.definition-grid dd { margin:0; white-space:pre-wrap; line-height:1.5; }
.section { margin-top:24px; }
.inline-form { display:inline; }
.pagination { display:flex; gap:8px; align-items:center; justify-content:center; margin-top:22px; }
@media (max-width:760px) {
  .topbar-inner { padding:12px 0; flex-wrap:wrap; gap:8px 14px; }
  .brand { width:100%; }
  .main-nav { order:3; width:100%; }
  .nav-user { margin-left:auto; }
  main { padding-top:16px; }
  .form-grid,.detail-layout { grid-template-columns:1fr; }
  .definition-grid { grid-template-columns:1fr; gap:3px; }
  .definition-grid dd { margin-bottom:12px; }
}

/* v0.2.1 responsive overflow corrections */
html, body { max-width:100%; overflow-x:hidden; }
.shell, .card, .plant-grid, .plant-card, .plant-card-body,
.detail-layout, .detail-layout > *, .definition-grid, .definition-grid > * { min-width:0; }
img { max-width:100%; height:auto; }
.plant-photo { width:100%; height:145px; max-width:100%; object-fit:cover; }
.detail-photo { width:100%; max-width:100%; height:auto; max-height:350px; object-fit:contain; }
.definition-grid dd, .plant-name, .plant-species, .location, p, .muted {
  overflow-wrap:anywhere;
  word-break:break-word;
}
input, select, textarea { max-width:100%; min-width:0; }
pre, code, .code { max-width:100%; overflow-wrap:anywhere; word-break:break-word; white-space:pre-wrap; }
@media (max-width:760px) {
  .shell { width:min(100% - 20px, 1120px); }
  .card { padding:16px; }
  .plant-grid { grid-template-columns:1fr; }
  .plant-photo { height:180px; }
  .detail-photo { max-height:300px; }
  .actions { align-items:stretch; }
  .actions > .button, .actions > button { text-align:center; }
}
