/* ═══════════════════════════════════════════════════════════════════
   DataraFlow intern portal: page-specific rules
   Everything shared is in portal.css. Each block below belongs to one
   template, named in its comment, and holds only what that page needs
   beyond the shared components. Tokens from df-tokens.css; no hex, no
   gradients, no shadows on hover.
   ═══════════════════════════════════════════════════════════════════ */

/* ── Shared intern patterns ───────────────────────────────────────── */
/* A page band: the quiet replacement for the gradient hero. Title, one
   line, actions; optional figure on the right. */
.df-page-band { background: var(--df-surface); border-bottom: 1px solid var(--df-line); padding: var(--df-space-6) 0; margin-bottom: var(--df-space-5); }
.df-page-band h1 { font-size: 1.85rem; letter-spacing: -.03em; margin-bottom: .4rem; }
.df-page-band .lead { font-size: 1rem; color: var(--df-ink-2); max-width: 64ch; margin-bottom: var(--df-space-4); }
.df-page-band .df-stat { min-width: 200px; }
/* Rendered markdown (dashboard AI panel, submission feedback). */
.markdown-content { font-size: var(--df-text-sm); line-height: 1.6; }
.markdown-content h1, .markdown-content h2, .markdown-content h3, .markdown-content h4 { margin: .75rem 0 .4rem; font-weight: 700; color: var(--df-ink); }
.markdown-content h2 { font-size: 1.05rem; border-bottom: 1px solid var(--df-line); padding-bottom: .3rem; }
.markdown-content h3 { font-size: 1rem; }
.markdown-content p { margin-bottom: .75rem; }
.markdown-content ul, .markdown-content ol { margin-bottom: .75rem; padding-left: 1.5rem; }
.markdown-content li { margin-bottom: .25rem; }
.markdown-content strong { color: var(--df-ink); font-weight: 600; }
.markdown-content code { background: var(--df-accent-soft); padding: .15rem .35rem; border-radius: 4px; font-size: .9em; color: var(--df-accent-deep); }
.markdown-content pre { background: var(--df-paper); border: 1px solid var(--df-line); padding: .75rem; border-radius: var(--df-radius-ctl); overflow-x: auto; margin-bottom: .75rem; }
.markdown-content pre code { background: none; padding: 0; color: inherit; }
.markdown-content blockquote { border-left: 3px solid var(--df-line-strong); padding-left: 1rem; margin: 0 0 .75rem; color: var(--df-ink-2); }
.markdown-content a { color: var(--df-accent-deep); }
.markdown-content table { width: 100%; border-collapse: collapse; margin-bottom: .75rem; }
.markdown-content table th, .markdown-content table td { padding: .5rem; border: 1px solid var(--df-line); }
.markdown-content table th { background: var(--df-paper); font-weight: 600; }

/* ── index.html (intern dashboard) ────────────────────────────────── */
.hero-banner { background: var(--df-surface); border: 1px solid var(--df-line); border-radius: var(--df-radius-panel); padding: var(--df-space-6) var(--df-space-6); color: var(--df-ink); margin-bottom: var(--df-space-5); }
.hero-banner h1 { font-size: 1.65rem; margin-bottom: .35rem !important; }
.hero-banner .lead { font-size: 1rem; color: var(--df-ink-2); margin-bottom: var(--df-space-4) !important; }
.hero-banner .small { color: var(--df-ink-3); }
.progress-ring { width: 120px; height: 120px; }
.progress-ring circle { stroke: var(--df-line); }
.progress-ring #progress-circle { stroke: var(--df-accent); }
.progress-ring text { fill: var(--df-ink); font-family: inherit; font-weight: 700; }
.completion-ring { animation: dash 1.2s var(--df-ease) forwards; }
@keyframes dash { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .completion-ring { animation: none; stroke-dashoffset: 0; } }

.glass-card { background: var(--df-surface); border: 1px solid var(--df-line); border-radius: var(--df-radius-panel); }

.stat-card { background: var(--df-surface); border: 1px solid var(--df-line); border-radius: var(--df-radius-panel); padding: var(--df-space-4) var(--df-space-5); height: 100%; transition: border-color 160ms var(--df-ease); }
.stat-card:hover { border-color: var(--df-line-strong); }
.stat-card .small { text-transform: none; letter-spacing: 0; font-weight: 600; color: var(--df-ink-3) !important; font-size: var(--df-text-sm); }
.stat-card .rounded-circle { border-radius: 12px !important; padding: .6rem !important; }
.stat-value { font-size: 1.85rem; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; color: var(--df-ink); font-variant-numeric: tabular-nums; }
.gradient-text { color: var(--df-ink); font-weight: 700; font-size: 1.1rem; }

.action-card { background: var(--df-surface); border: 1px solid var(--df-line); border-radius: var(--df-radius-panel); padding: var(--df-space-5) var(--df-space-4); text-align: center; cursor: pointer; height: 100%; transition: border-color 160ms var(--df-ease), background-color 160ms var(--df-ease); }
.action-card:hover { border-color: var(--df-accent); background: var(--df-accent-soft); }
.action-card h5, .action-card h6 { font-size: .95rem; margin: 0 0 .25rem; }
.action-card p, .action-card small { color: var(--df-ink-3); font-size: var(--df-text-sm); margin: 0; }
.action-icon { width: 44px; height: 44px; margin: 0 auto .75rem; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.25rem; color: var(--df-accent-deep); background: var(--df-accent-soft); }

