:root{--bg: #f6f4ee;--surface: #ffffff;--text: #1f2a22;--muted: #6b7468;--line: #e3e0d6;--brand: #2f6b3f;--brand-soft: #e3efe5;--warn: #a8670b;--warn-soft: #fbefd9;--bad: #b3261e;--bad-soft: #fbe3e1;--good: #2f6b3f;--female: #8a3f74;--female-soft: #f6e6f1;--male: #2c5d8f;--male-soft: #e3edf7;--radius: 14px;color-scheme:light}@media(prefers-color-scheme:dark){:root:not([data-theme=light]){--bg: #141814;--surface: #1d231e;--text: #e8ece6;--muted: #9aa496;--line: #2e362f;--brand: #6fbf83;--brand-soft: #22382a;--warn: #e5a94a;--warn-soft: #3a2e17;--bad: #f08c84;--bad-soft: #3d1f1d;--good: #6fbf83;--female: #e29ccc;--female-soft: #3a2433;--male: #8fbbe8;--male-soft: #1f2e3d;color-scheme:dark}}*{box-sizing:border-box}html,body{margin:0;background:var(--bg);color:var(--text);font-family:system-ui,-apple-system,Segoe UI,Noto Sans Arabic,Tahoma,sans-serif;font-size:16px;line-height:1.5;-webkit-tap-highlight-color:transparent}a{color:var(--brand);text-decoration:none}.page{max-width:720px;margin:0 auto;padding:12px 16px calc(96px + env(safe-area-inset-bottom));display:flex;flex-direction:column;gap:12px}.page-header{display:flex;align-items:center;gap:8px;min-height:48px}.page-header h1{font-size:1.35rem;margin:0;flex:1}.back{font-size:2rem;line-height:1;padding:0 6px;transform:scaleX(-1)}.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:14px}.card-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}.card h2{font-size:1.05rem;margin:0}.stats{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:8px}.stat{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:12px}.card .stat{background:var(--bg);border:none}.stat-value{font-size:1.4rem;font-weight:700}.stat.good .stat-value{color:var(--good)}.stat.bad .stat-value{color:var(--bad)}.stat-label{color:var(--muted);font-size:.9rem}.stat-sub{color:var(--muted);font-size:.78rem}.list{list-style:none;margin:0;padding:0}.list li{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px 0;border-bottom:1px solid var(--line)}.list li:last-child{border-bottom:none}.list li.stack{flex-direction:column;align-items:stretch}.list li>a,.list li>div,.row-btn{flex:1;display:flex;flex-direction:column;color:inherit;min-width:0}.row-btn{flex-direction:row;align-items:center;justify-content:space-between;background:none;border:none;padding:0;font:inherit;text-align:start;cursor:pointer}.row-btn>div{display:flex;flex-direction:column}.list small{color:var(--muted)}.list.animals li>a{flex-direction:row;align-items:center;gap:12px}.list.animals li>a>div{display:flex;flex-direction:column;flex:1}.tag{display:inline-flex;align-items:center;justify-content:center;min-width:52px;padding:6px 10px;border-radius:10px;font-weight:700;font-variant-numeric:tabular-nums}.tag.f{background:var(--female-soft);color:var(--female)}.tag.m{background:var(--male-soft);color:var(--male)}.badge{display:inline-block;padding:2px 10px;border-radius:999px;font-size:.8rem;background:var(--brand-soft);color:var(--brand);white-space:nowrap}.badge.warn{background:var(--warn-soft);color:var(--warn)}.badge.bad{background:var(--bad-soft);color:var(--bad)}.badge.muted{background:var(--line);color:var(--muted)}.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:44px;padding:8px 16px;border-radius:12px;border:1px solid var(--line);background:var(--surface);color:var(--text);font:inherit;font-weight:600;cursor:pointer}.btn.primary{background:var(--brand);border-color:var(--brand);color:#fff}@media(prefers-color-scheme:dark){.btn.primary{color:#10210f}}.btn.ghost{background:transparent}.btn.danger{color:var(--bad);border-color:var(--bad-soft)}.btn.small{min-height:34px;padding:4px 12px;font-size:.85rem}.btn.block{width:100%}.btn:disabled{opacity:.5;cursor:default}.icon-btn{background:none;border:none;font-size:1.1rem;min-width:40px;min-height:40px;cursor:pointer;color:var(--muted)}.row{display:flex;gap:8px;align-items:flex-end}.row>*{min-width:0}.row>.field,.row>input,.row>select,.grow{flex:1}.row.wrap{flex-wrap:wrap;align-items:center}.row.center{justify-content:center}.form{display:flex;flex-direction:column;gap:12px}.field{display:flex;flex-direction:column;gap:4px}.field-label{font-weight:600;font-size:.92rem}.field-hint{color:var(--muted);font-size:.8rem}input,select,textarea{width:100%;min-height:44px;padding:8px 12px;border-radius:10px;border:1px solid var(--line);background:var(--surface);color:var(--text);font:inherit}input[type=checkbox]{width:auto;min-height:0}input:focus,select:focus,textarea:focus{outline:2px solid var(--brand);outline-offset:1px}.segmented{display:flex;gap:4px;background:var(--line);border-radius:12px;padding:4px}.segmented.wrap{flex-wrap:wrap}.segmented button{flex:1;min-height:38px;border:none;border-radius:9px;background:transparent;color:var(--text);font:inherit;cursor:pointer;white-space:nowrap;padding:0 10px}.segmented button.on{background:var(--surface);font-weight:700;box-shadow:0 1px 2px #0000001f}.filters,.picker{display:flex;flex-direction:column;gap:8px}.picker-list{display:flex;flex-wrap:wrap;gap:6px;max-height:240px;overflow-y:auto;padding:2px}.chip{display:inline-flex;align-items:center;gap:6px;padding:6px 10px;border-radius:10px;border:1px solid var(--line);cursor:pointer;font-weight:600}.chip small{color:var(--muted);font-weight:400}.chip.on{background:var(--brand-soft);border-color:var(--brand)}.facts{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:10px}.fact{display:flex;flex-direction:column}.fact span{color:var(--muted);font-size:.82rem}.notes{margin:10px 0 0;white-space:pre-wrap}.actions-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}.highlight{background:var(--brand-soft);color:var(--brand);padding:8px 12px;border-radius:10px;margin:0 0 8px}.muted{color:var(--muted);margin:0}.error,.bad-text{color:var(--bad)}.error{margin:0;background:var(--bad-soft);padding:8px 12px;border-radius:10px}.warn-text{color:var(--warn);margin:8px 0 0}.notice{background:var(--brand-soft);color:var(--brand);padding:10px 14px;border-radius:12px;margin:0}.empty{text-align:center;padding:32px 16px;color:var(--muted)}.empty .big{font-size:1.3rem;color:var(--text);font-weight:700}.bars{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px}.bars li{display:grid;grid-template-columns:96px 1fr auto;align-items:center;gap:8px;font-size:.9rem}.bar{height:10px;background:var(--line);border-radius:999px;overflow:hidden}.bar>div{height:100%;background:var(--brand);border-radius:999px}.import-preview{margin-top:12px;display:flex;flex-direction:column;gap:8px}.errors{margin:0;padding-inline-start:20px;color:var(--bad);font-size:.88rem}.sheet-backdrop{position:fixed;inset:0;background:#0006;display:flex;align-items:flex-end;justify-content:center;z-index:20}.sheet{background:var(--bg);width:100%;max-width:720px;max-height:92vh;overflow-y:auto;border-radius:20px 20px 0 0;padding:12px 16px calc(20px + env(safe-area-inset-bottom))}.sheet-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}.sheet-head h2{margin:0;font-size:1.15rem}.tabbar{position:fixed;bottom:0;inset-inline:0;display:grid;grid-template-columns:repeat(6,1fr);background:var(--surface);border-top:1px solid var(--line);padding-bottom:env(safe-area-inset-bottom);z-index:10}.tabbar a{display:flex;flex-direction:column;align-items:center;gap:2px;padding:8px 0;font-size:.72rem;color:var(--muted)}.tabbar a span{font-size:1.2rem}.tabbar a.on{color:var(--brand);font-weight:700}.page-actions{display:flex;gap:6px}.mono{font-variant-numeric:tabular-nums;direction:ltr;unicode-bidi:isolate}.scan-input{min-height:56px;font-size:1.15rem;border:2px solid var(--brand);text-align:center}.big-number{font-size:1.5rem;font-weight:700;text-align:center;margin:4px 0 12px}.scan-animal{display:flex;align-items:center;gap:12px;margin-bottom:12px}.scan-animal>div{display:flex;flex-direction:column;flex:1}.scan-animal small{color:var(--muted)}.tag.big{font-size:1.6rem;min-width:88px;padding:10px 14px}.live-weight{display:flex;align-items:baseline;justify-content:space-between;background:var(--surface);border:2px solid var(--line);border-radius:var(--radius);padding:10px 16px}.live-weight span{font-size:2rem;font-weight:800;font-variant-numeric:tabular-nums}.live-weight small{color:var(--muted)}.live-weight.stable{border-color:var(--brand)}.live-weight.stable small{color:var(--brand);font-weight:700}.device{padding:8px 0;border-bottom:1px solid var(--line);display:flex;flex-direction:column;gap:6px}.device-head{display:flex;align-items:center;justify-content:space-between;gap:8px}.device-help{display:flex;flex-direction:column;gap:8px;margin-top:10px}.device-help .row{align-items:center}.link-existing{margin-top:12px}.link-existing summary{cursor:pointer;color:var(--brand);margin-bottom:8px}.auth-page{max-width:420px;padding-top:48px;text-align:center}.auth-page .form{text-align:start}.auth-logo{width:88px;height:88px;margin:0 auto}.auth-page h1{margin:0}.user-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:6px}.user-head>div{display:flex;flex-direction:column}.user-head small{color:var(--muted)}.check{display:flex;align-items:center;gap:8px;font-weight:600}.invite{white-space:pre-wrap;background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:12px;margin:0;font-family:inherit;text-align:start}.user-facts{list-style:none;margin:0 0 10px;padding:0;color:var(--muted);font-size:.9rem}.install{display:flex;gap:12px;align-items:flex-start;text-align:start}.install-icon{width:56px;height:56px;border-radius:13px;flex-shrink:0}.install-body{display:flex;flex-direction:column;gap:8px;flex:1}.install-body p{margin:0}.steps{margin:0;padding-inline-start:20px;display:flex;flex-direction:column;gap:4px}.inline-icon{width:20px;height:20px;vertical-align:-4px;color:#0a84ff}.small-text{font-size:.82rem}.qr{display:block;border-radius:8px;background:#fff}.share-url{text-align:center;word-break:break-all;margin:0 0 8px}.share-qr{display:flex;justify-content:center;margin-bottom:10px}
