:root{color-scheme:light dark;--bg:#f6f6f5;--surface:#fff;--raised:#f0f0ef;--text:#161616;--muted:#767676;--line:rgba(0,0,0,.07);--glass:rgba(250,250,250,.78);--safe:#348367;--warn:#99712c;--bad:#a35051;--radius:18px;--shadow:0 3px 22px rgba(0,0,0,.035);font-family:-apple-system,BlinkMacSystemFont,"SF Pro Display","SF Pro Text",system-ui,Arial,sans-serif;font-synthesis:none}
@media(prefers-color-scheme:dark){:root{--bg:#090909;--surface:#1a1a1c;--raised:#262628;--text:#f3f3f4;--muted:#a3a3a7;--line:rgba(255,255,255,.085);--glass:rgba(27,27,29,.77);--safe:#6bc2a0;--warn:#d6ac67;--bad:#ed8b8b;--shadow:0 8px 26px rgba(0,0,0,.1)}}
*{box-sizing:border-box}html{background:var(--bg);min-height:100%;-webkit-tap-highlight-color:transparent}body{margin:0;color:var(--text);font-size:15px;line-height:1.4}button,select,input{font:inherit;color:inherit}button{cursor:pointer}button:disabled{opacity:.45;cursor:not-allowed}:focus-visible{outline:2px solid var(--safe);outline-offset:2px}h1,h2,p{margin:0}h1{font-size:29px;letter-spacing:-.85px;font-weight:730;line-height:1.12}h2{font-size:17px;letter-spacing:-.25px;font-weight:650}p{line-height:1.5}.muted{color:var(--muted);font-size:13px;margin-top:5px}.small-muted{color:var(--muted);font-size:12px}
.app{max-width:860px;margin:0 auto;min-height:100dvh;padding:calc(12px + env(safe-area-inset-top)) 17px calc(98px + env(safe-area-inset-bottom));}
.glass{background:var(--glass);-webkit-backdrop-filter:blur(28px) saturate(1.3);backdrop-filter:blur(28px) saturate(1.3);border:1px solid var(--line)}
.header{height:62px;display:flex;justify-content:space-between;align-items:center;border-radius:22px;padding:9px 12px;margin-bottom:31px;box-shadow:var(--shadow)}
.brand{display:flex;align-items:center;gap:11px}.brand-mark{height:35px;width:35px;display:grid;place-items:center;border:1.5px solid var(--text);font-size:17px;font-weight:750;border-radius:50%;letter-spacing:-1px}.brand-name{font-size:17px;font-weight:750;line-height:1.05}.subtitle{font-size:11px;color:var(--muted);margin-top:3px}.icon-button{display:grid;place-items:center;border:0;border-radius:13px;background:var(--raised);min-width:38px;height:38px;font-size:24px;line-height:1}
.section-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 16px}.section-heading:not(:first-child){margin-top:25px}
.metrics{display:grid;grid-template-columns:repeat(3,1fr);gap:9px}.metric{min-height:99px;display:flex;flex-direction:column;justify-content:space-between;padding:15px 12px;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius)}.metric strong{font-size:29px;letter-spacing:-1.2px;font-variant-numeric:tabular-nums}.metric span{color:var(--muted);font-size:12px}.metric.warning strong{color:var(--warn)}
.post-list,.day-shifts{display:flex;flex-direction:column;gap:9px}.post-card,.shift-card,.person-card{border:1px solid var(--line);border-radius:var(--radius);padding:16px;background:var(--surface);box-shadow:var(--shadow)}.post-card header,.shift-card header{display:flex;align-items:start;justify-content:space-between;gap:10px;margin-bottom:10px}.post-card h3,.shift-card h3{font-size:16px;line-height:1.25;margin:0;font-weight:650}.card-description{font-size:13px;color:var(--muted);margin-top:3px;overflow-wrap:anywhere}.status{display:inline-flex;align-items:center;white-space:nowrap;gap:6px;font-size:12px;font-weight:580}.status::before{content:"";height:6px;width:6px;border-radius:50%;background:var(--muted)}.status.active{color:var(--safe)}.status.active::before{background:var(--safe)}.status.pending{color:var(--warn)}.status.pending::before{background:var(--warn)}.status.vacant{color:var(--bad)}.status.vacant::before{background:var(--bad)}.card-row{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:14px;padding:5px 0}.person{font-weight:560}.control{width:100%;display:block;border:1px solid var(--line);background:var(--surface);border-radius:14px;min-height:45px;padding:10px 12px;outline:none}.field-label{display:block;color:var(--muted);font-size:12px;margin:12px 0 7px}.control:focus{border-color:var(--safe)}
.small-button,.outline-button,.primary-button,.text-button{border:0;border-radius:12px;min-height:40px;padding:9px 15px;font-size:13px;font-weight:650}.small-button{background:var(--raised)}.outline-button{background:var(--surface);border:1px solid var(--line);width:100%;margin-top:12px}.primary-button{width:100%;background:var(--text);color:var(--bg);margin-top:15px}.text-button{background:transparent;color:var(--muted)}.button-row{display:flex;flex-wrap:wrap;gap:7px;margin-top:12px}.button-row button{flex:1}
.week-navigation{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:21px 0 14px}.week-navigation strong{font-size:15px;font-variant-numeric:tabular-nums}.days{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:5px}.day{border:1px solid transparent;background:var(--surface);border-radius:14px;min-height:72px;padding:8px 2px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px}.day .weekday{color:var(--muted);font-size:11px}.day strong{font-size:16px;font-weight:600}.day.selected{background:var(--text);color:var(--bg)}.day.selected .weekday{color:var(--bg);opacity:.72}.day-dot{height:5px;width:5px;background:var(--safe);border-radius:50%}.day-dot.alert{background:var(--warn)}.day-dot.empty{background:transparent}
.shift-card{display:block;width:100%;text-align:left}.shift-card .end{font-size:13px;color:var(--muted);font-variant-numeric:tabular-nums}.shift-card .shift-time{font-weight:650;font-variant-numeric:tabular-nums;font-size:15px;margin:6px 0}.shift-card .shift-person{font-size:14px;margin-top:6px}.shift-card .shift-person.empty{color:var(--warn)}
.tabs{position:fixed;bottom:max(12px,env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);display:grid;grid-template-columns:repeat(3,1fr);width:min(440px,calc(100% - 26px));padding:5px;border-radius:22px;box-shadow:0 9px 36px rgba(0,0,0,.15);z-index:20}.tab{border:0;border-radius:17px;min-height:52px;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:1px;background:transparent;color:var(--muted);font-size:11px}.tab.selected{background:var(--raised);color:var(--text);font-weight:670}.tab-symbol{font-size:22px;line-height:1}
.sheet{color:var(--text);border:1px solid var(--line);background:var(--surface);border-radius:26px 26px 0 0;padding:12px 20px calc(22px + env(safe-area-inset-bottom));width:100%;max-width:650px;max-height:min(90dvh,800px);overflow-y:auto;margin:auto auto 0;box-shadow:0 -15px 60px rgba(0,0,0,.16)}.sheet::backdrop{background:rgba(0,0,0,.42);backdrop-filter:blur(4px)}.sheet-bar{height:5px;width:38px;background:var(--muted);opacity:.35;border-radius:4px;margin:0 auto 15px}.sheet-head{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:16px}.sheet h3{font-size:16px;margin:0 0 8px}.sheet .mini-info{font-size:13px;color:var(--muted);margin:8px 0 16px}.form-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:10px}.empty-panel{text-align:center;color:var(--muted);font-size:13px;border:1px dashed var(--line);border-radius:var(--radius);padding:32px 17px}.person-card{display:flex;align-items:center;justify-content:space-between;gap:16px}.person-card .name{font-weight:630}.person-card .phone{color:var(--muted);font-size:12px}.banner{position:fixed;z-index:40;top:calc(17px + env(safe-area-inset-top));left:50%;transform:translateX(-50%);max-width:calc(100% - 32px);width:440px;box-shadow:0 10px 35px rgba(0,0,0,.22);border-radius:16px;background:var(--text);color:var(--bg);padding:13px 16px;font-size:13px}.hidden{display:none!important}
@media (min-width:720px){.app{padding:24px 30px 120px}.header{margin-bottom:40px}.post-list{display:grid;grid-template-columns:repeat(2,1fr)}.metrics{gap:14px}.metric{padding:20px;min-height:112px}.sheet{border-radius:26px;margin:auto}.days{gap:10px}}
@media(prefers-reduced-motion:no-preference){.small-button,.primary-button,.outline-button,.tab,.day{transition:background .15s ease,transform .15s ease}.small-button:active,.day:active,.primary-button:active{transform:scale(.98)}}

/* Telegram theme may differ from system theme; explicit Telegram takes priority. */
:root[data-tg-theme="light"]{color-scheme:light;--bg:#f6f6f5;--surface:#fff;--raised:#f0f0ef;--text:#161616;--muted:#767676;--line:rgba(0,0,0,.07);--glass:rgba(250,250,250,.78);--safe:#348367;--warn:#99712c;--bad:#a35051;--shadow:0 3px 22px rgba(0,0,0,.035)}
:root[data-tg-theme="dark"]{color-scheme:dark;--bg:#090909;--surface:#1a1a1c;--raised:#262628;--text:#f3f3f4;--muted:#a3a3a7;--line:rgba(255,255,255,.085);--glass:rgba(27,27,29,.77);--safe:#6bc2a0;--warn:#d6ac67;--bad:#ed8b8b;--shadow:0 8px 26px rgba(0,0,0,.1)}
