/* ---------- Blueprint and study planner: a month calendar with the day beside it, and the blueprint as a list ---------- */
/* each system has a hue (--c, a number); colours are mixed with the theme so they stay soft in light and dark */
.plan { max-width: 1320px; --hue: hsl(var(--c, 212) 52% 48%); }
@media (min-width: 900px) { main:has(.plan) { max-width: none; padding-left: 32px; padding-right: 32px; } }
.plan-empty { padding: 60px 0; }
.plan [style*="--c"] { --hue: hsl(var(--c) 52% 48%); }

.pl-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 18px; }
.pl-head h1 { margin: 6px 0 4px; font: 750 30px/1.15 var(--sans); letter-spacing: -.02em; }
.pl-head p { margin: 0; font-size: 14px; }
.pl-stats { display: flex; gap: 10px; flex-wrap: wrap; }
.stat { position: relative; display: flex; align-items: center; gap: 12px; min-width: 168px; padding: 11px 16px 11px 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); text-align: left; color: var(--text); }
.stat b { display: block; font: 700 17px/1.2 var(--sans); letter-spacing: -.01em; }
.stat span { display: block; font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.stat > svg { width: 22px; height: 22px; margin: 0 4px 0 6px; color: var(--dept); flex: none; }
.stat.date { cursor: pointer; }
.stat.date input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.stat.today:hover, .stat.date:hover { border-color: color-mix(in srgb, var(--dept) 35%, var(--line)); }
.ring { --p: 0; width: 46px; height: 46px; border-radius: 50%; flex: none; display: grid; place-items: center; background: conic-gradient(var(--dept) calc(var(--p) * 1%), color-mix(in srgb, var(--text) 8%, transparent) 0); }
.ring b { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); font: 750 11.5px/1 var(--sans); font-variant-numeric: tabular-nums; }

.pl-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 4px 0 14px; }
.pl-views button { display: inline-flex; align-items: center; gap: 7px; padding: 8px 16px; }
.pl-views svg.i { width: 15px; height: 15px; }
.pl-due { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; padding: 13px 16px 13px 18px; border-radius: 16px; background: color-mix(in srgb, var(--warn) 9%, var(--surface)); border: 1px solid color-mix(in srgb, var(--warn) 28%, var(--line)); }
.pl-due b { display: block; font-size: 14.5px; }
.pl-due span { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }

/* ---- the month ---- */
.pl-cal { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 18px; align-items: start; }
@media (max-width: 1060px) { .pl-cal { grid-template-columns: 1fr; } }
.mcal { padding: 18px 18px 16px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); }
.mcal-h { display: flex; justify-content: space-between; align-items: center; margin: 0 2px 12px; }
.mcal-h h2 { margin: 0; font: 750 22px/1.2 var(--sans); letter-spacing: -.02em; }
.mcal-h h2 span { font-weight: 400; color: var(--muted); }
.mcal-nav { display: flex; align-items: center; gap: 6px; }
.mcal-nav .chip { padding: 6px 12px; font-size: 12.5px; font-weight: 650; }
.mcal-nav .nav { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); border: 1px solid var(--line); }
.mcal-nav .nav:hover { color: var(--text); background: color-mix(in srgb, var(--text) 5%, transparent); }
.mcal-dow { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; padding: 0 2px 6px; }
.mcal-dow span { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding-left: 8px; }
.mcal-g { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cd { position: relative; display: flex; flex-direction: column; gap: 4px; min-height: 96px; min-width: 0; padding: 6px 6px 7px; border-radius: 13px; text-align: left; color: var(--text); background: color-mix(in srgb, var(--text) 2.6%, var(--surface)); border: 1px solid transparent; transition: border-color .15s, box-shadow .15s, background .15s; overflow: hidden; }
.cd:hover { border-color: var(--line-2, var(--line)); }
.cd.off { background: transparent; border: 1px dashed var(--line); }
.cd.out { opacity: .38; }
.cd.past .dn { color: var(--muted); }
.cd.sel { border-color: var(--dept); box-shadow: 0 0 0 3px color-mix(in srgb, var(--dept) 16%, transparent); background: var(--surface); }
.cd.exam { background: color-mix(in srgb, var(--bad) 7%, var(--surface)); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.cd .dn { display: inline-flex; align-items: center; justify-content: center; gap: 3px; align-self: flex-start; min-width: 25px; height: 25px; padding: 0 6px; border-radius: 999px; font: 700 13px/1 var(--sans); font-variant-numeric: tabular-nums; }
.cd .dn svg.i { width: 12px; height: 12px; color: var(--ok); }
.cd.today .dn { background: var(--dept); color: #fff; }
.cd.today .dn svg.i { color: #fff; }
.exam-t { position: absolute; top: 9px; right: 9px; font: 750 10px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--bad); font-style: normal; }
.chips { display: grid; gap: 3px; min-width: 0; }
.chips i { display: block; min-width: 0; padding: 3px 6px 3px 6px; border-radius: 6px; border-left: 2.5px solid var(--hue); background: color-mix(in srgb, var(--hue) 12%, var(--surface)); color: color-mix(in srgb, var(--hue) 70%, var(--text)); font: 600 11px/1.3 var(--sans); font-style: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chips i.ok { opacity: .5; text-decoration: line-through; }
.chips i.rev { --hue: var(--dept); }
.chips small { font-size: 10.5px; font-weight: 600; color: var(--muted); padding-left: 4px; }
.cd .nt { position: absolute; top: 10px; right: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--warn); }
.cd.exam .nt { top: 24px; }

/* ---- the day ---- */
.dayp { position: sticky; top: 16px; display: grid; gap: 14px; padding: 20px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); }
.dp-h h2 { margin: 3px 0 2px; font: 750 26px/1.15 var(--sans); letter-spacing: -.02em; }
.dp-h .muted { font-size: 13px; }
.dp-exam { padding: 11px 13px; border-radius: 12px; background: color-mix(in srgb, var(--bad) 8%, var(--surface)); color: var(--bad); font-size: 13.5px; font-weight: 600; }
.dp-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.dp-list li { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 8px 10px 11px; border-radius: 14px; border-left: 3px solid var(--hue); background: color-mix(in srgb, var(--hue) 7%, var(--surface)); }
.dp-list .nm { font-size: 14.5px; font-weight: 600; line-height: 1.35; }
.dp-list .nm small { display: block; margin-top: 2px; font-size: 12px; font-weight: 500; color: var(--muted); }
.dp-list li.s2 .nm { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 60%, transparent); }
.dp-list .ops { display: flex; gap: 2px; }
.dp-list .op { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: var(--muted); }
.dp-list .op:hover { background: color-mix(in srgb, var(--text) 6%, transparent); color: var(--text); }
.dp-list .op.rm:hover { color: var(--bad); background: color-mix(in srgb, var(--bad) 9%, transparent); }
.dp-empty { margin: 0; padding: 18px 14px; border-radius: 14px; border: 1px dashed var(--line); color: var(--muted); font-size: 13.5px; line-height: 1.5; text-align: center; }
.dp-acts { display: grid; gap: 8px; }
.plan .btn.soft { background: var(--dept-soft); color: var(--dept); border-color: transparent; }
.dp-note { display: grid; gap: 7px; }
.dp-note > span { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.dp-note svg.i { width: 14px; height: 14px; }
.dp-note textarea { width: 100%; min-height: 104px; resize: vertical; padding: 12px 13px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--warn) 22%, var(--line)); background: color-mix(in srgb, var(--warn) 5%, var(--surface)); color: var(--text); font: 14px/1.55 var(--sans); }
.dp-note textarea:focus { outline: none; border-color: color-mix(in srgb, var(--warn) 55%, var(--line)); }