.activity-item { padding: .8rem 1rem; border: 1px solid var(--df-line); border-left: 3px solid var(--df-accent); margin-bottom: .6rem; background: var(--df-surface); border-radius: var(--df-radius-ctl); position: relative; }
.activity-icon-badge { width: 36px; height: 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-size: 1rem; margin-right: .75rem; background: var(--df-accent-soft); color: var(--df-accent-deep); }
.activity-time { font-size: .82rem; color: var(--df-ink-3); font-weight: 500; }
.activity-description { font-size: var(--df-text-sm); color: var(--df-ink); font-weight: 500; margin-bottom: .2rem; }
.activity-empty { text-align: center; padding: var(--df-space-6) var(--df-space-4); color: var(--df-ink-3); }
.activity-empty i { font-size: 2rem; opacity: .5; margin-bottom: .6rem; display: block; }

/* This week, Programme progress, Learning progress (static/js/intern_dashboard.js) */
.dash-card { padding: var(--df-space-5); }
.dash-card-head { display: flex; justify-content: space-between; align-items: center; gap: var(--df-space-3); flex-wrap: wrap; margin-bottom: var(--df-space-4); }
.col-12.dash-card-head { margin-bottom: 0; }
.dash-week-label { font-size: var(--df-text-sm); font-weight: 600; color: var(--df-ink-3); }
.dash-hide { color: var(--df-ink-3); text-decoration: none; padding: .15rem .35rem; }
.dash-hide:hover, .dash-hide:focus-visible { color: var(--df-ink); }
.dash-empty { color: var(--df-ink-3); font-size: var(--df-text-sm); text-align: center; padding: var(--df-space-3) 0; }
.dash-empty i { display: block; font-size: 1.4rem; margin-bottom: .35rem; opacity: .6; }
.dash-week-list, .dash-req-list, .dash-quiz-list { list-style: none; margin: 0; padding: 0; }
.dash-week-item + .dash-week-item { border-top: 1px solid var(--df-line); }
.dash-week-link { display: flex; align-items: center; gap: var(--df-space-3); padding: .65rem 0; color: var(--df-ink); text-decoration: none; min-width: 0; }
.dash-week-link:hover .dash-week-title { text-decoration: underline; }
.dash-week-icon { flex: 0 0 auto; width: 32px; height: 32px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; background: var(--df-accent-soft); color: var(--df-accent-deep); }
.dash-week-item.is-done .dash-week-icon { background: var(--df-ok-soft); color: var(--df-ok); }
.dash-week-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.dash-week-title { font-weight: 600; font-size: .95rem; overflow-wrap: anywhere; }
.dash-week-item.is-done .dash-week-title { color: var(--df-ink-2); }
.dash-week-when { font-size: .82rem; color: var(--df-ink-3); overflow-wrap: anywhere; }
.dash-pill { flex: 0 0 auto; display: inline-block; padding: .2rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 600; white-space: nowrap; }
.dash-pill-ok { background: var(--df-ok-soft); color: var(--df-ok-deep); }
.dash-pill-warn { background: var(--df-warn-soft); color: var(--df-warn-deep); }
.dash-pill-todo { background: var(--df-accent-soft); color: var(--df-accent-deep); }
.dash-pill-req { background: var(--df-info-soft); color: var(--df-info); }
.dash-pill-muted { background: var(--df-neutral-soft); color: var(--df-neutral); }
.dash-progress-row { margin-bottom: var(--df-space-4); }
.dash-progress-head { display: flex; justify-content: space-between; gap: var(--df-space-3); flex-wrap: wrap; font-size: var(--df-text-sm); margin-bottom: .35rem; color: var(--df-ink); }
.dash-progress-name { font-weight: 600; color: var(--df-ink); }
a.dash-progress-name:hover { color: var(--df-accent-deep); }
.dash-progress-value { color: var(--df-ink-2); font-variant-numeric: tabular-nums; }
.dash-bar { height: 6px; background: var(--df-neutral-soft); }
.dash-bar .progress-bar { background: var(--df-accent); }
.dash-req { display: flex; align-items: flex-start; gap: var(--df-space-3); padding: .55rem 0; border-top: 1px solid var(--df-line); flex-wrap: wrap; }
.dash-req-met { color: var(--df-ok); }
.dash-req-open { color: var(--df-ink-3); }
.dash-req-text { flex: 1 1 10rem; min-width: 0; display: flex; flex-direction: column; }
.dash-req-name { font-weight: 600; color: var(--df-ink); font-size: .95rem; }
.dash-req-status { font-size: .82rem; color: var(--df-ink-3); }
.dash-note { font-size: .8rem; color: var(--df-ink-3); margin: var(--df-space-3) 0 0; }
.dash-quizzes { border-top: 1px solid var(--df-line); padding-top: var(--df-space-3); }
.dash-quiz-list li { padding: .2rem 0; font-size: var(--df-text-sm); overflow-wrap: anywhere; }
.dash-score-split { display: flex; justify-content: space-between; gap: var(--df-space-2); margin-top: .5rem; font-size: .82rem; color: var(--df-ink-3); }
.dash-score-split strong { color: var(--df-ink); font-variant-numeric: tabular-nums; }
@media (max-width: 575.98px) {
  .dash-card { padding: var(--df-space-4); }
  .dash-week-link { flex-wrap: wrap; }
  .dash-week-text { flex-basis: calc(100% - 48px); }
  .dash-week-link .dash-pill { margin-left: 44px; }
}

