/* ============================================
   DESIGN SYSTEM CONFIG — APA 7th Edition
   Monochrome variant: ONE ink + alpha stops.
   Never a grayscale ramp. Never a second hue.
   Differentiation = opacity, weight, border, size.
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,400;0,700;1,400;1,700&display=swap');

:root {

    /* --- THE ONLY CHROMATIC VALUES --- */
    --ink-rgb:                  48, 47, 43;
    --ink:                      rgb(var(--ink-rgb));
    --paper:                    #FFFFFF;

    /* Runtime-overridable hooks (dashboard admin-panel color pickers target these).
       Alpha stops below anchor to --ink-rgb, not --fg, so structural mono stays
       stable even if the user recolors text at runtime. */
    --fg:                       var(--ink);
    --bg:                       var(--paper);

    /* --- ALPHA STOPS — the whole value system --- */
    --ink-100:                  rgba(var(--ink-rgb), 1);
    --ink-85:                   rgba(var(--ink-rgb), 0.85);
    --ink-70:                   rgba(var(--ink-rgb), 0.70);
    --ink-55:                   rgba(var(--ink-rgb), 0.55);
    --ink-40:                   rgba(var(--ink-rgb), 0.40);
    --ink-25:                   rgba(var(--ink-rgb), 0.25);
    --ink-15:                   rgba(var(--ink-rgb), 0.15);
    --ink-08:                   rgba(var(--ink-rgb), 0.08);
    --ink-04:                   rgba(var(--ink-rgb), 0.04);

    /* --- FONTS (APA 2.19) — ONE family everywhere --- */
    --font-heading:             'Open Sans', sans-serif;
    --font-body:                'Open Sans', sans-serif;
    --font-figure:              'Open Sans', sans-serif;
    --font-code:                'Open Sans', sans-serif;
    --text-transform:           none;

    /* --- FONT SIZES --- */
    --size-h1:                  32px;
    --size-h2:                  24px;
    --size-h3:                  18px;
    --size-h4:                  16px;
    --size-h5:                  16px;
    --size-body:                15px;
    --size-secondary:           16px;
    --size-stat-number:         36px;
    --size-footnote:            12px;
    --size-figure-min:          10px;
    --size-figure-max:          16px;

    /* --- SEMANTIC TEXT --- */
    --color-h1:                 var(--fg);
    --color-h2:                 var(--fg);
    --color-h3:                 var(--fg);
    --color-body:               var(--fg);
    --color-secondary:          var(--ink-70);
    --color-hero-text:          var(--bg);
    --color-inverse-text:       var(--bg);

    /* --- BACKGROUNDS --- */
    --bg-page:                  var(--bg);
    --bg-hero:                  var(--fg);
    --bg-surface:               var(--bg);
    --bg-wash:                  var(--ink-04);
    --bg-hover:                 var(--ink-08);

    /* --- PROGRESS BARS (cycle by alpha, not by color) --- */
    --bar-track:                var(--ink-15);
    --bar-height:               12px;
    --bar-radius:               6px;
    --bar-fill-1:               var(--ink-100);
    --bar-fill-2:               var(--ink-85);
    --bar-fill-3:               var(--ink-70);
    --bar-fill-4:               var(--ink-55);
    --bar-fill-5:               var(--ink-40);
    --bar-fill-6:               var(--ink-25);
    --bar-fill-7:               var(--ink-15);

    /* --- DOTS / LIKERT --- */
    --dot-size:                 10px;
    --dot-1:                    var(--fg);

    /* --- DIVIDERS --- */
    --divider-color:            var(--fg);
    --divider-color-soft:       var(--ink-25);
    --divider-style:            solid;

    /* --- TABLE --- */
    --table-cell-border:        var(--ink-15);
    --table-row-hover:          var(--ink-04);

    /* --- CALLOUTS (variants collapse to alpha, not hue) --- */
    --callout-border:           var(--fg);
    --callout-border-warm:      var(--ink-100);
    --callout-border-clay:      var(--ink-55);
    --callout-border-light:     var(--ink-25);

    /* --- BADGES (inverse-chip / soft / outline) --- */
    --badge-bg-clay:            var(--ink-15);
    --badge-bg-warm:            var(--ink-100);
    --badge-bg-sepia:           var(--ink-55);

    /* --- RINGS / GAUGES --- */
    --ring-fill-red:            var(--ink-85);
    --ring-fill-clay:           var(--ink-55);
    --ring-fill-dark:           var(--ink-100);

    /* --- LAYOUT --- */
    --max-width:                none;
    --max-width-doc:            960px;
    --section-padding:          36px;
    --page-margin:              0;
    --image-size:               100%;

    /* --- APA SPACING --- */
    --line-height:              1.7;
    --paragraph-indent:         0;
    --hanging-indent:           0.5in;
    --block-quote-indent:       0.5in;
    --table-stub-indent:        0.15in;

    /* --- MOTION --- */
    --ease-bar:                 cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --dur-bar:                  1.2s;
    --dur-quick:                0.15s;
}

/* Dashboard admin-panel runtime toggles */
html.fg-flip { --fg: var(--paper); }
html.bg-flip { --bg: var(--ink); }
html.no-hlines tbody td { border-top: 0 !important; border-bottom: 0 !important; }


/* ============================================
   BASE
   ============================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    background: var(--bg-page);
    color: var(--color-body);
    font-family: var(--font-body);
    font-size: var(--size-body);
    line-height: var(--line-height);
    text-transform: var(--text-transform);
    margin: 0;
    padding: 0;
}

a {
    color: var(--fg);
    text-decoration: underline;
}


/* ============================================
   HEADINGS (APA 2.27)
   ============================================ */

h1 {
    font-family: var(--font-heading);
    font-size: var(--size-h1);
    color: var(--color-h1);
    font-weight: 700;
    font-style: normal;
    text-align: left;
    line-height: 1.3;
    margin-bottom: 16px;
}

h2 {
    font-family: var(--font-heading);
    font-size: var(--size-h2);
    color: var(--color-h2);
    font-weight: 700;
    font-style: normal;
    text-align: left;
    line-height: 1.3;
    margin-bottom: 16px;
}

h3 {
    font-family: var(--font-heading);
    font-size: var(--size-h3);
    color: var(--color-h3);
    font-weight: 600;
    font-style: normal;
    text-align: left;
    line-height: 1.4;
    margin-bottom: 12px;
}

h4 {
    font-family: var(--font-heading);
    font-size: var(--size-h4);
    color: var(--color-body);
    font-weight: bold;
    font-style: normal;
    text-align: left;
    text-indent: var(--paragraph-indent);
    display: inline;
    line-height: var(--line-height);
    margin: 0;
}

