/* =====================================================================
   Lois Law Firm Client Portal — PREVIEW stylesheet
   ---------------------------------------------------------------------
   This ONE file controls the look of every page. All colors, fonts and
   spacing are defined as variables below so the whole portal can be
   restyled later by changing only this :root block.
   Deliberately neutral: grays only, system fonts, no images, no
   animations (keeps memory use low for an all-day browser tab).
   ===================================================================== */
:root {
  --bg: #f4f4f5;          /* page background */
  --surface: #ffffff;     /* cards, panels */
  --border: #d4d4d8;      /* hairlines */
  --text: #18181b;        /* primary text */
  --muted: #52525b;       /* secondary text */
  --faint: #71717a;       /* captions */
  --accent: #3f3f46;      /* buttons, active nav */
  --accent-text: #ffffff;
  --sample-bg: #fafaf0;   /* "example data" banners */
  --sample-border: #a1a1aa;
  --radius: 6px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.5; font-size: 15px; display: flex; flex-direction: column; min-height: 100vh; }
a { color: var(--accent); }
h1 { font-size: 1.6rem; margin: 0 0 .5rem; font-weight: 600; }
h2 { font-size: 1.2rem; margin: 1.75rem 0 .75rem; font-weight: 600; }
h3 { font-size: 1rem; margin: 0 0 .35rem; font-weight: 600; }
p { margin: 0 0 .75rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* ---- Preview banner (removed in production) ---- */
.preview-bar { background: #27272a; color: #e4e4e7; font-size: .8rem; text-align: center; padding: .35rem 1rem; }
.preview-bar a { color: #fff; }

/* ---- Header / navigation ---- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.site-header .inner { max-width: 1440px; margin: 0 auto; padding: .75rem 1.25rem; display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.5rem; }
.brand { font-weight: 700; text-decoration: none; color: var(--text); font-size: 1.05rem; }
.brand span { font-weight: 400; color: var(--muted); }
nav.main { display: flex; flex-wrap: wrap; gap: .25rem; flex: 1; }
nav.main a { text-decoration: none; color: var(--muted); padding: .35rem .7rem; border-radius: var(--radius); font-size: .92rem; }
nav.main a:hover { background: var(--bg); color: var(--text); }
nav.main a.active { background: var(--accent); color: var(--accent-text); }
.user-chip { font-size: .85rem; color: var(--muted); display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }

/* ---- Layout ---- */
main { flex: 1; width: 100%; max-width: 1440px; margin: 0 auto; padding: 1.75rem 1.25rem 2.5rem; }
main.narrow { max-width: 460px; }
main.reading { max-width: 780px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.grid { display: grid; gap: 1rem; }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 960px) { .grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid.cols-3 { grid-template-columns: 1fr; } }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.stack > * + * { margin-top: 1rem; }

/* ---- Tool cards ---- */
a.tool-card { display: block; text-decoration: none; color: var(--text); }
a.tool-card:hover { border-color: var(--accent); }
.tool-card .tag { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--faint); }

/* ---- Social cards ---- */
.social-card .platform { font-weight: 600; font-size: .9rem; }
.social-card .post { color: var(--muted); font-size: .9rem; margin: .5rem 0 .9rem; min-height: 3.5em; }
.social-card .date { font-size: .78rem; color: var(--faint); }

/* ---- Sample / example data marker ---- */
.sample { background: var(--sample-bg); border: 1px dashed var(--sample-border); border-radius: var(--radius); padding: .5rem .75rem; font-size: .82rem; color: var(--muted); margin-bottom: 1rem; }
.badge { display: inline-block; font-size: .7rem; border: 1px solid var(--border); border-radius: 999px; padding: 0 .5rem; color: var(--muted); background: var(--bg); vertical-align: middle; }

/* ---- Forms ---- */
label { display: block; font-weight: 500; font-size: .9rem; margin-bottom: .25rem; }
.hint { font-size: .8rem; color: var(--faint); margin-top: .2rem; }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=search], input[type=date], input[type=file], select, textarea {
  width: 100%; font: inherit; padding: .55rem .65rem; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.field { margin-bottom: 1rem; }
.check { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; margin-bottom: .75rem; }
.check input { margin-top: .25rem; }
.btn { display: inline-block; font: inherit; font-size: .92rem; padding: .55rem 1rem; border-radius: var(--radius); border: 1px solid var(--accent); background: var(--accent); color: var(--accent-text); cursor: pointer; text-decoration: none; }
.btn.secondary { background: var(--surface); color: var(--accent); }
.btn.small { padding: .3rem .65rem; font-size: .82rem; }
.btn[disabled], .btn.disabled { opacity: .4; cursor: not-allowed; pointer-events: none; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }

/* ---- Result box ---- */
.result { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; font-family: var(--mono); font-size: 1.05rem; min-height: 3rem; }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--surface); font-size: .88rem; }
th, td { text-align: left; padding: .5rem .65rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { font-weight: 600; color: var(--muted); background: var(--bg); }
td.num, th.num { text-align: right; }
.status { font-size: .78rem; border: 1px solid var(--border); border-radius: 999px; padding: 0 .5rem; }
.status.suspended { border-style: dashed; color: var(--faint); }

/* ---- Bars (usage stats) ---- */
.bar-row { display: grid; grid-template-columns: 110px 1fr 48px; gap: .6rem; align-items: center; font-size: .86rem; margin-bottom: .4rem; }
.bar { height: 14px; background: var(--accent); border-radius: 3px; }
.bar-track { background: var(--bg); border-radius: 3px; }

/* ---- Admin tabs ---- */
.tabs { display: flex; flex-wrap: wrap; gap: .25rem; border-bottom: 1px solid var(--border); margin-bottom: 1.25rem; }
.tabs button { font: inherit; font-size: .9rem; background: none; border: none; padding: .5rem .9rem; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs button.active { color: var(--text); border-bottom-color: var(--accent); }
.panel[hidden] { display: none; }

/* ---- FAQ ---- */
details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .75rem 1rem; margin-bottom: .5rem; }
summary { cursor: pointer; font-weight: 500; }
details p { margin-top: .6rem; color: var(--muted); }

/* ---- Global footer (text comes from content/footer.txt in production) ---- */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); }
.site-footer .inner { max-width: 1440px; margin: 0 auto; padding: 1.1rem 1.25rem; font-size: .78rem; color: var(--muted); line-height: 1.55; }
/* Row action buttons inside tables stay on one line. */
td .actions { flex-wrap: wrap; gap: .35rem; min-width: 210px; }
td.tight { white-space: normal; }
main.wide { max-width: 1440px; }
.badge.prospect { border-style: dashed; color: var(--text); }
td .actions.col { flex-direction: column; align-items: stretch; min-width: 120px; }