/* ── submissions.html ─────────────────────────────────────────────── */
.pub-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font-size: .8rem; font-weight: 600; }
.pub-pill.neutral { background: var(--df-neutral-soft); color: var(--df-neutral); }
.pub-pill.success { background: var(--df-ok-soft); color: var(--df-ok); }
.pub-pill.warning { background: var(--df-warn-soft); color: var(--df-warn); }
/* `info`: a normal step the intern cannot act on. Blue, not amber. */
.pub-pill.info { background: var(--df-info-soft); color: var(--df-info); }
.pub-status-block { margin-top: .5rem; }
.pub-status-reassurance { color: var(--df-ink-3); font-size: .85rem; margin-top: .35rem; }
/* The open period's status line at the top of each form. */
.period-status-box { border: 1px solid var(--df-line); border-left: 3px solid var(--df-accent); border-radius: var(--df-radius-panel); padding: .6rem .85rem; background: var(--df-paper); color: var(--df-ink); }
/* Progress tiles are buttons (tap to jump to the row), drawn as the cards they were. */
.progress-tile { background: var(--df-surface); border-width: 1px; border-style: solid; padding: 0; font: inherit; cursor: pointer; }
.progress-tile:focus-visible { outline: 2px solid var(--df-accent); outline-offset: 2px; }
.progress-tile-open { border-width: 2px; }
.progress-tile-label { font-size: .72rem; overflow-wrap: anywhere; }
.row-highlight, .row-highlight > td { background: var(--df-accent-soft) !important; transition: background .3s; }

/* ── attendance.html ──────────────────────────────────────────────── */
.program-header { background: var(--df-surface); border-bottom: 1px solid var(--df-line); padding: var(--df-space-6) 0; }
.program-header h1 { font-size: 1.85rem; letter-spacing: -.03em; margin-bottom: .35rem; }
.program-header .lead { font-size: 1rem; color: var(--df-ink-2); margin: 0; }
.attendance-card { border: 1px solid var(--df-line); border-radius: var(--df-radius-panel); }
.attendance-card.session-open { border-color: var(--df-ok); }
.attendance-card.session-closed { background: var(--df-paper); }
.attendance-icon { font-size: 3rem; color: var(--df-ok); }
.closed-icon { font-size: 3rem; color: var(--df-ink-3); }
.btn-submit { padding: .6rem 1.5rem; font-weight: 600; }
.pulse { animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }

/* ── leaderboard.html ─────────────────────────────────────────────── */
.table-cards tbody tr td { vertical-align: middle; }
/* One compact row per intern at every width: on a phone the row is place |
   name with the score parts under it | total, so hundreds of rows stay a
   list rather than a page of cards, and nothing scrolls sideways. */
.lb-table { table-layout: auto; width: 100%; }
.lb-table tbody td { vertical-align: middle; }
.lb-table .lb-name { overflow-wrap: anywhere; }
.lb-table tr.lb-me > td { background: var(--df-accent-soft); }
.lb-table tr.lb-me > td:first-child { box-shadow: inset 3px 0 0 var(--df-accent); }
.lb-table tr.lb-flash > td { animation: lb-flash 1.6s var(--df-ease, ease-out); }
@keyframes lb-flash { 0%, 40% { background: var(--df-warn-soft); } 100% { background: var(--df-accent-soft); } }
.lb-table tr.lb-gap > td, .lb-table tr.lb-group > td { background: var(--df-paper); color: var(--df-ink-2); }
.lb-table .lb-bar { height: 6px; }
.lb-you-badge { background: var(--df-accent); color: var(--df-surface); font-size: .7rem; vertical-align: middle; }
.lb-you { border: 1px solid var(--df-line); border-left: 4px solid var(--df-accent); border-radius: var(--df-radius-panel); background: var(--df-surface); }
.lb-you-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: var(--df-space-3); margin-bottom: var(--df-space-3); }
.lb-you-label { font-size: var(--df-text-sm); color: var(--df-ink-3); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.lb-you-rank { font-size: 1.6rem; font-weight: 700; color: var(--df-ink); line-height: 1.2; font-variant-numeric: tabular-nums; }
.lb-you-joint { font-size: .95rem; font-weight: 600; color: var(--df-ink-2); }
.lb-you-actions { display: flex; flex-wrap: wrap; gap: var(--df-space-2); }
.lb-you-next { font-weight: 600; color: var(--df-ink); }
.lb-neighbours li { display: grid; grid-template-columns: 3.5rem 1fr auto; gap: var(--df-space-2); padding: .3rem .5rem; border-radius: var(--df-radius-tag); font-variant-numeric: tabular-nums; }
.lb-neighbours li.is-me { background: var(--df-accent-soft); font-weight: 700; }
.lb-neighbours .lb-n-name { overflow-wrap: anywhere; min-width: 0; }
.lb-neighbours .lb-n-rank, .lb-neighbours .lb-n-total { color: var(--df-ink-2); }
.lb-celebrate { display: flex; align-items: center; gap: var(--df-space-2); padding: .75rem 1rem; margin-bottom: var(--df-space-4); border-radius: var(--df-radius-panel); background: var(--df-ok-soft); color: var(--df-ok-deep); font-weight: 600; }
.lb-confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 1080; }
.lb-confetti i { position: absolute; top: -14px; width: 8px; height: 13px; border-radius: 2px; }
@media (max-width: 767.98px) {
    .lb-table .rank-badge { width: 32px; height: 32px; font-size: .8rem; }
    .lb-table td, .lb-table th { padding-top: .6rem; padding-bottom: .6rem; }
}
@media (prefers-reduced-motion: reduce) { .lb-table tr.lb-flash > td { animation: none; } }

