/* Go daily. Loaded after course.css; tokens come from there. Phone shaped, desktop tolerant. */
.daily { max-width: 520px; margin: 0 auto; padding: 3rem 1rem 9rem; }
.daily.map { padding-bottom: 4rem; }
.daily .backlink { margin-bottom: 1.2rem; }
@media (min-width: 900px) {
  .daily.map { max-width: 760px; padding-top: 3.5rem; }
  .daily.lesson { max-width: 640px; }
  .d-unit { padding: 1.3rem 1.6rem 1.5rem; }
  .d-node:nth-child(odd) { padding-left: 1rem; }
  .d-node:nth-child(even) { padding-left: 7.5rem; }
  .d-node.cp { padding-left: 4.2rem; }
  .d-nodes { gap: .8rem; }
  .d-unit.soon { padding: .8rem 1.6rem; }
}
.d-unit.soon .uh { margin-bottom: 0; }
.d-unit.soon .d-empty { display: none; }
.d-unit.soon .uh .d-src::after { content: ", coming soon"; }
.d-top { display: flex; align-items: center; gap: .8rem; margin-bottom: 1.1rem; }
.d-top .close { color: var(--muted); font-size: 1.4rem; text-decoration: none; display: flex; }
.d-top .close:hover { color: var(--ink); }
.d-bar { flex: 1; height: 12px; background: var(--line); border-radius: 999px; overflow: hidden; }
.d-bar > i { display: block; height: 100%; width: 0; background: var(--good); border-radius: 999px; transition: width .35s ease; }
.d-count { font-size: .8rem; font-weight: 700; color: var(--muted); min-width: 3em; text-align: right; }

