/* Prosper for Ava. Layout: one planner column on phones; on wide screens the school column sits
   left and the life column (to-dos, Ila, money, faith) right. Same family as her daily pages. */
:root{
  --paper:#f5f7fb; --sheet:#ffffff; --sheet-2:#f0f3fa; --ink:#1b2440; --muted:#5d6782; --faint:#8a93ab;
  --rule:#d9deea; --accent:#2f4fd6; --accent-ink:#ffffff; --accent-soft:#e6ebfd;
  --hl:#fff1b8; --hl-ink:#5a4700; --done:#1f8a5b; --done-soft:#e3f4ec; --warn:#b45309; --danger:#c02626;
  --shadow:0 1px 2px rgba(27,36,64,.06), 0 8px 24px rgba(27,36,64,.06);
  --display:"Bricolage Grotesque","Segoe UI",system-ui,sans-serif;
  --body:"Atkinson Hyperlegible","Segoe UI",system-ui,sans-serif;
  --mono:"JetBrains Mono",ui-monospace,"Cascadia Mono",Consolas,monospace;
  --r:14px;
  color-scheme:light;
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --paper:#0f1219; --sheet:#171b26; --sheet-2:#1d2230; --ink:#e7eaf4; --muted:#9aa3bd; --faint:#6f7894;
    --rule:#2a3042; --accent:#8fa6ff; --accent-ink:#0f1219; --accent-soft:#1e2742;
    --hl:#3a3216; --hl-ink:#f3dc86; --done:#4fcf95; --done-soft:#14291f; --warn:#f0a35a; --danger:#ff7a7a;
    --shadow:0 1px 2px rgba(0,0,0,.3);
    color-scheme:dark;
  }
}
:root[data-theme="dark"]{
  --paper:#0f1219; --sheet:#171b26; --sheet-2:#1d2230; --ink:#e7eaf4; --muted:#9aa3bd; --faint:#6f7894;
  --rule:#2a3042; --accent:#8fa6ff; --accent-ink:#0f1219; --accent-soft:#1e2742;
  --hl:#3a3216; --hl-ink:#f3dc86; --done:#4fcf95; --done-soft:#14291f; --warn:#f0a35a; --danger:#ff7a7a;
  --shadow:0 1px 2px rgba(0,0,0,.3);
  color-scheme:dark;
}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;background:var(--paper);color:var(--ink);font-family:var(--body);font-size:16px;line-height:1.55;
  padding-top:env(safe-area-inset-top,0px);padding-bottom:env(safe-area-inset-bottom,0px)}
body::before{content:"";position:fixed;inset:0 0 auto;height:env(safe-area-inset-top,0px);background:var(--paper);z-index:30}
a{color:var(--accent);text-underline-offset:2px}
button,input,select,textarea{font:inherit;color:inherit}
:focus-visible{outline:3px solid var(--accent);outline-offset:2px;border-radius:6px}
[hidden]{display:none!important}
h1,h2,h3{font-family:var(--display);margin:0;line-height:1.15;text-wrap:balance}
.mono{font-family:var(--mono)}
.muted{color:var(--muted)}
.small{font-size:13.5px}

/* ---------- top bar ---------- */
.top{position:sticky;top:env(safe-area-inset-top,0px);z-index:20;background:color-mix(in srgb,var(--paper) 88%,transparent);
  backdrop-filter:saturate(1.4) blur(10px);-webkit-backdrop-filter:saturate(1.4) blur(10px);border-bottom:1px solid var(--rule)}
.top-in{max-width:1180px;margin:0 auto;display:flex;align-items:center;gap:10px;padding-block:10px;
  padding-left:max(16px,env(safe-area-inset-left,0px));padding-right:max(16px,env(safe-area-inset-right,0px))}