/* ── profile.html ─────────────────────────────────────────────────── */
.profile-header { background: var(--df-surface); border-bottom: 1px solid var(--df-line); padding: var(--df-space-6) 0; color: var(--df-ink); }
.profile-header h1 { font-size: 1.65rem; }
.profile-header p { color: var(--df-ink-2); }
.profile-header .opacity-90 { opacity: 1; }
.profile-avatar { width: 96px; height: 96px; border-radius: 24px; border: 1px solid var(--df-line); background: var(--df-accent-soft); display: flex; align-items: center; justify-content: center; font-size: 2.4rem; color: var(--df-accent-deep); overflow: hidden; }
.profile-avatar img { border-radius: 24px !important; }
.profile-card { border: 1px solid var(--df-line); border-radius: var(--df-radius-panel); }
.profile-completion { height: 8px; border-radius: 999px; background-color: var(--df-neutral-soft); }
.profile-completion .progress-bar { background: var(--df-accent); border-radius: 999px; }
.stat-badge { background: var(--df-surface); border: 1px solid var(--df-line); border-radius: var(--df-radius-panel); padding: var(--df-space-4) var(--df-space-5); text-align: center; }
.stat-badge .stat-value { font-size: 1.85rem; }
.info-row { padding: .8rem 0; border-bottom: 1px solid var(--df-line); }
.info-row:last-child { border-bottom: none; }
.info-label { font-weight: 600; color: var(--df-ink-3); display: flex; align-items: center; gap: .5rem; font-size: var(--df-text-sm); }
.info-value { color: var(--df-ink); font-weight: 500; }
.btn-edit { font-weight: 600; }
.section-title { font-weight: 700; color: var(--df-ink); margin-bottom: var(--df-space-4); display: flex; align-items: center; gap: .5rem; font-size: 1.05rem; }
.section-title i { color: var(--df-ink-3); }
.skeleton { background: linear-gradient(90deg, var(--df-neutral-soft) 25%, var(--df-line) 50%, var(--df-neutral-soft) 75%); background-size: 200% 100%; animation: loading 1.5s infinite; border-radius: 4px; }
@keyframes loading { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── settings.html, edit_profile.html ─────────────────────────────── */
body.portal .page-header { background: var(--df-surface); border-bottom: 1px solid var(--df-line); padding: var(--df-space-6) 0; color: var(--df-ink); margin: 0; display: block; }
body.portal .page-header h1 { font-size: 1.65rem; }
body.portal .page-header h1 i { color: var(--df-ink-3); }
body.portal .page-header p { color: var(--df-ink-2); }
body.portal .page-header .opacity-90 { opacity: 1; }
.settings-card, .form-card { border: 1px solid var(--df-line); border-radius: var(--df-radius-panel); margin-bottom: var(--df-space-5); }
.setting-item { padding: 1rem 1.25rem; border-bottom: 1px solid var(--df-line); display: flex; justify-content: space-between; align-items: center; gap: var(--df-space-4); }
.setting-item:last-child { border-bottom: none; }
.setting-label { font-weight: 600; color: var(--df-ink); margin-bottom: .2rem; }
.setting-description { font-size: var(--df-text-sm); color: var(--df-ink-3); margin-bottom: 0; }
.settings-card .form-switch .form-check-input { width: 2.6rem; height: 1.4rem; cursor: pointer; }
.btn-save { padding: .6rem 1.5rem; font-weight: 600; }
.btn-cancel { padding: .6rem 1.5rem; font-weight: 600; }
.badge-info { background: var(--df-info-soft); color: var(--df-info); border: 0; }
.danger-zone { border: 1px solid var(--df-danger); border-radius: var(--df-radius-panel); background: var(--df-danger-soft); }
.char-count, .helper-text { font-size: .82rem; color: var(--df-ink-3); }
.helper-text { margin-top: .25rem; }

/* ── recommendation_letters.html ──────────────────────────────────── */
.recommendation-container { max-width: 1200px; margin: 0 auto; padding: var(--df-space-5) 20px; }
.recommendation-container .page-header { background: transparent; border: 0; padding: 0 0 var(--df-space-5); border-radius: 0; }
.request-section { background: var(--df-surface); padding: var(--df-space-5); border-radius: var(--df-radius-panel); border: 1px solid var(--df-line); margin-bottom: var(--df-space-5); }
.letters-grid { display: grid; gap: var(--df-space-4); }
.letter-card { background: var(--df-surface); padding: var(--df-space-5); border-radius: var(--df-radius-panel); border: 1px solid var(--df-line); border-left: 4px solid var(--df-line-strong); }
.letter-card.pending { border-left-color: var(--df-warn); }
.letter-card.approved { border-left-color: var(--df-info); }
.letter-card.published { border-left-color: var(--df-ok); }
.letter-card.rejected { border-left-color: var(--df-danger); }
.letter-card.draft { border-left-color: var(--df-neutral); }
.letter-card.edit_requested { border-left-color: var(--df-warn); }
.recommendation-container .status-badge { display: inline-block; padding: .28rem .6rem; border-radius: var(--df-radius-tag); font-size: .78rem; font-weight: 600; text-transform: none; letter-spacing: 0; }
.recommendation-container .status-pending { background: var(--df-warn-soft); color: var(--df-warn); }
.recommendation-container .status-approved { background: var(--df-info-soft); color: var(--df-info); }
.recommendation-container .status-draft { background: var(--df-neutral-soft); color: var(--df-neutral); }
.recommendation-container .status-published { background: var(--df-ok-soft); color: var(--df-ok); }
.recommendation-container .status-rejected { background: var(--df-danger-soft); color: var(--df-danger); }
.recommendation-container .status-edit_requested { background: var(--df-warn-soft); color: var(--df-warn); }
.form-section { display: none; }
.form-section.active { display: block; }
.btn-icon { display: inline-flex; align-items: center; gap: 8px; }
.recommendation-container .empty-state { text-align: center; padding: var(--df-space-6) var(--df-space-4); color: var(--df-ink-3); }
.recommendation-container .empty-state i { font-size: 2.5rem; margin-bottom: var(--df-space-3); display: block; }
.letter-info { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: var(--df-space-3); margin: var(--df-space-3) 0; }
.info-item { display: flex; gap: 10px; font-size: var(--df-text-sm); }
.letter-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: var(--df-space-4); padding-top: var(--df-space-4); border-top: 1px solid var(--df-line); }
.modal-backdrop-custom { display: none; position: fixed; inset: 0; background: rgba(15, 26, 51, .45); z-index: 1050; }
.modal-backdrop-custom.show { display: block; }
/* Text that came from a person (an institution, a reason, the letter
   itself) keeps its own line breaks; it is set as text, never markup. */
