/* My courses (my-courses.html only). Loaded after page.css, account.css
   (the header, fields, notices, footer) and courses.css (the All courses
   page's chips, panels and rows, which Preview another course reuses).
   This adds the page:
   the title row, the course cards, the receipts table, the account panel
   and the receipt dialog. A dashboard of plain cards on the page: paper, a
   1 px edge, the collage cards' lift. Every colour is a Clear token or a
   page.css token; no text carries an opacity. */

/* courses.css lands its anchors under its sticky jump links; this page has
   none, so page.css's own padding stands. */
html { scroll-padding-top: 84px; }
.mc-main { padding-top: 44px; }
.mc-wrap { max-width: 1160px; }

/* ── Title row ──────────────────────────────────────────────────── */
.mc-title { font-size: 36px; line-height: 42px; font-weight: 700; letter-spacing: -0.035em; color: var(--ink); }
.mc-who { margin-top: 6px; font-size: 16px; line-height: 24px; color: var(--muted-foreground); overflow-wrap: anywhere; }
.mc-who b { font-weight: 600; color: var(--card-foreground); }
.mc-notices .mc-notice { max-width: 760px; }

/* ── Layout: courses and receipts, the account beside them ─────────── */
.mc-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; column-gap: 40px; align-items: start; margin-top: 28px; }
.mc-col { min-width: 0; display: grid; row-gap: 40px; }
.mc-side { min-width: 0; display: grid; row-gap: 16px; }

/* Section labels: Clear's eyebrow (12 px, 600, 0.12em, muted). */
.mc-label { margin-bottom: 12px; font-size: 12.5px; line-height: 16px; font-weight: 650; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted-foreground); }

/* ── Course cards ──────────────────────────────────────────────────
   Code first (the strongest thing), the name under it, then the access
   line. The action sits on the right (Open in Study, where it shows, a
   link under Open in Clear); an extension offer runs under the card's
   body in a well. */
.mc-list { display: grid; row-gap: 12px; }
.mc-list > li[hidden] { display: none; }
.mc-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "main actions" "ext ext"; column-gap: 24px; align-items: center; padding: 20px 22px; border-radius: var(--radius-2xl); border: 1px solid var(--art-edge); background: var(--paper); box-shadow: var(--art-lift); }
.mc-card__main { grid-area: main; min-width: 0; }
.mc-card__actions { grid-area: actions; display: flex; flex-direction: column; gap: 8px; }
.mc-card__code { font-size: 21px; line-height: 26px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); }
.mc-card__name { margin-top: 2px; font-size: 15px; line-height: 21px; color: var(--muted-foreground); }
.mc-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 10px; font-size: 14.5px; line-height: 20px; color: var(--card-foreground); }
.mc-card__meta time { font-weight: 600; }
.mc-badge { background: var(--paper); }
/* Ending soon: the warning amber as text, with a clock. */
.mc-soon { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; color: var(--warning); }
.mc-soon svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
/* Passed: the success green as text, with a check. */
.mc-passed { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; color: var(--success); }
.mc-passed svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.mc-again { min-height: 44px; padding: 10px 18px; font-size: 15px; }
/* Open in Clear: a compact button, no arrow (James, 2026-11-22). */
.mc-open { min-height: 36px; padding: 6px 16px; font-size: 14.5px; }
/* Open in Study: on a course in Clear, a quiet link under Open in Clear;
   on a course not in Clear, that card's one button. */
.mc-study { min-height: 40px; padding: 8px 18px; font-size: 14.5px; }
.mc-card__actions:has(.mc-study-link) { gap: 4px; }
.mc-study-link { display: inline-flex; align-items: center; justify-content: center; min-height: 32px; padding: 0 4px; border-radius: 4px; font-size: 14.5px; line-height: 20px; font-weight: 600; color: var(--card-foreground); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.mc-study-link:hover { text-decoration-thickness: 2px; }
.mc-study-link:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }

