:root{
  --bg:#F2F3F6;--card:#FFFFFF;--text:#15171C;--muted:#5E6470;--line:#E2E4E9;--soft:#ECEEF2;
  --accent:#3B4BD8;--red:#D6312A;--green:#1F8A4C;--dark:#15171C;
  --st:env(safe-area-inset-top,0px);--sb:env(safe-area-inset-bottom,0px);
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
[hidden]{display:none!important}
html,body{margin:0;background:var(--bg);color:var(--text);font-family:Manrope,-apple-system,BlinkMacSystemFont,"Segoe UI",system-ui,sans-serif;font-size:15px}
body{min-height:100vh;overscroll-behavior-y:none}
button,input,select,textarea{font-family:inherit;color:inherit}
button{cursor:pointer}
svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;flex:none}
main{padding:calc(var(--st) + 18px) 16px calc(var(--sb) + 110px);max-width:640px;margin:0 auto}
a{color:var(--accent)}
.offline{position:fixed;top:0;left:0;right:0;z-index:60;background:#FFF4D6;color:#6B4E00;text-align:center;font-size:12px;font-weight:700;padding:calc(var(--st) + 4px) 8px 4px}

/* шапка */
.head{display:flex;justify-content:space-between;align-items:flex-end;gap:12px;margin-bottom:14px}
.head h1{margin:0;font-size:30px;font-weight:800;letter-spacing:-.5px;line-height:1.1}
.sub{font-size:13px;color:var(--muted);font-weight:600}
.clock{font-size:12px;color:var(--muted);font-weight:600;text-align:right;line-height:17px;white-space:nowrap}
.clock b{color:var(--text)}
.iconrow{display:flex;gap:8px;margin-bottom:12px;justify-content:flex-end}
.ibtn{width:40px;height:40px;border-radius:20px;border:0;background:var(--card);display:flex;align-items:center;justify-content:center;color:var(--text)}
.ibtn svg{width:20px;height:20px}

/* карточки */
.card{background:var(--card);border-radius:18px;padding:14px}
.principle{background:var(--card);border-radius:18px;padding:14px 16px;margin-bottom:12px;border:0;text-align:left;width:100%}
.principle .lab{font-size:11px;letter-spacing:1px;font-weight:800;color:var(--accent)}
.principle .txt{margin-top:6px;font-size:15px;line-height:21px;font-weight:600}
.banner{display:flex;gap:10px;align-items:center;border-radius:14px;padding:11px 13px;margin-bottom:10px;font-size:13px;font-weight:600;border:0;width:100%;text-align:left;background:var(--card)}
.banner.warn{background:#FDECEA;color:#8E1F19}
.banner.info{background:#E9ECFD;color:#26329E}
.banner svg{width:18px;height:18px}
.sec{display:flex;align-items:center;justify-content:space-between;margin:18px 2px 8px}
.sec h2{margin:0;font-size:13px;font-weight:800;letter-spacing:.6px;color:var(--muted);text-transform:uppercase;display:flex;align-items:center;gap:8px}
.sec .n{font-size:13px;color:var(--muted);font-weight:700}
.list{display:flex;flex-direction:column;gap:8px}
.empty{color:var(--muted);font-size:14px;font-weight:600;text-align:center;padding:28px 10px;line-height:20px}
.dot{width:8px;height:8px;border-radius:4px;display:inline-block;flex:none}

/* строка задачи */
.row{background:var(--card);border-radius:16px;padding:12px 14px;display:flex;gap:12px;align-items:flex-start;transition:opacity .25s,transform .25s}
.row.gone{opacity:0;transform:translateX(30px)}
.chk{flex:none;width:24px;height:24px;border-radius:12px;border:2px solid #B4B9C3;background:transparent;padding:0;margin-top:-1px;display:flex;align-items:center;justify-content:center;color:#fff}
.chk svg{width:14px;height:14px;stroke-width:3;opacity:0}
.chk.urgent{border-color:var(--red)}
.chk.on{background:var(--green);border-color:var(--green)}
.chk.on svg{opacity:1}
.rbody{flex:1;min-width:0;border:0;background:none;padding:0;text-align:left}
.rt{font-size:15px;line-height:20px;font-weight:600;word-wrap:break-word;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.row.done .rt{color:var(--muted)}
.meta{display:flex;gap:6px 10px;align-items:center;flex-wrap:wrap;margin-top:5px;font-size:12px;color:var(--muted);font-weight:600}
.meta .m{display:inline-flex;align-items:center;gap:5px}
.meta svg{width:13px;height:13px;stroke-width:2.4}
.lvl{padding:2px 7px;border-radius:6px;font-size:11px;font-weight:800}
.lvl.urgent{background:#FDECEA;color:#B3261E}
.lvl.next{background:#E9ECFD;color:#2B38B5}
.lvl.later{background:var(--soft);color:var(--muted)}
.red{color:var(--red)!important}
.big-btn{width:100%;min-height:48px;border-radius:14px;border:0;background:var(--card);font-size:14px;font-weight:700;margin-top:14px;color:var(--text)}

/* сферы */
.grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.tile{background:var(--card);border-radius:20px;padding:14px;display:flex;flex-direction:column;gap:9px;min-height:120px;border:0;text-align:left}
.tile.add{background:transparent;border:2px dashed #C5C9D2;align-items:center;justify-content:center;color:var(--muted);font-weight:700}
.sq{width:38px;height:38px;border-radius:12px;display:flex;align-items:center;justify-content:center;font-size:13px;font-weight:800;color:#fff;letter-spacing:.2px}
.tname{font-size:15px;font-weight:700;line-height:19px;word-break:break-word}
.tcnt{display:flex;gap:4px 10px;flex-wrap:wrap;font-size:12px;color:var(--muted);font-weight:700}
.summary{background:var(--dark);color:#fff;border-radius:20px;padding:16px;display:flex;align-items:center;gap:14px;margin-bottom:12px;border:0;width:100%;text-align:left}
.ring{width:52px;height:52px;border-radius:26px;display:flex;align-items:center;justify-content:center;flex:none}
.ring i{width:40px;height:40px;border-radius:20px;background:var(--dark);display:flex;align-items:center;justify-content:center;font-size:13px;font-weight:800;font-style:normal}
.shead{margin:calc(-1 * (var(--st) + 18px)) -16px 14px;padding:calc(var(--st) + 14px) 18px 18px;color:#fff;border-radius:0 0 26px 26px}
.shead .bar{display:flex;justify-content:space-between}
.shead .ibtn{background:rgba(255,255,255,.2);color:#fff}
.shead h1{margin:14px 0 0;font-size:30px;font-weight:800;line-height:1.1}
.shead .sub{color:rgba(255,255,255,.9)}
.floatadd{position:fixed;right:18px;bottom:calc(var(--sb) + 96px);height:50px;padding:0 20px;border-radius:25px;border:0;background:var(--dark);color:#fff;font-size:15px;font-weight:700;display:flex;align-items:center;gap:8px;z-index:20;box-shadow:0 6px 20px rgba(21,23,28,.25)}
.floatadd svg{width:20px;height:20px;stroke-width:2.6}
.toggle-done{border:0;background:none;color:var(--muted);font-weight:800;font-size:14px;display:flex;align-items:center;gap:8px;min-height:44px;padding:0 2px;margin-top:8px}
.toggle-done svg{width:18px;height:18px}

/* календарь */
.week{display:flex;gap:2px;margin-bottom:12px;align-items:center}
.day{flex:1;display:flex;flex-direction:column;align-items:center;gap:3px;padding:8px 0;border-radius:14px;border:0;background:transparent;min-height:62px}
.day .dw{font-size:11px;color:var(--muted);font-weight:700}
.day .dn{font-size:17px;font-weight:800}
.day .pip{width:5px;height:5px;border-radius:3px}
.day.sel{background:var(--dark);color:#fff}
.day.sel .dw{color:#C5C9D2}
.day.today:not(.sel) .dn{color:var(--accent)}
.warr{width:32px;height:44px;border:0;background:none;color:var(--muted);display:flex;align-items:center;justify-content:center;padding:0}
.slot{display:flex;gap:10px;align-items:stretch}
.hr{width:46px;flex:none;font-size:12px;color:var(--muted);font-weight:700;padding-top:12px;text-align:right;line-height:15px}
.hr small{display:block;font-size:10px;font-weight:600}
.ev{flex:1;border-radius:14px;padding:11px 13px;background:var(--dark);color:#fff;border:0;text-align:left;min-height:56px}
.ev .et{font-size:15px;font-weight:700;line-height:19px}
.ev .em{font-size:12px;margin-top:3px;font-weight:600;opacity:.8}
.slot .row{flex:1;border:1.5px solid var(--line);background:var(--card)}

/* контроль */
.chips{display:flex;gap:8px;overflow-x:auto;padding-bottom:4px;margin-bottom:12px;scrollbar-width:none}
.chips::-webkit-scrollbar{display:none}
.chip{flex:none;padding:8px 14px;border-radius:18px;font-size:13px;font-weight:700;border:1.5px solid var(--line);background:var(--card);min-height:36px;white-space:nowrap}
.chip.on{background:var(--dark);color:#fff;border-color:var(--dark)}
.ccard{background:var(--card);border-radius:16px;padding:14px;display:flex;flex-direction:column;gap:9px}
.who{display:flex;align-items:center;gap:8px;font-size:13px;font-weight:800}
.av{width:28px;height:28px;border-radius:14px;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:800;color:#fff;flex:none}
.acts{display:flex;gap:6px;flex-wrap:wrap}
.sbtn{flex:1;min-height:38px;border-radius:10px;border:1.5px solid var(--line);background:transparent;font-size:13px;font-weight:700;padding:0 8px}
.sbtn.pri{background:var(--dark);color:#fff;border-color:var(--dark)}

/* статистика */
.seg{display:flex;background:var(--soft);border-radius:12px;padding:3px;gap:3px}
.seg button{flex:1;min-height:38px;border:0;border-radius:10px;background:transparent;font-size:13px;font-weight:700;color:var(--muted)}
.seg button.on{background:var(--card);color:var(--text);box-shadow:0 1px 3px rgba(0,0,0,.08)}
.kpi{font-size:40px;font-weight:800;line-height:44px}
.lab2{font-size:12px;font-weight:800;letter-spacing:.6px;color:var(--muted);text-transform:uppercase}
.bars{display:flex;flex-direction:column;gap:10px}
.bar2{display:flex;align-items:center;gap:10px;font-size:13px;font-weight:700}
.bar2 .bn{width:120px;flex:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.bar2 .bt{flex:1;height:10px;border-radius:5px;background:var(--soft);overflow:hidden}
.bar2 .bt i{display:block;height:10px;border-radius:5px}
.bar2 .bv{width:26px;text-align:right}
.tri{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}

/* таб-бар */
.tabs{position:fixed;left:0;right:0;bottom:0;z-index:30;background:rgba(255,255,255,.94);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);border-top:1px solid var(--line);display:flex;justify-content:space-around;align-items:flex-start;padding:6px 8px calc(var(--sb) + 6px)}
.tab{display:flex;flex-direction:column;align-items:center;gap:3px;font-size:10px;font-weight:700;color:var(--muted);background:none;border:0;padding:4px 0;min-width:62px;min-height:46px}
.tab.on{color:var(--accent)}
.fab{width:52px;height:52px;border-radius:18px;border:0;background:var(--dark);color:#fff;display:flex;align-items:center;justify-content:center}
.fab svg{width:24px;height:24px;stroke-width:2.6}

/* шторка */
.backdrop{position:fixed;inset:0;background:rgba(21,23,28,.35);z-index:40;animation:fade .2s}
.sheet{position:fixed;left:0;right:0;bottom:0;z-index:41;background:var(--bg);border-radius:22px 22px 0 0;max-height:calc(100vh - var(--st) - 24px);overflow-y:auto;-webkit-overflow-scrolling:touch;padding:8px 16px calc(var(--sb) + 20px);animation:up .25s ease-out;max-width:640px;margin:0 auto}
.sheet.full{height:calc(100vh - var(--st) - 24px)}
.handle{width:40px;height:5px;border-radius:3px;background:#C5C9D2;margin:0 auto 10px}
.shbar{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px;gap:8px}
.shbar h3{margin:0;font-size:18px;font-weight:800}
.tbtn{border:0;background:none;font-size:15px;font-weight:700;color:var(--accent);min-height:44px;padding:0 4px}
@keyframes up{from{transform:translateY(40px);opacity:.4}to{transform:none;opacity:1}}
@keyframes fade{from{opacity:0}to{opacity:1}}
.fld{background:var(--card);border-radius:14px;padding:12px 14px;margin-bottom:10px}
.fld>label,.flab{display:block;font-size:12px;font-weight:800;color:var(--muted);margin-bottom:8px;letter-spacing:.3px}
.fld input[type=text],.fld input[type=date],.fld input[type=time],.fld input[type=number],.fld select,.fld textarea{width:100%;font-size:16px;border:1.5px solid var(--line);border-radius:10px;padding:10px 12px;background:#fff;min-height:44px;outline:none}
.fld input:focus,.fld textarea:focus,.fld select:focus{border-color:var(--accent)}
.fld textarea{resize:vertical;min-height:70px;line-height:21px}
.ttl{width:100%;font-size:19px;font-weight:700;border:0;background:var(--card);border-radius:14px;padding:14px;min-height:56px;resize:none;outline:none;margin-bottom:10px;line-height:25px}
.two{display:flex;gap:8px}
.two>*{flex:1;min-width:0}
.hint{font-size:12px;color:var(--muted);font-weight:600;margin-top:6px}
.sw{display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:15px;font-weight:700;min-height:32px}
.switch{width:51px;height:31px;border-radius:16px;border:0;background:#D5D8DE;position:relative;flex:none;padding:0}
.switch::after{content:"";position:absolute;top:2px;left:2px;width:27px;height:27px;border-radius:14px;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.2);transition:left .2s}
.switch.on{background:var(--green)}
.switch.on::after{left:22px}
.wds{display:flex;gap:4px;margin-top:8px}
.wds button{flex:1;min-height:38px;border-radius:10px;border:1.5px solid var(--line);background:#fff;font-weight:700;font-size:13px}
.wds button.on{background:var(--dark);color:#fff;border-color:var(--dark)}
.subl{display:flex;flex-direction:column;gap:6px}
.subi{display:flex;align-items:center;gap:10px;min-height:36px}
.subi .chk{width:22px;height:22px;border-radius:7px}
.subi span{flex:1;font-size:15px;font-weight:600}
.subi.on span{color:var(--muted);text-decoration:line-through}
.x{border:0;background:none;color:var(--muted);width:34px;height:34px;display:flex;align-items:center;justify-content:center;padding:0}
.x svg{width:18px;height:18px}
.addsub{display:flex;gap:8px;margin-top:8px}
.addsub input{flex:1}
.actions{display:flex;gap:8px;margin-top:6px;flex-wrap:wrap}
.btn{flex:1;min-height:50px;border-radius:14px;border:0;font-size:15px;font-weight:800;background:var(--card);padding:0 12px}
.btn.pri{background:var(--dark);color:#fff}
.btn.danger{color:var(--red)}
.btn.ok{background:var(--green);color:#fff}
.links{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
.links a{font-size:13px;font-weight:700;background:#E9ECFD;border-radius:8px;padding:6px 10px;text-decoration:none;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.colors{display:flex;gap:10px;flex-wrap:wrap}
.colors button{width:38px;height:38px;border-radius:12px;border:3px solid transparent;padding:0}
.colors button.on{border-color:var(--text)}
.mlist{display:flex;flex-direction:column;gap:6px}
.mitem{display:flex;align-items:center;gap:10px;background:var(--card);border-radius:14px;padding:6px 6px 6px 14px;min-height:50px}
.mitem span{flex:1;font-size:14px;font-weight:600;line-height:19px}
.search{width:100%;font-size:17px;border:0;border-radius:14px;padding:14px;background:var(--card);outline:none;min-height:50px;margin-bottom:12px}
.login{max-width:380px;margin:18vh auto 0;text-align:center}
.login h1{font-size:30px;margin:0 0 8px}
.login input{width:100%;font-size:17px;padding:14px;border-radius:14px;border:1.5px solid var(--line);margin:18px 0 10px;text-align:center}
.toast{position:fixed;left:16px;right:16px;bottom:calc(var(--sb) + 92px);z-index:50;background:var(--dark);color:#fff;border-radius:14px;padding:12px 14px;display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:14px;font-weight:700;max-width:600px;margin:0 auto}
.toast button{border:0;background:none;color:#A9B4FF;font-weight:800;font-size:14px;min-height:36px}

.fld .chips{flex-wrap:wrap;overflow:visible;margin-bottom:0}
.sq.s4{font-size:10px}
.sq.s1{font-size:17px}