h5 {
    font-family: var(--font-heading);
    font-size: var(--size-h5);
    color: var(--color-body);
    font-weight: bold;
    font-style: italic;
    text-align: left;
    text-indent: var(--paragraph-indent);
    display: inline;
    line-height: var(--line-height);
    margin: 0;
}

.section-label {
    text-align: center;
    font-weight: bold;
    font-size: var(--size-body);
    line-height: var(--line-height);
}


/* ============================================
   PARAGRAPHS + BLOCK QUOTATIONS
   ============================================ */

p {
    text-align: left;
    text-indent: 0;
    line-height: var(--line-height);
    margin: 0 0 8px;
}

.abstract { margin-top: 0; }
.abstract p { text-indent: 0; }
.abstract .keywords { text-indent: var(--paragraph-indent); }
.abstract .keywords-label { font-style: italic; }

blockquote,
.block-quotation {
    margin: 0;
    padding: 0 0 0 var(--block-quote-indent);
    font-size: var(--size-body);
    font-style: normal;
    color: var(--color-body);
    line-height: var(--line-height);
    border-left: none;
}

blockquote p,
.block-quotation p { text-indent: 0; }

blockquote p + p,
.block-quotation p + p { text-indent: var(--paragraph-indent); }

.styled-quote {
    font-size: var(--size-body);
    font-style: normal;
    color: var(--color-body);
    padding: 0 0 0 var(--block-quote-indent);
    border-left: none;
    line-height: var(--line-height);
    margin-bottom: 0;
}

.styled-quote cite {
    display: block;
    margin-top: 0;
    font-size: var(--size-body);
    color: var(--color-body);
    font-style: normal;
}


/* ============================================
   UTILITIES
   ============================================ */

.no-transform   { text-transform: none; }
.no-indent      { text-indent: 0; }
.col-1          { grid-column: 1; }
.col-2          { grid-column: 2; }
.col-3          { grid-column: 3; }
.full-width     { grid-column: 1 / -1; }
.label-intro    { margin-bottom: 0; }
.spacer         { height: var(--section-padding); }
.half-spacer    { height: calc(var(--section-padding) / 2); }
.tabular-nums   { font-variant-numeric: tabular-nums; }
.text-center    { text-align: center; }
.text-left      { text-align: left; }
.text-right     { text-align: right; }
.text-mute      { color: var(--color-secondary); }
.text-faint     { color: var(--ink-55); }
.text-upper     { text-transform: uppercase; letter-spacing: 0.5px; }
.stack > * + *  { margin-top: 8px; }
.sr-only {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}


/* ============================================
   LAYOUT
   ============================================ */

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0;
}

.container-doc {
    max-width: var(--max-width-doc);
    margin: 0 auto;
    padding: 0 24px;
}

section { padding: var(--section-padding) 0; }

.wrap {
    max-width: 100%;
    padding: 24px;
}

.table-scroll { overflow-x: auto; }

.two-col   { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.three-col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 24px; }
.four-col  { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }


/* ============================================
   PAGE HEADER + TITLE PAGE (APA 2.3–2.18)
   ============================================ */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-family: var(--font-body);
    font-size: var(--size-body);
    line-height: var(--line-height);
    margin-bottom: calc(var(--line-height) * 1em);
}

.running-head {
    text-transform: uppercase;
    font-weight: normal;
    font-size: var(--size-body);
}

.page-number {
    text-align: right;
    font-size: var(--size-body);
}

.title-page { text-align: center; padding-top: 3em; }
.title-page .paper-title { font-weight: 700; font-size: var(--size-h1); text-align: center; }
.title-page .byline      { font-weight: normal; text-align: center; margin-top: 1em; }
.title-page .affiliation { font-weight: normal; text-align: center; }


/* ============================================
   HERO + ADMIN PANEL
   ============================================ */

.hero {
    background: var(--bg-hero);
    color: var(--color-hero-text);
    padding: 56px 0;
    position: relative;
    overflow: hidden;
}

.hero::before { content: none; }

.hero .container {
    position: relative;
    z-index: 1;
    text-align: center;
}

.hero h1 {
    color: var(--color-hero-text);
    font-weight: 700;
    margin: 0;
    letter-spacing: 0.5px;
    font-size: var(--size-h1);
    text-align: center;
}

.hero-subtitle {
    color: var(--color-inverse-text);
    font-size: var(--size-h3);
    font-family: var(--font-body);
    font-weight: 400;
    letter-spacing: 0;
    text-align: center;
}

.mini-hero { padding: 32px 0; }
.mini-hero h1 { font-size: var(--size-h2); }

/* Compact dashboard hero */
header.hero {
    padding: 18px 24px;
    text-align: center;
    font-family: var(--font-body);
}

header.hero h1 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.4px;
}

header.hero .hero-subtitle {
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.2px;
}

header.hero .hero-stamp {
    position: absolute;
    top: 8px;
    left: 12px;
    margin: 0;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.2px;
    color: var(--bg);
    opacity: 0.7;
}

header.hero .hero-arrow {
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 10px;
    line-height: 1;
    background: transparent;
    border: 0;
    color: var(--bg);
    cursor: pointer;
    padding: 4px 6px;
    transition: transform var(--dur-quick) ease;
}

header.hero .hero-arrow.open { transform: rotate(180deg); }

header.hero p {
    margin: 0;
    font-size: 13px;
    font-weight: 400;
    opacity: 0.9;
}

.admin-panel {
    position: absolute;
    top: calc(100% - 1px);
    right: 8px;
    background: var(--bg);
    color: var(--fg);
    border: 1px solid var(--fg);
    border-top: 0;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    padding: 14px 18px;
    min-width: 240px;
    max-width: 320px;
    text-align: left;
    z-index: 100;
    box-shadow: 0 4px 12px var(--ink-08);
}

.admin-panel .admin-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--fg);
    padding-bottom: 6px;
}

.admin-panel .admin-list {
    margin: 0; padding: 0; list-style: none;
    font-size: 12px;
}

.admin-panel .admin-list li { padding: 4px 0; }

.admin-panel .admin-btn {
    background: transparent; border: 0;
    color: var(--fg); font: inherit;
    cursor: pointer;
    padding: 4px 0;
    text-align: left;
    text-decoration: none;
    display: block;
    width: 100%;
}

.admin-panel .admin-btn:hover { text-decoration: underline; }

.admin-panel .admin-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 6px 0;
}

