/* Home — the dashboard.
 *
 * Ink and paper first; red is "today" and the one thing to do next, green is
 * done. The study areas are told apart by name, not by colour: ochre and
 * indigo mean Casual and Polite in the lessons, and green means done. */

/* ── The day's line ── */
.home-head { margin: 10px 2px 28px; }
.hh-eyebrow { font-size: .84rem; font-weight: 600; color: var(--ink-soft); }
/* The play button runs on after the last character, wherever the line breaks.
   The tall line leaves the furigana room, clear of the line above. */
.hh-line { margin-top: 12px; font-size: clamp(1.5rem, 6.4vw, 2.3rem); line-height: 1.8; }
.hh-line.is-one { white-space: nowrap; }
.hh-jp { display: inline; font-size: 1em; font-weight: 700; letter-spacing: .02em; color: var(--ink); line-break: strict; }
.hh-jp rt { font-size: .44em; font-weight: 500; letter-spacing: .04em; }
.hh-say { display: inline-flex; vertical-align: middle; width: 36px; height: 36px; margin-left: 4px; color: var(--ink-soft); }
.hh-say svg { width: 20px; height: 20px; }
.hh-say:hover { color: var(--red); }
/* The meaning: there when wanted, quieter than the Japanese. */
.hh-en { font-size: .86rem; line-height: 1.5; color: var(--ink-soft); margin-top: 2px; text-wrap: pretty; }
.hh-kind::before { content: ' · '; }

/* ── The grid ── */
.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-items: stretch; }
.dash-grid > div > .card { height: 100%; }
@media (min-width: 900px) {
  .dash-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 18px; }
  .dg-progress { grid-column: 1 / -1; }
  .dash-grid.is-admin .dg-progress { grid-column: auto; }
}
.dash-offline { text-align: center; color: var(--ink-soft); font-size: .82rem; margin-top: 18px; }

/* ── A card ── */
.dash-card { padding: 18px 18px 20px; box-shadow: none; border-radius: 20px; }
@media (min-width: 600px) { .dash-card { padding: 22px 24px 24px; } }
.dc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 30px; }
.dc-title { font-size: 1.05rem; font-weight: 750; letter-spacing: -.01em; color: var(--ink); }
.dc-aside { font-size: .8rem; font-weight: 600; color: var(--ink-soft); }
.dc-link { font-size: .82rem; font-weight: 650; color: var(--ink-soft); text-decoration: none; padding: 4px 2px; }
.dc-link:hover { color: var(--red); }

/* ── Today ── */
.today-time { display: flex; align-items: center; gap: 14px; margin: 14px 0 6px; }
.ring { width: 54px; height: 54px; flex: none; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 5; }
.ring-bg { stroke: var(--paper); }
.ring-fg { stroke: var(--red); stroke-linecap: round; }
.today-time.is-hit .ring-fg { stroke: var(--green); }
.tt-text { display: flex; flex-direction: column; min-width: 0; }
.tt-n { font-size: 1.65rem; font-weight: 800; letter-spacing: -.025em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tt-l { font-size: .82rem; color: var(--ink-soft); font-weight: 600; }
.today-time.is-hit .tt-l { color: var(--green); }

.goal-list { list-style: none; margin: 8px 0 16px; padding: 0; }
.goal {
  display: flex; align-items: center; gap: 12px; padding: 12px 2px; min-height: 58px;
  text-decoration: none; color: var(--ink); border-top: 1px solid var(--border);
}
.goal-list li:last-child .goal { border-bottom: 1px solid var(--border); }
.goal:hover .g-go { color: var(--ink); transform: translateX(2px); }
.g-check {
  width: 24px; height: 24px; flex: none; border-radius: 50%; border: 1.5px solid var(--line-2);
  display: inline-flex; align-items: center; justify-content: center; color: var(--on-ink);
}
.g-check svg { width: 14px; height: 14px; stroke-width: 3; }
.goal.is-hit .g-check { background: var(--green); border-color: var(--green); }
.goal.is-na .g-check { border-style: dashed; }
.g-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.g-label { font-size: .95rem; font-weight: 700; line-height: 1.3; }
.g-text { font-size: .86rem; color: var(--ink-mid); line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.goal.is-hit .g-label, .goal.is-na .g-label { color: var(--ink-mid); }
.goal.is-hit .g-text, .goal.is-na .g-text { color: var(--ink-soft); }
.g-note { flex: none; font-size: .74rem; font-weight: 650; color: var(--ink-soft); background: var(--paper); border-radius: 999px; padding: 3px 9px; white-space: nowrap; }
.g-go { display: inline-flex; color: var(--ink-soft); flex: none; transition: transform .15s var(--ease), color .15s; }
.g-go svg { width: 16px; height: 16px; }
@media (max-width: 420px) { .g-note { display: none; } }

.today-cta { width: 100%; min-height: 50px; justify-content: center; border-radius: 14px; }
.today-cta { white-space: normal; text-align: center; line-height: 1.3; }
.cta-ic { display: inline-flex; }
.cta-ic svg { width: 18px; height: 18px; }
.today-done + .today-cta { margin-top: 10px; }
.today-done {
  display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-radius: 14px;
  background: var(--green-bg); color: var(--ink-mid); font-size: .92rem; line-height: 1.45;
}
.today-done b { color: var(--green); }
.td-check { width: 28px; height: 28px; flex: none; border-radius: 50%; background: var(--green); color: var(--on-ink); display: inline-flex; align-items: center; justify-content: center; }
.td-check svg { width: 16px; height: 16px; stroke-width: 3; }
.today-card.is-done { border-color: var(--green-ln); }

/* ── The week ── */
.seg-mini { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--paper); }
.range-btn {
  appearance: none; border: 0; background: transparent; color: var(--ink-soft);
  font-size: .76rem; font-weight: 700; padding: 5px 11px; border-radius: 999px;
}
.range-btn[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(22, 24, 26, .1); }
html[data-theme="dark"] .range-btn[aria-pressed="true"] { background: var(--line-2); }
.week-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 0 4px; }