.letter-card .letter-note { white-space: pre-wrap; overflow-wrap: anywhere; }
.letter-card h4 { overflow-wrap: anywhere; }
#previewContent .letter-heading { font-weight: 700; margin: 1.5rem 0 1rem; font-size: 1.15rem; }
#previewContent .letter-item { margin: 0 0 .5rem 2rem; }
#previewContent p { margin-bottom: 1rem; }
@media (max-width: 420px) {
  .letter-actions .btn { flex: 1 1 100%; justify-content: center; }
  #previewModal .card-body { padding: 1.25rem !important; }
}

/* ── requests.html ────────────────────────────────────────────────── */
.ticket-summary { cursor: pointer; list-style-position: outside; }
.ticket-subject { font-weight: 600; overflow-wrap: anywhere; margin-right: .35rem; }
.ticket-chips { display: inline-flex; gap: .35rem; flex-wrap: wrap; vertical-align: middle; }
.ticket-facts { display: grid; grid-template-columns: max-content 1fr; gap: .25rem .75rem; }
.ticket-facts dt { font-weight: 600; color: var(--df-ink-3); }
.ticket-facts dd { margin: 0; min-width: 0; }
.ticket-body, .ticket-reason { white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 420px) { .ticket-facts { grid-template-columns: 1fr; } .ticket-facts dd { margin-bottom: .35rem; } }

/* ── my_group.html ────────────────────────────────────────────────── */
.member-avatar { width: 48px; height: 48px; border-radius: 14px; background: var(--df-accent-soft); display: flex; align-items: center; justify-content: center; color: var(--df-accent-deep); font-size: 1.25rem; overflow: hidden; flex-shrink: 0; }
.member-avatar img { width: 100%; height: 100%; object-fit: cover; }
.group-standing { font-size: var(--df-text-sm); background: var(--df-accent-soft); color: var(--df-ink); border-radius: var(--df-radius-ctl); padding: var(--df-space-2) var(--df-space-3); }