/* The extension offer: a well across the card's foot. */
.mc-card__ext { grid-area: ext; display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; margin-top: 16px; padding: 12px 14px 12px 16px; border-radius: var(--radius-xl); background: var(--mono-surface); }
.theme-dark .mc-card__ext { background: var(--muted); }
.mc-card__ext-copy { font-size: 14.5px; line-height: 21px; color: var(--card-foreground); }
.mc-ext-btn { flex-shrink: 0; min-height: 40px; padding: 8px 14px; font-size: 14px; background: var(--paper); }
.mc-card__ext .btn:focus-visible { box-shadow: 0 0 0 2px var(--mono-surface), 0 0 0 4px var(--ring); }
/* "How did it go?": the same well, its three answers side by side. */
.mc-ask__btns { display: flex; flex-wrap: wrap; gap: 8px; flex-shrink: 0; }
/* Its × skips the question: after the answers, in the well's corner on a
   phone. Hover steps up to the card's paper (the well is the muted tone). */
.mc-ask { position: relative; }
.mc-ask__x { flex-shrink: 0; margin-left: -8px; }
.mc-card__ext .mc-x:hover { background: var(--paper); }

/* Ended: no lift, the page shows through, and the Ended badge says it.
   Never faded. */
.mc-card--ended { background: transparent; box-shadow: none; border-color: var(--hair); }
.mc-card--ended .mc-card__meta { color: var(--muted-foreground); }
.mc-card--ended .btn:focus-visible { box-shadow: 0 0 0 2px var(--page), 0 0 0 4px var(--ring); }

/* Preview in Clear: the eye before its label. */
.mc-preview { gap: 8px; }
.mc-eye { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Ended over a year ago: folded behind one dashed button across the list. */
.mc-older-btn { display: flex; width: 100%; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px 8px; margin-top: 12px; min-height: 48px; padding: 8px 16px; border: 1px dashed var(--border-strong); border-radius: var(--radius-2xl); background: transparent; color: var(--card-foreground); font: 600 15px var(--font-sans); cursor: pointer; }
.mc-older-btn--alone { margin-top: 0; }
.mc-older-btn:hover { background: var(--tile-hover); }
.mc-older-btn__note { font-weight: 500; color: var(--muted-foreground); }
.mc-older-btn__note::before { content: "· "; }
.mc-older-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform 200ms ease; }
.mc-older-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.mc-older-btn:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--page), 0 0 0 4px var(--ring); }
@media (prefers-reduced-motion: reduce) { .mc-older-btn svg { transition: none; } }

/* ── Preview another course ─────────────────────────────────────────
   Clear's finder on the website's own pieces: the search box, the All
   courses page's group chips (here filters, solid ink when on) and its
   panels of rows, folded until asked for. */
.mc-pv { padding: 20px 22px 22px; border-radius: var(--radius-2xl); border: 1px solid var(--art-edge); background: var(--paper); box-shadow: var(--art-lift); }
.mc-pv__hint { font-size: 15px; line-height: 22px; color: var(--muted-foreground); }
.mc-pv__search { width: 100%; margin-top: 14px; }
.mc-pv__search input { height: 48px; }
.mc-pv__chips { margin-top: 14px; flex-wrap: wrap; overflow: visible; }
.mc-pv__chips:empty { display: none; }
.mc-pv__chips button { cursor: pointer; background: transparent; font-family: inherit; }
.mc-pv__chips button[aria-pressed="true"], .mc-pv__chips button[aria-pressed="true"]:hover { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.mc-pv__chips button[aria-pressed="true"] .cx-jump__n { color: var(--paper); }
.mc-pv__chips button:focus-visible { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--ring); }
@media (forced-colors: active) {
  .mc-pv__chips button[aria-pressed="true"] { forced-color-adjust: none; background: Highlight; color: HighlightText; }
  .mc-pv__chips button[aria-pressed="true"] .cx-jump__n { color: HighlightText; }
}
.mc-pv__more { display: flex; width: 100%; align-items: center; justify-content: center; gap: 8px; margin-top: 16px; min-height: 44px; border: 1px solid var(--border-strong); border-radius: var(--radius-xl); background: transparent; color: var(--card-foreground); font: 600 15px var(--font-sans); cursor: pointer; }
.mc-pv__more:hover { background: var(--tile-hover); }
.mc-pv__more:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--ring); }
.mc-pv__more svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mc-pv__group { margin-top: 20px; }
.mc-pv__gtitle { margin: 0 0 8px; font-size: 15px; line-height: 22px; font-weight: 700; color: var(--ink); }
.mc-pv__gtitle span { font-weight: 500; color: var(--muted-foreground); }
.mc-pv .cx-row { grid-template-columns: 96px minmax(0, 1fr) auto; grid-template-areas: "code name go"; min-height: 54px; padding: 10px 16px 10px 18px; column-gap: 16px; }
.mc-pv .cx-row::after { display: none; }
.mc-pv__free { display: block; margin-top: 2px; font-size: 13.5px; line-height: 18px; color: var(--muted-foreground); }
.mc-pv__go { grid-area: go; align-self: center; display: inline-flex; align-items: center; gap: 6px; font-size: 14.5px; font-weight: 600; color: var(--primary-text); white-space: nowrap; }
.mc-pv__go svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mc-pv__res { margin-top: 18px; font-size: 14px; line-height: 20px; color: var(--muted-foreground); }
.mc-pv__res:empty { display: none; }
.mc-pv__empty { margin-top: 18px; font-size: 15px; line-height: 22px; color: var(--muted-foreground); }