.d-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 1.4rem 1.3rem 1.5rem; min-height: 18rem; animation: fadein .18s ease; }
.d-kind { font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin-bottom: .6rem; }
.d-card h2 { margin: 0 0 .6rem; font-size: 1.35rem; line-height: 1.25; }
.d-card p.body { margin: 0 0 1rem; font-size: 1.05rem; }
.d-ex { border: 1px solid var(--line); border-radius: 12px; background: var(--bg); padding: .7rem .9rem; }
.d-ex .lab { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: .3rem; }
.d-ex pre { margin: 0; border: none; background: none; padding: 0; font-size: .86rem; white-space: pre-wrap; word-break: break-word; }
.d-q { font-size: 1.15rem; font-weight: 600; margin: 0 0 1rem; line-height: 1.4; }
.d-opts { display: flex; flex-direction: column; gap: .55rem; }
.d-opt { text-align: left; font: inherit; font-size: 1rem; line-height: 1.4; padding: .8rem 1rem; border: 2px solid var(--line); border-bottom-width: 4px; border-radius: 12px; background: var(--surface); color: inherit; cursor: pointer; }
.d-opt:hover:not(:disabled) { border-color: var(--muted); }
.d-opt.sel { border-color: var(--accent); background: var(--accent-soft); }
.d-opt.right { border-color: var(--good); background: color-mix(in srgb, var(--good) 14%, var(--surface)); }
.d-opt.wrong { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 14%, var(--surface)); }
.d-opt:disabled { cursor: default; }
.d-judge { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.d-judge .d-opt { text-align: center; font-weight: 700; font-size: 1.05rem; padding: 1rem; }
.d-mono .d-opt { font-family: ui-monospace, Menlo, monospace; font-size: .88rem; }
.d-state { font-size: 1.1rem; line-height: 1.5; margin: 0 0 1.1rem; padding: .9rem 1rem; border-left: 4px solid var(--accent); background: var(--bg); border-radius: 0 12px 12px 0; }

/* order the steps */
.d-seq { min-height: 3.4rem; border: 2px dashed var(--line); border-radius: 12px; padding: .5rem; display: flex; flex-direction: column; gap: .4rem; margin-bottom: .8rem; }
.d-bank { display: flex; flex-wrap: wrap; gap: .5rem; }
.d-chip { font: inherit; font-size: .95rem; line-height: 1.35; padding: .55rem .85rem; border: 2px solid var(--line); border-bottom-width: 4px; border-radius: 10px; background: var(--surface); color: inherit; cursor: pointer; text-align: left; }
.d-chip:hover:not(:disabled) { border-color: var(--muted); }
.d-seq .d-chip { display: flex; gap: .6rem; align-items: baseline; }
.d-seq .d-chip b { color: var(--muted); font-size: .8rem; min-width: 1.2em; }
.d-chip.ghost { visibility: hidden; }
.d-chip.right { border-color: var(--good); }
.d-chip.wrong { border-color: var(--bad); }
.d-chip:disabled { cursor: default; }

/* fill the blank */
.d-sent { font-size: 1.15rem; line-height: 1.8; margin-bottom: 1rem; }
.d-slot { display: inline-block; min-width: 5.5em; border-bottom: 3px solid var(--accent); padding: 0 .3em; text-align: center; font-weight: 700; color: var(--accent); }
.d-slot.empty::after { content: "\00a0"; }
.d-slot.right { color: var(--good); border-color: var(--good); }
.d-slot.wrong { color: var(--bad); border-color: var(--bad); }

/* fixed footer: check button and feedback */
.d-foot { position: fixed; left: 0; right: 0; bottom: 0; background: var(--surface); border-top: 2px solid var(--line); padding: .9rem 1rem 1.1rem; z-index: 20; }
.d-foot .in { max-width: 520px; margin: 0 auto; display: flex; flex-direction: column; gap: .7rem; }
.d-foot.good { background: color-mix(in srgb, var(--good) 14%, var(--surface)); border-color: var(--good); }
.d-foot.bad { background: color-mix(in srgb, var(--bad) 14%, var(--surface)); border-color: var(--bad); }
.d-fb { display: none; }
.d-foot.good .d-fb, .d-foot.bad .d-fb { display: block; }
.d-fb b { display: flex; align-items: center; gap: .4rem; font-size: 1.05rem; }
.d-fb b .ic { font-size: 1.3em; }
.d-foot.good .d-fb b { color: var(--good); }
.d-foot.bad .d-fb b { color: var(--bad); }
.d-fb p { margin: .25rem 0 0; font-size: .95rem; line-height: 1.45; }
.d-fb .d-src { font-size: .74rem; color: var(--muted); margin-top: .2rem; }
.d-btn { font: inherit; font-weight: 700; font-size: 1rem; padding: .85rem 1.2rem; border-radius: 12px; border: none; cursor: pointer; background: var(--accent); color: #fff; width: 100%; letter-spacing: .04em; text-transform: uppercase; }
.d-btn:disabled { opacity: .4; cursor: not-allowed; }
.d-foot.good .d-btn { background: var(--good); }
.d-foot.bad .d-btn { background: var(--bad); }
.d-btn.ghost { background: var(--surface); color: var(--ink); border: 2px solid var(--line); }
.d-btn + .d-btn { margin-top: .3rem; }

/* end of lesson */
.d-end { text-align: center; padding: 1.5rem .5rem; }
.d-end .big { font-size: 3.4rem; color: var(--accent); line-height: 1; }
.d-end .big.good { color: var(--good); }
.d-end h2 { margin: .6rem 0 .3rem; }
.d-end p { color: var(--muted); margin: 0; }
.d-stats { display: flex; justify-content: center; gap: .8rem; margin: 1.3rem 0; }
.d-stat { border: 1px solid var(--line); border-radius: 12px; padding: .7rem .9rem; min-width: 6.2rem; background: var(--surface); }
.d-stat b { display: block; font-size: 1.4rem; }
.d-stat span { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.d-stat .ic { color: var(--accent); }

/* the path map */
.d-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.2rem; flex-wrap: wrap; }
.d-head h1 { margin: .2rem 0 0; font-size: 1.7rem; }
.d-head .kicker a { color: inherit; text-decoration: none; }
.d-chips { display: flex; gap: .5rem; flex-wrap: wrap; }
.d-chipstat { display: flex; align-items: center; gap: .35rem; font-weight: 700; font-size: .92rem; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: .35rem .8rem; }
.d-chipstat .ic { color: var(--accent); font-size: 1.15em; }
.d-section { margin: 1.6rem 0 .6rem; font-size: .76rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.d-unit { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); padding: 1rem 1.1rem 1.1rem; margin-bottom: 1rem; }
.d-unit.soon { opacity: .55; }
.d-unit .uh { display: flex; align-items: baseline; gap: .6rem; margin-bottom: .9rem; flex-wrap: wrap; }
.d-unit .uh .n { font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.d-unit .uh h3 { margin: 0; font-size: 1.15rem; }
.d-unit .uh .d-src { margin-left: auto; font-size: .78rem; color: var(--muted); }
.d-nodes { display: flex; flex-direction: column; gap: .5rem; position: relative; }
.d-nodes svg.d-line { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 0; overflow: visible; }
.d-nodes svg.d-line line { stroke: var(--line); stroke-width: 5; stroke-linecap: round; }
.d-nodes svg.d-line line.done { stroke: var(--good); }
.d-node { display: flex; align-items: center; gap: .9rem; text-decoration: none; color: inherit; padding: .35rem .4rem; border-radius: 12px; position: relative; z-index: 1; }
.d-node:nth-child(odd) { padding-left: 1.8rem; }
.d-node.cp { padding-left: .4rem; }
a.d-node:hover { background: var(--bg); }
.d-node .dot { width: 3rem; height: 3rem; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 3px solid var(--line); background: var(--bg); color: var(--muted); font-weight: 800; flex: none; font-size: 1.05rem; }
.d-node .dot .ic { font-size: 1.35rem; }
.d-node.cp .dot { border-radius: 12px; }
.d-node.next .dot { border-color: var(--accent); background: var(--accent); color: #fff; animation: dpulse 1.8s ease-in-out infinite; }
.d-node.done .dot { border-color: var(--good); background: var(--good); color: #fff; }
.d-node.perfect .dot { border-color: #c9960c; background: #c9960c; color: #fff; }
.d-node.locked { cursor: default; }
.d-node .t { display: flex; flex-direction: column; }
.d-node .t b { font-size: 1rem; }
.d-node .t span { font-size: .8rem; color: var(--muted); }
@keyframes dpulse { 0%, 100% { box-shadow: 0 0 0 4px var(--accent-soft); } 50% { box-shadow: 0 0 0 9px var(--accent-soft); } }
.d-empty { color: var(--muted); font-size: .9rem; margin: .4rem 0 0; }

/* icon tiles, intro screens, flip cards, kind labels with icons */
.d-tile { width: 3.8rem; height: 3.8rem; border-radius: 16px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 2.1rem; margin-bottom: .9rem; }
.d-kind .ic { font-size: 1.25em; vertical-align: -.22em; margin-right: .15rem; }
.d-goals { list-style: none; padding: 0; margin: .2rem 0 1rem; display: flex; flex-direction: column; gap: .55rem; }
.d-goals li { display: flex; align-items: flex-start; gap: .6rem; font-size: 1.02rem; line-height: 1.4; }
.d-goals .ic { color: var(--good); font-size: 1.35em; flex: none; margin-top: .05em; }
.d-meta { margin: 0; color: var(--muted); font-size: .9rem; display: flex; align-items: center; gap: .4rem; }
.d-meta .ic { font-size: 1.25em; color: var(--accent); }
.d-hint { margin: 1.2rem 0 0; color: var(--muted); font-size: .9rem; display: flex; align-items: center; gap: .4rem; }
.d-hint .ic { color: var(--accent); font-size: 1.2em; }
.d-card.d-flip { perspective: 1200px; cursor: pointer; padding: 0; border: none; background: none; min-height: 0; }
.d-flip-inner { position: relative; min-height: 21rem; transition: transform .55s; transform-style: preserve-3d; }
.d-flip.on .d-flip-inner { transform: rotateY(180deg); }
.d-face { position: absolute; inset: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 1.4rem 1.3rem 1.5rem; backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow-y: auto; }
.d-face.front { border-bottom: 4px solid var(--accent); }
.d-face.back { transform: rotateY(180deg); border-bottom: 4px solid var(--good); }
.d-face .body { font-size: 1.05rem; margin: 0 0 1rem; }
.d-judge .d-opt .ic { font-size: 1.3em; vertical-align: -.25em; margin-right: .2rem; }
.d-section .ic { font-size: 1.5em; vertical-align: -.35em; margin-right: .25rem; color: var(--accent); }
.d-utile { width: 2.2rem; height: 2.2rem; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; font-size: 1.3rem; align-self: center; margin-right: .2rem; }
.d-unit.soon .d-utile { opacity: .8; }
.d-node.open .dot { border-color: var(--accent); color: var(--accent); }
.d-node.next .dot .ic, .d-node.open .dot .ic { font-size: 1.5rem; }

/* points, streak, levels, second art style */
.ic.art { width: 1em; height: 1em; }
.d-tile .ic.art, .d-utile .ic.art, .d-level .d-art .ic.art { font-size: 1.15em; }
.d-tile { background: color-mix(in srgb, var(--accent) 7%, var(--surface)); font-size: 2.4rem; }
.d-pts { display: inline-flex; align-items: center; gap: .2rem; font-size: .85rem; font-weight: 800; color: var(--accent); min-width: 3.2em; justify-content: flex-end; }
.d-pts .ic { font-size: 1.2em; }
.d-pts.pop { animation: dpop .5s ease; }
@keyframes dpop { 0% { transform: scale(1); } 40% { transform: scale(1.45); } 100% { transform: scale(1); } }
.d-gain { margin-left: auto; font-size: .95rem; font-weight: 800; background: var(--surface); border-radius: 999px; padding: .1rem .6rem; }
.d-combo { color: var(--accent); font-weight: 700; }
.d-combo .ic { font-size: 1.2em; vertical-align: -.2em; }
.d-end .big .ic.art { font-size: 1.3em; }
.d-break { width: 100%; max-width: 20rem; margin: .4rem auto 1rem; font-size: .92rem; border-collapse: collapse; }
.d-break td { padding: .3rem .4rem; border-bottom: 1px dashed var(--line); text-align: left; }
.d-break td + td { text-align: right; font-weight: 700; }
.d-break tr.sum td { border-bottom: none; font-weight: 800; color: var(--accent); }
.d-break tr.note td { border-bottom: none; color: var(--muted); font-weight: 600; }
.d-streakcard { display: flex; flex-direction: column; gap: .6rem; text-align: left; border: 1px solid var(--line); border-radius: 14px; padding: .9rem 1rem; background: var(--surface); margin: .6rem 0; }
.d-streakcard .t b { display: flex; align-items: center; gap: .35rem; font-size: 1.05rem; }
.d-streakcard .t b .ic { color: var(--accent); font-size: 1.3em; }
.d-streakcard .t span { display: block; font-size: .85rem; color: var(--muted); }
.d-week { display: flex; justify-content: space-between; gap: .3rem; }
.d-day { display: flex; flex-direction: column; align-items: center; gap: .25rem; flex: 1; }
.d-day i { width: 1.9rem; height: 1.9rem; border-radius: 50%; border: 2px solid var(--line); background: var(--bg); display: flex; align-items: center; justify-content: center; color: #fff; font-style: normal; }
.d-day.on i { background: var(--good); border-color: var(--good); }
.d-day.today i { box-shadow: 0 0 0 3px var(--accent-soft); }
.d-day.today b { color: var(--accent); }
.d-day b { font-size: .68rem; color: var(--muted); letter-spacing: .04em; }
.d-level { display: flex; align-items: center; gap: .8rem; text-align: left; border: 1px solid var(--line); border-radius: 14px; padding: .8rem 1rem; background: var(--surface); margin: .6rem 0; }
.d-level .d-art { width: 3rem; height: 3rem; border-radius: 12px; background: color-mix(in srgb, var(--accent) 7%, var(--surface)); display: flex; align-items: center; justify-content: center; font-size: 1.9rem; flex: none; }
.d-level .t { flex: 1; min-width: 0; }
.d-level .t b { display: block; font-size: 1rem; }
.d-level .t span { display: block; font-size: .82rem; color: var(--muted); }
.d-lvbar { height: 8px; border-radius: 999px; background: var(--line); margin-top: .45rem; overflow: hidden; }
.d-lvbar i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.d-statcard { margin-bottom: 1.2rem; }
.d-statcard .d-streakcard, .d-statcard .d-level { margin: 0 0 .6rem; }
.d-minirow { display: flex; gap: 1rem; font-size: .88rem; font-weight: 700; color: var(--muted); padding: 0 .2rem; }
.d-minirow .ic { color: var(--accent); font-size: 1.25em; vertical-align: -.25em; }
.d-node.next .dot .ic.art, .d-node.open .dot .ic.art { font-size: 1.7rem; }
.d-node.next .dot { background: var(--accent-soft); border-color: var(--accent); }
.d-node.open .dot { background: var(--accent-soft); }
@media (min-width: 900px) { .d-statcard { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; align-items: stretch; } .d-statcard .d-streakcard, .d-statcard .d-level { margin: 0; } .d-statcard .d-minirow { grid-column: 1 / -1; } }

/* stats tucked into the top corner; detail opens as a popover */
.d-corner { position: relative; display: flex; align-items: center; align-self: flex-start; margin-top: .3rem; }
.d-corner .d-chipstat { font: inherit; font-weight: 700; font-size: .88rem; cursor: pointer; color: var(--ink); gap: .3rem; padding: .35rem .75rem; }
.d-corner .d-chipstat:hover { border-color: var(--accent); }
.d-corner .sep { width: 1px; height: 1em; background: var(--line); margin: 0 .25rem; }
.d-lvtag { display: inline-flex; align-items: center; gap: .3rem; color: var(--muted); font-weight: 600; }
.d-lvtag .ic.art { font-size: 1.25em; }
.d-pop { position: absolute; right: 0; top: calc(100% + .5rem); width: min(340px, 90vw); z-index: 40; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: .8rem; box-shadow: 0 12px 32px rgba(0,0,0,.14); }
.d-pop .d-streakcard, .d-pop .d-level { margin: 0 0 .6rem; box-shadow: none; }
.d-pop .d-minirow { padding: 0 .2rem .2rem; }
.d-head { align-items: flex-start; }
@media (max-width: 480px) { .d-corner .d-lvtag, .d-corner .sep-lv { display: none; } }

/* collapsed units: only the unit with the next lesson opens by default */
.d-unit:not(.soon) .uh { cursor: pointer; user-select: none; }
.d-unit.closed .d-nodes { display: none; }
.d-unit.closed .uh { margin-bottom: 0; }
.d-unit.closed { padding-bottom: 1rem; }
.d-caret { margin-left: .4rem; color: var(--muted); display: inline-flex; transition: transform .2s; align-self: center; }
.d-caret .ic { font-size: 1.1em; }
.d-unit.open .d-caret { transform: rotate(90deg); }
.d-usum { display: block; font-size: .78rem; color: var(--muted); text-align: right; }
.d-usum .ic { color: var(--accent); font-size: 1.2em; vertical-align: -.25em; }
.d-unit.done .d-utile { background: color-mix(in srgb, var(--good) 12%, var(--surface)); }