/* ── intern_calendar.html ─────────────────────────────────────────── */
.calendar-container { background: var(--df-surface); border-radius: var(--df-radius-panel); border: 1px solid var(--df-line); padding: var(--df-space-5); }
#internCalendar { min-height: 580px; }
.calendar-actions { display: flex; flex-wrap: wrap; gap: var(--df-space-2); align-items: center; }
/* Filter chips: the active one takes its kind's colour (--chip, set on the
   chip); near-white text on it in both themes, since the colour does not flip. */
#internFilterBar .filter-chip { border: 1px solid var(--df-line); }
#internFilterBar .filter-chip.active { background: var(--chip, var(--df-accent)); border-color: var(--chip, var(--df-accent)); color: var(--df-on-navy); }
#internFilterBar .filter-chip:focus-visible { outline: 2px solid var(--df-accent); outline-offset: 2px; }
#eventPopup .popup-header, #eventPopup .popup-header .close-btn { color: var(--df-on-navy); }
#eventPopup .popup-text { overflow-wrap: anywhere; }
#eventPopup .popup-actions { display: flex; flex-wrap: wrap; gap: var(--df-space-2); margin-top: var(--df-space-3); }
#eventPopup .popup-actions[hidden], #eventPopup .popup-actions [hidden] { display: none; }
/* Past events step back so what is ahead reads first. */
#internCalendar .fc-event-past { opacity: .55; }
.calendar-status { padding: var(--df-space-3) var(--df-space-4); border: 1px solid var(--df-line); border-radius: var(--df-radius-ctl); background: var(--df-surface); color: var(--df-ink-2); font-size: var(--df-text-sm); }
.calendar-status.is-error { border-color: var(--df-danger); }
.calendar-upcoming { background: var(--df-surface); border: 1px solid var(--df-line); border-radius: var(--df-radius-panel); padding: var(--df-space-3) var(--df-space-4); }
.calendar-upcoming__title { font-size: var(--df-text-sm); font-weight: 700; color: var(--df-ink); margin: 0 0 var(--df-space-2); }
.calendar-upcoming__list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--df-space-1); }
.calendar-upcoming__item { display: grid; grid-template-columns: auto 1fr; column-gap: var(--df-space-2); width: 100%; text-align: left; background: none; border: 0; padding: var(--df-space-2); border-radius: var(--df-radius-ctl); color: var(--df-ink); }
.calendar-upcoming__item:hover, .calendar-upcoming__item:focus-visible { background: var(--df-paper); }
.calendar-upcoming__item .dot { width: 10px; height: 10px; border-radius: 50%; margin-top: .4em; grid-row: span 2; }
.calendar-upcoming__name { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.calendar-upcoming__when, .calendar-upcoming__empty { font-size: var(--df-text-sm); color: var(--df-ink-3); }
/* Phones: the title takes its own row and the buttons shrink, so the
   toolbar never runs wider than the screen. */
@media (max-width: 767.98px) {
    .calendar-container { padding: var(--df-space-3); }
    #internCalendar { min-height: 0; }
    #internCalendar .fc-header-toolbar { flex-wrap: wrap; row-gap: var(--df-space-2); column-gap: var(--df-space-2); }
    #internCalendar .fc-header-toolbar .fc-toolbar-chunk { min-width: 0; display: flex; flex-wrap: wrap; gap: 4px; }
    #internCalendar .fc-header-toolbar .fc-toolbar-chunk:nth-child(2) { order: -1; flex: 1 0 100%; justify-content: center; }
    #internCalendar .fc-toolbar-title { font-size: 1.05rem; text-align: center; }
    #internCalendar .fc-button { padding: 4px 9px; font-size: .8rem; }
    #internCalendar .fc-button-group > .fc-button { flex: 0 0 auto; }
}

/* ── founder_challenge.html ───────────────────────────────────────── */
/* The four window dates: a label over a value, as many across as fit. */
.fc-dates { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--df-space-3); margin: 0; }
.fc-dates > div { background: var(--df-surface); border: 1px solid var(--df-line); border-radius: var(--df-radius-ctl); padding: var(--df-space-3) var(--df-space-4); min-width: 0; }
.fc-dates dt { font-size: .8rem; font-weight: 600; color: var(--df-ink-3); margin: 0 0 .15rem; }
.fc-dates dd { margin: 0; font-weight: 600; color: var(--df-ink); font-variant-numeric: tabular-nums; }
/* A heading for one step inside the entry card; my_research.html and
   my_group.html use it for their stages too. */
.fc-section-title { font-size: var(--df-text-sm); font-weight: 700; color: var(--df-ink); margin-bottom: var(--df-space-3); padding-bottom: var(--df-space-2); border-bottom: 1px solid var(--df-line); }
/* "How the challenge works": the summary is the card's header and the
   whole of it is the click target. */
.fc-how > summary { cursor: pointer; font-weight: 600; }
.fc-how:not([open]) > summary { border-bottom: 0; border-radius: inherit; }

/* ── Leaderboard extras (_leaderboard_extras.html,
      static/js/leaderboard_extras.js) ──────────────────────────────── */