/* Buttons on paper: the ring's gap is the paper. */
.mc-card .btn:focus-visible, .mc-panel .btn:focus-visible, .mc-empty .btn:focus-visible { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--ring); }

/* Empty: Clear's EmptyState, card variant. */
.mc-empty { display: flex; flex-direction: column; align-items: center; padding: 40px 24px 36px; border-radius: var(--radius-2xl); border: 1px solid var(--art-edge); background: var(--paper); box-shadow: var(--art-lift); text-align: center; }
.mc-empty__mark { display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: var(--radius-xl); background: var(--mono-surface); color: var(--muted-foreground); }
.theme-dark .mc-empty__mark { background: var(--muted); }
.mc-empty__mark svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mc-empty__title { margin-top: 16px; font-size: 19px; line-height: 26px; font-weight: 700; letter-spacing: -0.015em; color: var(--ink); }
.mc-empty__hint { margin-top: 4px; font-size: 15px; line-height: 22px; color: var(--muted-foreground); }
.mc-empty__btn { margin-top: 20px; min-height: 44px; padding: 10px 20px; font-size: 15px; }

/* ── Receipts ──────────────────────────────────────────────────────── */
.mc-tablecard { overflow: hidden; border-radius: var(--radius-2xl); border: 1px solid var(--art-edge); background: var(--paper); box-shadow: var(--art-lift); }
.mc-table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 22px; color: var(--card-foreground); }
.mc-table th, .mc-table td { padding: 13px 18px; text-align: left; vertical-align: middle; border-top: 1px solid var(--hair-soft); }
.mc-table thead th { padding-top: 12px; padding-bottom: 12px; border-top: 0; font-size: 12.5px; line-height: 16px; font-weight: 650; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted-foreground); }
.mc-table tbody th { font-weight: 600; }
/* No tabular-nums: Schibsted Grotesk gives "," and "." a full figure width under tnum. */
.mc-table .mc-num { text-align: right; white-space: nowrap; }
.mc-t-date, .mc-t-order { white-space: nowrap; color: var(--muted-foreground); }
.mc-t-act { text-align: right; white-space: nowrap; }
.mc-view { font-size: 14.5px; }
.mc-none { font-size: 15px; line-height: 22px; color: var(--muted-foreground); }

