:root{
  --bg:#F4F1ED;--surface:#FFFFFF;--surface-2:#EEEAE5;--ink:#171412;--muted:#7B726A;--line:rgba(23,20,18,.08);
  --accent:#FF6414;--on-accent:#171412;--accent-soft:#FFE7D8;--accent-text:#B8470A;
  --ok:#1D7F46;--ok-soft:#DDF0E3;--warn:#9A5B00;--warn-soft:#FDF0D5;--danger:#B3261E;--danger-soft:#FBE3E1;
  --hero:#171412;--hero-ink:#F7F2EC;--hero-muted:#A69D95;
  --display:"Unbounded","Manrope",system-ui,sans-serif;--body:"Manrope",system-ui,-apple-system,"Segoe UI",sans-serif;
  --ease:cubic-bezier(.23,1,.32,1);--drawer:cubic-bezier(.32,.72,0,1);
  color-scheme:light;
}
:root[data-theme="dark"]{
  --bg:#0F0D0C;--surface:#1B1816;--surface-2:#272320;--ink:#F4EFEA;--muted:#9C938B;--line:rgba(255,255,255,.08);
  --accent:#FF7526;--on-accent:#171412;--accent-soft:#3A1E0E;--accent-text:#FF9F66;
  --ok:#62D18F;--ok-soft:#14301F;--warn:#F2B650;--warn-soft:#352711;--danger:#FF8A80;--danger-soft:#3A1614;
  --hero:#221E1B;--hero-ink:#F4EFEA;--hero-muted:#9C938B;
  color-scheme:dark;
}
*{box-sizing:border-box}
html,body{height:100%;margin:0}
body{background:var(--bg);color:var(--ink);font-family:var(--body);font-size:14px;-webkit-font-smoothing:antialiased;overscroll-behavior:none}
#root{height:100%}
button{font:inherit;color:inherit;background:none;border:0;padding:0;cursor:pointer;-webkit-tap-highlight-color:transparent}
button:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
button:disabled{opacity:.5;cursor:default}
.press{transition:transform 140ms var(--ease)}
.press:active:not(:disabled){transform:scale(.97)}
svg.i{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex:none}
svg.i.s{width:16px;height:16px}

.app{position:relative;height:100%;overflow:hidden}
.scroll{position:absolute;inset:0;overflow-y:auto;padding:calc(12px + env(safe-area-inset-top,0px)) 16px calc(104px + env(safe-area-inset-bottom,0px));scrollbar-width:none}
.scroll::-webkit-scrollbar{display:none}
.screen{display:flex;flex-direction:column;gap:12px;max-width:560px;margin:0 auto}

.hdr{display:flex;align-items:center;gap:12px;padding:4px 2px 6px}
.ava{width:46px;height:46px;border-radius:50%;background:var(--accent);color:var(--on-accent);display:grid;place-items:center;font-family:var(--display);font-weight:700;font-size:15px;flex:none;position:relative;overflow:hidden}
.ava img{width:100%;height:100%;object-fit:cover}
.ava.ring::after{content:"";position:absolute;inset:-3px;border-radius:50%;border:1.5px solid var(--accent);opacity:.35}
.ava.sm{width:38px;height:38px;font-size:12px}
.ava.lg{width:84px;height:84px;font-size:26px}
.ava.muted{background:var(--surface-2);color:var(--muted)}
.hdr-t{flex:1;min-width:0;text-align:left}
.hdr-name{font-weight:700;font-size:17px;line-height:1.2}
.status{display:inline-flex;align-items:center;gap:6px;margin-top:3px;font-family:var(--display);font-weight:500;font-size:12px;color:var(--accent-text)}
.icon-btn{width:42px;height:42px;border-radius:14px;background:var(--surface);display:grid;place-items:center;position:relative}
.h1{font-family:var(--display);font-weight:700;font-size:24px;letter-spacing:-.02em;margin:0;padding:6px 2px 4px}