.admin-panel .admin-controls {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.admin-panel .switch {
    display: inline-block;
    position: relative;
    width: 32px; height: 18px;
    flex-shrink: 0;
}

.admin-panel .switch input { opacity: 0; width: 0; height: 0; }

.admin-panel .switch .slider {
    position: absolute;
    inset: 0;
    background: var(--bg);
    border: 1px solid var(--fg);
    border-radius: 10px;
    cursor: pointer;
    transition: background var(--dur-quick) ease;
}

.admin-panel .switch .slider::before {
    content: '';
    position: absolute;
    width: 12px; height: 12px;
    top: 2px; left: 2px;
    background: var(--fg);
    border-radius: 50%;
    transition: transform var(--dur-quick) ease, background var(--dur-quick) ease;
}

.admin-panel .switch input:checked + .slider { background: var(--fg); }
.admin-panel .switch input:checked + .slider::before { transform: translateX(14px); background: var(--bg); }

.admin-panel .color-picker {
    width: 22px; height: 18px;
    padding: 0;
    border: 1px solid var(--fg);
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.admin-panel .color-picker::-webkit-color-swatch-wrapper { padding: 0; }
.admin-panel .color-picker::-webkit-color-swatch { border: 0; border-radius: 3px; }
.admin-panel .color-picker::-moz-color-swatch   { border: 0; border-radius: 3px; }


/* ============================================
   DEMOGRAPHICS
   ============================================ */

.demographics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px 32px;
}

.demo-item { display: flex; flex-direction: column; gap: 0; }

.demo-label {
    font-size: var(--size-secondary);
    color: var(--color-secondary);
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.demo-value {
    font-size: var(--size-body);
    color: var(--color-body);
}

.demo-description {
    padding-left: var(--paragraph-indent);
    display: inline-block;
    margin-top: 0;
}


/* ============================================
   DIVIDER
   ============================================ */

.divider {
    border: none;
    border-top: 1px var(--divider-style) var(--divider-color);
    margin: 0;
    width: 100%;
}

.divider-soft {
    border-top-color: var(--divider-color-soft);
}


/* ============================================
   LISTS
   ============================================ */

.bullet-narrative { list-style: none; padding: 0; }

.bullet-narrative li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 10px;
    line-height: var(--line-height);
}

.bullet-narrative li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    width: var(--dot-size);
    height: var(--dot-size);
    border-radius: 50%;
    background: var(--bar-fill-3);
}

.numbered-list {
    list-style: decimal;
    padding-left: var(--paragraph-indent);
}

.numbered-list li {
    position: relative;
    padding-left: 0;
    margin-bottom: 0;
    line-height: var(--line-height);
}

.numbered-list li::before { content: none; }

.reference-list p,
.reference-entry {
    text-indent: calc(-1 * var(--hanging-indent));
    padding-left: var(--hanging-indent);
    text-align: left;
    line-height: var(--line-height);
    margin: 0;
}

.def-list dt {
    font-family: var(--font-body);
    font-size: var(--size-body);
    color: var(--color-body);
    font-weight: bold;
    margin-bottom: 0;
}

.def-list dd {
    font-size: var(--size-body);
    color: var(--color-body);
    margin-left: 0;
    padding-left: var(--paragraph-indent);
    margin-bottom: 0;
    border-left: none;
}

.checklist {
    list-style: none;
    padding: 0;
    padding-left: var(--paragraph-indent);
}

.checklist li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 0;
    line-height: var(--line-height);
}

.checklist li::before {
    content: '';
    position: absolute;
    left: 0; top: 6px;
    width: 14px; height: 14px;
    border: 1px solid var(--color-body);
    border-radius: 0;
}

.checklist li.checked::before {
    background: var(--color-body);
    border-color: var(--color-body);
}

.checklist li.checked::after {
    content: '';
    position: absolute;
    left: 3px; top: 9px;
    width: 8px; height: 4px;
    border-left: 2px solid var(--bg-page);
    border-bottom: 2px solid var(--bg-page);
    transform: rotate(-45deg);
}


/* ============================================
   HIGHLIGHT + SEPARATOR
   ============================================ */

.highlight        { background: var(--ink-15); padding: 1px 4px; border-radius: 0; }
.highlight-warm   { background: var(--ink-25); padding: 1px 4px; border-radius: 0; }
.highlight-clay   { background: var(--ink-08); padding: 1px 4px; border-radius: 0; }

.key-statement {
    display: inline-block;
    padding: 2px 8px;
    margin: 0 4px 4px 0;
    background: var(--ink-08);
    border-left: 2px solid var(--fg);
    font-style: italic;
    font-size: 13px;
    color: var(--fg);
}

.quote {
    font-style: italic;
    color: var(--color-body);
}

p.quote {
    padding-left: var(--block-quote-indent);
    margin-bottom: 8px;
}

.dot-separator {
    text-align: center;
    margin: 0;
    color: var(--color-body);
    font-size: var(--size-body);
    letter-spacing: 8px;
}


/* ============================================
   TABLES (APA 7.8–7.21) + DASHBOARD EXTENSIONS
   ============================================ */

.table-number {
    font-weight: 700;
    text-align: left;
    font-size: var(--size-body);
    line-height: var(--line-height);
}

.table-title {
    font-style: italic;
    font-weight: normal;
    text-align: left;
    font-size: var(--size-body);
    line-height: var(--line-height);
    margin-bottom: 8px;
}

.styled-table,
table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-body);
    font-size: var(--size-body);
    border-top: 2px solid var(--fg);
    border-bottom: 2px solid var(--fg);
}

.styled-table thead th,
thead th {
    position: sticky;
    top: 0;
    background: var(--bg);
    color: var(--fg);
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    padding: 10px 8px;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border-bottom: 1px solid var(--fg);
    cursor: pointer;
    user-select: none;
}

.styled-table tbody td,
tbody td {
    padding: 6px 8px;
    vertical-align: middle;
    font-family: var(--font-body);
    text-align: center;
    color: var(--color-body);
    border-bottom: 1px solid var(--fg);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
}

.styled-table tbody td:first-child { text-align: left; }
.styled-table tbody tr:last-child td { border-bottom: none; }
.styled-table tbody tr:nth-child(even) { background: none; }

tbody tr { height: 32px; }

tbody td.num       { text-align: center; font-variant-numeric: tabular-nums; max-width: none; }
tbody td.wide      { max-width: 320px; }
tbody td.xwide     { max-width: 420px; }

thead th.num                           { text-align: center; }
thead th.has-info                      { position: relative; }
thead th.col-rank, tbody td.col-rank   { width: 44px; min-width: 44px; text-align: center; }
thead th.loc,      tbody td.loc        { width: 80px;  min-width: 72px; max-width: 90px; text-align: center; }
thead th.hrs-cell, tbody td.hrs-cell   { text-align: center; width: 150px; max-width: 170px; }
thead th.prog-cell, tbody td.prog-cell { width: 340px; min-width: 280px; max-width: 360px; text-align: left; }
thead th.set-cell, tbody td.set-cell   { text-align: left; }
thead th.spec-cell, thead th.orient-cell { text-align: left; }
thead th.orient-cell, tbody td.orient-cell { width: 120px; max-width: 140px; }

