/* The student's dashboard: the app's layout in a browser, a sidebar on a wide screen and tabs at the foot of a phone. */
.small { font-size: 13px; color: var(--text2); }
.small.error { color: var(--loss); }
.small.ok { color: var(--gain); }
/* Signing in: a word of welcome beside the form. */
.signin { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px); gap: 72px; align-items: center;
          max-width: 1040px; margin: 0 auto; padding: 40px 28px; }
.signin-side h1 { font-size: clamp(34px, 4vw, 48px); line-height: 1.08; letter-spacing: -0.03em; margin: 36px 0 14px; font-weight: 680; }
.signin form { width: 100%; display: flex; flex-direction: column; gap: 14px; padding: 30px; }
.signin form h2 { font-size: 22px; margin: 0 0 4px; }

/* The dashboard: the app's sidebar in a browser, tabs at the foot of a phone. */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.side { background: rgba(13, 17, 22, .86); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-right: 1px solid var(--hairline);
        padding: 20px 12px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .brand { margin: 0 8px 18px; }
.side .group { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--text3); font-weight: 650; padding: 14px 10px 6px; }
.side a:not(.brand) { display: flex; gap: 11px; align-items: center; color: var(--text2); text-decoration: none; padding: 8px 10px; border-radius: 9px; font-size: 14.5px; }
.side a:not(.brand):hover { background: var(--hover); color: var(--text); }
.side a.active { background: var(--raised); color: var(--text); box-shadow: inset 3px 0 0 var(--steel); }
/* The academy's own icons, from /icons.svg: square ends and sharp corners, like the app's. */
.icon { width: 18px; height: 18px; flex: none; color: var(--steel); fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: square; stroke-linejoin: miter; }
.icon.lock { width: 13px; height: 13px; margin-left: auto; color: var(--text3); display: none; }
body.free .icon.lock { display: block; }
.badge { background: var(--accent); color: var(--on-accent); border-radius: 9px; padding: 0 7px; font-size: 11px; }
.me { margin-top: auto; border-top: 1px solid var(--hairline); padding-top: 12px; display: flex; justify-content: space-between; align-items: center; color: var(--text2); font-size: 14px; }
.small-button { padding: 5px 10px; font-size: 13px; }
.page { padding: 36px 40px 96px; max-width: 940px; width: 100%; min-width: 0; }
.page h1 { font-size: 30px; margin: 0 0 6px; letter-spacing: -0.02em; }
.page .card + .card, .page .card + .stack, .page .stack + .card { margin-top: 14px; }
.page .stats > .card, .page .platforms > .card { margin-top: 0; }
.rule { border-top: 1px solid var(--hairline); margin: 10px 0 4px; }
details.more > summary { cursor: pointer; font-weight: 600; }
details.more[open] > summary { margin-bottom: 14px; }
.narrow-only { display: none !important; }
.page h2 { font-size: 20px; margin: 0 0 8px; }
.sub { color: var(--text2); margin: 0 0 20px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 14px; }
.stat b { display: block; font-size: 26px; }
.stat span { color: var(--text2); font-size: 14px; }
.bar { height: 6px; background: var(--hairline); border-radius: 3px; overflow: hidden; margin-top: 8px; }
.bar > div { height: 100%; background: var(--steel); }
.week { margin-bottom: 12px; }
.week summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
.lesson-link { display: flex; justify-content: space-between; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--hairline); color: var(--text); text-decoration: none; }
.lesson-link .tick { color: var(--gain); }
.reader { font-size: 17px; line-height: 1.7; overflow-wrap: anywhere; }
.reader figure { margin: 14px 0; }
.reader h1 { font-size: 28px; line-height: 1.25; }
.reader h2 { font-size: 20px; margin: 28px 0 8px; }
.reader .lead { font-size: 18px; color: var(--text2); }
.callout { border-left: 3px solid var(--steel); background: rgba(127,166,201,.07); border-radius: 0 10px 10px 0; padding: 12px 16px; margin: 14px 0; }
.callout.warning { border-color: var(--loss); background: rgba(212,112,122,.07); }
.callout.example { border-color: var(--gain); background: rgba(87,184,148,.07); }
.callout.story { border-color: var(--warn); background: rgba(217,160,91,.07); }
.callout b.title { display: block; margin-bottom: 4px; }
.formula { border-left: 3px solid var(--steel); background: rgba(127,166,201,.07); border-radius: 0 10px 10px 0; padding: 12px 16px; margin: 14px 0; }
.formula b.title { display: block; margin-bottom: 6px; color: var(--steel); }
.formula-lines { font-family: var(--mono, ui-monospace, monospace); font-size: 1.05rem; margin: 4px 0 10px; display: grid; gap: 4px; }
.formula abbr { color: var(--steel); text-decoration: underline dotted; cursor: help; }
.formula dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0; }
.formula dt { font-family: var(--mono, ui-monospace, monospace); font-weight: 600; color: var(--steel); }
.formula dd { margin: 0; }
.code { border: 1px solid var(--line, rgba(255,255,255,.12)); border-radius: 10px; margin: 14px 0; overflow: hidden; }
.code-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 12px; background: rgba(127,166,201,.07); }
.code pre { margin: 0; padding: 12px 14px; overflow-x: auto; font-size: .9rem; line-height: 1.55; }
.in-app { border: 1px dashed var(--steel-dim); border-radius: 10px; padding: 12px 16px; color: var(--text2); font-size: 14px; margin: 14px 0; }