.card{background:var(--surface);border-radius:24px;padding:16px}
.eyebrow{font-size:11px;letter-spacing:.08em;text-transform:uppercase;font-weight:700;color:var(--muted)}
.row{display:flex;align-items:center;gap:10px}
.sp{flex:1;min-width:0}
.muted{color:var(--muted)}
.small{font-size:12.5px}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;height:44px;padding:0 18px;border-radius:14px;font-weight:700;font-size:14px}
.btn-accent{background:var(--accent);color:var(--on-accent)}
.btn-soft{background:var(--surface-2);color:var(--ink)}
.btn-ghost{background:transparent;border:1.5px solid var(--line);color:var(--ink)}
.btn-danger{background:var(--danger-soft);color:var(--danger)}
.btn-sm{height:34px;padding:0 12px;border-radius:11px;font-size:13px}
.btn-block{width:100%}
.chip{display:inline-flex;align-items:center;gap:5px;font-size:12px;font-weight:600;padding:4px 9px;border-radius:999px;background:var(--surface-2);color:var(--muted);white-space:nowrap}
.chip-accent{background:var(--accent-soft);color:var(--accent-text)}
.chip-ok{background:var(--ok-soft);color:var(--ok)}
.chip-warn{background:var(--warn-soft);color:var(--warn)}
.chip.display{font-family:var(--display);font-weight:500;font-size:11.5px}

.attn{background:var(--surface);border-radius:24px;padding:14px 16px;display:flex;flex-direction:column}
.attn-row{display:flex;align-items:center;gap:12px;padding:9px 0;text-align:left;width:100%}
.attn-row+.attn-row{border-top:1px solid var(--line)}
.num{min-width:26px;height:26px;padding:0 6px;border-radius:9px;background:var(--accent);color:var(--on-accent);font-weight:700;font-size:13px;display:grid;place-items:center;font-variant-numeric:tabular-nums}
.num.zero{background:var(--surface-2);color:var(--muted)}

.cal-h{display:flex;align-items:center;gap:6px;margin-bottom:12px}
.cal-title{font-family:var(--display);font-weight:500;font-size:17px;flex:1}
.grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));row-gap:4px;text-align:center}
.wd{font-size:11px;font-weight:700;color:var(--muted);padding-bottom:4px}
.day{height:40px;display:grid;place-items:center;font-weight:600;font-size:14px;font-variant-numeric:tabular-nums;border-radius:13px}
.day.past{color:var(--muted)}
.day.today{background:var(--ink);color:var(--bg)}
.soon{margin-top:12px;border-top:1px solid var(--line);padding-top:12px;font-size:13px;color:var(--muted);display:flex;gap:8px;align-items:center}

.placeholder{background:var(--surface);border-radius:24px;padding:28px 20px;text-align:center;display:flex;flex-direction:column;align-items:center;gap:10px}
.placeholder .big{width:64px;height:64px;border-radius:22px;background:var(--accent-soft);color:var(--accent-text);display:grid;place-items:center}
.placeholder .big svg{width:30px;height:30px}
.placeholder h2{font-family:var(--display);font-weight:700;font-size:19px;margin:6px 0 0}
.placeholder p{margin:0;color:var(--muted);line-height:1.55;max-width:300px}

.tabbar{position:absolute;left:50%;bottom:calc(18px + env(safe-area-inset-bottom,0px));transform:translateX(-50%);display:flex;gap:4px;padding:6px;border-radius:22px;background:var(--hero);z-index:4}
.tab{height:48px;padding:0 16px;border-radius:17px;display:flex;align-items:center;gap:8px;color:var(--hero-muted);font-weight:700;font-size:13px;transition:background 200ms var(--ease),color 200ms var(--ease)}
.tab .lbl{display:none}
.tab[aria-current="page"]{background:var(--accent);color:var(--on-accent)}
.tab[aria-current="page"] .lbl{display:inline}