tbody td.prog-cell .name-btn { text-align: left; width: 100%; display: block; }

/* Info popover — hover tooltip from column headers */
thead th .info-pop {
    position: absolute;
    top: calc(100% - 1px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg);
    color: var(--fg);
    border: 1px solid var(--fg);
    border-radius: 8px;
    padding: 10px 14px;
    min-width: 240px;
    max-width: 340px;
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0.1px;
    line-height: 1.5;
    text-align: left;
    white-space: normal;
    z-index: 80;
    box-shadow: 0 4px 12px var(--ink-08);
}

thead th .info-pop.info-pop-right { left: 0; transform: none; }
thead th .info-pop strong         { font-weight: 700; }
thead th .info-pop code.eq {
    display: inline-block;
    background: transparent;
    color: var(--fg);
    font-family: var(--font-body);
    font-size: 10px;
    padding: 0;
    border: 0;
}

/* Sort indicators */
.sort-asc::after  { content: " \25B2"; }
.sort-desc::after { content: " \25BC"; }

/* Best-row highlight — border-weight differentiation, no color change */
tbody tr.best-row td               { border-top: 2px solid var(--fg); border-bottom: 2px solid var(--fg); }
tbody tr.best-row td:first-child   { border-left: 3px solid var(--fg); }
tbody tr.best-row td:last-child    { border-right: 3px solid var(--fg); }

/* Hours legend strip */
tbody tr.hrs-spacer-row             { height: 22px; }
tbody tr.hrs-spacer-row td          { border: 0 !important; padding: 0; background: var(--bg); }
tbody tr.hrs-legend-row             { height: 22px; }
tbody tr.hrs-legend-row td          { padding-top: 2px; padding-bottom: 2px; line-height: 1.1; }
tbody td.hrs-legend {
    background: var(--fg);
    color: var(--bg);
    text-align: center;
    font-weight: 400;
    letter-spacing: 0.3px;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    font-size: 11px;
}

/* Expandable detail row */
tbody td.spec-cell { white-space: normal; vertical-align: top; text-align: left; }
tbody td.spec-cell details summary {
    list-style: none;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 14px;
    position: relative;
}
tbody td.spec-cell details summary::-webkit-details-marker { display: none; }
tbody td.spec-cell details summary::after {
    content: "\25B8";
    position: absolute;
    right: 0; top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    opacity: 0.7;
}
tbody td.spec-cell details[open] summary              { white-space: normal; }
tbody td.spec-cell details[open] summary::after       { content: "\25BE"; }
tbody td.spec-cell details .spec-full                 { padding-top: 6px; white-space: normal; line-height: 1.5; }

tbody tr.detail-row            { height: auto; }
tbody tr.detail-row td         { background: var(--bg); border-top: 0; max-width: none; white-space: normal; overflow: visible; }

/* Name button inside prog-cell */
.name-btn {
    background: transparent;
    border: 0;
    color: var(--fg);
    font: inherit;
    cursor: pointer;
    text-align: center;
    padding: 0;
    text-decoration: none;
}

/* Table notes */
.table-note {
    text-align: left;
    text-indent: 0;
    font-size: var(--size-body);
    line-height: var(--line-height);
}

.table-note-general::before {
    content: "Note. ";
    font-style: italic;
}


/* ============================================
   FIGURES (APA 7.22–7.36)
   ============================================ */

.figure-number {
    font-weight: bold;
    text-align: left;
    text-indent: 0;
    line-height: var(--line-height);
}

.figure-title {
    font-style: italic;
    font-weight: normal;
    text-align: left;
    text-indent: 0;
    line-height: var(--line-height);
}

.figure-image {
    font-family: var(--font-figure);
    font-size: 11pt;
}

.figure-note {
    text-align: left;
    text-indent: 0;
    font-size: var(--size-body);
    line-height: var(--line-height);
}

.image-placeholder {
    width: var(--image-size);
    max-width: 100%;
    height: auto;
    aspect-ratio: auto;
    margin: 0;
    border: 1px solid var(--divider-color);
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-secondary);
    font-size: var(--size-body);
    letter-spacing: 0;
}


/* ============================================
   DRAWINGS
   ============================================ */

.drawing-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.drawing-cell {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.drawing-grid .image-placeholder {
    width: 100%;
    max-width: 100%;
    height: unset;
    aspect-ratio: 1;
    margin: 0;
}

.drawing-label {
    font-size: var(--size-body);
    color: var(--color-body);
    font-weight: bold;
    margin-bottom: 0;
}

.paper {
    position: relative;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--bg-surface);
    border-radius: 0;
    box-shadow: none;
}

.paper canvas {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 0;
}


/* ============================================
   PROGRESS BARS
   ============================================ */

.progress-group     { margin-bottom: calc(var(--line-height) * 1em); }

.progress-label-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
}

.progress-label,
.progress-value {
    font-size: var(--size-body);
    color: var(--color-body);
    font-family: var(--font-body);
}

.progress-track {
    width: 100%;
    height: var(--bar-height);
    background: var(--bar-track);
    border-radius: var(--bar-radius);
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    border-radius: var(--bar-radius);
    transition: width var(--dur-bar) var(--ease-bar);
    position: relative;
    background: var(--bar-fill-1);
}

.progress-list > .progress-group:nth-child(7n+1) .progress-fill { background: var(--bar-fill-1); }
.progress-list > .progress-group:nth-child(7n+2) .progress-fill { background: var(--bar-fill-2); }
.progress-list > .progress-group:nth-child(7n+3) .progress-fill { background: var(--bar-fill-3); }
.progress-list > .progress-group:nth-child(7n+4) .progress-fill { background: var(--bar-fill-4); }
.progress-list > .progress-group:nth-child(7n+5) .progress-fill { background: var(--bar-fill-5); }
.progress-list > .progress-group:nth-child(7n+6) .progress-fill { background: var(--bar-fill-6); }
.progress-list > .progress-group:nth-child(7n+7) .progress-fill { background: var(--bar-fill-7); }


/* ============================================
   LIKERT / DOT SCALE
   Unified: .likert-dot (template vocab) +
   .dot (dashboard inline vocab) both work.
   ============================================ */

.likert-group { margin-bottom: calc(var(--line-height) * 1em); }

.likert-label {
    font-size: var(--size-body);
    color: var(--color-body);
    margin-bottom: 4px;
}

.likert-dots,
.dots {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    vertical-align: middle;
}

.likert-dots { gap: 8px; }

.likert-dot,
.dot {
    width: var(--dot-size);
    height: var(--dot-size);
    border-radius: 50%;
    border: 1.5px solid var(--fg);
    background: transparent;
}

