/* v2 layout: calendar first, day sheet, medicine ring, floating chat */
.dash2{max-width:880px;margin:0 auto;padding:30px 24px 130px;display:flex;flex-direction:column;gap:24px}
body.noscroll{overflow:hidden}

/* today row + rings */
.today{gap:26px}
.medring{background:none;border:0;padding:0;cursor:pointer;color:inherit;width:124px;height:124px;margin:0;flex:none;transition:transform .2s;font:inherit}
.medring:hover{transform:scale(1.05)}
.medring b{font-size:34px}
.medring small,.medring i{color:#7fd6c2}
.medring i{max-width:84px;text-align:center;line-height:1.5;font-size:6px}
.medring.warn #medArc{stroke:#ff8fa8}
.medring.warn small,.medring.warn i{color:#ff8fa8}

/* calendar: every day is a circle */
.calpanel .cal{gap:9px}
.cal .d{border:1px solid rgba(255,255,255,.1);background:rgba(255,255,255,.02);font:300 14px var(--sans);color:#c3c4d3;cursor:pointer;padding:0;transition:transform .15s,border-color .15s,background .15s}
.cal .d:hover:not(:disabled){border-color:var(--pink);transform:scale(1.07)}
.cal .d:disabled{opacity:.3;cursor:default}
.cal .d.p{background:var(--pink);border-color:var(--pink);color:#2a0b1a;font-weight:600}
.cal .d.pp{border:1px dashed var(--pink);color:var(--pink);background:none}
.cal .d.f{background:rgba(166,140,255,.2);border-color:rgba(166,140,255,.35);color:#e2d8ff}
.cal .d.sel{box-shadow:0 0 0 3px rgba(255,127,191,.5)}
.cal .d.l::after{content:"";position:absolute;bottom:5px;left:calc(50% - 6px);width:5px;height:5px;border-radius:50%;background:var(--violet)}
.cal .d.m::before{content:"";position:absolute;bottom:5px;left:calc(50% + 1px);width:5px;height:5px;border-radius:50%;background:#7fd6c2}
.cal .d.p.l::after{background:#2a0b1a}
.pmbanner{display:flex;gap:14px;justify-content:space-between;align-items:center;margin:0 0 14px;padding:12px 16px;border:1px solid var(--pink);background:rgba(255,127,191,.1);border-radius:14px;font-size:13px}
.pmbanner .link{background:none;border:0;color:var(--muted);font:500 10px var(--sans);letter-spacing:.22em;text-transform:uppercase;cursor:pointer}
.calpanel .row .hint{flex-basis:100%}

/* sheets (day / report / periods) */
.sheet{position:fixed;inset:0;z-index:100;background:rgba(5,7,12,.78);backdrop-filter:blur(6px);display:flex;align-items:flex-start;justify-content:center;padding:40px 16px;overflow-y:auto}
.sheet[hidden]{display:none}
.sbox{position:relative;width:100%;max-width:880px;border:1px solid rgba(166,140,255,.35);background:linear-gradient(160deg,#161c30,#0d1119);border-radius:22px;padding:32px;box-shadow:0 0 80px rgba(166,140,255,.15);animation:pop .22s}
.sbox.narrow{max-width:520px}
@keyframes pop{from{opacity:0;transform:translateY(10px)}}
.sbox h3{font-size:30px;margin-bottom:4px;padding-right:40px}
.sbox h4{font:500 10px var(--sans);letter-spacing:.26em;text-transform:uppercase;color:var(--muted);margin:0 0 12px}
.sx{position:absolute;top:16px;right:18px;width:36px;height:36px;border-radius:50%;background:none;border:1px solid var(--line);color:var(--text);font-size:20px;line-height:1;cursor:pointer;transition:.2s}
.sx:hover{border-color:var(--pink);color:var(--pink)}
.sx.static{position:static;flex:none}
.sgrid{display:grid;grid-template-columns:1.1fr 1fr;gap:34px;align-items:start}
.scol+.scol{border-left:1px solid var(--line);padding-left:34px}
.autosave{font-size:11px;color:var(--muted);margin-top:12px;min-height:16px}
.insight{margin-top:20px;border:1px solid rgba(166,140,255,.4);background:rgba(166,140,255,.08);border-radius:16px;padding:16px 18px}
.insight .who{display:flex;gap:10px;align-items:center;margin-bottom:8px;font-size:12px}
.insight .who img{width:26px;height:26px;border-radius:50%}
.insight p{font-size:13px;color:#d6d7e4;margin:0;white-space:pre-wrap}
.insight p.wait{color:var(--muted);font-style:italic}
#dayMeds .medrow .nm{text-transform:none}
.warnline{font-size:11px;color:#ff8fa8;margin-top:4px;flex-basis:100%}

/* floating chat */
.fab{position:fixed;right:22px;bottom:22px;width:68px;height:68px;border-radius:50%;padding:0;border:0;background:none;cursor:grab;z-index:90;touch-action:none;box-shadow:0 0 0 1px rgba(255,255,255,.18),0 10px 40px rgba(220,80,170,.45);transition:box-shadow .2s,transform .2s}
.fab:hover{transform:scale(1.06)}
.fab:active{cursor:grabbing}
.fab img{width:100%;height:100%;border-radius:50%;object-fit:cover;pointer-events:none;display:block}
.fab.nudge{animation:nudge 1.6s ease-in-out 3}
@keyframes nudge{50%{transform:translateY(-8px)}}
.chatwin{position:fixed;right:22px;bottom:104px;width:392px;max-width:calc(100vw - 24px);height:min(620px,calc(100vh - 140px));z-index:95;display:flex;flex-direction:column;border:1px solid rgba(166,140,255,.35);background:linear-gradient(160deg,#161c30,#0d1119);border-radius:22px;box-shadow:0 30px 90px rgba(0,0,0,.65);overflow:hidden;animation:pop .22s}
.chatwin[hidden]{display:none}
.chatwin .chathead{padding:16px 18px}
.chatwin .chatlog{padding:16px 18px}
.chatwin .sugg,.chatwin .quota{padding-left:18px;padding-right:18px}
.chatwin .chatform{padding:12px 18px 16px}

@media(max-width:760px){
  .dash2{padding:18px 14px 120px;gap:18px}
  .panel{padding:20px}
  .today{gap:18px}
  .today{justify-content:center}
  .today .info{min-width:0;flex-basis:100%;order:3;text-align:center}
  .today .info .eyebrow{justify-content:center}
  .today .info .eyebrow::before{display:none}
  .calpanel .cal{gap:5px}
  .cal .d{font-size:13px}
  .sheet{padding:0;align-items:stretch}
  .sbox,.sbox.narrow{max-width:none;border-radius:0;min-height:100%;padding:26px 18px 40px}
  .sgrid{grid-template-columns:1fr;gap:28px}
  .scol+.scol{border-left:0;padding-left:0;border-top:1px solid var(--line);padding-top:24px}
  .fab{width:58px;height:58px;right:16px;bottom:16px}
  .chatwin{right:0;bottom:0;width:100%;max-width:none;height:100%;border-radius:0;border:0}
}

/* save bar at the end of every sheet + close button that never scrolls away on phones */
.sfoot{margin-top:28px;display:flex;justify-content:flex-end}
.sfoot .btn{min-width:140px;text-align:center}
@media(max-width:760px){
  .sheet .sx{position:sticky;top:10px;float:right;margin:-8px -4px 0 12px;z-index:6;background:#0f1424;border-color:rgba(166,140,255,.5)}
  .sbox,.sbox.narrow{padding-bottom:20px}
  .sfoot{position:sticky;bottom:0;margin:24px -18px 0;padding:14px 18px calc(18px + env(safe-area-inset-bottom));background:linear-gradient(rgba(13,17,25,0),#0d1119 38%);z-index:5}
  .sfoot .btn{width:100%}
  .sheet{display:block;padding:0 0 84px}
  .sbox,.sbox.narrow{min-height:100%}
}

/* ===== chat: ChatGPT-style ===== */
.chatwin.cg{background:#0b0d12;border:1px solid rgba(255,255,255,.1);width:430px;height:min(680px,calc(100vh - 130px));border-radius:24px;overflow:hidden;position:fixed}
.cg svg{width:20px;height:20px;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.chead{display:flex;align-items:center;gap:10px;padding:14px 14px 8px}
.ctitle{flex:1;min-width:0;text-align:center;font:500 15px var(--sans);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--text)}
.cbtn{width:42px;height:42px;border-radius:50%;flex:none;display:flex;align-items:center;justify-content:center;background:rgba(255,255,255,.07);border:1px solid rgba(255,255,255,.1);color:var(--text);cursor:pointer;padding:0;transition:background .15s}
.cbtn:hover{background:rgba(255,255,255,.13)}
.cg .chatlog{flex:1;overflow-y:auto;padding:8px 18px 12px;display:flex;flex-direction:column;gap:18px}
.cg .m{font-size:15px;line-height:1.6}
.cg .m.user{align-self:flex-end;max-width:84%;background:rgba(255,255,255,.09);padding:10px 16px;border-radius:20px;white-space:pre-wrap;word-break:break-word}
.cg .m.ai{align-self:stretch;color:#e9e8f0;word-break:break-word}
.cg .m.ai p{margin:0 0 10px}
.cg .m.ai p:last-child,.cg .m.ai ul:last-child,.cg .m.ai ol:last-child{margin-bottom:0}
.cg .m.ai ul,.cg .m.ai ol{margin:0 0 10px;padding-left:22px}
.cg .m.ai li{margin:4px 0}
.cg .m.ai strong{font-weight:600;color:#fff}
.cg .m.typing{display:flex;gap:5px;padding:6px 0}
.cg .m.typing span{width:8px;height:8px;border-radius:50%;background:#8b8fa3;animation:blink 1.2s infinite}
.cg .m.typing span:nth-child(2){animation-delay:.2s}.cg .m.typing span:nth-child(3){animation-delay:.4s}
@keyframes blink{0%,80%,100%{opacity:.25}40%{opacity:1}}
.cempty{display:flex;flex-direction:column;flex:1;min-height:100%}
.chello{margin:auto;text-align:center;padding:10px 0 20px}
.chello img{width:72px;height:72px;border-radius:50%;box-shadow:0 0 40px rgba(220,80,170,.4);margin-bottom:14px}
.chello h2{font:400 30px var(--serif);margin:0}
.clist{display:flex;flex-direction:column}
.crow{display:flex;align-items:center;gap:16px;width:100%;padding:14px 4px;background:none;border:0;color:var(--text);font:400 16px var(--sans);text-align:left;cursor:pointer}
.crow svg{width:22px;height:22px;color:var(--muted);flex:none}
.crow:hover{color:#fff}
.cform{padding:8px 14px calc(12px + env(safe-area-inset-bottom))}
.cpill{display:flex;align-items:flex-end;gap:8px;background:#1a1d26;border:1px solid rgba(255,255,255,.1);border-radius:28px;padding:6px 6px 6px 18px}
.cpill textarea{flex:1;width:auto;min-width:0;background:none;border:0;border-radius:0;outline:0;box-shadow:none;color:var(--text);font:400 16px/1.4 var(--sans);resize:none;max-height:120px;padding:9px 0}
.cpill textarea:focus{box-shadow:none;border:0}
.cpill button{width:40px;height:40px;border-radius:50%;flex:none;border:0;background:var(--ame);color:#120b2e;display:flex;align-items:center;justify-content:center;cursor:pointer}
.cpill button:disabled{opacity:.35;cursor:default}
.cform .quota{padding:8px 0 0;text-align:center;font-size:10px;color:var(--muted)}
.cscrim{position:absolute;inset:0;background:rgba(0,0,0,.55);z-index:2}
.cdrawer{position:absolute;top:0;left:0;bottom:0;width:86%;max-width:320px;background:#0f1218;border-right:1px solid rgba(255,255,255,.1);z-index:3;display:flex;flex-direction:column;padding:14px;animation:slidein .2s}
.cscrim[hidden],.cdrawer[hidden]{display:none}
@keyframes slidein{from{transform:translateX(-24px);opacity:0}}
.dhead{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}
.dhead b{font:500 15px var(--sans)}
.dnew{display:flex;align-items:center;gap:12px;width:100%;padding:12px 14px;border-radius:14px;background:rgba(255,255,255,.07);border:0;color:var(--text);font:500 14px var(--sans);cursor:pointer;margin-bottom:12px}
.dnew:hover{background:rgba(255,255,255,.12)}
.dlist{flex:1;overflow-y:auto}
.dgroup{font:500 10px var(--sans);letter-spacing:.2em;text-transform:uppercase;color:var(--muted);margin:16px 6px 6px}
.ditem{display:flex;align-items:center;border-radius:12px}
.ditem.on,.ditem:hover{background:rgba(255,255,255,.08)}
.ditem .ttl{flex:1;min-width:0;background:none;border:0;color:var(--text);font:400 14px var(--sans);text-align:left;padding:11px 12px;cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ditem .del{background:none;border:0;color:var(--muted);padding:8px 10px;cursor:pointer;opacity:.0}
.ditem:hover .del,.ditem.on .del{opacity:1}
.ditem .del:hover{color:#ff8fa8}
.ditem .del svg{width:17px;height:17px}
@media(hover:none){.ditem .del{opacity:1}}
@media(max-width:760px){
  .chatwin.cg{top:0;left:0;right:0;bottom:auto;width:100%;max-width:none;height:100dvh;border-radius:0;border:0}
}
