/* Rep home (rep-home.js): the navy hero, This week rows, one strip of numbered squares per stage, More courses.
   Square marks come from squares.css; every colour is a theme token from theme-tokens.css. Square corners throughout. */
.rh { display: flex; flex-direction: column; gap: 28px; }
.rh h3 { margin: 0 0 10px; font-size: 13px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--th-text-2); }
.rh-empty { margin: 0; font-size: 13px; color: var(--th-text-3); }

/* Hero: one navy hard-edged tile, the stage's done of required in lime. */
.rh-hero {
  display: grid; grid-template-columns: 1fr auto; grid-template-areas: 'stage late' 'num late' 'bar bar';
  gap: 6px 16px; align-items: end; padding: 18px 20px 20px; max-width: 420px;
  background: var(--th-surface-ink); color: var(--th-on-ink); border-radius: 0; box-shadow: var(--th-shadow-hard);
}
.rh-hero-stage { grid-area: stage; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--th-on-ink-2); }
.rh-hero-num { grid-area: num; font-family: 'DM Mono', ui-monospace, monospace; font-size: 56px; line-height: 1; color: var(--th-hero-num); font-variant-numeric: tabular-nums; }
.rh-hero-of { font-size: 28px; color: var(--th-on-ink-2); }
.rh-bar { grid-area: bar; display: block; height: 8px; background: color-mix(in srgb, var(--th-on-ink) 14%, transparent); }
.rh-bar-fill { display: block; height: 100%; background: var(--th-grad-bar); }
.rh-late { grid-area: late; display: inline-flex; align-items: center; gap: 6px; align-self: start; }
.rh-late .sq { --sq-size: 14px; }
.rh-late-n { font-family: 'DM Mono', ui-monospace, monospace; font-size: 20px; color: var(--th-on-ink); }

/* This week: rows of mark, name, due. */
.rh-rows { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; max-width: 560px; }
.rh-row {
  display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; width: 100%; box-sizing: border-box;
  padding: 8px 10px; background: var(--th-surface); color: var(--th-text); border: 1px solid var(--th-border); border-radius: 0;
  font: inherit; font-size: 14px; text-align: left; text-decoration: none; cursor: pointer;
}
.rh-row:hover { border-color: var(--th-text); }
.rh-row:focus-visible { outline: 2px solid var(--th-focus); outline-offset: 2px; }
.rh-row-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rh-due { font-family: 'DM Mono', ui-monospace, monospace; font-size: 12px; color: var(--th-text-2); white-space: nowrap; }
.rh-due-late { color: var(--th-bad); }

/* The path: one strip per stage, numbered squares, the graduation as the end marker. */
.rh-stage { display: grid; grid-template-columns: 9ch 1fr; gap: 12px; align-items: center; margin-bottom: 10px; }
.rh-stage-name { display: inline-flex; align-items: baseline; gap: 10px; font-size: 13px; font-weight: 600; color: var(--th-text); white-space: nowrap; }
.rh-stage-n { font-family: 'DM Mono', ui-monospace, monospace; font-weight: 400; color: var(--th-text-2); }
.rh-strip { --sq-size: 26px; --sq-gap: 4px; }
.rh-sq { display: inline-flex; align-items: center; justify-content: center; }
.rh-n { font-family: 'DM Mono', ui-monospace, monospace; font-size: 11px; line-height: 1; color: var(--th-text); }
.sq-done > .rh-n { color: var(--th-surface); }
/* The numeral sits on a panel-coloured backing where a fill pattern runs under it. */
.sq-late > .rh-n, .sq-progress > .rh-n { background: var(--th-surface); padding: 1px 2px; }
/* A locked square shows its lock (squares.css), not its number; the number stays in its label. */
.sq-locked > .rh-n { display: none; }
.rh-mark { --sq-size: 12px; }

/* A click focuses the square, so the detail stays up after a click. On a touch screen the bottom sheet takes over
   (Squares.sheet, squares.css). Long lines wrap. */
.rh .sq:focus > .sq-tip, .rh-grad:hover > .sq-tip, .rh-grad:focus > .sq-tip { display: flex; }
.rh .rh-tip { white-space: normal; width: max-content; max-width: 32ch; }

.rh-grad {
  position: relative; flex: none; width: 26px; height: 26px; margin-left: 6px; padding: 0; box-sizing: border-box;
  display: inline-flex; align-items: center; justify-content: center; cursor: default;
  background: var(--th-surface); border: 2px solid var(--th-text); border-radius: 0; font: inherit; color: inherit;
}
/* The graduation mark is a cap. */
.rh-grad-mark { display: block; width: 70%; height: 70%; fill: var(--th-text); }
.rh-grad-earned { background: var(--th-ok); border-color: var(--th-ok); }
.rh-grad-earned .rh-grad-mark { fill: var(--th-surface); }
.rh-grad-wait { background: var(--th-info-tint); }
.rh-grad:focus-visible { outline: 2px solid var(--th-focus); outline-offset: 2px; }

@media (max-width: 560px) {
  .rh-stage { grid-template-columns: 1fr; gap: 6px; }
  .rh-hero { max-width: none; }
  .rh-hero-num { font-size: 44px; }
}
/* Touch and phone: every square and the graduation is a 44px target. */
@media (pointer: coarse), (max-width: 560px) {
  .rh-strip { --sq-size: 44px; --sq-gap: 6px; }
  .rh-grad { width: 44px; height: 44px; }
  .rh-n { font-size: 14px; }
}
