:root{--bg:#eef0f4;--ink:#17181c;--muted:#9aa0ad;--accent:#2f6bff;--shadow:0 6px 24px rgba(20,24,40,.08)}
*{box-sizing:border-box;margin:0;padding:0;-webkit-tap-highlight-color:transparent}
html,body{height:100%}
body{font-family:-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
  background:radial-gradient(120% 120% at 20% 0%,#20264a 0%,#0e1226 60%,#090c1a 100%);
  display:flex;align-items:center;justify-content:center;min-height:100vh;padding:18px;color:var(--ink)}
.phone{position:relative;width:100%;max-width:400px;height:min(860px,94vh);background:var(--bg);border-radius:44px;
  overflow:hidden;box-shadow:0 30px 80px rgba(0,0,0,.55),inset 0 0 0 8px #0c0e14;display:flex;flex-direction:column}
[dir="rtl"] .phone{direction:rtl}
.ic{display:block;flex:none}
.topbar{display:flex;align-items:center;justify-content:space-between;padding:22px 22px 6px}
.topbar h1{font-size:30px;font-weight:800;letter-spacing:-.5px}
.top-actions{display:flex;gap:10px}
.icon-btn{width:44px;height:44px;border-radius:50%;border:none;background:#fff;box-shadow:var(--shadow);cursor:pointer;color:var(--ink);display:flex;align-items:center;justify-content:center}
.icon-btn:active{transform:scale(.94)}
.selector-row{display:flex;align-items:center;justify-content:center;gap:10px;padding:10px 18px}
.nav-arrow{border:none;background:none;font-size:26px;color:#6b7280;cursor:pointer;padding:0 10px}
.pill{border:none;background:none;font-size:16px;font-weight:700;cursor:pointer;min-width:150px}
.hero{padding:2px 0}
.ring-box{position:relative;width:190px;height:190px;margin:0 auto}
.ring-box canvas{width:100%;height:100%}
.ring-center{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center}
.ring-center strong{font-size:34px;font-weight:800;letter-spacing:-1px}
.muted{color:var(--muted);font-size:13px}
.list{flex:1;overflow-y:auto;padding:10px 18px 130px;scrollbar-width:none}
.list::-webkit-scrollbar{display:none}
.h-card{display:flex;align-items:center;gap:12px;background:#fff;border-radius:20px;padding:12px 14px;margin-bottom:10px;box-shadow:var(--shadow)}
.h-ic{width:42px;height:42px;border-radius:15px;display:flex;align-items:center;justify-content:center;flex:none}
.h-mid{flex:1;min-width:0}
.h-name{font-weight:700;font-size:15px}
.h-sub{font-size:12px;color:var(--muted);margin-top:2px;display:flex;align-items:center;gap:4px}
.week{display:flex;gap:4px;margin-top:7px}
.week i{width:14px;height:6px;border-radius:99px;background:#e8eaf0}
.check{width:38px;height:38px;border-radius:50%;border:2px solid #dfe2ea;background:#fff;cursor:pointer;display:flex;align-items:center;justify-content:center;color:#fff;flex:none}
.check.on{border-color:transparent}
.check:active{transform:scale(.92)}
.p-empty{text-align:center;color:var(--muted);padding:50px 0;font-size:14px}
.fab{position:absolute;bottom:26px;inset-inline-end:22px;width:60px;height:60px;border-radius:50%;border:none;background:var(--ink);color:#fff;
  box-shadow:0 10px 30px rgba(20,24,40,.3);cursor:pointer;z-index:5;display:flex;align-items:center;justify-content:center}
.fab:active{transform:scale(.93)}
.modal-overlay{position:absolute;inset:0;background:rgba(10,12,24,.45);display:none;align-items:flex-end;z-index:10}
.modal-overlay.open{display:flex}
.modal{background:#fff;width:100%;border-radius:28px 28px 0 0;padding:22px 20px 30px;max-height:88%;overflow-y:auto;scrollbar-width:none}
.modal h3{font-size:20px;font-weight:800;margin-bottom:16px}
.field{margin-bottom:14px}
.field label{display:block;font-size:12px;font-weight:700;color:var(--muted);margin-bottom:6px}
.field input{width:100%;border:1.5px solid #e8eaf0;border-radius:14px;padding:12px 14px;font-size:15px;font-family:inherit;background:#fafbfd;outline:none}
.field input:focus{border-color:var(--accent)}
.grid{display:grid;grid-template-columns:repeat(6,1fr);gap:8px}
.cell{aspect-ratio:1;border:1.5px solid #e8eaf0;border-radius:14px;background:#fff;cursor:pointer;display:flex;align-items:center;justify-content:center}
.cell.sel{border-color:var(--accent);background:#f0f4ff}
.sw{aspect-ratio:1;border-radius:50%;border:3px solid #fff;box-shadow:0 0 0 1.5px #e8eaf0;cursor:pointer}
.sw.sel{box-shadow:0 0 0 2.5px var(--ink)}
.btn-primary{width:100%;border:none;background:var(--ink);color:#fff;padding:15px;border-radius:16px;font-size:16px;font-weight:700;cursor:pointer;margin-top:6px}
.btn-danger{width:100%;border:none;background:#fee2e2;color:#b91c1c;padding:13px;border-radius:16px;font-size:15px;font-weight:700;cursor:pointer;margin-top:10px}
.panel-overlay{position:absolute;inset:0;background:var(--bg);z-index:7;display:none;flex-direction:column}
.panel-overlay.open{display:flex}
.panel{display:flex;flex-direction:column;height:100%}
.panel-head{display:flex;align-items:center;justify-content:space-between;padding:22px 22px 10px}
.panel-head h2{font-size:24px;font-weight:800}
.panel-body{flex:1;overflow-y:auto;padding:6px 18px 40px;scrollbar-width:none}
.p-card{background:#fff;border-radius:20px;padding:16px;box-shadow:var(--shadow);margin-bottom:12px}
.stat-row{display:flex;gap:10px;margin-bottom:12px}
.stat{flex:1;background:linear-gradient(135deg,#1d2547,#31408a);color:#fff;border-radius:20px;padding:16px}
.stat b{display:block;font-size:26px;font-weight:800}
.stat span{font-size:12px;color:#aab3d6}
.heat{display:grid;grid-template-columns:repeat(7,1fr);gap:5px;margin-top:10px}
.heat i{aspect-ratio:1;border-radius:7px;background:#eef0f4}
.bar{height:8px;border-radius:99px;background:#eef0f4;overflow:hidden;margin-top:8px}
.bar i{display:block;height:100%;border-radius:99px}
.seg{display:flex;background:#e3e6ee;border-radius:14px;padding:4px;margin:8px 18px 4px}
.seg button{flex:1;border:none;background:none;padding:9px 4px;border-radius:11px;font-weight:700;font-size:13px;cursor:pointer;color:#6b7280}
.seg button.on{background:#fff;color:var(--ink);box-shadow:var(--shadow)}
.ring-box{width:230px;height:230px}
.ring-center strong{font-size:48px;font-variant-numeric:tabular-nums;cursor:pointer}
.controls{display:flex;align-items:center;justify-content:center;gap:22px;padding:8px 0 4px}
.round{width:52px;height:52px;border-radius:50%;border:none;background:#fff;box-shadow:var(--shadow);cursor:pointer;display:flex;align-items:center;justify-content:center;color:var(--ink)}
.round.big{width:72px;height:72px;background:var(--ink);box-shadow:0 10px 30px rgba(20,24,40,.3)}
.round:active{transform:scale(.93)}
.subjects{padding:10px 18px 0}
.sub-head{display:flex;justify-content:space-between;align-items:center;font-size:13px;font-weight:700;color:var(--muted);margin-bottom:8px}
.link{border:none;background:none;color:var(--accent);font-weight:700;font-size:13px;cursor:pointer}
.chips-row{display:flex;gap:8px;flex-wrap:wrap}
.chip-s{--c:#3b82f6;border:1.5px solid #e1e4ec;background:#fff;border-radius:99px;padding:8px 14px;font-weight:700;font-size:13px;cursor:pointer;display:flex;align-items:center;gap:7px;color:var(--ink)}
.chip-s i{width:9px;height:9px;border-radius:50%;background:var(--c)}
.chip-s.on{border-color:var(--c);background:color-mix(in srgb,var(--c) 12%,#fff)}
.today{display:grid;grid-template-columns:1fr 1fr 1.3fr;gap:8px;padding:14px 18px}
.t-card{background:#fff;border-radius:18px;padding:12px;box-shadow:var(--shadow);display:flex;flex-direction:column;gap:3px}
.t-card b{font-size:20px;font-weight:800}
.t-card span{font-size:11px;color:var(--muted)}
.t-card.goal .bar{margin-top:6px}.t-card.goal .bar i{background:linear-gradient(90deg,#2f6bff,#7c3aed)}
.two{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.check-row{display:flex;align-items:center;gap:10px;font-weight:600;font-size:14px;margin:4px 0 12px}
.cols{display:flex;align-items:flex-end;gap:8px;height:140px;margin-top:12px}
.col{flex:1;height:100%;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;gap:4px}
.col i{width:100%;background:linear-gradient(180deg,#2f6bff,#7c3aed);border-radius:8px;min-height:3px}
.col em{font-style:normal;font-size:11px;color:var(--muted);font-weight:700}
.col .v{font-size:10px;color:#6b7280;font-weight:700;height:12px}
.srow{margin-top:12px}.sline{display:flex;justify-content:space-between}
.srow2{display:flex;align-items:center;gap:10px;padding:10px 0;border-bottom:1px solid #f1f2f6}
.srow2 i{width:12px;height:12px;border-radius:50%}.srow2 b{flex:1}
.mini{border:none;background:#fee2e2;border-radius:10px;width:34px;height:34px;display:flex;align-items:center;justify-content:center;cursor:pointer}
.grid{display:grid;grid-template-columns:repeat(7,1fr);gap:8px;margin-bottom:10px}
/* DARK */
html[data-theme=dark]{--bg:#0d1020;--ink:#eef0f6;--muted:#8a90a8;--shadow:0 6px 24px rgba(0,0,0,.35)}
html[data-theme=dark] .phone{background:var(--bg)}
html[data-theme=dark] .icon-btn{background:#1a1e33}
html[data-theme=dark] .nav-arrow{color:#9aa0b5}
html[data-theme=dark] .h-card{background:#1a1e33}
html[data-theme=dark] .week i{background:#2a2f4d}
html[data-theme=dark] .check{background:#1a1e33;border-color:#3a4064}
html[data-theme=dark] .modal{background:#1a1e33}
html[data-theme=dark] .field input{background:#14172a;border-color:#2a2f4d}
html[data-theme=dark] .cell{background:#1a1e33;border-color:#2a2f4d}
html[data-theme=dark] .cell.sel{background:#262d55}
html[data-theme=dark] .sw{border-color:#1a1e33}
html[data-theme=dark] .btn-danger{background:#4a1f26;color:#fca5a5}
html[data-theme=dark] .p-card{background:#1a1e33}
html[data-theme=dark] .heat i{background:#2a2f4d}
html[data-theme=dark] .bar{background:#2a2f4d}
html[data-theme=dark] .seg{background:#232846}
html[data-theme=dark] .seg button{color:#9aa0b5}
html[data-theme=dark] .seg button.on{background:#1a1e33}
html[data-theme=dark] .round{background:#1a1e33}
html[data-theme=dark] .chip-s{background:#1a1e33;border-color:#2a2f4d}
html[data-theme=dark] .t-card{background:#1a1e33}
html[data-theme=dark] .col .v{color:#9aa0b5}
html[data-theme=dark] .mini{background:#4a1f26}
html[data-theme=dark] .btn-primary,html[data-theme=dark] .fab,html[data-theme=dark] .chip.on,html[data-theme=dark] .round.big{background:#2f6bff;color:#fff}
html[data-theme=dark] .seg button.on{color:#eef0f6}
html[data-theme=dark] .field input,html[data-theme=dark] .field textarea,html[data-theme=dark] .field select{background:#14172a;border-color:#2a2f4d;color:#eef0f6}
html[data-theme=dark] .lang-sheet{background:#1a1e33}html[data-theme=dark] .lang-sheet h3,html[data-theme=dark] .lang-item{color:#eef0f6}html[data-theme=dark] .lang-item:hover{background:#232846}html[data-theme=dark] .lang-item.on{background:#262d55;color:#7ea4ff}
html[data-theme=dark] .n-card,html[data-theme=dark] .n-card b,html[data-theme=dark] .n-card p,html[data-theme=dark] .n-card small{color:#17181c}
html[data-theme=dark] .nav-arrow{color:#9aa0b5}