/* Spotlight: a strip of cards that scrolls sideways on a phone. */
.lbx-spotlight { display: flex; gap: var(--df-space-3); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: var(--df-space-2); margin-bottom: var(--df-space-4); }
.lbx-spot { flex: 0 0 min(300px, 85%); scroll-snap-align: start; background: var(--df-surface); border: 1px solid var(--df-line); border-left: 3px solid var(--df-achieve-fill); border-radius: var(--df-radius-ctl); padding: var(--df-space-3) var(--df-space-4); min-width: 0; }
.lbx-spot-kicker { font-size: .78rem; font-weight: 700; color: var(--df-achieve); margin-bottom: .35rem; display: flex; align-items: center; gap: .35rem; }
.lbx-spot-by { color: var(--df-ink-3); font-size: .82rem; }
.lbx-spot-list { list-style: none; margin: .25rem 0 0; padding: 0; font-size: var(--df-text-sm); }
.lbx-spot-list li { padding: .2rem 0; overflow-wrap: anywhere; color: var(--df-ink-2); }
.lbx-title-text { font-weight: 600; color: var(--df-ink); overflow-wrap: anywhere; }
a.lbx-title-text { color: var(--df-accent-deep); }

/* The two cards. */
.lbx-card { border: 1px solid var(--df-line); border-radius: var(--df-radius-panel); background: var(--df-surface); }
.lbx-card-head { display: flex; justify-content: space-between; align-items: center; gap: var(--df-space-2); flex-wrap: wrap; padding: var(--df-space-4) var(--df-space-5) 0; }
.lbx-card-title { font-size: 1rem; font-weight: 700; margin: 0; display: flex; align-items: center; gap: .45rem; color: var(--df-ink); }
.lbx-card-title i { color: var(--df-ink-3); }
.lbx-private { font-size: .75rem; color: var(--df-ink-3); display: inline-flex; align-items: center; gap: .3rem; }
.lbx-card-body { padding: var(--df-space-4) var(--df-space-5) var(--df-space-5); }
.lbx-block + .lbx-block { margin-top: var(--df-space-5); }
.lbx-block-title { font-size: var(--df-text-sm); font-weight: 700; color: var(--df-ink); margin: 0 0 var(--df-space-2); }
.lbx-empty { color: var(--df-ink-3); font-size: var(--df-text-sm); margin: 0; display: flex; gap: .45rem; align-items: baseline; flex-wrap: wrap; }
.lbx-note { color: var(--df-ink-3); font-size: .8rem; margin: 0 0 var(--df-space-3); }
.lbx-meta { color: var(--df-ink-3); font-size: .8rem; font-variant-numeric: tabular-nums; }
.lbx-panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--df-space-2); flex-wrap: wrap; }
.lbx-panel-head .lbx-block-title { margin-bottom: .25rem; }

/* Streaks. */
.lbx-streaks { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--df-space-3); }
.lbx-streak { display: flex; gap: var(--df-space-3); align-items: flex-start; border: 1px solid var(--df-line); border-radius: var(--df-radius-ctl); padding: var(--df-space-3); min-width: 0; }
.lbx-streak > i { font-size: 1.35rem; color: var(--df-line-strong); line-height: 1; }
.lbx-streak.is-live > i { color: var(--df-warn); }
.lbx-streak-text { display: flex; flex-direction: column; min-width: 0; }
.lbx-streak-text strong { color: var(--df-ink); font-size: .95rem; }
.lbx-streak-text span { color: var(--df-ink-3); font-size: .8rem; }

/* Personal bests. */
.lbx-bests { list-style: none; margin: 0; padding: 0; }
.lbx-best { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem var(--df-space-3); padding: .45rem 0; border-top: 1px solid var(--df-line); font-size: var(--df-text-sm); }
.lbx-best:first-child { border-top: 0; }
.lbx-best-kind { flex: 0 0 4.5rem; color: var(--df-ink-3); font-weight: 600; }
.lbx-best-what { flex: 1 1 6rem; min-width: 0; color: var(--df-ink); overflow-wrap: anywhere; }
.lbx-best-pct { font-weight: 700; color: var(--df-ink); font-variant-numeric: tabular-nums; }
.lbx-new-best { flex-basis: 100%; display: inline-flex; align-items: center; gap: .3rem; font-size: .78rem; font-weight: 700; color: var(--df-warn-deep); }
.lbx-new-best i { color: var(--df-warn); }
.lbx-best.is-new .lbx-new-best i { animation: lbx-pop 600ms var(--df-ease) 1; }
@keyframes lbx-pop { 0% { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.25); opacity: 1; } 100% { transform: scale(1); } }

/* Badge shelf: earned ones filled, locked ones outlined. */
.lbx-badges { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: var(--df-space-2); }
.lbx-badge { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: .55rem .35rem; background: transparent; border: 1px dashed var(--df-line-strong); border-radius: var(--df-radius-ctl); color: var(--df-ink-3); font-size: .72rem; line-height: 1.2; text-align: center; cursor: pointer; transition: border-color 160ms var(--df-ease), background-color 160ms var(--df-ease); }
.lbx-badge i { font-size: 1.2rem; opacity: .55; }
.lbx-badge.is-earned { border-style: solid; border-color: var(--df-achieve-fill); background: var(--df-ok-soft); color: var(--df-ink); font-weight: 600; }
.lbx-badge.is-earned i { opacity: 1; color: var(--df-achieve); }
.lbx-badge[aria-pressed="true"] { outline: 2px solid var(--df-accent); outline-offset: 1px; }
.lbx-badge:focus-visible { outline: 2px solid var(--df-accent); outline-offset: 1px; }
.lbx-badge-detail { font-size: .8rem; color: var(--df-ink-2); margin: var(--df-space-2) 0 0; min-height: 1.2em; }