/* Key/value result table used by tool result panels */
table.kv { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.kv td { padding: .3rem .25rem; border-bottom: 1px solid var(--border, #e2e2e2); }
table.kv td:first-child { color: var(--muted, #555); }

/* Admin tab that links to a separate page (e.g. Bulk import) */
.tabs a.tab-link { font-size: .9rem; padding: .5rem .9rem; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; }
.tabs a.tab-link:hover { color: var(--text); }
/* Invited / Pending first login */
.status.pending { border-style: dotted; color: var(--muted); }
/* Bulk import row checks */
.check { display: inline-block; font-size: .75rem; border: 1px solid var(--border); border-radius: 999px; padding: 0 .5rem; white-space: nowrap; }
.check.ok { color: var(--text); }
.check.warn { border-style: dashed; }
.check.error { border-color: var(--text); font-weight: 600; }
tr.row-error td { background: var(--sample-bg); }
tr.row-error td em { color: var(--text); font-weight: 600; }
button.btn { font: inherit; cursor: pointer; }

/* Course resource type (proposed) */
.course-meta { margin: .25rem 0 .4rem; }
.progress-line { height: 6px; background: #eceef1; border-radius: 9px; overflow: hidden; margin-bottom: .75rem; }
.progress-line span { display: block; height: 100%; background: var(--accent, #2f5fd0); }
.course-bar { display: flex; align-items: center; gap: 1rem; margin-bottom: .75rem; }
.course-bar-title { flex: 1; display: flex; flex-direction: column; }
.course-frame { width: 100%; height: 640px; border: 1px solid #dfe1e5; border-radius: 10px; background: #fff; display: block; }

/* Tool 4 combined SLU wizard (mockup) */
.pending { display: inline-block; font-size: .68rem; font-weight: 500; color: #8a5a00; background: #fdf3dc; border: 1px solid #f0d9a8; border-radius: 999px; padding: 0 .45rem; margin-left: .25rem; vertical-align: middle; white-space: nowrap; }
.stepper { list-style: none; display: flex; gap: .5rem; padding: 0; margin: 0 0 1rem; flex-wrap: wrap; }
.stepper .step { font: inherit; font-size: .9rem; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: .4rem .9rem; cursor: pointer; color: var(--muted); }
.stepper .step.active { border-color: var(--accent); color: var(--text); font-weight: 600; }
.slu-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 1rem; align-items: start; }
@media (max-width: 960px) { .slu-layout { grid-template-columns: 1fr; } }
.results-panel { position: sticky; top: 1rem; }
.member-card { border: 1px solid var(--border); border-radius: var(--radius); padding: .9rem 1rem; margin-bottom: 1rem; background: var(--bg); }
.member-head { display: flex; justify-content: space-between; margin-bottom: .6rem; }
.row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
@media (max-width: 700px) { .row3 { grid-template-columns: 1fr; } }
input.mini { width: 6.5rem; text-align: right; padding: .25rem .4rem; }
.notice { font-size: .82rem; background: #fff8e6; border: 1px solid #f0d9a8; border-radius: var(--radius); padding: .45rem .65rem; margin: .6rem 0; }
.mini-result { margin-top: .6rem; font-size: .9rem; }
tr.total td { font-weight: 600; background: var(--bg); }
table.kv.money td.num { text-align: right; white-space: nowrap; }
table.kv.money tr.strong td { font-weight: 700; }
.rules li { margin-bottom: .35rem; }
h4.sub { font-size: .95rem; margin: 1rem 0 .35rem; }

/* ===================================================================
   Portal additions (production). Inline style="" attributes are blocked
   by the Content Security Policy, so spacing uses these classes.
   =================================================================== */
.mt-1 { margin-top: 1rem; }
.mt-05 { margin-top: .5rem; }
.mt-075 { margin-top: .75rem; }
.mb-0 { margin-bottom: 0; }
.agree-row { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; margin-bottom: .75rem; }
.agree-row input { margin-top: .25rem; }
.alert { font-size: .88rem; border-radius: var(--radius); padding: .6rem .8rem; margin-bottom: 1rem; border: 1px solid; }
.alert.error { background: #fdecec; border-color: #f1b5b5; color: #7a1f1f; }
.alert.ok { background: #edf7ee; border-color: #b9dcbd; color: #1f5126; }
.alert.info { background: #fff8e6; border-color: #f0d9a8; color: #5c4300; }
.field.has-error input { border-color: #c0392b; }
.field .field-error { font-size: .8rem; color: #a32020; margin-top: .2rem; }
.linklike { background: none; border: none; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline; }
.inline-form { display: inline; margin: 0; }
.result h4.sub:first-child { margin-top: 0; }
.result ul.steps { margin: .2rem 0 .6rem; padding-left: 1.1rem; font-size: .85rem; color: var(--muted); }
.result .messages { margin: .5rem 0 0; padding-left: 1.1rem; font-size: .88rem; }
fieldset.group { border: 1px solid var(--border); border-radius: var(--radius); padding: .75rem 1rem .25rem; margin: 0 0 1rem; }
fieldset.group legend { font-weight: 600; font-size: .9rem; padding: 0 .35rem; }
.tip { cursor: help; border-bottom: 1px dotted var(--faint); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media print {
  .site-header, .site-footer nav, .actions, .no-print { display: none !important; }
  main { padding: 0; }
}
/* Real results are tables, not the preview's monospace sample text. */
.result.result { font-family: var(--font); white-space: normal; font-size: .92rem; }

/* ---- Phase 2 tools ---------------------------------------------------- */
.info-tip { display: inline-block; position: relative; width: 1.05rem; height: 1.05rem; line-height: 1.05rem; text-align: center;
  font-size: .7rem; font-weight: 700; border: 1px solid var(--faint, #999); border-radius: 50%; color: var(--muted, #555); cursor: help; margin-left: .25rem; vertical-align: 1px; }
.info-tip::after { content: attr(data-tip); display: none; position: absolute; left: 50%; top: 1.4rem; transform: translateX(-50%); z-index: 20;
  width: 17rem; padding: .5rem .6rem; background: #1f2328; color: #fff; font-weight: 400; font-size: .78rem; line-height: 1.35; text-align: left; border-radius: 6px; white-space: normal; }
.info-tip:hover::after, .info-tip:focus::after { display: block; }
.field .sub-label { display: block; font-size: .78rem; color: var(--muted, #555); font-weight: 400; margin-top: .1rem; }
.big-figures { display: flex; gap: 1rem; flex-wrap: wrap; margin: .2rem 0 .6rem; }
.big-figures div { border: 1px solid var(--border); border-radius: var(--radius); padding: .5rem .8rem; min-width: 9rem; }
.big-figures .label { font-size: .78rem; color: var(--muted, #555); }
.big-figures .value { font-size: 1.4rem; font-weight: 700; }
.narrative { white-space: pre-wrap; font-size: .9rem; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: .6rem .75rem; }
textarea.narrative-box { width: 100%; min-height: 12rem; font: inherit; font-size: .9rem; }
.question-card { border: 1px solid var(--border); border-radius: var(--radius); padding: .75rem .9rem; margin-bottom: .75rem; }
.question-card.current { border-color: var(--accent); }
.question-card .q-title { font-weight: 600; }
.question-card .answers { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: .4rem; }
.question-card .answers label { font-weight: 400; display: inline-flex; gap: .35rem; align-items: center; }
.answered { font-size: .88rem; }
.answered dt { font-weight: 600; margin-top: .4rem; }
.answered dd { margin: 0 0 0 .8rem; }
.letter { white-space: pre-wrap; font-family: Georgia, "Times New Roman", serif; font-size: .9rem; border: 1px solid var(--border); padding: .8rem 1rem; background: #fff; }
.staff-only { border: 1px dashed var(--faint, #999); padding: .4rem .6rem; font-size: .82rem; margin: .5rem 0; }
.staff-only::before { content: "Staff only · "; font-weight: 700; }
table.data { width: 100%; border-collapse: collapse; font-size: .88rem; }
table.data th, table.data td { border-bottom: 1px solid var(--border); padding: .3rem .35rem; text-align: left; vertical-align: top; }
table.data td.num, table.data th.num { text-align: right; white-space: nowrap; }
.deadline-list li { margin-bottom: .3rem; }
.outcome { font-size: 1.05rem; font-weight: 600; margin: .3rem 0 .5rem; }
.row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
@media (max-width: 700px) { .row2 { grid-template-columns: 1fr; } }
.member-card .remove { float: right; }
.checklist li { margin-bottom: .3rem; }
@media print { form[data-tool], .site-header, .site-footer, .actions { display: none !important; } }
.big-figures div div { border: 0; padding: 0; min-width: 0; background: none; margin: 0; }
/* Tool 4 cards */
.label-like { display: block; font-weight: 600; margin-bottom: .25rem; }
fieldset.question-card table.data input { width: 6rem; }
fieldset.question-card details { margin: .5rem 0; }
label.checkbox { display: block; margin: .25rem 0; }
/* Tool 5 */
.stage-bar { display: flex; list-style: none; padding: 0; margin: 0 0 .75rem; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; font-size: .75rem; }
.stage-bar .stage { flex: 1; padding: .35rem .4rem; text-align: center; border-right: 1px solid var(--border); color: var(--muted); }
.stage-bar .stage:last-child { border-right: 0; }
.stage-bar .stage.active { font-weight: 700; color: var(--text); background: var(--bg); }
.stage-bar .stage.done { color: #1d6b3a; }
.question-card { outline: none; }
.question-card:focus-visible { box-shadow: 0 0 0 2px var(--border); border-radius: var(--radius); }
.msp-card { border: 1px solid var(--border); border-left-width: 4px; border-radius: var(--radius); padding: .5rem .75rem; margin: .6rem 0; }
.msp-card.msp-danger { border-left-color: #b3261e; }
.msp-card.msp-warn { border-left-color: #b7791f; }
.msp-card.msp-good { border-left-color: #1d6b3a; }
pre.memo { white-space: pre-wrap; font-size: .75rem; max-height: 22rem; overflow: auto; border: 1px solid var(--border); padding: .5rem; border-radius: var(--radius); }

/* ---- Admin (Phase 4) ---- */
.admin-tabs { margin-bottom: 1rem; }
.tabs a.tab-link.active { color: var(--text); border-bottom: 2px solid var(--accent); font-weight: 600; }
.actions.col { flex-direction: column; align-items: stretch; gap: .25rem; }
.actions.col .inline-form, .actions.col .inline-form .btn { display: block; width: 100%; }
.nowrap { white-space: nowrap; }
.mb-075 { margin-bottom: .75rem; }
.mb-1 { margin-bottom: 1rem; }
.filters input[type="search"], .filters select, .filters input[type="date"] { width: auto; }
.form-narrow { max-width: 640px; }
.users-table td, .audit-table td { vertical-align: top; }
.notes-cell { max-width: 16rem; }
.reminders ul { margin: .4rem 0 0; padding-left: 1.1rem; }
.reminders .inline-form { display: inline; }
textarea.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .82rem; width: 100%; }
.btn.danger { background: #8f1d1d; border-color: #8f1d1d; color: #fff; }
meter { width: 100%; height: 14px; }
tr.edit-row td { background: var(--bg); }
.import-table .check { white-space: nowrap; }
table.kv td { overflow-wrap: anywhere; }
.filters input[type="search"] { min-width: 16rem; }
.filters label.small { align-self: center; }
input.mini { width: 6.5rem; }
.actions input[type=date] { width: auto; }

/* ---- Phase 3: resources, course player, How To ---- */
.alert.success { background: #edf7ee; border-color: #b9dcbd; color: #1f5126; }
.res-jump { margin-bottom: .5rem; }
.res-jump .badge { text-decoration: none; }
.res-group h2 { margin-top: 1.5rem; }
.badge.pending { border-style: dashed; color: #7a5300; }
.placeholder-card { border-style: dashed; background: transparent; }
progress.progress-line { appearance: none; -webkit-appearance: none; display: block; width: 100%; height: 6px; border: 0; }
progress.progress-line::-webkit-progress-bar { background: #eceef1; border-radius: 9px; }
progress.progress-line::-webkit-progress-value { background: var(--accent); border-radius: 9px; }
progress.progress-line::-moz-progress-bar { background: var(--accent); border-radius: 9px; }
.course-frame.tall { height: calc(100vh - 210px); min-height: 520px; }
.course { display: grid; grid-template-columns: 270px 1fr; gap: 1.25rem; align-items: start; }
.course-nav { position: sticky; top: .75rem; max-height: calc(100vh - 1.5rem); overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .75rem; }
.course-nav .btn { margin-top: .5rem; }
.course-chapters { list-style: none; padding: 0; margin: .75rem 0 0; font-size: .88rem; }
.course-chapters li { padding: .3rem 0; border-top: 1px solid #eee; }
.course-chapters li.locked { color: var(--faint); }
.course-chapters li.passed a::after { content: " ✓"; }
.course-chapters li.extra { font-size: .82rem; }
.course-chapters a { text-decoration: none; }
.course-chapters a[aria-current] { font-weight: 600; text-decoration: underline; }
.course-main { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem 1.5rem; min-width: 0; }
.course-main h2 { border-top: 1px solid #eee; padding-top: 1rem; }
.course-main h2.part { border: 0; color: var(--muted); font-size: 1rem; text-transform: uppercase; letter-spacing: .03em; }
.lesson table { border-collapse: collapse; width: 100%; margin: .5rem 0 1rem; font-size: .88rem; }
.lesson th, .lesson td { border: 1px solid var(--border); padding: .3rem .45rem; text-align: left; vertical-align: top; }
.lesson .callout, .lesson .example, .lesson .note, .key-points { border-left: 3px solid var(--accent); background: var(--bg); padding: .5rem .8rem; margin: .75rem 0; border-radius: 0 var(--radius) var(--radius) 0; }
.lesson .example { border-left-color: #8a8f98; }
.lesson .note { border-left-color: #b08900; }
.lesson blockquote { margin: .5rem 0; padding-left: .8rem; border-left: 2px solid var(--border); color: var(--muted); }
.section-toc { columns: 2; column-gap: 2rem; padding-left: 1.2rem; }
.section-toc li.done a { color: var(--muted); }
.terms dt { font-weight: 600; margin-top: .4rem; }
.terms dd { margin: 0 0 .3rem 1rem; }
.check, .qbox { margin: .75rem 0; }
.qbox { border: 1px solid var(--border); }
.check .question, .qbox .question { font-weight: 600; margin-bottom: .4rem; }
.scenario { font-style: italic; color: var(--muted); }
label.choice { display: block; padding: .2rem 0; font-weight: normal; cursor: pointer; }
.match-row { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; align-items: center; margin: .25rem 0; }
.match-row select { width: 100%; }
.feedback { margin-top: .5rem; font-size: .88rem; }
.feedback.ok { color: #1f5126; }
.feedback.no { color: #7a1f1f; }
.quiz-result .actions { display: flex; margin-top: .5rem; }
.section-done { margin: .75rem 0 1.25rem; }
.howto details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .55rem .8rem; margin-bottom: .5rem; }
.howto summary { cursor: pointer; font-weight: 600; }
.howto details > :not(summary) { margin-top: .5rem; }
.social-card .post { font-size: .9rem; white-space: pre-line; }
.social-card .placeholder { border: 1px dashed var(--border); border-radius: var(--radius); padding: .5rem .7rem; }
@media (max-width: 800px) { .course { grid-template-columns: 1fr; } .course-nav { position: static; max-height: none; } .section-toc { columns: 1; } .match-row { grid-template-columns: 1fr; } }
@media print { .course-nav, .course-bar, .check, .section-done, .quiz-cta, .course-head .actions { display: none !important; } .course { display: block; } .course-main { border: 0; padding: 0; } }

/* Version 4: organizations and logos */
.org-thumb { width: 32px; height: 32px; object-fit: contain; vertical-align: middle; }
.org-logo { width: 100px; height: 100px; object-fit: contain; flex: 0 0 100px; }
.org-heading { display: flex; align-items: center; gap: 1rem; }
.welcome-row { display: flex; align-items: center; gap: 1rem; }
.welcome-row h1 { margin: 0; }
.badge.danger { border-color: #8f1d1d; color: #8f1d1d; font-weight: 600; }
.sort-link { color: inherit; text-decoration: none; white-space: nowrap; }
.sort-link:hover, .sort-link:focus { text-decoration: underline; }
th[aria-sort="ascending"] .sort-link, th[aria-sort="descending"] .sort-link { font-weight: 700; }
.pager { align-items: center; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.center { text-align: center; }
.tiny { font-size: .7rem; }

/* Version 4: role styles. static/css/roles/<role>.css sets the variables;
   these rules use them. With no role stylesheet nothing changes. */
.site-header { border-top: 4px solid var(--role-color, transparent); }
.role-label { display: inline-block; font-size: .7rem; font-weight: 600; letter-spacing: .02em; border-radius: 999px; padding: .05rem .55rem;
  background: var(--role-label-bg, var(--accent)); color: var(--role-label-text, #fff); vertical-align: middle; }
.login-note { border-left: 4px solid var(--border); padding: .5rem .75rem; background: var(--bg); }
/* Version 4: Resources dashboard */
.tiles { display: flex; flex-wrap: wrap; gap: .75rem; }
.tile { display: flex; flex-direction: column; min-width: 8.5rem; padding: .6rem .8rem; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--text); text-decoration: none; }
.tile:hover, .tile:focus { border-color: var(--accent); }
.tile-n { font-size: 1.5rem; font-weight: 700; line-height: 1.1; }
.tile-n.small { font-size: 1rem; padding-top: .35rem; }
.tile-l { font-size: .8rem; color: var(--muted); }
.tile.warn { border-color: #b45309; }
.tile.warn .tile-n { color: #92400e; }
.attention-list { margin: .5rem 0 0; }
.tiny-btn { padding: 0 .35rem; font-size: .7rem; line-height: 1.4; margin-right: 2px; }
/* Version 4: the wider Users list stays on one screen */
.users-table { font-size: .82rem; }
.users-table td, .users-table th { padding-left: .35rem; padding-right: .35rem; }
.users-table .row-actions .actions { flex-wrap: nowrap; gap: .25rem; }
.users-table .row-actions .btn.small { padding: .1rem .4rem; font-size: .72rem; }
#bulk-form .actions select { width: auto; }
.res-table { font-size: .85rem; }
#add input[type=url] { width: 100%; }