/* This week's goals (Schema, Praxis): a segment for each one aimed at. */
.wk-goals { list-style: none; margin: 14px 0 0; padding: 0; }
.wg { display: block; padding: 11px 0; border-top: 1px solid var(--border); text-decoration: none; color: var(--ink); }
.wk-goals li:last-child .wg { border-bottom: 1px solid var(--border); }
.wg-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.wg-label { font-size: .95rem; font-weight: 700; }
.wg-count { display: inline-flex; align-items: center; gap: 5px; font-size: .95rem; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wg-count .of { font-size: .82rem; font-weight: 600; color: var(--ink-soft); }
.wg-check { display: inline-flex; width: 18px; height: 18px; border-radius: 50%; background: var(--green); color: var(--on-ink); align-items: center; justify-content: center; align-self: center; }
.wg-check svg { width: 11px; height: 11px; }
.wg-segs { display: flex; gap: 3px; margin: 8px 0 0; }
.wg-segs i { flex: 1; height: 6px; border-radius: 3px; background: var(--paper); }
.wg-segs i.on { background: var(--ink); }
.wg.is-hit .wg-segs i.on { background: var(--green); }
.wg-note { display: block; font-size: .8rem; color: var(--ink-soft); margin-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wg:hover .wg-note { color: var(--ink-mid); }

.chart-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 18px; }
.ch-title { font-size: .86rem; font-weight: 700; color: var(--ink-mid); }
.ws { display: flex; flex-direction: column; min-width: 0; }
.ws-n { font-size: 1.65rem; font-weight: 800; letter-spacing: -.025em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.ws-u { font-size: .9rem; font-weight: 700; letter-spacing: 0; color: var(--ink-soft); }
.ws-l { font-size: .8rem; font-weight: 600; color: var(--ink-soft); margin-top: 3px; }
.ws-streak.is-on .ws-l { color: var(--green); }

.chart { --lbl: 22px; position: relative; display: flex; align-items: stretch; gap: 6px; height: 156px; padding: 14px 44px 0 0; margin-top: 10px; }
.chart--dense { gap: 3px; }
.chart-layer { position: absolute; left: 0; right: 0; top: 14px; bottom: var(--lbl); pointer-events: none; }
.chart-goal { position: absolute; left: 0; right: 0; border-top: 1.5px dashed var(--line-2); }
.chart-goal em { position: absolute; right: 0; top: 0; transform: translateY(-55%); font-style: normal; font-size: .66rem; font-weight: 700; color: var(--ink-soft); background: var(--surface); padding-left: 4px; }
.chart .col { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; cursor: default; outline: none; }
.col-track { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; position: relative; }
.col-bar { position: relative; display: block; width: 100%; max-width: 24px; border-radius: 7px 7px 3px 3px; background: var(--line-2); }
/* The day's time on its bar: quiet, in the bar's own colours. */
.col-val { position: absolute; left: 50%; transform: translateX(-50%); font-size: .58rem; font-weight: 700; letter-spacing: -.02em; line-height: 1; white-space: nowrap; font-variant-numeric: tabular-nums; pointer-events: none; }
.col-val.is-in { top: 4px; color: var(--ink-mid); }
.col-val.is-out { margin-bottom: 3px; color: var(--ink-soft); }
.col.is-hit .col-val.is-in { color: var(--surface); }
.col.is-hit .col-val.is-out { color: var(--ink-mid); }
.col.is-today .col-val.is-in { color: var(--on-red); }
.col.is-today .col-val.is-out { color: var(--red); }
.chart--dense .col-bar { max-width: 12px; border-radius: 3px 3px 1px 1px; }
.col.is-hit .col-bar { background: var(--ink-mid); }
.col.is-today .col-bar { background: var(--red); }
.col.is-empty .col-track::after { content: ''; position: absolute; bottom: 0; left: 50%; width: min(100%, 24px); transform: translateX(-50%); height: 3px; border-radius: 2px; background: var(--border); }
.chart--dense .col.is-empty .col-track::after { width: min(100%, 12px); }
.col:focus-visible .col-bar, .col.is-open .col-bar { outline: 2px solid var(--red-mid); outline-offset: 2px; }
.col-lbl { display: block; height: var(--lbl); line-height: var(--lbl); font-size: .68rem; font-weight: 600; color: var(--ink-soft); white-space: nowrap; }
.col.is-today .col-lbl { color: var(--red); font-weight: 800; }
.col.is-future .col-lbl { opacity: .45; }
.col.is-future .col-track::after { display: none; }
.col-tip {
  position: absolute; top: 0; left: 0; z-index: 5; display: none; width: max-content; min-width: 8.5rem;
  padding: 8px 10px; text-align: left; pointer-events: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-2);
}
html[data-theme="dark"] .col-tip { background: var(--line-2); }
@media (hover: hover) { .chart .col:hover .col-tip { display: block; } }
.chart .col.is-open .col-tip, .chart .col:focus-visible .col-tip { display: block; }
.ct-date { display: block; font-size: .72rem; font-weight: 700; color: var(--ink-soft); margin-bottom: 4px; }
.ct-row { display: flex; align-items: center; gap: 10px; line-height: 1.7; font-size: .8rem; color: var(--ink); }
.ct-k { flex: 1; }
.ct-v { font-weight: 750; font-variant-numeric: tabular-nums; }
.ct-sum { border-top: 1px solid var(--border); margin-top: 3px; padding-top: 3px; }
.ct-none { color: var(--ink-soft); }

/* ── Progress ── */
.tracks { margin-top: 6px; }
.track { padding: 14px 0 2px; }
.track + .track { border-top: 1px solid var(--border); margin-top: 12px; }
@media (min-width: 900px) {
  .dash-grid:not(.is-admin) .tracks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 28px; }
  .dash-grid:not(.is-admin) .track + .track { border-top: 0; margin-top: 0; border-left: 1px solid var(--border); padding-left: 28px; }
}
.track-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.track-name { font-size: .95rem; font-weight: 700; }
.track-count { font-size: .95rem; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.track-count .of { font-weight: 600; font-size: .82rem; color: var(--ink-soft); }
.track-bar { display: block; position: relative; height: 8px; border-radius: 999px; background: var(--paper); overflow: hidden; margin: 10px 0 9px; }
.track-bar > span { position: absolute; left: 0; top: 0; height: 100%; border-radius: 999px; }
.tb-learn { background: var(--line-2); }
.tb-fill { background: var(--ink); }
.track.is-done .tb-fill { background: var(--green); }
.track-note { font-size: .84rem; line-height: 1.45; color: var(--ink-mid); }
.track.is-ontrack .track-note, .track.is-done .track-note { color: var(--green); font-weight: 650; }
.track.is-behind .track-note, .track.is-stalled .track-note { color: var(--red); font-weight: 650; }
.track.is-idle .track-note, .track.is-warmup .track-note { color: var(--ink-soft); }
.track-detail { font-size: .76rem; color: var(--ink-soft); margin-top: 4px; }

/* ── Arriving: the bars and the ring grow in, once ── */
@media (prefers-reduced-motion: no-preference) {
  .is-entering .ring-fg { animation: ring-in .8s var(--ease) both; }
  .is-entering .col-bar { animation: bar-in .55s var(--ease) both; transform-origin: bottom; }
  .is-entering .track-bar > span { animation: fill-in .7s var(--ease) both; transform-origin: left; }
  @keyframes ring-in { from { stroke-dasharray: 0 999; } }
  @keyframes bar-in { from { transform: scaleY(0); } }
  @keyframes fill-in { from { transform: scaleX(0); } }
}

/* ── Waiting for the numbers ── */
.is-skeleton { display: flex; flex-direction: column; gap: 14px; min-height: 180px; }
.sk { display: block; height: 14px; border-radius: 7px; background: var(--paper); }
.sk:first-child { height: 18px; }
@media (prefers-reduced-motion: no-preference) {
  .sk { animation: sk-pulse 1.4s ease-in-out infinite; }
  @keyframes sk-pulse { 50% { opacity: .55; } }
}

/* ── The instructor's view of a student ── */
.admin-goals { font-size: .86rem; color: var(--ink-mid); margin: 0 2px 12px; }
.admin-goals b { color: var(--ink); }

/* Install card */
.install-card { align-items: center; }
.install-icon { width: 44px; height: 44px; border-radius: 11px; flex: none; border: 1px solid var(--border); }
.inline-ic { display: inline-flex; vertical-align: -3px; }
.inline-ic svg { width: 16px; height: 16px; }