.likert-dot.filled,
.dot.filled { background: var(--fg); }

.dot.sm { width: 8px;  height: 8px;  border-width: 1px; }
.dot.md { width: 12px; height: 12px; }
.dot.lg { width: 16px; height: 16px; border-width: 2px; }


/* ============================================
   CONCENTRIC RINGS
   ============================================ */

.rings-row {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: calc(var(--line-height) * 1em);
}

.ring-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.ring-label {
    font-size: var(--size-body);
    color: var(--color-body);
    text-align: center;
    max-width: 120px;
}

.concentric-ring {
    position: relative;
    width: 100px;
    height: 100px;
}

.concentric-ring .ring {
    position: absolute;
    border-radius: 50%;
    border: 2px solid var(--color-body);
    background: transparent;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.concentric-ring .ring.unfilled      { background: transparent; border-color: var(--ink-40); border-style: dashed; }
.concentric-ring .ring.filled        { background: var(--ink-25); border-color: var(--color-body); }
.concentric-ring .ring.filled-solid  { background: var(--color-body); }
.concentric-ring .ring.filled-red    { background: var(--ink-15); border-color: var(--color-body); }
.concentric-ring .ring.filled-red-solid  { background: var(--ring-fill-red);  border-color: var(--ring-fill-red); }
.concentric-ring .ring.filled-clay   { background: var(--ink-08); border-color: var(--color-body); }
.concentric-ring .ring.filled-clay-solid { background: var(--ring-fill-clay); border-color: var(--ring-fill-clay); }
.concentric-ring .ring.filled-dark   { background: var(--ink-40); border-color: var(--color-body); }
.concentric-ring .ring.filled-dark-solid { background: var(--ring-fill-dark); border-color: var(--ring-fill-dark); }

.concentric-ring .ring-1 { width: 100px; height: 100px; }
.concentric-ring .ring-2 { width: 76px;  height: 76px; }
.concentric-ring .ring-3 { width: 52px;  height: 52px; }
.concentric-ring .ring-4 { width: 28px;  height: 28px; }

.concentric-ring.ring-md         { width: 150px; height: 150px; }
.concentric-ring.ring-md .ring-1 { width: 150px; height: 150px; }
.concentric-ring.ring-md .ring-2 { width: 114px; height: 114px; }
.concentric-ring.ring-md .ring-3 { width: 78px;  height: 78px; }
.concentric-ring.ring-md .ring-4 { width: 42px;  height: 42px; }

.concentric-ring.ring-lg         { width: 200px; height: 200px; }
.concentric-ring.ring-lg .ring-1 { width: 200px; height: 200px; }
.concentric-ring.ring-lg .ring-2 { width: 152px; height: 152px; }
.concentric-ring.ring-lg .ring-3 { width: 104px; height: 104px; }
.concentric-ring.ring-lg .ring-4 { width: 56px;  height: 56px; }

.concentric-ring.ring-xl         { width: 260px; height: 260px; }
.concentric-ring.ring-xl .ring-1 { width: 260px; height: 260px; }
.concentric-ring.ring-xl .ring-2 { width: 198px; height: 198px; }
.concentric-ring.ring-xl .ring-3 { width: 136px; height: 136px; }
.concentric-ring.ring-xl .ring-4 { width: 74px;  height: 74px; }


/* ============================================
   TIMELINE
   ============================================ */

.timeline {
    position: relative;
    padding-left: 32px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 10px; top: 0; bottom: 0;
    width: 3px;
    background: var(--ink-25);
}

.timeline-item {
    position: relative;
    margin-bottom: 28px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -28px; top: 6px;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: var(--ink-70);
    border: 3px solid var(--bg-page);
}

.timeline-date {
    font-family: var(--font-heading);
    font-size: var(--size-h3);
    color: var(--color-h2);
    font-weight: 600;
    margin-bottom: 6px;
}

.timeline-content {
    font-size: var(--size-body);
    color: var(--color-body);
}


/* ============================================
   CARDS
   ============================================ */

.card {
    background: var(--bg-surface);
    border: 1px solid var(--divider-color);
    border-radius: 10px;
    padding: 20px 24px;
    margin-bottom: 12px;
}

.card-highlight {
    border-width: 2px;
    background: var(--ink-04);
}

.card-title {
    font-family: var(--font-heading);
    font-size: var(--size-h3);
    color: var(--color-h2);
    font-weight: 700;
    margin-bottom: 8px;
}

.card-grid        { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.card-grid-3      { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.card-container   { display: flex; flex-wrap: wrap; gap: 16px; }

.dimension-card {
    background: var(--bg-surface);
    border: 1px solid var(--divider-color-soft);
    border-left: 3px solid var(--fg);
    border-radius: 6px;
    padding: 16px 20px;
    margin-bottom: 12px;
}

.observation-card {
    background: var(--bg-surface);
    border: 1px solid var(--divider-color-soft);
    border-radius: 6px;
    padding: 14px 18px;
    margin-bottom: 12px;
}

.observation-card p { margin-bottom: 6px; }
.observation-card p:last-child { margin-bottom: 0; }


/* ============================================
   STAT CARDS
   ============================================ */

.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--divider-color);
    border-radius: 10px;
    padding: 24px;
    text-align: center;
}

.stat-number {
    font-family: var(--font-heading);
    font-size: var(--size-stat-number);
    color: var(--color-h1);
    font-weight: 700;
    line-height: 1.2;
}

.stat-label {
    font-size: var(--size-secondary);
    color: var(--color-secondary);
    margin-top: 6px;
}


/* ============================================
   CALLOUTS
   Variants differ by border-opacity only.
   ============================================ */

.callout {
    padding: 1px 24px 10px;
    border-left: 4px solid var(--callout-border);
    border-radius: 0 8px 8px 0;
    background: none;
    margin-bottom: 2px;
}

.callout-title {
    font-family: var(--font-heading);
    font-size: var(--size-h3);
    color: var(--color-h2);
    font-weight: 700;
    margin-bottom: 8px;
}

.callout-warm  { border-left-color: var(--callout-border-warm); }
.callout-clay  { border-left-color: var(--callout-border-clay); }
.callout-light { border-left-color: var(--callout-border-light); }

.ethics-box {
    border: 1px solid var(--fg);
    border-left: 4px solid var(--fg);
    padding: 14px 18px;
    background: var(--ink-04);
    border-radius: 0 6px 6px 0;
    margin-bottom: 12px;
}


/* ============================================
   ACCORDION
   ============================================ */

.accordion details {
    border: 1px solid var(--divider-color);
    border-radius: 8px;
    margin-bottom: 8px;
    overflow: hidden;
    background: var(--bg-surface);
}

.accordion summary {
    font-family: var(--font-heading);
    font-size: var(--size-h3);
    color: var(--color-h2);
    font-weight: 600;
    padding: 14px 20px;
    cursor: pointer;
    list-style: none;
}

.accordion summary::before {
    content: '+ ';
    color: var(--color-secondary);
}

.accordion details[open] summary::before { content: '- '; }

.accordion .accordion-body {
    padding: 0 20px 16px;
    font-size: var(--size-body);
    color: var(--color-body);
}


/* ============================================
   BADGES / CHIPS / SPECTRUM BADGES
   ============================================ */

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 0;
    font-size: var(--size-body);
    font-family: var(--font-body);
    letter-spacing: 0;
}