/* ── Account panel ─────────────────────────────────────────────────── */
.mc-panel { padding: 6px 22px 6px; border-radius: var(--radius-2xl); border: 1px solid var(--art-edge); background: var(--paper); box-shadow: var(--art-lift); }
.mc-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 14px; align-items: start; padding: 16px 0; border-top: 1px solid var(--hair-soft); }
.mc-row:first-of-type { border-top: 0; }
.mc-row__text { min-width: 0; }
.mc-row__label { font-size: 13.5px; line-height: 18px; font-weight: 600; color: var(--muted-foreground); }
.mc-row__value { margin-top: 2px; font-size: 15.5px; line-height: 22px; font-weight: 500; color: var(--card-foreground); }
.mc-row__value--email { overflow-wrap: anywhere; }
.mc-row__hint { margin-top: 4px; font-size: 13.5px; line-height: 19px; color: var(--muted-foreground); }
.mc-edit { grid-column: 1 / -1; margin-top: 4px; }
.mc-edit .fld { margin-top: 14px; }
.mc-edit .fld__row { grid-template-columns: minmax(0, 1fr); }
.mc-edit__actions { display: flex; gap: 8px; margin-top: 16px; }
.mc-edit__actions .btn { min-height: 38px; padding: 8px 16px; font-size: 14px; }
/* Sign out at the card's foot (James, 2026-11-22); the header keeps its own. */
.mc-signout { padding: 14px 0 16px; border-top: 1px solid var(--hair-soft); }
.mc-signout .btn { min-height: 40px; padding: 8px 18px; font-size: 14.5px; }
.mc-help { font-size: 14px; line-height: 20px; color: var(--muted-foreground); }
.mc-help a { color: var(--card-foreground); font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.mc-help a:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 3px; }

/* ── Receipt dialog ───────────────────────────────────────────────────
   Clear's modal panel: rounded-2xl, card surface, a 28 px close circle. */
.mc-receipt { box-sizing: border-box; width: min(520px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); margin: auto; padding: 0; border: 1px solid var(--art-edge); border-radius: var(--radius-2xl); background: var(--paper); color: var(--card-foreground); box-shadow: var(--shadow-2xl); }
.mc-receipt::backdrop { background: var(--backdrop); }
.mc-receipt__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 18px 0 24px; }
.mc-receipt__title { font-size: 18px; line-height: 28px; font-weight: 600; color: var(--card-foreground); }
.mc-x { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted-foreground); cursor: pointer; }
.mc-x:hover { background: var(--muted); color: var(--card-foreground); }
.mc-x:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.mc-x svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.mc-receipt__body { padding: 8px 24px 24px; }
.mc-receipt__from { padding-bottom: 16px; border-bottom: 1px solid var(--hair-soft); font-size: 13.5px; line-height: 19px; color: var(--muted-foreground); }
.mc-receipt__brand { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font-size: 15px; line-height: 22px; font-weight: 700; color: var(--card-foreground); }
.mc-receipt__brand svg { width: 22px; height: 18px; color: var(--brand); }
.mc-receipt__meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px; padding: 16px 0; }
.mc-receipt__meta dt { font-size: 12.5px; line-height: 16px; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-foreground); }
.mc-receipt__meta dd { margin: 3px 0 0; font-size: 15px; line-height: 21px; color: var(--card-foreground); }
.mc-receipt__email { overflow-wrap: anywhere; }
.mc-lines { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 21px; color: var(--card-foreground); }
.mc-lines th, .mc-lines td { padding: 11px 0; text-align: left; vertical-align: top; border-top: 1px solid var(--hair-soft); }
.mc-lines thead th { padding: 8px 0; font-size: 12.5px; line-height: 16px; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-foreground); }
.mc-lines tbody th { font-weight: 600; padding-right: 16px; }
.mc-lines tbody th span { display: block; margin-top: 1px; font-size: 13.5px; font-weight: 400; color: var(--muted-foreground); }
.mc-lines .mc-num { text-align: right; white-space: nowrap; }
.mc-lines tfoot th, .mc-lines tfoot td { padding-top: 13px; border-top: 1px solid var(--border-strong); font-size: 16.5px; font-weight: 700; }
.mc-cur { font-size: 13px; font-weight: 500; color: var(--muted-foreground); }
.mc-receipt__actions { display: flex; justify-content: flex-end; margin-top: 20px; }
.mc-receipt .btn:focus-visible { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--ring); }