.brand{font-family:var(--display);font-weight:800;font-size:20px;letter-spacing:-.01em;display:flex;align-items:center;gap:8px}
.brand i{width:22px;height:22px;border-radius:7px;background:var(--accent);display:inline-block;position:relative}
.brand i::after{content:"";position:absolute;left:7px;right:7px;bottom:7px;height:4px;background:var(--accent-ink);border-radius:5px 5px 0 0}
.brand i::before{content:"";position:absolute;left:4px;right:4px;bottom:5px;height:1.5px;background:var(--accent-ink);border-radius:1px}
.top .date{font-family:var(--mono);font-size:12.5px;color:var(--muted);white-space:nowrap}
.top .spacer{flex:1}
.chip{display:inline-flex;align-items:center;gap:6px;font-size:13px;padding:4px 10px;border-radius:99px;background:var(--sheet-2);border:1px solid var(--rule);white-space:nowrap}
.chip.dad{background:var(--accent-soft);border-color:transparent}
.iconbtn{background:none;border:1px solid var(--rule);border-radius:10px;height:36px;min-width:36px;padding:0 10px;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;gap:6px;background:var(--sheet)}
.iconbtn:hover{border-color:var(--accent)}
.pill{max-width:220px;overflow:hidden;min-width:0}
@media (max-width:560px){
  .top .date{display:none}
  .top-in{gap:8px}
  .pill{max-width:120px}
  .brand{font-size:18px}
  .chip{padding:3px 8px;font-size:12.5px}
}
@media (max-width:380px){ .pill .t{display:none} }
.pill .t{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px}
.eq{display:inline-flex;gap:2px;align-items:flex-end;height:12px}
.eq b{width:3px;background:var(--accent);border-radius:1px;height:4px}
.eq.on b{animation:eq 1s ease-in-out infinite}
.eq.on b:nth-child(2){animation-delay:.2s}.eq.on b:nth-child(3){animation-delay:.4s}
@keyframes eq{0%,100%{height:3px}50%{height:12px}}
@media (prefers-reduced-motion:reduce){.eq.on b{animation:none;height:8px}}

/* ---------- page ---------- */
.page{max-width:1180px;margin:0 auto;padding-block:18px 80px;
  padding-left:max(16px,env(safe-area-inset-left,0px));padding-right:max(16px,env(safe-area-inset-right,0px))}
.cols{display:grid;grid-template-columns:1fr;gap:22px}
@media (min-width:1000px){.cols{grid-template-columns:minmax(0,1.35fr) minmax(0,1fr);align-items:start}}
.col{display:flex;flex-direction:column;gap:22px;min-width:0}

.hero{display:flex;flex-direction:column;gap:10px}
.hero h1{font-size:clamp(28px,6.5vw,40px);font-weight:800;letter-spacing:-.015em}
.headline{font-size:17px;max-width:62ch;margin:0}
.headline .by{font-family:var(--mono);font-size:11.5px;color:var(--faint);margin-left:6px;white-space:nowrap}
.stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
@media (max-width:520px){.stats{grid-template-columns:repeat(2,minmax(0,1fr))}}
.stat{background:var(--sheet);border:1px solid var(--rule);border-radius:12px;padding:10px 12px;min-width:0}
.stat .n{font-family:var(--display);font-weight:800;font-size:24px;font-variant-numeric:tabular-nums;line-height:1.1}
.stat .l{font-size:12.5px;color:var(--muted)}

section.blk{display:flex;flex-direction:column;gap:12px}
.blk-head{display:flex;align-items:baseline;justify-content:space-between;gap:10px;flex-wrap:wrap}
.blk-head h2{font-size:22px;font-weight:600}
.blk-head .meta{font-family:var(--mono);font-size:12.5px;color:var(--muted)}
.card{background:var(--sheet);border:1px solid var(--rule);border-radius:var(--r);padding:16px}
.note{background:var(--hl);color:var(--hl-ink);border-radius:12px;padding:11px 14px;font-size:15px}
.empty{color:var(--muted);font-size:15px;padding:6px 2px}