.badge-clay    { background: var(--badge-bg-clay);  color: var(--color-body); }
.badge-warm    { background: var(--badge-bg-warm);  color: var(--color-inverse-text); }
.badge-sepia   { background: var(--badge-bg-sepia); color: var(--color-inverse-text); }
.badge-outline { background: transparent; border: 1px solid var(--color-body); color: var(--color-body); }

.approach-card {
    display: inline-block;
    padding: 4px 10px;
    margin: 0 6px 6px 0;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
    border: 1px solid var(--fg);
    border-radius: 16px;
    background: transparent;
    color: var(--fg);
}

.approach-card.approach-primary {
    background: var(--fg);
    color: var(--bg);
}

/* Spectrum badges — differentiate by border-width, not hue */
.spectrum-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 2px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    border: 1px solid var(--fg);
    background: transparent;
    color: var(--fg);
}

.spectrum-badge.internalizing    { background: var(--ink-15); border-width: 1px; }
.spectrum-badge.thought-disorder { background: var(--ink-25); border-width: 1px; }
.spectrum-badge.detachment       { background: var(--ink-08); border-width: 2px; }
.spectrum-badge.somatoform       { background: transparent;   border-style: dashed; }
.spectrum-badge.disinhibited     { background: var(--ink-40); color: var(--bg); border-width: 1px; }
.spectrum-badge.antagonistic     { background: var(--fg);     color: var(--bg); border-width: 1px; }


/* ============================================
   DASHBOARD DETAIL PANEL (expanded row)
   ============================================ */

.detail {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    padding: 16px 0;
}

.detail section h3 {
    margin: 0 0 8px;
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    border-bottom: 1px solid var(--fg);
    padding-bottom: 4px;
}

.detail dl { margin: 0; }

.detail dl > div {
    display: flex;
    gap: 8px;
    padding: 2px 0;
    font-size: 12px;
}

.detail dl > div > span:first-child {
    min-width: 110px;
    opacity: 0.7;
}


/* ============================================
   ORIENT CHIPS (dashboard-specific)
   Tier differentiation by border + background opacity.
   ============================================ */

.orient-chip {
    display: inline-block;
    padding: 1px 6px;
    margin: 0 4px 4px 0;
    font-size: 11px;
    border: 1px solid var(--fg);
    border-radius: 2px;
    background: transparent;
    color: var(--fg);
}

.orient-yea     { background: var(--fg);      color: var(--bg); }
.orient-fine    { background: var(--ink-40);  color: var(--bg); }
.orient-meh     { background: var(--ink-15); }
.orient-hellnaw { border-style: dashed; background: transparent; opacity: 0.55; }


/* ============================================
   TIER OPACITY UTILITIES
   Apply to currentColor fills/strokes in charts.
   ============================================ */

.tier-1 { opacity: 1;    }
.tier-2 { opacity: 0.85; }
.tier-3 { opacity: 0.70; }
.tier-4 { opacity: 0.55; }
.tier-5 { opacity: 0.40; }


/* ============================================
   SEMANTIC "COLOR" CLASSES (mono-remapped)
   Kept as class names for markup compatibility;
   differentiation is alpha stop + order, not hue.
   ============================================ */

.c-gray   { color: var(--ink-100); fill: var(--ink-100); stroke: var(--ink-100); }
.c-coral  { color: var(--ink-85);  fill: var(--ink-85);  stroke: var(--ink-85); }
.c-blue   { color: var(--ink-70);  fill: var(--ink-70);  stroke: var(--ink-70); }
.c-teal   { color: var(--ink-55);  fill: var(--ink-55);  stroke: var(--ink-55); }
.c-amber  { color: var(--ink-40);  fill: var(--ink-40);  stroke: var(--ink-40); }
.c-red    { color: var(--ink-25);  fill: var(--ink-25);  stroke: var(--ink-25); }
.c-purple { color: var(--ink-15);  fill: var(--ink-15);  stroke: var(--ink-15); }
.c-pink   { color: var(--ink-08);  fill: var(--ink-08);  stroke: var(--ink-08); }


/* ============================================
   CHART PRIMITIVES — SVG-oriented
   All use currentColor; parent sets tier or ink.
   ============================================ */

/* Radar / spider */
.radar-wrap,
.rings-wrap {
    display: block;
    max-width: 100%;
    margin: 0 auto;
}
.radar-wrap svg,
.rings-wrap svg { width: 100%; height: auto; color: var(--fg); }
.radar-wrap .axis,
.rings-wrap .axis { stroke: currentColor; stroke-width: 1; opacity: 0.25; fill: none; }
.radar-wrap .grid,
.rings-wrap .grid { stroke: currentColor; stroke-width: 1; opacity: 0.15; fill: none; }
.radar-wrap .plot,
.rings-wrap .plot { fill: currentColor; fill-opacity: 0.15; stroke: currentColor; stroke-width: 1.5; }
.radar-wrap .label,
.rings-wrap .label { font-family: var(--font-figure); font-size: 11px; fill: currentColor; }

/* Donut / pie */
.donut-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    justify-content: center;
}

.donut-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: var(--fg);
}

.donut-item svg { width: 120px; height: 120px; }
.donut-item .track   { fill: none; stroke: var(--ink-15); stroke-width: 12; }
.donut-item .segment { fill: none; stroke: currentColor; stroke-width: 12; stroke-linecap: butt; transform: rotate(-90deg); transform-origin: 50% 50%; }
.donut-pct {
    font-family: var(--font-heading);
    font-size: var(--size-stat-number);
    font-weight: 700;
    color: var(--fg);
}
.donut-label {
    font-size: var(--size-body);
    color: var(--color-secondary);
    text-align: center;
    max-width: 140px;
}

/* Gauge */
.gauge-row {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
}

