* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 6rem; }
body { margin: 0; background: #f3f6fa; color: var(--gm-ink); font-family: var(--gm-font-body); font-size: 16px; line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
a { color: inherit; }
svg { display: block; }
.hidden { display: none !important; }
.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; }
.skip-link { position: fixed; z-index: 100; left: 1rem; top: 0; transform: translateY(-120%); padding: .7rem 1rem; border-radius: 0 0 .6rem .6rem; background: var(--gm-navy); color: white; text-decoration: none; transition: transform var(--gm-motion-micro) var(--gm-ease-out); }
.skip-link:focus { transform: translateY(0); }
:focus-visible { outline: none; box-shadow: var(--gm-focus-ring); }

.app-shell { width: min(1600px, calc(100% - 2rem)); margin: 1rem auto 4rem; background: #f9fbfd; border: 1px solid rgba(35, 58, 94, .12); border-radius: 16px; overflow: clip; min-height: calc(100vh - 2rem); }
.topbar { min-height: 74px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 2rem; padding: .75rem 1.5rem; background: white; border-bottom: 1px solid rgba(35, 58, 94, .12); position: sticky; top: 0; z-index: 20; }
.brand { display: inline-flex; align-items: center; gap: .7rem; text-decoration: none; min-width: max-content; }
.brand-symbol { width: 38px; height: 38px; display: grid; place-items: center; background: #eef5ff; border-radius: 10px; }
.brand-symbol img { width: 25px; height: 25px; }
.brand strong { display: block; font-family: var(--gm-font-display); font-size: 1.02rem; letter-spacing: -.02em; }
.brand small { display: block; color: var(--gm-ink-muted); font-size: .71rem; }
.primary-nav { display: flex; justify-content: center; gap: .2rem; }
.primary-nav a { padding: .58rem .75rem; border-radius: 9px; color: #526078; font-size: .82rem; font-weight: 600; text-decoration: none; transition: background var(--gm-motion-micro), color var(--gm-motion-micro); }
.primary-nav a:hover, .primary-nav a.active { background: #edf4ff; color: var(--gm-blue-strong); }
.auth-area { display: flex; align-items: center; gap: .65rem; justify-content: flex-end; }
.user-label { max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--gm-ink-muted); font-size: .78rem; }

.button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .55rem .9rem; border: 0; border-radius: 9px; font-weight: 650; font-size: .82rem; transition: transform var(--gm-motion-micro) var(--gm-ease-out), background var(--gm-motion-micro), color var(--gm-motion-micro); }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:active:not(:disabled) { transform: translateY(0); }
.button:disabled { cursor: not-allowed; opacity: .48; }
.button.primary { background: var(--gm-blue-strong); color: white; }
.button.primary:hover { background: #1859c2; }
.button.quiet { background: #edf2f8; color: #233149; }
.button.quiet:hover { background: #e1e9f3; }
.button.large { min-height: 46px; padding-inline: 1.2rem; }
.button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.welcome { min-height: calc(100vh - 108px); display: flex; align-items: center; justify-content: space-between; gap: 3rem; padding: clamp(3rem, 8vw, 8rem); background: white; }
.welcome h1, .hero-copy h1 { margin: 0; max-width: 18ch; font-family: var(--gm-font-display); font-size: clamp(2.35rem, 4vw, 4.8rem); line-height: .98; letter-spacing: -.04em; text-wrap: balance; }
.welcome p, .hero-copy p { max-width: 70ch; margin: 1.2rem 0 0; color: var(--gm-ink-muted); font-size: clamp(1rem, 1.3vw, 1.15rem); }
.dashboard { padding: 1.35rem clamp(1rem, 2.4vw, 2.5rem) 4rem; }
.hero-section { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1.4rem 2rem; }
.hero-copy h1 { font-size: clamp(2rem, 2.5vw, 3rem); max-width: 24ch; }
.hero-copy p { max-width: 72ch; margin-top: .4rem; font-size: 1rem; }
.hero-actions { align-self: end; }

.filter-bar { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(9, minmax(125px, 1fr)); align-items: end; gap: .65rem; padding: .8rem; background: #edf3f8; border-radius: 12px; overflow-x: auto; }
.filter-bar select { min-width: 0; }
.filter-reset { background: transparent; color: #33445f; border: 1px solid rgba(35, 58, 94, .18); }
.filter-reset:hover { background: white; }
label { display: grid; gap: .34rem; color: #46556e; font-size: .88rem; font-weight: 600; }
label > span { white-space: nowrap; }
input, select, textarea { width: 100%; min-height: 40px; border: 1px solid rgba(35, 58, 94, .18); border-radius: 8px; background: white; color: var(--gm-ink); padding: .55rem .7rem; }
select { min-width: 10.5rem; }
textarea { resize: vertical; line-height: 1.45; }
input::placeholder, textarea::placeholder { color: #647189; opacity: 1; }
input:hover, select:hover, textarea:hover { border-color: rgba(36, 103, 219, .42); }
.data-status { grid-column: 1 / -1; min-height: 20px; color: var(--gm-ink-muted); font-size: .88rem; }
.data-status.error { color: var(--gm-danger); }

.kpi-grid { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .8rem; }
.kpi-card { min-height: 142px; padding: 1.05rem; background: white; border: 1px solid rgba(35, 58, 94, .13); border-radius: 14px; display: flex; flex-direction: column; }
.kpi-card > span { color: #3e4d65; font-weight: 650; font-size: .94rem; }
.kpi-card > strong { margin-top: .48rem; font-family: var(--gm-font-display); font-size: clamp(2rem, 3vw, 3.2rem); line-height: 1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.kpi-card > small { margin-top: .35rem; color: var(--gm-ink-muted); font-size: .82rem; }
.kpi-card > div { display: flex; align-items: baseline; gap: .45rem; margin-top: auto; padding-top: .65rem; border-top: 1px solid rgba(35, 58, 94, .1); }
.kpi-card > div b { font-family: var(--gm-font-data); font-size: .93rem; }
.kpi-card > div span { color: var(--gm-ink-muted); font-size: .8rem; }
.accent-card { background: #123b72; border-color: #123b72; color: white; }
.accent-card > span, .accent-card > small, .accent-card > div span { color: #d6e8ff; }
.accent-card > div { border-top-color: rgba(255,255,255,.18); }

.section-block { margin-top: clamp(2.6rem, 4.5vw, 4.5rem); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.section-heading h2 { margin: 0; font-family: var(--gm-font-display); font-size: clamp(1.7rem, 2.1vw, 2rem); letter-spacing: -.035em; line-height: 1.05; }
.section-heading p, .panel > p, .panel-title-row p { max-width: 72ch; margin: .35rem 0 0; color: var(--gm-ink-muted); font-size: .94rem; }
.panel { background: white; border: 1px solid rgba(35, 58, 94, .13); border-radius: 14px; padding: 1.25rem; }
.panel h3 { margin: 0; font-family: var(--gm-font-display); font-size: 1.22rem; letter-spacing: -.02em; }
.panel-heading { margin-bottom: 1.15rem; }
.panel-heading p { margin: .3rem 0 0; color: var(--gm-ink-muted); font-size: .9rem; }
.analytics-layout { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(310px, .85fr); gap: 1rem; }
.analytics-layout.split-even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.analytics-layout + .analytics-layout { margin-top: 1rem; }
.lead-grid { grid-template-columns: minmax(0, 1.65fr) minmax(340px, .9fr); }
.compact-row .panel { min-height: 280px; }
.activity-panel { min-height: 400px; }
.donut-panel { min-height: 400px; }
.chart-legend { display: flex; gap: 1rem; justify-content: flex-end; margin-bottom: .5rem; color: var(--gm-ink-muted); font-size: .72rem; }
.chart-legend span { display: flex; align-items: center; gap: .35rem; }
.chart-legend i { width: 18px; height: 3px; border-radius: 2px; }
.legend-interactions { background: var(--gm-blue-strong); }
.legend-sessions { background: #0e8f9f; }
.line-chart { min-height: 330px; position: relative; }
.line-chart svg { width: 100%; height: 330px; overflow: visible; }
.chart-grid line { stroke: #e5ebf3; stroke-width: 1; }
.chart-axis { fill: #68758b; font: 13px var(--gm-font-body); }
.chart-line { fill: none; stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: 1600; animation: line-reveal 850ms var(--gm-ease-out) both; }
.chart-line.interactions { stroke: var(--gm-blue-strong); }
.chart-line.sessions { stroke: #0e8f9f; stroke-width: 2; }
.chart-area { fill: rgba(36, 103, 219, .07); }
.chart-dot { stroke: white; stroke-width: 2; }
.chart-dot.interactions { fill: var(--gm-blue-strong); }
.chart-dot.sessions { fill: #0e8f9f; }
@keyframes line-reveal { from { stroke-dashoffset: 1600; } to { stroke-dashoffset: 0; } }

.bar-chart { display: grid; gap: .82rem; margin-top: 1.4rem; }
.bar-chart.large { min-height: 240px; }
.bar-row { display: grid; grid-template-columns: minmax(100px, 1fr) minmax(90px, 2fr) auto; align-items: center; gap: .65rem; }
.bar-row .label { color: #34435c; font-size: .76rem; line-height: 1.25; overflow-wrap: anywhere; }
.bar-track { height: 9px; background: #edf2f7; border-radius: 5px; overflow: hidden; }
.bar-fill { display: block; width: 100%; height: 100%; background: var(--gm-blue); border-radius: inherit; transform: scaleX(var(--bar-scale)); transform-origin: left; transition: transform 600ms var(--gm-ease-out); }
.bar-row:nth-child(2n) .bar-fill { background: #28b8c9; }
.bar-value { min-width: 4.3rem; text-align: right; font: 500 .75rem var(--gm-font-data); }
.empty-chart, .empty-cell { color: var(--gm-ink-muted); text-align: center; padding: 2.5rem 1rem; }

.donut-layout { display: grid; grid-template-columns: minmax(150px, .8fr) minmax(180px, 1fr); align-items: center; gap: 1rem; min-height: 260px; }
.donut-figure { position: relative; width: min(100%, 210px); margin-inline: auto; }
.donut-figure svg { width: 100%; transform: rotate(-90deg); }
.donut-figure > div { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.donut-figure strong { font-family: var(--gm-font-display); font-size: 1.8rem; letter-spacing: -.04em; }
.donut-figure span { color: var(--gm-ink-muted); font-size: .68rem; }
.donut-legend { display: grid; gap: .55rem; }
.donut-legend > div { display: grid; grid-template-columns: 9px minmax(0, 1fr) auto auto; align-items: center; gap: .45rem; font-size: .72rem; }
.donut-legend i { width: 9px; height: 9px; border-radius: 3px; background: var(--legend-color); }
.donut-legend span { overflow-wrap: anywhere; }
.donut-legend strong { font-family: var(--gm-font-data); }
.donut-legend small { min-width: 1.8rem; color: var(--gm-ink-muted); text-align: right; }

.ranking-head { display: grid; grid-template-columns: 1fr auto; padding: 0 0 .65rem 2.7rem; color: var(--gm-ink-muted); font-size: .65rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.content-ranking { display: grid; }
.content-row { display: grid; grid-template-columns: 2rem minmax(0, 1fr) auto; gap: .7rem; align-items: center; padding: .82rem 0; border-bottom: 1px solid #edf1f5; }
.content-row:last-child { border-bottom: 0; }
.content-row .rank { color: #58677e; font-family: var(--gm-font-data); font-size: .68rem; }
.content-row > div { min-width: 0; display: grid; gap: .24rem; }
.content-row strong { color: #263750; font-size: .79rem; line-height: 1.3; overflow-wrap: anywhere; }
.content-row div > span { color: var(--gm-ink-muted); font-size: .67rem; }
.content-row i { height: 4px; overflow: hidden; border-radius: 99px; background: #edf2f7; }
.content-row i b { display: block; width: 100%; height: 100%; border-radius: inherit; background: var(--gm-blue-strong); transform: scaleX(var(--bar-scale)); transform-origin: left; }
.content-row em { color: #243653; font: 600 .85rem var(--gm-font-data); font-style: normal; }

.resource-list { display: grid; }
.resource-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .7rem; padding: .82rem 0; border-bottom: 1px solid #edf1f5; }
.resource-row:last-child { border-bottom: 0; }
.resource-row > div { min-width: 0; display: grid; gap: .18rem; }
.resource-row strong { font-size: .78rem; }
.resource-row div span { color: var(--gm-ink-muted); font-size: .67rem; overflow-wrap: anywhere; }
.resource-row > b { font: 600 .82rem var(--gm-font-data); }
.resource-status { min-width: 5.4rem; padding: .24rem .48rem; border-radius: 999px; font-size: .62rem; font-weight: 700; text-align: center; }
.resource-status.requested { background: #e9f2ff; color: #225ea8; }
.resource-status.recommended { background: #e9f8f5; color: #126b59; }

.research-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; }
.research-grid article { display: grid; min-height: 128px; padding: 1rem; border: 1px solid rgba(35, 58, 94, .12); border-radius: 12px; background: white; }
.research-grid span { color: #46556e; font-size: .72rem; font-weight: 650; }
.research-grid strong { align-self: end; font-family: var(--gm-font-display); font-size: 2rem; letter-spacing: -.04em; }
.research-grid small { color: var(--gm-ink-muted); font-size: .67rem; }

.observatory-shell { display: grid; grid-template-columns: minmax(300px, .72fr) minmax(0, 1.5fr); min-height: 690px; overflow: hidden; border-radius: 16px; border: 1px solid #1d3b61; background: white; }
.observatory-master { display: grid; grid-template-rows: minmax(250px, auto) minmax(300px, 1fr); gap: 1.35rem; padding: 1.15rem; background: #102a4a; color: white; }
.master-group { min-height: 0; display: grid; grid-template-rows: auto 1fr; }
.master-heading { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .65rem; }
.master-heading h3 { margin: 0; font-family: var(--gm-font-display); font-size: .9rem; letter-spacing: -.01em; }
.master-heading span { color: #96b5d8; font: 500 .68rem var(--gm-font-data); }
.master-list { min-height: 0; display: grid; align-content: start; gap: .35rem; overflow: auto; scrollbar-color: #446587 transparent; }
.master-item { width: 100%; display: grid; grid-template-columns: 12px minmax(0, 1fr); gap: .12rem .55rem; padding: .68rem .72rem; border: 1px solid transparent; border-radius: 10px; background: transparent; color: #f5f8fc; text-align: left; transition: background var(--gm-motion-micro), border-color var(--gm-motion-micro), transform var(--gm-motion-micro) var(--gm-ease-out); }
.master-item:hover { transform: translateX(2px); background: rgba(255,255,255,.07); }
.master-item.selected { border-color: rgba(102, 215, 235, .42); background: #1b4673; }
.master-item strong, .master-item > span:not(.activity-dot):not(.student-rank), .master-item small { grid-column: 2; min-width: 0; }
.master-item strong { font-size: .76rem; line-height: 1.25; overflow-wrap: anywhere; }
.master-item > span:not(.activity-dot):not(.student-rank) { color: #bed0e5; font-size: .67rem; line-height: 1.3; overflow-wrap: anywhere; }
.master-item small { color: #83a5cb; font-size: .62rem; }
.activity-dot { grid-row: 1 / span 3; align-self: start; width: 8px; height: 8px; margin-top: .25rem; border-radius: 50%; background: var(--gm-cyan); box-shadow: 0 0 0 3px rgba(42, 194, 211, .12); }
.student-rank { grid-row: 1 / span 3; align-self: start; color: #7699c1; font: 500 .62rem var(--gm-font-data); }
.student-group { min-height: 310px; }
.master-empty { margin: 0; padding: 1rem; color: #96b5d8; font-size: .72rem; }

.observatory-detail { min-width: 0; padding: clamp(1.25rem, 2.4vw, 2.2rem); background: #f3f8fd; }
.detail-header { display: flex; align-items: start; justify-content: space-between; gap: 1rem; padding-bottom: 1.15rem; border-bottom: 1px solid #cfdeed; }
.detail-header h3 { margin: 0; color: #132f50; font-family: var(--gm-font-display); font-size: clamp(1.5rem, 2.2vw, 2.1rem); letter-spacing: -.035em; }
.detail-header p { margin: .25rem 0 0; color: #566c86; font-size: .78rem; overflow-wrap: anywhere; }
.detail-status { padding: .35rem .62rem; border-radius: 999px; background: #dcecff; color: #285b95; font-size: .65rem; font-weight: 700; white-space: nowrap; }
.detail-context { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .65rem; margin-top: 1.1rem; }
.detail-context > div { display: grid; gap: .2rem; padding: .7rem 0; border-bottom: 1px solid #cfdeed; }
.detail-context span, .detail-metrics span, .detail-callout > span { color: #52657d; font-size: .63rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.detail-context strong { color: #203a5b; font-size: .78rem; overflow-wrap: anywhere; }
.detail-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .65rem; margin-top: 1.2rem; }
.detail-metrics.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.detail-metrics article { display: grid; min-height: 92px; padding: .8rem; border: 1px solid #cfdeed; border-radius: 10px; background: rgba(255,255,255,.72); }
.detail-metrics strong { align-self: end; color: #163a66; font-family: var(--gm-font-display); font-size: 1.65rem; letter-spacing: -.04em; }
.detail-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem; margin-top: 1.35rem; }
.detail-columns h4, .detail-section h4 { margin: 0 0 .6rem; color: #2d4665; font-size: .7rem; letter-spacing: .05em; text-transform: uppercase; }
.detail-bars { display: grid; gap: .55rem; }
.detail-bars > div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(55px, .7fr) auto; align-items: center; gap: .5rem; font-size: .68rem; }
.detail-bars span { overflow-wrap: anywhere; }
.detail-bars i { height: 5px; overflow: hidden; border-radius: 99px; background: #dce7f2; }
.detail-bars i b { display: block; width: 100%; height: 100%; background: var(--gm-blue); transform: scaleX(var(--bar-scale)); transform-origin: left; }
.detail-bars strong { font: 500 .68rem var(--gm-font-data); }
.detail-section { margin-top: 1.35rem; }
.detail-resources { display: flex; flex-wrap: wrap; gap: .45rem; }
.detail-resources > span { padding: .34rem .55rem; border-radius: 7px; background: #dcecff; color: #285b95; font-size: .65rem; }
.detail-resources > span.recommended { background: #daf2ed; color: #176655; }
.detail-resources b { margin-left: .25rem; font-family: var(--gm-font-data); }
.detail-empty { margin: 0; color: #6a7d94; font-size: .7rem; }
.session-timeline { display: grid; max-height: 235px; overflow: auto; }
.session-timeline > div { position: relative; display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: .65rem; align-items: baseline; padding: .58rem 0 .58rem 1rem; border-bottom: 1px solid #d8e4ef; }
.session-timeline > div::before { content: ""; position: absolute; left: 0; top: .9rem; width: 6px; height: 6px; border-radius: 50%; background: var(--gm-cyan); }
.session-timeline time { color: #50657e; font: 500 .65rem var(--gm-font-data); }
.session-timeline span { color: #243d5c; font-size: .72rem; overflow-wrap: anywhere; }
.session-timeline small { color: #586d84; font-size: .63rem; text-align: right; overflow-wrap: anywhere; }
.detail-callout { display: grid; gap: .28rem; margin-top: 1.2rem; padding: 1rem; border: 1px solid #c9dbea; border-radius: 8px; background: white; }
.detail-callout strong { color: #173a65; font-size: 1rem; }
.detail-callout small { color: #60748d; }

.accompaniment-strip { display: grid; grid-template-columns: minmax(220px, .55fr) minmax(0, 1fr); align-items: center; gap: 2rem; margin-top: clamp(3.5rem, 6vw, 6rem); padding: 1.25rem 1.4rem; border: 1px solid #c9d8ea; border-radius: 12px; background: #e8f3fc; }
.accompaniment-strip h2 { margin: 0; font-family: var(--gm-font-display); font-size: 1.15rem; letter-spacing: -.02em; }
.accompaniment-strip p { margin: 0; color: #445673; font-size: .82rem; }

.flow-section { padding: 1.5rem; background: #0d2344; color: white; border-radius: 16px; }
.flow-section .section-heading p { color: #c6d7ed; }
.learning-flow { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(7, 1fr); gap: 1.2rem; }
.learning-flow li { position: relative; display: grid; justify-items: center; align-content: start; gap: .6rem; color: #e8f1fc; font-size: .74rem; font-weight: 600; text-align: center; }
.learning-flow li:not(:last-child)::after { content: ""; position: absolute; top: 18px; left: calc(50% + 28px); width: calc(100% - 42px); height: 1px; background: #507199; }
.learning-flow svg { width: 38px; height: 38px; padding: 8px; border: 1px solid #53769f; border-radius: 11px; fill: none; stroke: var(--gm-cyan); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.badge { display: inline-flex; align-items: center; min-height: 29px; padding: .3rem .65rem; border-radius: 999px; background: #eaf1f8; color: #3e4e67; font-size: .7rem; font-weight: 650; white-space: nowrap; }
.badge.warning { background: #fff2d8; color: #704b08; }
.badge.danger { background: #ffe5ea; color: #9a263c; }

.operations-toolbar { display: flex; align-items: end; gap: .75rem; margin-bottom: 1rem; }
.operations-toolbar label { flex: 1 1 13rem; }
.table-panel { padding-bottom: .75rem; }
.panel-title-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: .76rem; }
th { padding: .7rem .65rem; background: #f1f5f9; color: #4a5870; text-align: left; white-space: nowrap; font-size: .67rem; letter-spacing: .02em; text-transform: uppercase; }
td { padding: .72rem .65rem; border-bottom: 1px solid #edf1f5; color: #27354c; white-space: nowrap; }
tbody tr:hover { background: #f8fbff; }
.population-tag { display: inline-flex; border-radius: 999px; padding: .18rem .48rem; background: #eaf2ff; color: #245ba5; font-size: .66rem; font-weight: 650; }
.population-tag.team { background: #eee9ff; color: #6045a3; }
.population-tag.unknown { background: #eef0f3; color: #5b6472; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: .75rem; color: var(--gm-ink-muted); font-size: .75rem; }
.pagination > div { display: flex; gap: .4rem; }

.health-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .8rem; }
.health-card { padding: 1rem; background: #f5f8fc; border-radius: 12px; }
.health-card > strong { font-family: var(--gm-font-data); font-size: .78rem; overflow-wrap: anywhere; }
.health-card dl { display: grid; grid-template-columns: 1fr auto; gap: .45rem 1rem; margin: .85rem 0 0; font-size: .73rem; }
.health-card dt { color: var(--gm-ink-muted); }
.health-card dd { margin: 0; font-family: var(--gm-font-data); }
.config-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.form-panel { display: grid; gap: 1rem; }
.field-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7rem; }
.field-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.toggle { display: flex; align-items: center; gap: .6rem; min-height: 32px; }
.toggle input { width: 18px; min-height: 18px; accent-color: var(--gm-blue-strong); }
.models-panel { margin-top: 1rem; }
.model-list { display: grid; gap: .55rem; }
.model-row { display: grid; grid-template-columns: 2rem minmax(0, 1fr) auto repeat(3, 36px); align-items: center; gap: .55rem; padding: .55rem; background: #f4f7fb; border-radius: 10px; }
.model-order { color: var(--gm-ink-muted); font-family: var(--gm-font-data); text-align: center; }
.model-name { overflow-wrap: anywhere; font-family: var(--gm-font-data); font-size: .78rem; }
.model-enabled { width: 18px; min-height: 18px; accent-color: var(--gm-blue-strong); }
.icon-button { width: 36px; height: 36px; border: 0; border-radius: 8px; background: white; color: #34445d; }
.icon-button svg { width: 16px; height: 16px; margin: auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-button:hover { background: #e5edf6; }
.save-bar { position: sticky; bottom: 1rem; display: flex; justify-content: flex-end; align-items: center; gap: 1rem; margin-top: 1rem; padding: .8rem; background: #eaf0f7; border-radius: 12px; z-index: 10; }
.save-bar span { color: #46546b; font-size: .78rem; }
.empty-state { max-width: 42rem; margin: 5rem auto; padding: 2rem; text-align: center; background: white; border: 1px solid rgba(35,58,94,.15); border-radius: 14px; }
.empty-state h2 { font-family: var(--gm-font-display); }
.empty-state p { color: var(--gm-ink-muted); }

.exit-presentation { position: fixed; z-index: 50; right: 1rem; top: 1rem; min-height: 42px; padding: .6rem 1rem; border: 0; border-radius: 9px; background: var(--gm-navy); color: white; font-weight: 650; }
.active-filters { grid-column: 1 / -1; min-height: 0; display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; }
.active-filters:empty { display: none; }
.active-filters > span { color: #5b6980; font-size: .84rem; font-weight: 650; }
.active-filters button { display: inline-flex; align-items: center; gap: .35rem; min-height: 34px; padding: .35rem .62rem; border: 1px solid #c9d7e7; border-radius: 999px; background: white; color: #31435e; font: 500 .84rem var(--gm-font-body); cursor: pointer; transition: border-color 180ms, background 180ms, transform 180ms; }
.active-filters button:hover { border-color: var(--gm-blue); background: #f5f9ff; transform: translateY(-1px); }
.active-filters button b { color: #155eef; }
.active-filters button i { font-size: 1rem; font-style: normal; }
.active-filters .clear-all { border: 0; background: transparent; color: #155eef; font-weight: 650; }

.chart-hit { fill: transparent; cursor: crosshair; outline: none; }
.chart-hit:hover + .chart-dot, .chart-hit:focus + .chart-dot { r: 6; filter: drop-shadow(0 0 4px rgba(21, 94, 239, .35)); }
.chart-tooltip { position: fixed; z-index: 1000; width: max-content; max-width: 260px; padding: .75rem .85rem; border: 1px solid rgba(137, 162, 194, .42); border-radius: 10px; background: #12233d; color: white; box-shadow: 0 12px 30px rgba(18, 35, 61, .2); pointer-events: none; }
.chart-tooltip > strong { display: block; margin-bottom: .45rem; font: 650 .92rem var(--gm-font-body); }
.chart-tooltip > span { display: flex; justify-content: space-between; gap: 1.5rem; padding: .12rem 0; font-size: .82rem; }
.chart-tooltip i { color: #b8c9df; font-style: normal; }
.chart-tooltip b { font-family: var(--gm-font-data); font-weight: 500; }

.donut-segment { cursor: pointer; transition: stroke-width 180ms, opacity 180ms; outline: none; }
.donut-segment:hover, .donut-segment:focus { stroke-width: 20; opacity: .9; }
.donut-center span { max-width: 92px; padding-inline: .4rem; font-size: .78rem; line-height: 1.15; }
.donut-legend > button { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto auto; align-items: center; gap: .5rem; width: 100%; padding: .28rem .35rem; border: 0; border-radius: 7px; background: transparent; color: inherit; text-align: left; font: inherit; cursor: pointer; transition: background 180ms; }
.donut-legend > button:hover, .donut-legend > button:focus-visible { background: #eef5fc; outline: none; }
.donut-legend > button i { width: 10px; height: 10px; border-radius: 3px; background: var(--legend-color); }
.donut-legend > button strong { font-family: var(--gm-font-data); }
.donut-legend > button small { min-width: 2rem; color: var(--gm-ink-muted); text-align: right; }
.bar-row { width: 100%; padding: .2rem; border: 0; border-radius: 7px; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.bar-row:hover, .bar-row:focus-visible { background: #f2f7fc; outline: 2px solid rgba(21, 94, 239, .16); }
.bar-row .label { font-size: .88rem; }
.bar-value { font-size: .84rem; }

.heatmap-panel, .matrix-panel, .content-detail { margin-top: 1rem; }
.day-hour-scroll, .matrix-scroll, .content-map-scroll { overflow-x: auto; padding-bottom: .45rem; scrollbar-color: #b7c7da transparent; }
.day-hour-grid { display: grid; grid-template-columns: 44px repeat(24, minmax(29px, 1fr)); gap: 4px; min-width: 820px; align-items: center; }
.day-hour-grid > strong { color: #40516a; font-size: .82rem; }
.hour-label { color: #6b788c; font: 12px var(--gm-font-data); text-align: center; }
.heat-cell, .matrix-cell { aspect-ratio: 1; min-width: 24px; padding: 0; border: 1px solid rgba(21, 94, 239, .1); border-radius: 4px; background: rgba(21, 94, 239, var(--cell-alpha)); cursor: crosshair; transition: transform 160ms, border-color 160ms; }
.heat-cell:hover, .heat-cell:focus-visible, .matrix-cell:hover, .matrix-cell:focus-visible { border-color: #123b72; outline: none; transform: scale(1.14); }
.heat-scale { display: flex; justify-content: flex-end; align-items: center; gap: .3rem; margin-top: .65rem; color: #68758b; font-size: .78rem; }
.heat-scale i { width: 18px; height: 10px; border-radius: 2px; background: rgba(21, 94, 239, .18); }
.heat-scale i:nth-of-type(2) { background: rgba(21, 94, 239, .4); }
.heat-scale i:nth-of-type(3) { background: rgba(21, 94, 239, .65); }
.heat-scale i:nth-of-type(4) { background: rgba(21, 94, 239, .9); }

.content-layout { grid-template-columns: minmax(0, 1.8fr) minmax(300px, .7fr); }
.content-map-panel { min-width: 0; }
.segmented-control { display: inline-flex; padding: 3px; border: 1px solid #cfdae8; border-radius: 9px; background: #f1f5f9; }
.segmented-control button { min-height: 32px; padding: .35rem .65rem; border: 0; border-radius: 6px; background: transparent; color: #526078; font-weight: 650; cursor: pointer; }
.segmented-control button.active { background: white; color: #155eef; box-shadow: 0 1px 3px rgba(30, 54, 84, .12); }
.content-map-bars { display: grid; grid-template-columns: repeat(32, minmax(34px, 1fr)); align-items: end; gap: 7px; min-width: 1120px; height: 330px; padding: .8rem .3rem .15rem; border-bottom: 1px solid #d9e2ed; }
.content-column { display: grid; grid-template-rows: 24px minmax(0, 1fr) 34px; align-items: end; gap: .32rem; height: 100%; padding: 0; border: 0; background: transparent; color: #3c4c64; cursor: pointer; }
.content-column > strong { color: #516078; font: 500 .75rem var(--gm-font-data); text-align: center; }
.content-column > small { align-self: center; color: #4f5f75; font: 500 .72rem var(--gm-font-data); line-height: 1.05; text-align: center; white-space: nowrap; }
.content-column:hover small, .content-column:focus-visible small { color: #155eef; }
.content-column:focus-visible { outline: 2px solid rgba(21, 94, 239, .34); outline-offset: 3px; }
.content-bar-track { position: relative; display: flex; align-items: end; width: 100%; height: 100%; overflow: hidden; border-radius: 5px 5px 2px 2px; background: #edf2f7; }
.total-fill, .stacked-fill { display: flex; flex-direction: column-reverse; width: 100%; height: 100%; transform: scaleY(var(--bar-scale)); transform-origin: bottom; background: #155eef; transition: transform 260ms var(--gm-ease-out); }
.stacked-fill { background: transparent; }
.stacked-fill i { display: block; flex: var(--stack-size); min-height: 1px; background: var(--stack-color); }
.content-column.is-zero .content-bar-track { background: #f7f9fb; border: 1px dashed #d7e0ea; }
.matrix-grid { display: grid; grid-template-columns: minmax(170px, 1fr) repeat(var(--matrix-columns), 31px); gap: 4px; min-width: max-content; align-items: center; }
.matrix-corner, .matrix-row-label { position: sticky; left: 0; z-index: 2; background: white; color: #40516a; font-size: .82rem; font-weight: 650; }
.matrix-content-label { width: 31px; padding: 0; border: 0; background: transparent; color: #54637a; font: 500 .68rem var(--gm-font-data); writing-mode: vertical-rl; transform: rotate(180deg); cursor: pointer; }
.matrix-row-label { padding-right: .8rem; }
.matrix-cell { width: 29px; height: 29px; }
.content-detail { background: #f3f8fd; }
.content-detail .eyebrow { color: #155eef; font-size: .76rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.mini-bars { display: flex; align-items: end; gap: 3px; min-height: 90px; padding-top: .5rem; border-bottom: 1px solid #cfdbea; }
.mini-bars i { flex: 1; min-width: 3px; max-width: 18px; height: 82px; transform: scaleY(var(--mini-scale)); transform-origin: bottom; border-radius: 3px 3px 0 0; background: #155eef; }

.research-distributions { margin-top: 1rem; }
.histogram-bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: .45rem; min-height: 220px; align-items: end; padding-top: 1rem; }
.histogram-bars > div { display: grid; grid-template-rows: 22px 150px 24px; gap: .25rem; align-items: end; text-align: center; }
.histogram-bars strong { color: #46566d; font: 500 .78rem var(--gm-font-data); }
.histogram-bars i { display: flex; align-items: end; height: 150px; border-bottom: 1px solid #cfdae8; }
.histogram-bars b { display: block; width: 100%; height: 100%; transform: scaleY(var(--hist-scale)); transform-origin: bottom; border-radius: 5px 5px 0 0; background: #0e8f9f; transition: transform 260ms var(--gm-ease-out); }
.histogram-bars span { color: #5b6980; font: 500 .76rem var(--gm-font-data); }
.stat-strip { display: grid; grid-template-columns: repeat(4, 1fr); margin: .8rem 0 0; border-top: 1px solid #e2e8f0; }
.stat-strip > div { padding: .65rem .45rem 0; }
.stat-strip dt { color: #6a778a; font-size: .74rem; }
.stat-strip dd { margin: .12rem 0 0; color: #263b59; font: 500 .92rem var(--gm-font-data); }

body.presentation-mode { background: white; }
body.presentation-mode .app-shell { width: 100%; margin: 0; border: 0; border-radius: 0; }
body.presentation-mode .topbar, body.presentation-mode .admin-only, body.presentation-mode .hero-actions, body.presentation-mode .user-label { display: none !important; }
body.presentation-mode .dashboard { padding-top: 2.5rem; }
body.presentation-mode .hero-section { padding-top: 0; }
body.presentation-mode .filter-bar label:not(:first-child), body.presentation-mode .filter-bar, body.presentation-mode .active-filters { display: none; }
body.presentation-mode .hero-copy h1 { font-size: clamp(2rem, 3vw, 3.2rem); }
body.presentation-mode .section-block { margin-top: 3rem; }

@media (max-width: 1180px) {
  .topbar { grid-template-columns: auto 1fr; }
  .primary-nav { grid-row: 2; grid-column: 1 / -1; justify-content: flex-start; overflow-x: auto; }
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .analytics-layout { grid-template-columns: 1fr; }
  .activity-panel, .donut-panel { min-height: auto; }
  .filter-bar { grid-template-columns: repeat(4, minmax(145px, 1fr)); }
  .research-grid { grid-template-columns: repeat(2, 1fr); }
  .observatory-shell { grid-template-columns: minmax(275px, .75fr) minmax(0, 1.25fr); }
  .field-grid.four { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .app-shell { width: 100%; margin: 0; border: 0; border-radius: 0; }
  .topbar { padding: .65rem 1rem; gap: .75rem; }
  .brand small, .user-label { display: none; }
  .auth-area { justify-self: end; }
  .primary-nav { margin-inline: -1rem; padding-inline: 1rem; }
  .dashboard { padding: 1.5rem 1rem 3rem; }
  .welcome { min-height: calc(100vh - 74px); padding: 2rem 1.25rem; flex-direction: column; align-items: flex-start; justify-content: center; }
  .hero-section { grid-template-columns: 1fr; }
  .hero-actions { justify-self: start; }
  .filter-bar { grid-column: 1; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
  .filter-bar select { min-width: 0; }
  .data-status, .kpi-grid { grid-column: 1; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-card { min-height: 148px; }
  .analytics-layout.split-even, .config-grid { grid-template-columns: 1fr; }
  .donut-layout { grid-template-columns: 1fr; }
  .accompaniment-strip { grid-template-columns: 1fr; gap: .55rem; }
  .observatory-shell { grid-template-columns: 1fr; }
  .observatory-master { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: minmax(310px, 410px); }
  .detail-context, .detail-metrics.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .learning-flow { grid-template-columns: repeat(2, 1fr); }
  .learning-flow li:not(:last-child)::after { display: none; }
  .operations-toolbar { align-items: stretch; flex-direction: column; }
  .operations-toolbar > * { width: 100%; }
  .field-grid, .field-grid.four { grid-template-columns: 1fr; }
  .model-row { grid-template-columns: 2rem minmax(0, 1fr) auto; }
  .model-row .icon-button { grid-row: 2; }
  .section-heading { align-items: flex-start; }
}
@media (max-width: 430px) {
  .brand strong { font-size: .9rem; }
  .button { padding-inline: .7rem; }
  .kpi-grid { grid-template-columns: 1fr; }
  .filter-bar { grid-template-columns: 1fr; }
  .research-grid { grid-template-columns: 1fr; }
  .observatory-master { grid-template-columns: 1fr; grid-template-rows: auto; }
  .master-list { max-height: 320px; }
  .detail-header { flex-direction: column; }
  .detail-columns, .detail-metrics { grid-template-columns: 1fr; }
  .session-timeline > div { grid-template-columns: 58px minmax(0, 1fr); }
  .session-timeline small { grid-column: 2; text-align: left; }
  .learning-flow { grid-template-columns: 1fr; }
  .panel { padding: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