/* ---------- course cards ---------- */
.course{background:var(--sheet);border:1px solid var(--rule);border-radius:var(--r);overflow:hidden}
.course .bar{height:4px;background:var(--rule)}
.course .bar span{display:block;height:100%;background:var(--c,var(--accent))}
.course .in{padding:14px 16px 16px;display:flex;flex-direction:column;gap:10px}
.course .hd{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.dot{width:10px;height:10px;border-radius:50%;background:var(--c,var(--accent));flex:0 0 auto}
.course h3{font-size:19px;font-weight:600}
.course .wd{font-family:var(--mono);font-size:12.5px;color:var(--muted)}
.course .tm{margin-left:auto;font-family:var(--mono);font-size:12.5px;color:var(--muted);white-space:nowrap}
.assign{font-size:15.5px;max-width:68ch}
.assign p{margin:0 0 8px}
.assign ul{margin:0 0 8px;padding-left:20px}
.assign.clip{max-height:9.5em;overflow:hidden;-webkit-mask-image:linear-gradient(#000 70%,transparent);mask-image:linear-gradient(#000 70%,transparent)}
.lit{border-left:3px solid var(--c,var(--accent));padding-left:10px;font-size:14.5px}
details.notes{font-size:14px;color:var(--muted)}
details.notes summary{cursor:pointer}
.res{display:flex;flex-wrap:wrap;gap:6px}
.res a{font-size:13px;background:var(--sheet-2);border:1px solid var(--rule);border-radius:8px;padding:3px 8px;text-decoration:none;color:var(--ink)}
.res a:hover{border-color:var(--accent)}
.actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.btn{border:1px solid var(--rule);background:var(--sheet);border-radius:10px;padding:8px 14px;cursor:pointer;font-weight:700;font-size:15px;display:inline-flex;align-items:center;gap:6px;text-decoration:none;color:var(--ink)}
.btn:hover{border-color:var(--accent)}
.btn.primary{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}
.btn.good{background:var(--done);border-color:var(--done);color:var(--accent-ink)}
.btn.ghost{background:none}
.btn.sm{padding:5px 10px;font-size:13.5px;border-radius:8px}
.btn:disabled{opacity:.5;cursor:default}
.course.done .in{gap:6px}
.course.done h3{color:var(--muted)}
.donebadge{display:inline-flex;align-items:center;gap:6px;color:var(--done);font-weight:700;font-size:14px}
.later-list{display:flex;flex-direction:column;gap:6px}
.later-row{display:flex;align-items:center;gap:10px;font-size:14.5px;color:var(--muted);padding:6px 2px}

/* ---------- to-dos ---------- */
.add{display:flex;flex-direction:column;gap:8px}
.add-row{display:flex;gap:8px}
.add-row input[type=text]{flex:1;min-width:0}
.field{border:1px solid var(--rule);background:var(--sheet);border-radius:10px;padding:9px 12px;min-height:42px}
.field:focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}
.opts{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.seg{display:inline-flex;border:1px solid var(--rule);border-radius:10px;overflow:hidden;background:var(--sheet)}
.seg button{border:0;background:none;padding:6px 11px;cursor:pointer;font-size:13.5px}
.seg button[aria-pressed="true"]{background:var(--accent);color:var(--accent-ink)}
.tasks{list-style:none;margin:0;padding:0;display:flex;flex-direction:column}
.task{display:flex;align-items:flex-start;gap:10px;padding:10px 2px;border-bottom:1px solid var(--rule)}
.task:last-child{border-bottom:0}
.task .ck{appearance:none;-webkit-appearance:none;flex:0 0 auto;width:22px;height:22px;margin-top:2px;border:2px solid var(--muted);border-radius:7px;background:var(--sheet);cursor:pointer;display:grid;place-content:center}
.task .ck:checked{background:var(--done);border-color:var(--done)}
.task .ck:checked::after{content:"";width:6px;height:11px;border:solid var(--sheet);border-width:0 2.5px 2.5px 0;transform:rotate(45deg) translate(-1px,-1px)}
.task .body{flex:1;min-width:0}
.task .ttl{overflow-wrap:anywhere}
.task .sub{font-size:13px;color:var(--muted);display:flex;gap:8px;flex-wrap:wrap}
.task .sub .late{color:var(--danger)}
.task.done .ttl{text-decoration:line-through;color:var(--muted)}
.menu{position:relative}
.menu-pop{position:absolute;right:0;top:calc(100% + 4px);z-index:25;background:var(--sheet);border:1px solid var(--rule);border-radius:12px;box-shadow:var(--shadow);padding:6px;display:flex;flex-direction:column;min-width:190px}
.menu-pop button{background:none;border:0;text-align:left;padding:8px 10px;border-radius:8px;cursor:pointer;font-size:14.5px}
.menu-pop button:hover{background:var(--sheet-2)}

/* ---------- lists in life column ---------- */
.list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px}
.list li{display:flex;gap:10px;align-items:baseline}
.list .when{font-family:var(--mono);font-size:12.5px;color:var(--muted);min-width:76px;white-space:nowrap}
.kv{display:grid;grid-template-columns:auto 1fr;gap:4px 14px;font-size:15px}
.kv dt{color:var(--muted)}
.kv dd{margin:0}
.money-top{display:flex;gap:18px;align-items:baseline;flex-wrap:wrap}
.money-top .big{font-family:var(--display);font-weight:800;font-size:34px;font-variant-numeric:tabular-nums}
.amt{font-variant-numeric:tabular-nums;font-family:var(--mono);font-size:14px;white-space:nowrap}
.amt.in{color:var(--done)}
.amt.out{color:var(--muted)}
.pending{font-size:13px;color:var(--warn)}

/* ---------- sheets (music, parent tools) ---------- */
.scrim{position:fixed;inset:0;background:rgba(10,14,25,.42);z-index:40}
.sheet{position:fixed;z-index:41;background:var(--sheet);border:1px solid var(--rule);box-shadow:var(--shadow);display:flex;flex-direction:column;
  left:0;right:0;bottom:0;max-height:88vh;border-radius:18px 18px 0 0;padding-bottom:env(safe-area-inset-bottom,0px)}
@media (min-width:820px){.sheet{left:auto;right:16px;top:70px;bottom:16px;width:440px;max-height:none;border-radius:18px}}
.sheet-hd{display:flex;align-items:center;gap:10px;padding:14px 16px;border-bottom:1px solid var(--rule)}
.sheet-hd h2{font-size:20px;flex:1}
.sheet-bd{overflow:auto;padding:14px 16px 20px;display:flex;flex-direction:column;gap:14px;-webkit-overflow-scrolling:touch}
.tabs{display:flex;gap:6px}
.tabs button{border:1px solid var(--rule);background:var(--sheet);border-radius:99px;padding:5px 12px;cursor:pointer;font-size:14px}
.tabs button[aria-selected="true"]{background:var(--ink);color:var(--paper);border-color:var(--ink)}
.np{display:flex;gap:12px;align-items:center}
.np img,.np .art{width:64px;height:64px;border-radius:10px;object-fit:cover;background:var(--sheet-2);flex:0 0 auto}
.np .meta{min-width:0;flex:1}
.np .title{font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.np .artist{font-size:14px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ctrl{display:flex;gap:8px;justify-content:center}
.ctrl .btn{min-width:52px;justify-content:center}
.prog{height:4px;background:var(--rule);border-radius:2px;overflow:hidden}
.prog span{display:block;height:100%;background:var(--accent)}
.results{list-style:none;margin:0;padding:0;display:flex;flex-direction:column}
.results li{display:flex;gap:10px;align-items:center;padding:8px 0;border-bottom:1px solid var(--rule)}
.results li:last-child{border-bottom:0}
.results img{width:42px;height:42px;border-radius:6px;object-fit:cover;background:var(--sheet-2);flex:0 0 auto}
.results .meta{flex:1;min-width:0}
.results .meta div{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.results .meta .s{font-size:13px;color:var(--muted)}
#yt-frame-wrap{border-radius:12px;overflow:hidden;background:#000;aspect-ratio:16/9;max-width:100%}
#yt-frame-wrap.mini{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}

/* ---------- login ---------- */
.gate{min-height:100dvh;display:grid;place-items:center;padding-left:max(16px,env(safe-area-inset-left,0px));padding-right:max(16px,env(safe-area-inset-right,0px));padding-block:24px}
.gate .card{width:min(420px,100%);display:flex;flex-direction:column;gap:14px;padding:22px}
.gate h1{font-size:30px;font-weight:800}
.err{color:var(--danger);font-size:14px;min-height:1.2em}

/* ---------- parent ---------- */
.ptable{width:100%;border-collapse:collapse;font-size:14.5px}
.ptable th,.ptable td{text-align:left;padding:8px 6px;border-bottom:1px solid var(--rule);vertical-align:top}
.ptable th{font-size:12.5px;color:var(--muted);font-weight:400;font-family:var(--mono)}
.tablewrap{overflow-x:auto}
.stepper{display:inline-flex;align-items:center;gap:4px}
.stepper input{width:52px;text-align:center}
.toast{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(18px + env(safe-area-inset-bottom,0px));z-index:60;background:var(--ink);color:var(--paper);padding:10px 16px;border-radius:12px;font-size:14.5px;box-shadow:var(--shadow);max-width:calc(100% - 32px)}
.toast button{background:none;border:0;color:inherit;text-decoration:underline;cursor:pointer;margin-left:8px;font-weight:700}