.gauge-item {
    flex: 1 1 160px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.gauge-label {
    font-size: var(--size-secondary);
    color: var(--color-secondary);
    font-weight: 600;
    letter-spacing: 0.3px;
}

.gauge-track {
    position: relative;
    height: var(--bar-height);
    background: var(--bar-track);
    border-radius: var(--bar-radius);
    overflow: hidden;
}

.gauge-fill {
    height: 100%;
    background: currentColor;
    color: var(--fg);
    transition: width var(--dur-bar) var(--ease-bar);
}

.gauge-value {
    font-family: var(--font-heading);
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    color: var(--fg);
}

/* Heatmap */
.heatmap-wrap {
    display: block;
    overflow-x: auto;
}

.heatmap {
    border-collapse: collapse;
    width: 100%;
}

.heatmap th,
.heatmap td {
    padding: 6px 8px;
    text-align: center;
    border: 1px solid var(--ink-15);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.heatmap th,
.heatmap .row-label {
    background: var(--bg);
    font-weight: 600;
    text-align: left;
    color: var(--fg);
}

.heatmap td.cell-1 { background: var(--ink-04); }
.heatmap td.cell-2 { background: var(--ink-08); }
.heatmap td.cell-3 { background: var(--ink-15); }
.heatmap td.cell-4 { background: var(--ink-25); }
.heatmap td.cell-5 { background: var(--ink-40); color: var(--bg); }
.heatmap td.cell-6 { background: var(--ink-55); color: var(--bg); }
.heatmap td.cell-7 { background: var(--ink-70); color: var(--bg); }
.heatmap td.cell-8 { background: var(--ink-85); color: var(--bg); }

/* Pyramid */
.pyramid-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.pyramid-layer {
    padding: 6px 12px;
    background: var(--ink-15);
    border: 1px solid var(--fg);
    text-align: center;
    font-size: var(--size-body);
    color: var(--fg);
}

.pyramid-layer.l-1 { width: 30%;  background: var(--ink-70); color: var(--bg); }
.pyramid-layer.l-2 { width: 50%;  background: var(--ink-40); }
.pyramid-layer.l-3 { width: 70%;  background: var(--ink-25); }
.pyramid-layer.l-4 { width: 90%;  background: var(--ink-15); }
.pyramid-layer.l-5 { width: 100%; background: var(--ink-08); }

/* Flowchart */
.flowchart-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.flow-diagram {
    display: grid;
    gap: 12px;
    font-size: var(--size-body);
}

.flow-node {
    padding: 10px 16px;
    border: 1px solid var(--fg);
    border-radius: 6px;
    background: var(--bg);
    color: var(--fg);
    text-align: center;
}

.flow-node.flow-node-strong { background: var(--fg); color: var(--bg); }
.flow-node.flow-node-soft   { background: var(--ink-08); }

.flow-arrow {
    text-align: center;
    color: var(--fg);
    font-size: 18px;
    line-height: 1;
}

/* Venn */
.venn-wrap {
    position: relative;
    width: 280px;
    height: 180px;
    margin: 0 auto;
}

.venn-wrap .venn-circle {
    position: absolute;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 1.5px solid var(--fg);
    background: var(--ink-08);
    top: 20px;
}

.venn-wrap .venn-circle.v-a { left: 0;   }
.venn-wrap .venn-circle.v-b { left: 70px; background: var(--ink-15); }
.venn-wrap .venn-circle.v-c { left: 140px; top: 20px; background: var(--ink-08); }

.venn-wrap .venn-label {
    position: absolute;
    font-size: 12px;
    color: var(--fg);
    font-weight: 600;
}

/* Spectrum bar */
.spectrum-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.spectrum-bar {
    position: relative;
    height: 14px;
    background: var(--ink-15);
    border-radius: var(--bar-radius);
    overflow: hidden;
}

.spectrum-bar .fill {
    height: 100%;
    background: currentColor;
    color: var(--fg);
    transition: width var(--dur-bar) var(--ease-bar);
}

.spectrum-marker {
    position: absolute;
    top: -2px; bottom: -2px;
    width: 2px;
    background: var(--fg);
}

.spectrum-ends {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--color-secondary);
}

/* Before / After */
.before-after {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 12px;
    align-items: stretch;
}

.ba-panel {
    border: 1px solid var(--fg);
    padding: 14px 16px;
    border-radius: 6px;
    background: var(--bg);
}

.ba-before { background: var(--ink-04); }
.ba-after  { background: var(--ink-08); }

.ba-title {
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--color-secondary);
    margin-bottom: 6px;
}

.ba-arrow {
    align-self: center;
    font-size: 20px;
    color: var(--fg);
}

/* Scale dots (fine-grained ordinal, distinct from Likert) */
.scale-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
}

.scale-label {
    min-width: 140px;
    font-size: var(--size-body);
    color: var(--color-body);
}

.scale-dots {
    display: inline-flex;
    gap: 3px;
}

.scale-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    border: 1px solid var(--fg);
    background: transparent;
}

.scale-dot.filled { background: var(--fg); }

.scale-anchor {
    font-size: 11px;
    color: var(--color-secondary);
    font-style: italic;
}

/* Bubble wrap / wheel */
.bubble-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.bubble-wrap .bubble {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    border-radius: 16px;
    border: 1px solid var(--fg);
    background: var(--bg);
    font-size: 12px;
    color: var(--fg);
}

.bubble-wrap .bubble.filled { background: var(--fg); color: var(--bg); }
.bubble-wrap .bubble.soft   { background: var(--ink-15); }

.wheel-wrap {
    position: relative;
    width: 240px;
    height: 240px;
    margin: 0 auto;
}

.wheel-wrap svg { width: 100%; height: 100%; color: var(--fg); }

.wheel-center-text {
    position: absolute;
    left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-heading);
    font-weight: 700;
    text-align: center;
    color: var(--fg);
}


/* ============================================
   SVG SCAFFOLD (axes, grids, data series)
   ============================================ */

.axis         { stroke: var(--fg); stroke-width: 1.5; fill: none; }
.axis-light   { stroke: var(--ink-40); stroke-width: 1; fill: none; }
.axis-title   { fill: var(--fg); font-family: var(--font-figure); font-size: 12px; font-weight: 600; }
.grid         { stroke: var(--ink-15); stroke-width: 1; fill: none; stroke-dasharray: 2 3; }

.t-axis       { fill: var(--fg); font-family: var(--font-figure); font-size: 10px; }
.t-tick       { fill: var(--color-secondary); font-family: var(--font-figure); font-size: 9px; }
.t-phase      { fill: var(--fg); font-family: var(--font-figure); font-size: 10px; font-weight: 600; }
.t-mean       { fill: var(--ink-70); font-family: var(--font-figure); font-size: 9px; font-style: italic; }
.t-mean-int   { fill: var(--fg); font-family: var(--font-figure); font-size: 9px; font-weight: 600; }

.data-bl      { stroke: var(--ink-55); stroke-width: 1.5; fill: none; }
.data-int     { stroke: var(--fg); stroke-width: 2;   fill: none; }
.pt-bl        { fill: var(--ink-55); stroke: var(--ink-55); }
.pt-int       { fill: var(--fg); stroke: var(--fg); }