/* Tabs: one row that scrolls sideways rather than wrapping on a phone. */
.lbx-tabs { display: flex; gap: .25rem; overflow-x: auto; padding: var(--df-space-3) var(--df-space-4) 0; border-bottom: 1px solid var(--df-line); scrollbar-width: thin; }
.lbx-tab { flex: 0 0 auto; background: transparent; border: 0; border-bottom: 2px solid transparent; padding: .5rem .75rem; font-size: var(--df-text-sm); font-weight: 600; color: var(--df-ink-3); white-space: nowrap; cursor: pointer; }
.lbx-tab:hover { color: var(--df-ink); }
.lbx-tab[aria-selected="true"] { color: var(--df-accent-deep); border-bottom-color: var(--df-accent); }
.lbx-tab:focus-visible { outline: 2px solid var(--df-accent); outline-offset: -2px; border-radius: var(--df-radius-tag); }
.lbx-panel:focus-visible { outline: 2px solid var(--df-accent); outline-offset: 4px; border-radius: var(--df-radius-tag); }

/* People and group lists. */
.lbx-list, .lbx-groups, .lbx-modules { list-style: none; margin: 0; padding: 0; }
.lbx-row, .lbx-group-top { display: flex; align-items: center; gap: var(--df-space-3); min-width: 0; }
.lbx-row { padding: .45rem .5rem; border-radius: var(--df-radius-tag); }
.lbx-row + .lbx-row { border-top: 1px solid var(--df-line); }
.lbx-row.is-me, .lbx-group.is-me, .lbx-module.is-me { background: var(--df-accent-soft); }
.lbx-row-rank { flex: 0 0 2.6rem; font-weight: 700; color: var(--df-ink-2); font-variant-numeric: tabular-nums; font-size: var(--df-text-sm); }
.lbx-row-name { flex: 1 1 auto; min-width: 0; color: var(--df-ink); overflow-wrap: anywhere; font-size: var(--df-text-sm); }
.lbx-row-value { flex: 0 0 auto; font-weight: 700; color: var(--df-ink); font-variant-numeric: tabular-nums; font-size: var(--df-text-sm); }
.lbx-you { display: inline-block; margin-left: .4rem; padding: 0 .4rem; border-radius: 999px; background: var(--df-accent); color: var(--df-on-status); font-size: .68rem; font-weight: 700; vertical-align: middle; }
.lbx-me-line { margin: var(--df-space-3) 0 0; padding: .55rem .75rem; border-radius: var(--df-radius-ctl); background: var(--df-neutral-soft); color: var(--df-ink-2); font-size: var(--df-text-sm); display: flex; gap: .45rem; align-items: baseline; }
.lbx-me-line.is-good { background: var(--df-ok-soft); color: var(--df-ok-deep); }
.lbx-group { padding: .55rem .5rem; border-radius: var(--df-radius-tag); }
.lbx-group + .lbx-group { border-top: 1px solid var(--df-line); }
.lbx-group-rates { display: flex; flex-wrap: wrap; gap: .15rem var(--df-space-3); margin: .2rem 0 0 calc(2.6rem + var(--df-space-3)); font-size: .78rem; color: var(--df-ink-3); font-variant-numeric: tabular-nums; }
.lbx-module { padding: .6rem .5rem; border-radius: var(--df-radius-tag); }
.lbx-module + .lbx-module { border-top: 1px solid var(--df-line); }
.lbx-module-title { font-weight: 600; color: var(--df-ink); font-size: var(--df-text-sm); overflow-wrap: anywhere; }
.lbx-module-who { font-size: .82rem; color: var(--df-ink-2); overflow-wrap: anywhere; display: flex; gap: .35rem; align-items: baseline; }
.lbx-module-who i { color: var(--df-warn); }
.lbx-module-me { font-size: .78rem; color: var(--df-ink-3); }

@media (max-width: 575.98px) {
  .lbx-card-head { padding: var(--df-space-3) var(--df-space-4) 0; }
  .lbx-card-body { padding: var(--df-space-3) var(--df-space-4) var(--df-space-4); }
  .lbx-tabs { padding: var(--df-space-2) var(--df-space-3) 0; }
  .lbx-group-rates { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .lbx-best.is-new .lbx-new-best i { animation: none; }
  .lbx-badge { transition: none; }
}
/* ── end Leaderboard extras ───────────────────────────────────────── */
/* The hub's messages stay in view: an action lands the intern back at the
   part of the page they used, often far below the top. */
.fc-flash { position: sticky; top: .5rem; z-index: 1020; }
.fc-flash .alert { box-shadow: var(--df-shadow-2, 0 4px 14px rgba(0, 0, 0, .12)); }