/* ---- shared ---- */
.plan .tick { width: 24px; height: 24px; flex: none; border-radius: 50%; display: grid; place-items: center; border: 1.6px solid var(--line-2, var(--line)); background: var(--surface); color: #fff; transition: background .15s, border-color .15s; }
.plan .tick:hover { border-color: var(--ok); }
.plan .tick svg.i { width: 14px; height: 14px; }
.plan .s2 .tick { background: var(--ok); border-color: var(--ok); }
.plan .wq { font-size: 12px; font-weight: 700; color: var(--muted); padding: 3px 8px; border-radius: 8px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.plan .wq.hi { color: var(--dept); background: color-mix(in srgb, var(--dept) 10%, transparent); }
.plan .tag { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px; font: 600 11.5px/1.2 var(--sans); font-style: normal; background: color-mix(in srgb, var(--text) 6%, transparent); color: var(--muted); }
.plan .tag svg.i { width: 12px; height: 12px; }
.plan .tag.when { background: var(--dept-soft); color: var(--dept); }
.plan .tag.lec { color: var(--dept); }
.plan .tag.study { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); }
.plan .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--hue); flex: none; display: inline-block; }
.plan .f { display: grid; gap: 7px; }
.plan .f > span { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.plan .f small { font-size: 12.5px; }
.plan .seg.block { display: flex; }
.plan .seg.block button { flex: 1; }

/* ---- the blueprint list ---- */
.pl-tools { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.pl-search { display: flex; align-items: center; gap: 8px; min-width: 260px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); }
.pl-search input { flex: 1; min-width: 0; padding: 9px 0; border: 0; background: transparent; color: var(--text); font: 14px var(--sans); outline: none; box-shadow: none; }
.sysg { columns: 2 380px; column-gap: 16px; }
.sysc { break-inside: avoid; margin: 0 0 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.sysc header { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 14px 16px 12px; }
.sysc header b { font-size: 15.5px; font-weight: 700; }
.sysc header > span { font-size: 12.5px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.sysc .sbar { grid-column: 1 / -1; display: block; height: 4px; border-radius: 4px; background: color-mix(in srgb, var(--text) 7%, transparent); overflow: hidden; }
.sysc .sbar i { display: block; height: 100%; border-radius: inherit; background: var(--hue); transition: width .3s; }
.tr { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 10px 12px 10px 16px; border-top: 1px solid var(--line); }
.tr .tt { display: grid; gap: 5px; min-width: 0; }
.tr .nm { font-size: 14.5px; font-weight: 550; line-height: 1.35; }
.tr.s2 .nm { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 60%, transparent); }
.tr .meta { display: flex; gap: 6px; flex-wrap: wrap; }
.plan-btn { display: inline-flex; align-items: center; gap: 5px; padding: 6px 10px; border-radius: 10px; font: 600 12.5px/1 var(--sans); color: var(--dept); border: 1px solid color-mix(in srgb, var(--dept) 28%, transparent); background: transparent; }
.plan-btn:hover { background: var(--dept-soft); }
.plan-btn svg.i { width: 13px; height: 13px; }
.pl-none { padding: 30px 0; text-align: center; }

/* ---- drawers ---- */
.pl-dr { position: fixed; inset: 0; z-index: 60; display: flex; justify-content: flex-end; background: rgba(16, 20, 26, 0); transition: background .25s ease; }
.pl-dr.in { background: rgba(16, 20, 26, .28); }
.pl-dr .dr { width: min(470px, 100%); height: 100%; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; padding: 22px 22px 28px; background: var(--surface); box-shadow: -12px 0 40px rgba(0, 0, 0, .12); transform: translateX(104%); transition: transform .3s cubic-bezier(.2, .8, .2, 1); }
.pl-dr.in .dr { transform: none; }
.dr-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.dr-h h2 { margin: 3px 0 0; font: 750 22px/1.2 var(--sans); letter-spacing: -.02em; }
.dr-h h2.sm { font-size: 18px; line-height: 1.3; }
.dr-hint { margin: -4px 0 0; line-height: 1.5; }
.dr .pl-tools { flex-direction: column; align-items: stretch; margin: 0; }
.dr .pl-tools .seg { display: flex; }
.dr .pl-tools .seg button { flex: 1; padding-left: 6px; padding-right: 6px; }
.dr-scroll { display: grid; gap: 14px; }
.dr-sys > b { display: flex; align-items: center; gap: 8px; margin: 2px 0 7px; font-size: 13px; font-weight: 700; color: var(--muted); }
.pick { width: 100%; display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 10px; margin-bottom: 6px; padding: 10px 10px 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); text-align: left; color: var(--text); transition: border-color .15s, background .15s; }
.pick .box { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; border: 1.6px solid var(--line-2, var(--line)); color: #fff; }
.pick .box svg.i { width: 13px; height: 13px; }
.pick.on { border-color: var(--hue); background: color-mix(in srgb, var(--hue) 8%, var(--surface)); }
.pick.on .box { background: var(--hue); border-color: var(--hue); }
.pick .nm { font-size: 14px; font-weight: 550; line-height: 1.35; }
.pick .nm small { display: block; margin-top: 2px; font-size: 12px; font-weight: 500; color: var(--muted); }
.pick.s2:not(.on) .nm { color: var(--muted); }
.soon { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.sd { display: grid; gap: 2px; padding: 10px 6px; border-radius: 13px; border: 1px solid var(--line); background: var(--surface); text-align: center; color: var(--text); transition: background .15s, border-color .15s; }
.sd span { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.sd b { font-size: 14px; font-weight: 700; }
.sd small { font-size: 11.5px; color: var(--muted); }
.sd:hover { border-color: color-mix(in srgb, var(--dept) 40%, var(--line)); }
.sd.on { background: var(--dept); border-color: var(--dept); color: #fff; }
.sd.on span, .sd.on small { color: rgba(255, 255, 255, .8); }
.when-list { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.when-list > b { width: 100%; font-size: 12.5px; color: var(--muted); }
.when-list .tag { background: var(--dept-soft); color: var(--dept); padding-right: 4px; }
.when-list .tag button { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; color: inherit; }
.dows { display: flex; gap: 6px; flex-wrap: wrap; }
.dows button { min-width: 48px; height: 40px; padding: 0 8px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font: 650 13px var(--sans); color: var(--muted); }
.dows button.on { background: var(--dept); border-color: var(--dept); color: #fff; }
.setup-sum { padding: 14px 16px; border-radius: 14px; background: var(--dept-soft); }
.setup-sum b { display: block; font-size: 17px; color: var(--dept); }
.setup-sum span { font-size: 13px; color: var(--muted); }
.pl-search input.text:focus { outline: none; border: 0; }
.pl-search:focus-within { border-color: var(--dept); box-shadow: 0 0 0 3px color-mix(in srgb, var(--dept) 15%, transparent); }
/* a narrow day shows each topic as a short bar in its system's colour; the names are in the day panel */
.cd { container-type: inline-size; }
@container (max-width: 92px) {
  .chips { gap: 3px; padding: 0 1px; }
  .chips i { height: 6px; padding: 0; border: 0; border-radius: 3px; font-size: 0; background: var(--hue); }
  .chips i.ok { opacity: .35; }
  .chips i.rev { height: auto; padding: 2px 4px; font-size: 10px; background: color-mix(in srgb, var(--dept) 12%, var(--surface)); }
  .chips small { padding-left: 1px; font-size: 10px; }
  .chips small .w { display: none; }
}
.pl-cal { grid-template-columns: minmax(0, 1fr) 330px; gap: 16px; }