.sheet-wrap{position:absolute;inset:0;z-index:10}
.backdrop{position:absolute;inset:0;background:rgba(10,8,7,.45);opacity:0;transition:opacity 260ms ease}
.sheet-wrap.shown .backdrop{opacity:1}
.sheet{position:absolute;left:0;right:0;bottom:0;max-height:calc(100% - 40px - env(safe-area-inset-top,0px));overflow-y:auto;background:var(--bg);border-radius:30px 30px 0 0;padding:10px 18px calc(28px + env(safe-area-inset-bottom,0px));transform:translateY(100%);transition:transform 380ms var(--drawer);scrollbar-width:none;max-width:640px;margin:0 auto}
.sheet.tall{height:calc(100% - 40px - env(safe-area-inset-top,0px))}
.sheet-wrap.shown .sheet{transform:translateY(0)}
.grab{width:40px;height:5px;border-radius:5px;background:var(--muted);opacity:.35;margin:0 auto 14px}
.sheet-h{display:flex;align-items:flex-start;gap:10px;margin-bottom:14px}
.sheet-title{font-family:var(--display);font-weight:700;font-size:21px;line-height:1.25;letter-spacing:-.01em;margin:0;text-wrap:balance}
.close{width:36px;height:36px;border-radius:12px;background:var(--surface-2);display:grid;place-items:center;flex:none}
.close svg{width:16px;height:16px}

.facts{background:var(--surface);border-radius:20px;padding:4px 14px;margin-bottom:12px}
.fact{display:flex;gap:12px;align-items:center;padding:11px 0}
.fact+.fact{border-top:1px solid var(--line)}
.fact>svg{color:var(--accent)}
.fact small{display:block;font-size:11.5px;color:var(--muted);font-weight:600}
.fact .v{font-weight:600;font-size:14px}
.prof{display:flex;flex-direction:column;align-items:center;text-align:center;gap:6px;padding:0 0 16px}
.prof-name{font-family:var(--display);font-weight:700;font-size:20px;margin-top:8px;text-wrap:balance}
.hist{display:flex;gap:6px;flex-wrap:wrap;justify-content:center;margin-top:4px}
.stack{display:flex;flex-direction:column;gap:8px}
.section{margin:18px 2px 8px}