@media (prefers-reduced-motion: no-preference) {
  .mc-receipt[open] { animation: mc-in 200ms var(--ease-signature); }
  @keyframes mc-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}

/* Print: the receipt alone, on white whatever the theme. Print copies it
   out of the dialog into .mc-print (my-courses.js). */
.mc-print { display: none; }
@media print {
  :root:has(body.mc-printing), body.mc-printing { background: #fff; }
  body.mc-printing > :not(.mc-print) { display: none !important; }
  .mc-print { display: block; max-width: 520px; background: #fff; color: var(--card-foreground); }
  .mc-print .mc-x, .mc-print .mc-receipt__actions { display: none; }
}

/* ── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .mc-grid { grid-template-columns: minmax(0, 1fr) 320px; column-gap: 28px; }
}
/* Tablet and phone: one column; the account after the receipts. */
@media (max-width: 900px) {
  .mc-grid { grid-template-columns: minmax(0, 1fr); row-gap: 40px; }
  .mc-side { max-width: 640px; }
}
@media (max-width: 640px) {
  .mc-main { padding-top: 24px; }
  .mc-title { font-size: 30px; line-height: 36px; }
  .mc-who { font-size: 15px; }
  .mc-who__sep { display: none; }
  .mc-who__email { display: block; }
  .mc-grid { margin-top: 22px; }
  .mc-col { row-gap: 32px; }
  /* A card stacks: its text, then its action full width. */
  .mc-card { grid-template-columns: minmax(0, 1fr); grid-template-areas: "main" "actions" "ext"; padding: 16px 16px 16px; border-radius: var(--radius-xl); }
  .mc-card__actions { margin-top: 16px; }
  .mc-card__actions .btn { width: 100%; }
  .mc-open, .mc-study, .mc-study-link, .mc-signout .btn { min-height: 44px; }
  .mc-signout .btn { width: 100%; }
  .mc-card__code { font-size: 19px; line-height: 24px; }
  .mc-card__ext { flex-direction: column; align-items: stretch; margin-top: 12px; padding: 12px; }
  .mc-ext-btn { min-height: 44px; }
  .mc-ask__btns .btn { flex: 1 1 0; padding-inline: 8px; }
  .mc-ask .mc-card__ext-copy { padding-right: 36px; }
  .mc-ask__x { position: absolute; top: 4px; right: 4px; margin: 0; }
  .mc-empty { padding: 32px 18px 28px; border-radius: var(--radius-xl); }
  /* Receipts: each order is a small block (course and amount on top, date
     and order number under, the link last). */
  .mc-tablecard { border-radius: var(--radius-xl); }
  .mc-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .mc-table tbody tr { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; grid-template-areas: "course course course amt" "date order . ." "act act act act"; padding: 14px 16px; border-top: 1px solid var(--hair-soft); }
  .mc-table tbody tr:first-child { border-top: 0; }
  .mc-table th, .mc-table td { padding: 0; border: 0; }
  .mc-t-course { grid-area: course; }
  .mc-t-amt { grid-area: amt; font-weight: 600; }
  .mc-t-date { grid-area: date; margin-top: 2px; font-size: 14px; }
  .mc-t-order { grid-area: order; margin-top: 2px; font-size: 14px; }
  .mc-t-order::before { content: "·"; margin: 0 7px; }
  .mc-t-act { grid-area: act; text-align: left !important; margin-top: 6px; }
  .mc-view { display: inline-flex; align-items: center; min-height: 32px; }
  .mc-panel { padding: 4px 16px 4px; border-radius: var(--radius-xl); }
  .mc-pv { padding: 18px 16px 18px; border-radius: var(--radius-xl); }
  .mc-pv .cx-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "code go" "name go"; row-gap: 2px; padding: 12px 14px 12px 16px; }
  .mc-receipt__head { padding: 14px 12px 0 18px; }
  .mc-receipt__body { padding: 6px 18px 18px; }
  .mc-receipt__meta { grid-template-columns: minmax(0, 1fr); gap: 10px; }
}