/* The course is taken in the app: said plainly, with the way there. */
.app-first { display: flex; align-items: center; gap: 18px; margin: 16px 0 22px; padding: 18px 20px; border-radius: 14px; position: relative; overflow: hidden;
             border: 1px solid rgba(94,143,194,.45); background: linear-gradient(120deg, rgba(79,127,176,.20), rgba(62,143,133,.10) 60%, rgba(20,25,32,.6)); }
.app-first::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.06) 45%, transparent 60%);
                    transform: translateX(-100%); animation: sheen 6s ease-in-out 1s infinite; pointer-events: none; }
@keyframes sheen { 0%, 70% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
.app-first-text { flex: 1; min-width: 0; }
.app-first b { font-size: 16.5px; }
.app-first p { margin: 4px 0 0; color: var(--text2); font-size: 14.5px; }
.app-first .button { flex: none; }
@media (max-width: 640px) { .app-first { flex-direction: column; align-items: flex-start; } }
@media (prefers-reduced-motion: reduce) { .app-first::after { animation: none; display: none; } }

/* Reporting, and the sessions on the account. */
.pill { display: inline-block; border-radius: 9px; padding: 1px 9px; font-size: 11.5px; font-weight: 600; background: rgba(94,143,194,.18); color: var(--text); }
.link-button { background: none; border: none; padding: 0; font: inherit; color: var(--steel); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.link-button:hover { color: var(--text); }
.bubble .about { font-size: 12px; font-weight: 600; color: var(--steel); margin-bottom: 4px; }
.bubble .quote { margin: 2px 0 8px; font-size: 13px; }
.quote { margin: 0; padding: 10px 14px; border-left: 3px solid var(--steel-dim); background: rgba(255,255,255,.03); border-radius: 0 8px 8px 0; color: var(--text2); white-space: pre-wrap; }
.ok-card { border-color: rgba(87,184,148,.4); color: var(--text); margin-top: 12px; }
.sessions { display: flex; flex-direction: column; gap: 8px; }
.session { border: 1px solid var(--hairline); border-radius: 11px; padding: 10px 14px; background: rgba(255,255,255,.02); }
.session.current { border-color: var(--steel-dim); }
.session summary { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; cursor: pointer; list-style: none; }
.session summary::-webkit-details-marker { display: none; }
.session summary .small { margin-left: auto; }
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 16px; margin: 12px 0; font-size: 14px; }
.facts dt { color: var(--text2); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.handover summary { cursor: pointer; }

/* A free account's welcome: the whole course, part by part. */
.tiles-title { margin: 30px 0 4px; }
.part-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; margin: 14px 0 18px; }
.page .part-tiles > .card { margin-top: 0; }
.part-tile { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--text); transition: border-color .2s, transform .2s; }
.part-tile:hover { border-color: var(--steel-dim); transform: translateY(-2px); }
.part-tile p { margin: 0; flex: 1; }
.part-no { font: 600 12px/1 var(--mono); color: var(--steel); letter-spacing: .1em; }
.part-size { font-size: 12.5px; color: var(--text3); }
@media (prefers-reduced-motion: reduce) { .part-tile:hover { transform: none; } }
.reader table { border-collapse: collapse; width: 100%; font-size: 14px; margin: 12px 0; display: block; overflow-x: auto; }
.reader th, .reader td { border-bottom: 1px solid var(--hairline); padding: 6px 8px; text-align: left; }
.reader img { max-width: 100%; border-radius: 8px; border: 1px solid var(--hairline); }
.keypoints li { margin-bottom: 6px; }
.bubbles { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.bubble { max-width: 85%; padding: 9px 13px; border-radius: 12px; background: var(--raised); border: 1px solid var(--hairline); white-space: pre-wrap; }
.bubble.mine { align-self: flex-end; background: #1d2c3b; border-color: var(--steel-dim); }
.bubble .meta { font-size: 11px; color: var(--text2); margin-top: 3px; }
textarea { background: #111820; color: var(--text); border: 1px solid var(--hairline); border-radius: 8px; padding: 10px 12px; font: inherit; min-height: 80px; width: 100%; }
.item { padding: 10px 0; border-bottom: 1px solid var(--hairline); }
.item:last-child { border-bottom: none; }
.item .when { color: var(--text2); font-size: 13px; }
.unread { box-shadow: inset 3px 0 0 var(--accent); padding-left: 10px; }
/* What a free account sees: a door, and the way through it. */
.locked { border: 1px solid var(--hairline-2); border-radius: 16px; padding: 28px; background: linear-gradient(180deg, rgba(24,32,42,.92), rgba(20,25,32,.92)); }
.locked .icon { width: 26px; height: 26px; margin-bottom: 12px; }
.locked p { color: var(--text2); max-width: 600px; }
.checklist { list-style: none; padding: 0; margin: 0; counter-reset: next; }
.checklist li { counter-increment: next; position: relative; padding: 18px 0 18px 52px; border-top: 1px solid var(--hairline); }
.checklist li::before { content: counter(next); position: absolute; left: 0; top: 18px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
                        font-weight: 650; color: var(--steel); border: 1px solid var(--steel-dim); background: rgba(79,127,176,.08); }
.checklist li.done::before { content: "✓"; color: var(--gain); border-color: rgba(87,184,148,.5); background: rgba(87,184,148,.08); }
.checklist b { display: block; }
.checklist p { margin: 4px 0 10px; color: var(--text2); }
/* The student's own devices, each with a way to take it off. */
.devices { display: flex; flex-direction: column; }
.device { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--hairline); }
.device-what { flex: 1; min-width: 0; }
.device-what .pill { margin-left: 8px; }
/* Installing the app: numbered steps for the visitor's system, lines to copy, and fixes that open one at a time. */
.install[data-showing="windows"] [data-os="linux"], .install[data-showing="linux"] [data-os="windows"] { display: none; }
.guide-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.guide-head h2 { margin: 0; }
.os-switch { display: inline-flex; padding: 3px; gap: 3px; border-radius: 11px; background: var(--raised); border: 1px solid var(--hairline); }
.os-switch .button { border: 0; background: transparent; color: var(--text2); }
.os-switch .button[aria-pressed="true"] { background: var(--hover); color: var(--text); box-shadow: inset 0 -2px 0 var(--steel); }
.install-steps { list-style: none; padding: 0; margin: 0; counter-reset: step; }
.install-steps li { counter-increment: step; position: relative; padding: 14px 0 14px 46px; border-top: 1px solid var(--hairline); }
.install-steps li::before { content: counter(step); position: absolute; left: 0; top: 13px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
                    font: 650 13px/1 var(--mono); color: var(--steel); border: 1px solid var(--steel-dim); background: rgba(79,127,176,.08); }
.install-steps b { display: block; }
.install-steps p { margin: 4px 0 8px; color: var(--text2); }
.cmd { display: flex; flex-direction: column; gap: 4px; margin: 6px 0; }
.cmd-line { display: flex; align-items: flex-start; gap: 8px; background: var(--bg-2); border: 1px solid var(--hairline); border-radius: 10px; padding: 8px 8px 8px 12px; }
.cmd-line code { flex: 1; min-width: 0; font: 13px/1.6 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); padding-top: 3px; }
.cmd-line .button { flex: none; }
.fixes { display: flex; flex-direction: column; }
.fix { border-top: 1px solid var(--hairline); }
.fix summary { display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; padding: 13px 28px 13px 0; font-weight: 600; position: relative; }
.fix summary::-webkit-details-marker { display: none; }
.fix summary::after { content: ""; position: absolute; right: 6px; top: 19px; width: 7px; height: 7px; border-right: 2px solid var(--steel); border-bottom: 2px solid var(--steel);
                      transform: rotate(45deg); transition: transform .2s; }
.fix[open] summary::after { transform: rotate(-135deg); top: 22px; }
.fix summary .pill { font-weight: 600; color: var(--text2); }
.fix > .stack { padding: 0 0 16px; gap: 8px; }
.fix p { margin: 0; color: var(--text2); max-width: 720px; }
.platforms { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-bottom: 14px; }
.platforms .card { display: flex; flex-direction: column; gap: 10px; }
.platforms .card h2 { margin: 0; }
.key { font-family: var(--mono); letter-spacing: .04em; text-transform: uppercase; max-width: 280px; }
.secret { font: 600 20px var(--mono); letter-spacing: .08em; padding: 12px 14px; border-radius: 10px; background: var(--raised); user-select: all; }
/* A QR code needs dark on light to scan, whatever the theme. */
.qr { display: block; width: 200px; height: 200px; padding: 8px; border-radius: 10px; background: #fff; image-rendering: pixelated; }
.wrap-anywhere { overflow-wrap: anywhere; }

@media (max-width: 900px) {
  .signin { grid-template-columns: minmax(0, 1fr); gap: 28px; padding: 28px 18px; }
  .signin-side h1 { margin-top: 24px; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side .group { display: none; }
  .icon.lock { display: none !important; }
  .side { position: fixed; bottom: 0; top: auto; left: 0; right: 0; height: auto; flex-direction: row; justify-content: space-around; padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
          border-right: none; border-top: 1px solid var(--hairline); z-index: 10; }
  .side .brand, .side .wide-only { display: none !important; }
  .side a:not(.brand) { flex-direction: column; gap: 2px; font-size: 11px; padding: 4px 6px; }
  .page { padding: 22px 16px 96px; }
  .narrow-only { display: flex !important; }
}
.button.danger { border-color: var(--loss); color: var(--loss); background: transparent; }
.button.danger:hover { background: rgba(212,112,122,.1); }
.danger-zone { border-color: rgba(212,112,122,.35); }
.danger-zone input[type=password] { max-width: 320px; }

/* The calendar: a month of days, each opening to everything on it. */
.cal-bar { gap: 8px; }
.cal-title { min-width: 170px; text-align: center; text-transform: capitalize; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-weekday { font-size: 11.5px; color: var(--text3); text-transform: uppercase; letter-spacing: .06em; padding: 0 6px; }
.cal-day { min-height: 86px; display: flex; flex-direction: column; align-items: stretch; gap: 3px; padding: 6px; text-align: left;
           background: rgba(255,255,255,.02); border: 1px solid var(--hairline); border-radius: 10px; color: var(--text); font: inherit; cursor: pointer; min-width: 0; }
.cal-day:hover { border-color: var(--hairline-2); background: rgba(255,255,255,.04); }
.cal-day.outside { opacity: .45; }
.cal-day.selected { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.cal-num { font-size: 13px; font-weight: 600; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; }
.cal-day.today .cal-num { background: var(--accent); color: var(--on-accent); }
.cal-day.noted .cal-num { text-decoration: underline dotted; text-underline-offset: 3px; }
.cal-chip { font-size: 11.5px; line-height: 1.35; padding: 2px 6px; border-radius: 6px; background: rgba(94,143,194,.18);
            white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-chip.own { background: rgba(62,143,133,.18); }
.cal-more { font-size: 11px; color: var(--text3); }
.cal-dot { display: none; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin: 2px auto 0; }
.cal-detail .item .button { margin-top: 8px; display: inline-block; }
@media (max-width: 760px) {
  .cal-grid { gap: 4px; }
  .cal-day { min-height: 48px; padding: 4px; align-items: center; }
  .cal-chip, .cal-more { display: none; }
  .cal-dot { display: block; }
  .cal-title { min-width: 0; flex: 1; }
}
/* An announcement from the admin, above the page. */
.banner { display: flex; gap: 14px; align-items: center; justify-content: space-between; border-color: var(--steel-dim); margin-bottom: 14px; }
/* The banner at the top of the page: its colours say what kind of message it is. */
.banner .banner-text { flex: 1; }
.banner.update { border-color: var(--steel); background: rgba(141,178,212,.07); }
.banner.maintenance { border-color: var(--warn); background: rgba(217,160,91,.08); }
.banner.maintenance .icon { color: var(--warn); }
.banner.important { border-color: var(--loss); background: rgba(212,112,122,.09); }
.banner.important .icon { color: var(--loss); }
.banner button.primary { flex: none; white-space: nowrap; }
.banners { display: contents; }
/* The admin's pop-up message, over the whole page: no close button, only the way through it. */
.popup-shade { position: fixed; inset: 0; z-index: 80; background: rgba(4,6,9,.78); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
               display: grid; place-items: center; padding: 20px; animation: popup-fade .2s ease-out; }
@keyframes popup-fade { from { opacity: 0; } }
.popup-window { width: min(720px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; gap: 12px; border-color: var(--loss);
                box-shadow: 0 24px 80px rgba(0,0,0,.5); }
.popup-window h2 { margin: 0; font-size: 24px; letter-spacing: -0.01em; }
.popup-head { display: flex; align-items: center; gap: 10px; }
.popup-head .icon { color: var(--loss); }
.popup-head .section-label { flex: 1; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--text3); font-weight: 650; }
.popup-body { flex: 1 1 auto; min-height: 120px; overflow-y: auto; background: #111820; border: 1px solid var(--hairline); border-radius: 10px; padding: 14px 18px;
              line-height: 1.55; color: var(--text); }
.popup-body:focus { outline: 2px solid var(--steel-dim); outline-offset: 2px; }
.popup-body h3 { font-size: 16px; margin: 14px 0 6px; }
.popup-body h4 { font-size: 14.5px; margin: 10px 0 4px; }
.popup-body p, .popup-body ul { margin: 0 0 10px; }
.popup-body > :first-child { margin-top: 0; }
.popup-tick { display: flex; flex-direction: row; flex-wrap: nowrap; align-items: flex-start; gap: 10px; font-size: 15px; color: var(--text); cursor: pointer; }
.popup-tick input { margin-top: 3px; width: 17px; height: 17px; flex: none; }
.popup-buttons { flex-wrap: wrap; gap: 10px; }
.popup-window .banner { margin: 0; }
body.popup-open { overflow: hidden; }
@media (prefers-reduced-motion: reduce) { .popup-shade { animation: none; } }
@media (max-width: 760px) {
  .popup-shade { padding: 10px; }
  .popup-window { max-height: calc(100vh - 20px); padding: 18px; }
  .popup-window h2 { font-size: 20px; }
}
textarea.tall { min-height: 220px; }
/* A host candidate's path: each step, ticked when done. */
.check-line { display: flex; gap: 8px; align-items: baseline; font-size: 14px; color: var(--text2); }
.check-line.ok { color: var(--text); }
.check-mark { flex: none; display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; font-size: 10.5px; font-weight: 700; background: rgba(255,255,255,.06); color: var(--text3); }
.check-line.ok .check-mark { background: rgba(87,184,148,.18); color: var(--gain); }
.pill.warn { background: rgba(217,160,91,.16); color: var(--warn); }
.pill.gain { background: rgba(87,184,148,.15); color: var(--gain); }

/* The community: threads as cards in a list, a thread with its replies, and the reply box. */
.row.tight { gap: 6px; }
.space-tabs { margin-bottom: 12px; }
.space-tabs .badge { margin-left: 6px; }
.community-tools input[type="search"] { flex: 1 1 220px; min-width: 0; }
.community-tools select { flex: 0 1 auto; }
.threads { margin-top: 14px; }
.page .threads .card + .card { margin-top: 0; }
.thread-row { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--text); transition: border-color .15s ease, background .15s ease; }
.thread-row:hover { border-color: var(--steel-dim); background: var(--hover); }
.thread-title { font-size: 16px; }
.thread-row .excerpt { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pill.new { background: var(--accent); color: var(--on-accent); }
.thread-heading { font-size: 26px; margin: 2px 0 0; overflow-wrap: anywhere; }
/* What people wrote reads as body text, not as the small grey of a card's notes. */
.post-text p { margin: 0 0 10px; font-size: 15.5px; line-height: 1.6; color: var(--text); overflow-wrap: anywhere; }
.post-text p:last-child { margin-bottom: 0; }
.about-lesson { display: inline-flex; gap: 8px; align-items: center; color: var(--steel); text-decoration: none; font-weight: 600; font-size: 14px; }
.about-lesson:hover { color: var(--text); }
.thread-row.is-new { box-shadow: inset 3px 0 0 var(--accent); }
.page .reply-box { margin-top: 14px; }
.page .replies-title { margin: 22px 0 10px; }
.reply { display: flex; flex-direction: column; gap: 8px; }
.reply.answer { border-color: rgba(87,184,148,.55); box-shadow: inset 3px 0 0 var(--gain); }
.reply.mine { background: #18232f; }
.mentions .button { display: inline-flex; gap: 6px; align-items: center; }
@media (max-width: 760px) {
  .community-tools select, .community-tools .button { flex: 1 1 45%; }
  .thread-heading { font-size: 22px; }
}

/* A part's learning goals on the programme page: a quiet panel under its title. */
.part-goals { margin: 4px 0 14px; padding: 12px 16px; border-left: 3px solid var(--steel); background: rgba(127,166,201,.06); border-radius: 0 10px 10px 0; }
.part-goals summary { cursor: pointer; font-weight: 600; color: var(--text); }
.part-goals p { margin: 8px 0; }
.part-goals .keypoints { margin: 6px 0 2px; }

/* A page comes in with a short fade and rise, its parts one after another. */
@keyframes page-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.page.entering > * { animation: page-in .45s cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(var(--i, 0) * 45ms); }
@media (prefers-reduced-motion: reduce) { .page.entering > * { animation: none; } }

/* The student's sky on Home. */
.sky-card { padding-bottom: 14px; }
.sky-card .sky { height: 210px; margin: 4px -8px 2px; }
@media (max-width: 760px) {
  .sky-card .sky { height: 360px; }
  .page .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .page .stats .stat { padding: 14px 12px; }
  .page .stats .stat b { font-size: 20px; }
  .page .stats .stat span { font-size: 12.5px; }
}
.page .stats { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.sky-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.sky-head h2 { margin: 0; }
.sky-card > .small { margin: 2px 0 0; }

/* The download: the platforms side by side and the same height, the button on one line. */
.platforms { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); align-items: stretch; }
.platform-head { display: flex; align-items: center; gap: 10px; }
.platform-head .icon { width: 22px; height: 22px; }
.platform .button { white-space: nowrap; align-self: flex-start; }
.platform > .small:last-child { margin-top: auto; }
.locked { position: relative; overflow: hidden; }
.locked::before { content: ""; position: absolute; inset: -40% -10% auto auto; width: 420px; height: 420px; border-radius: 50%; pointer-events: none;
                  background: radial-gradient(circle, rgba(112,96,196,.16), rgba(79,127,176,.06) 45%, transparent 70%); }
.locked h2 { margin: 0 0 8px; }
.unlock .key { flex: 1 1 220px; }

/* The numbers at the top of a page: an accent line that fills, and room to breathe. */
.stat { position: relative; overflow: hidden; }
.stat b { letter-spacing: -0.02em; }
.stat .bar { margin-top: 10px; }
.bar > div { width: 0; transition: width .9s cubic-bezier(.2,.7,.2,1); }

/* Pictures and files in the conversations: the tray under a writing box, and the files of a message. */
textarea.dropping { border-color: var(--steel); box-shadow: 0 0 0 3px rgba(141,178,212,.18); }
.button.attach { padding-left: 14px; padding-right: 16px; }
.button.attach .icon { width: 18px; height: 18px; }
.file-tray { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 2px; }
.file-chip { display: flex; align-items: center; gap: 10px; max-width: 100%; padding: 6px 6px 6px 6px; border-radius: 10px;
             background: var(--raised); border: 1px solid var(--hairline-2); animation: chip-in .25s ease; }
.file-chip .file-thumb { width: 40px; height: 40px; flex: none; border-radius: 7px; object-fit: cover; display: grid; place-items: center;
                         background: var(--surface); color: var(--steel); }
.file-chip .file-thumb .icon { width: 20px; height: 20px; }
.file-chip .file-name { font-size: 13px; overflow-wrap: anywhere; min-width: 0; }
.file-chip progress { width: 70px; height: 4px; flex: none; }
.file-chip.ready { border-color: var(--steel-dim); }
.file-chip.failed { border-color: var(--loss); }
.file-chip.failed .small { color: var(--loss); }
.file-chip.uploading .file-thumb { opacity: .6; }
.file-x { flex: none; width: 28px; height: 28px; border-radius: 8px; border: 0; background: transparent; color: var(--text2); cursor: pointer; display: grid; place-items: center; }
.file-x:hover { background: var(--hover); color: var(--text); }
.file-x .icon { width: 14px; height: 14px; }
@keyframes chip-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.files { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 2px; white-space: normal; }
.file-pic { padding: 0; border: 1px solid var(--hairline-2); border-radius: 10px; overflow: hidden; background: var(--surface); cursor: zoom-in;
            max-width: min(320px, 100%); line-height: 0; transition: border-color .2s, transform .2s; }
.file-pic:hover { border-color: var(--steel); transform: translateY(-1px); }
.file-pic img { display: block; max-width: 100%; max-height: 240px; width: auto; height: auto; object-fit: contain; }
.file-pic img.loading { min-width: 120px; min-height: 80px; background: linear-gradient(90deg, var(--surface), var(--raised), var(--surface)); background-size: 200% 100%;
                        animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: 0 0; } }
.file-link { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 8px 12px; border-radius: 10px; cursor: pointer;
             background: var(--surface); border: 1px solid var(--hairline-2); color: var(--text); font: inherit; font-size: 13px; text-align: left; }
.file-link:hover { border-color: var(--steel); background: var(--hover); }
.file-link .icon { width: 16px; height: 16px; color: var(--steel); flex: none; }
.file-link .file-name { overflow-wrap: anywhere; min-width: 0; }
.file-link .small { color: var(--text2); white-space: nowrap; }

.file-view { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 24px; background: rgba(5,8,12,.86);
             backdrop-filter: blur(6px); animation: view-in .2s ease; }
.file-view figure { margin: 0; display: flex; flex-direction: column; gap: 10px; max-width: 100%; max-height: 100%; }
.file-view img { max-width: min(1400px, 100%); max-height: calc(100vh - 120px); object-fit: contain; border-radius: 10px; border: 1px solid var(--hairline-2);
                 box-shadow: 0 20px 60px rgba(0,0,0,.5); background: var(--surface); }
.file-view figcaption { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--text2); font-size: 13px; }
@keyframes view-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .file-chip, .file-view { animation: none; }
  .file-pic img.loading { animation: none; }
  .file-pic, .file-pic:hover { transition: none; transform: none; }
}