.search{display:flex;align-items:center;gap:8px;background:var(--surface);border-radius:15px;padding:0 12px;height:44px;color:var(--muted)}
.search input{flex:1;border:0;background:transparent;font:inherit;font-size:15px;color:var(--ink);outline:none;min-width:0}
.filters{display:flex;gap:6px;overflow-x:auto;margin:10px -18px 4px;padding:0 18px;scrollbar-width:none}
.filters::-webkit-scrollbar{display:none}
.filter{height:34px;padding:0 13px;border-radius:11px;background:var(--surface);font-weight:700;font-size:13px;color:var(--muted);white-space:nowrap;flex:none}
.filter[aria-pressed="true"]{background:var(--ink);color:var(--bg)}
.list{background:var(--surface);border-radius:20px;padding:2px 12px}
.li{display:flex;align-items:center;gap:12px;padding:10px 0;width:100%;text-align:left}
.li+.li{border-top:1px solid var(--line)}
.li-t{flex:1;min-width:0}
.li-name{font-weight:700;font-size:14.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.li-sub{font-size:12.5px;color:var(--muted);margin-top:1px}
.li-sub.accent{color:var(--accent-text);font-weight:600}
.tg{color:var(--muted)}
.tg.on{color:#2AABEE}
.count{font-size:12px;color:var(--muted);font-weight:600;margin-left:6px;text-transform:none;letter-spacing:0}

.field{display:flex;flex-direction:column;gap:6px}
.field label{font-size:12px;font-weight:700;color:var(--muted)}
.input,select.input{height:46px;border-radius:14px;border:1.5px solid var(--line);background:var(--surface);padding:0 14px;font:inherit;font-size:15px;color:var(--ink);width:100%;appearance:none}
select.input{background-image:linear-gradient(45deg,transparent 50%,var(--muted) 50%),linear-gradient(135deg,var(--muted) 50%,transparent 50%);background-position:calc(100% - 20px) 20px,calc(100% - 15px) 20px;background-size:5px 5px;background-repeat:no-repeat;padding-right:36px}
.input:focus{border-color:var(--accent);outline:none}
.form{display:flex;flex-direction:column;gap:12px}
.two{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.seg{display:flex;background:var(--surface-2);border-radius:14px;padding:4px;gap:2px}
.seg button{flex:1;padding:9px 6px;border-radius:10px;font-weight:700;font-size:13px;color:var(--muted)}
.seg button[aria-pressed="true"]{background:var(--surface);color:var(--ink)}

.app-card{background:var(--surface);border-radius:22px;padding:16px;display:flex;flex-direction:column;gap:12px}
.app-name{font-weight:700;font-size:16px}
.hint{background:var(--accent-soft);color:var(--accent-text);border-radius:14px;padding:10px 12px;font-size:13px;font-weight:600;line-height:1.45}
.actions{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.actions .wide{grid-column:1/-1}

.pos-row{display:flex;align-items:center;gap:10px;padding:8px 0}
.pos-row+.pos-row{border-top:1px solid var(--line)}
.x-btn{width:32px;height:32px;border-radius:10px;background:var(--surface-2);color:var(--muted);display:grid;place-items:center}

.gate{min-height:100%;display:flex;flex-direction:column;justify-content:center;gap:18px;padding:calc(24px + env(safe-area-inset-top,0px)) 20px calc(24px + env(safe-area-inset-bottom,0px));max-width:460px;margin:0 auto}
.brand{font-family:var(--display);font-weight:700;font-size:40px;letter-spacing:-.03em;line-height:1}
.brand span{color:var(--accent)}
.gate p{margin:0;color:var(--muted);line-height:1.6;font-size:15px}
.gate-scroll{position:absolute;inset:0;overflow-y:auto}

.toast{position:absolute;left:16px;right:16px;bottom:calc(92px + env(safe-area-inset-bottom,0px));z-index:30;background:var(--ink);color:var(--bg);border-radius:16px;padding:13px 16px;font-weight:600;font-size:13.5px;display:flex;gap:10px;align-items:center;opacity:0;transform:translateY(10px);transition:opacity 200ms ease,transform 260ms var(--ease);pointer-events:none;max-width:528px;margin:0 auto}
.toast.show{opacity:1;transform:translateY(0)}
.toast.err svg{color:var(--danger)}
.toast svg{color:var(--accent)}
.spinner{width:28px;height:28px;border-radius:50%;border:3px solid var(--surface-2);border-top-color:var(--accent);animation:spin .7s linear infinite;margin:40px auto}
@keyframes spin{to{transform:rotate(360deg)}}
.empty{padding:22px 8px;text-align:center;color:var(--muted);font-size:14px}

@media (prefers-reduced-motion:reduce){
  .sheet,.toast,.press,.tab,.backdrop{transition-duration:0ms}
}

/* --- Календарь --- */
.nav-btn{width:34px;height:34px;border-radius:11px;display:grid;place-items:center;background:var(--surface-2)}
.legend{display:flex;gap:12px;flex-wrap:wrap;font-size:12px;color:var(--muted);margin:-2px 0 10px}
.legend span{display:inline-flex;align-items:center;gap:6px}
.lg{width:8px;height:8px;border-radius:50%;display:inline-block}
button.day{flex-direction:column;gap:3px;display:flex;align-items:center;justify-content:center;position:relative}
.day .dots{display:flex;gap:3px;height:5px}
.dot{width:5px;height:5px;border-radius:50%}
.dot.draft{background:transparent !important;border:1.5px dashed var(--muted);width:6px;height:6px}
.t-squad{background:var(--accent)}
.t-city{background:var(--ink)}
.t-shift{background:var(--accent-soft);border:1.5px solid var(--accent)}
.day.shift{background:var(--accent-soft);border-radius:0;color:var(--accent-text)}
.day.shift.s0{border-radius:13px 0 0 13px}
.day.shift.s1{border-radius:0 13px 13px 0}
.day.shift.s0.s1{border-radius:13px}
.day.today{background:transparent;color:var(--accent)}
.day.sel{background:var(--ink);color:var(--bg);border-radius:13px}
.day.sel .t-city{background:var(--bg)}
.ev-list{margin-top:12px;border-top:1px solid var(--line);padding-top:6px;display:flex;flex-direction:column}
.ev{display:flex;gap:12px;align-items:center;padding:10px 0;text-align:left;width:100%}
.ev+.ev{border-top:1px solid var(--line)}
.ev-time{width:52px;flex:none;font-family:var(--display);font-weight:500;font-size:14px}
.ev-time small{display:block;font-family:var(--body);font-size:11px;color:var(--muted);font-weight:600}
.ev-bar{width:3px;align-self:stretch;border-radius:3px;flex:none}
.ev-bar.t-shift{background:var(--accent);border:0}
.ev-t{flex:1;min-width:0}
.ev-title{font-weight:700;font-size:14.5px;line-height:1.3}
.ev-sub{font-size:12.5px;color:var(--muted);margin-top:2px;display:flex;gap:6px;flex-wrap:wrap;align-items:center}
.tag{font-size:11px;font-weight:700;padding:2px 7px;border-radius:7px;background:var(--surface-2);color:var(--muted)}
.tag.warn{background:var(--warn-soft);color:var(--warn)}
.tag.ok{background:var(--ok-soft);color:var(--ok)}
.tag.accent{background:var(--accent-soft);color:var(--accent-text)}
.drafts{display:flex;align-items:center;gap:10px;margin-top:12px;padding:10px 12px;border-radius:14px;border:1.5px dashed var(--line);font-size:13px}

/* --- Мероприятие --- */
.tbd{color:var(--muted);font-style:italic;font-weight:500}
.desc{line-height:1.6;font-size:14px;margin:0 2px 14px;white-space:pre-wrap}
.rsvp{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.rsvp .btn{height:48px}
.rsvp .btn[aria-pressed="true"].go{background:var(--accent);color:var(--on-accent);border-color:var(--accent)}
.rsvp .btn[aria-pressed="true"].no{background:var(--ink);color:var(--bg);border-color:var(--ink)}
.fee{background:var(--surface);border-radius:20px;padding:14px;margin-bottom:12px;display:flex;flex-direction:column;gap:10px}
.fee-top{display:flex;align-items:flex-start;gap:10px}
.fee-sum{font-family:var(--display);font-weight:700;font-size:22px;font-variant-numeric:tabular-nums}
.faces{display:flex;flex-wrap:wrap;gap:10px 8px}
.face{display:flex;flex-direction:column;align-items:center;gap:4px;width:58px;text-align:center;font-size:11px;font-weight:600;line-height:1.2}
.face span{max-width:58px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.links{display:flex;flex-direction:column;gap:8px;margin-bottom:12px}
.warnbox{background:var(--warn-soft);color:var(--warn);border-radius:14px;padding:10px 12px;font-size:13px;font-weight:600;line-height:1.5;margin-bottom:12px}
.fee-row{display:flex;align-items:center;gap:10px;padding:8px 0}
.fee-row+.fee-row{border-top:1px solid var(--line)}
.stat{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-bottom:10px}
.stat div{background:var(--surface-2);border-radius:14px;padding:10px;text-align:center}
.stat b{display:block;font-family:var(--display);font-size:18px;font-variant-numeric:tabular-nums}
.stat span{font-size:11.5px;color:var(--muted);font-weight:600}
textarea.input{height:auto;min-height:96px;padding:12px 14px;line-height:1.5;resize:vertical}
.toggle{display:flex;align-items:center;gap:12px;padding:12px 14px;background:var(--surface);border-radius:14px;border:1.5px solid var(--line);text-align:left;width:100%}
.toggle .sw{width:42px;height:26px;border-radius:13px;background:var(--surface-2);position:relative;flex:none;transition:background 160ms ease}
.toggle .sw::after{content:"";position:absolute;top:3px;left:3px;width:20px;height:20px;border-radius:50%;background:var(--surface);box-shadow:0 1px 2px rgba(0,0,0,.2);transition:transform 200ms var(--ease)}
.toggle[aria-checked="true"] .sw{background:var(--accent)}
.toggle[aria-checked="true"] .sw::after{transform:translateX(16px)}
.sub-card{background:var(--surface-2);border-radius:16px;padding:12px;display:flex;flex-direction:column;gap:10px}
.link-row{display:grid;grid-template-columns:1fr 1.4fr 32px;gap:6px;align-items:center}
.link-row .input{height:40px;font-size:14px;padding:0 10px}