.criterion-line { stroke: var(--ink-40); stroke-width: 1; stroke-dasharray: 4 3; fill: none; }
.phase-line     { stroke: var(--fg); stroke-width: 1.5; stroke-dasharray: 6 3; fill: none; }
.mean-line      { stroke: var(--ink-55); stroke-width: 1; fill: none; }
.mean-line-int  { stroke: var(--fg); stroke-width: 1.5; fill: none; }
.trendline      { stroke: var(--ink-70); stroke-width: 1.5; stroke-dasharray: 2 2; fill: none; }

.th { font-family: var(--font-figure); font-size: 14px; font-weight: 700; fill: var(--fg); }
.ts { font-family: var(--font-figure); font-size: 11px; font-style: italic; fill: var(--color-secondary); }


/* ============================================
   POSTER / STUDY / PRODUCT LAYOUTS
   ============================================ */

.poster {
    display: grid;
    grid-template-rows: auto 1fr;
    min-height: 100vh;
    background: var(--bg-page);
}

.poster-header {
    background: var(--fg);
    color: var(--bg);
    padding: 24px 32px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.poster-header-content { flex: 1; }
.poster-title          { font-family: var(--font-heading); font-size: 36px; font-weight: 700; margin: 0; color: var(--bg); }
.poster-subheading     { font-size: 18px; opacity: 0.85; color: var(--bg); margin-top: 4px; }
.poster-author         { font-size: 14px; color: var(--bg); opacity: 0.9; }
.poster-affiliation    { font-size: 12px; color: var(--bg); opacity: 0.75; font-style: italic; }
.poster-logo           { max-height: 80px; width: auto; filter: invert(1); }

.poster-body {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    padding: 32px;
}

.poster-col     { display: flex; flex-direction: column; gap: 16px; }
.poster-row-2   { grid-column: span 2; }

.poster-section {
    background: var(--bg-surface);
    border: 1px solid var(--ink-25);
    padding: 16px 20px;
    border-radius: 6px;
}

.poster-section-heading {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--fg);
    border-bottom: 2px solid var(--fg);
    padding-bottom: 6px;
    margin-bottom: 10px;
}

.study-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.book-week {
    border: 1px solid var(--fg);
    padding: 16px;
    border-radius: 0;
    background: var(--bg);
}

.book-title    { font-family: var(--font-heading); font-size: 18px; font-weight: 700; color: var(--fg); }
.book-subtitle { font-size: 13px; color: var(--color-secondary); font-style: italic; margin-bottom: 8px; }
.book-body     { font-size: var(--size-body); color: var(--color-body); line-height: var(--line-height); }
.book-prompt   { font-size: 13px; color: var(--ink-70); font-style: italic; margin-top: 8px; border-top: 1px dashed var(--ink-25); padding-top: 6px; }
.book-braille-label { font-family: var(--font-code); font-size: 11px; letter-spacing: 2px; color: var(--ink-55); }

.product-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.color-group        { border: 1px solid var(--ink-15); padding: 12px; border-radius: 4px; }
.color-group-header { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--color-secondary); margin-bottom: 8px; }


/* ============================================
   SWATCHES
   ============================================ */

.swatch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
}

.swatch {
    border: 1px solid var(--ink-25);
    border-radius: 4px;
    overflow: hidden;
    background: var(--bg);
}

.swatch.invalid { border-style: dashed; opacity: 0.5; }

.swatch-color {
    aspect-ratio: 3 / 2;
    background: var(--fg);
}

.swatch-info { padding: 8px 10px; font-size: 11px; }

.swatch-hex  { font-family: var(--font-code); font-size: 11px; color: var(--fg); }
.swatch-name { font-size: 12px; color: var(--fg); font-weight: 600; }
.swatch-code { font-family: var(--font-code); font-size: 10px; color: var(--color-secondary); }


/* ============================================
   VIDEO GRID
   ============================================ */

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.video-card {
    background: var(--bg-surface);
    border: 1px solid var(--divider-color-soft);
    border-radius: 6px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.video-card h3 {
    margin-bottom: 0;
    font-size: var(--size-h3);
}

.video-card video {
    width: 100%;
    height: auto;
    border: 1px solid var(--ink-15);
    border-radius: 4px;
    background: var(--ink-08);
}

.video-meta {
    font-size: 12px;
    color: var(--color-secondary);
    font-variant-numeric: tabular-nums;
}


/* ============================================
   FOOTNOTES + APPENDIX
   ============================================ */

.footnote {
    font-size: var(--size-footnote);
    line-height: 1;
}

.footnote-page .footnote {
    font-size: var(--size-body);
    line-height: var(--line-height);
    text-indent: var(--paragraph-indent);
}

.appendix-label {
    text-align: center;
    font-weight: bold;
    text-indent: 0;
    line-height: var(--line-height);
}


/* ============================================
   FOOTER
   ============================================ */

footer {
    padding: 16px 24px 32px;
    font-size: 12px;
    opacity: 0.7;
    border-top: 1px solid var(--fg);
    margin-top: 24px;
}


/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes slideInUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes growWidth {
    from { width: 0; }
}

@keyframes growHeight {
    from { height: 0; }
}

.animate-in { animation: slideInUp 0.6s ease-out both; }
.fade-in    { animation: fadeIn    0.6s ease-out both; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}


/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 700px) {
    :root {
        --size-h1: 24px;
        --size-h2: 20px;
        --size-h3: 16px;
        --size-body: 14px;
        --size-stat-number: 28px;
    }

    .demographics-grid,
    .card-grid,
    .card-grid-3,
    .two-col,
    .three-col,
    .four-col,
    .study-layout,
    .before-after {
        grid-template-columns: 1fr;
    }

    .poster-body { grid-template-columns: 1fr; }
    .detail      { grid-template-columns: 1fr 1fr; }
}


/* ============================================
   PRINT (APA papers are print-first)
   ============================================ */

@media print {
    body {
        margin: var(--page-margin);
        font-size: 12pt;
        line-height: 2;
    }

    .page-header { position: running(header); }

    @page {
        size: 8.5in 11in;
        margin: 1in;
    }

    .hero {
        background: none;
        color: var(--fg);
        padding: 0;
    }

    .hero h1,
    .hero-subtitle { color: var(--fg); }

    .animate-in,
    .fade-in { animation: none; }

    table            { break-inside: avoid; }
    tr.detail-row    { display: none; }
    thead th         { position: static; }
    .admin-panel,
    .hero-arrow,
    .hero-stamp      { display: none; }

    tr.best-row td,
    .card,
    .stat-card,
    .poster-section { break-inside: avoid; }
}
