/* Common shell and controls, adapted from the ROP3 workspace. */
@font-face {
  font-family: Inter;
  src: url('brand/inter-variable.ttf') format('truetype');
  font-weight: 100 900;
  font-display: swap;
}
:root {
  --ink: #142b48;
  --muted: #596981;
  --border: #dbe2ed;
  --line-soft: #e7edf5;
  --page: #f4f6fa;
  --blue: #173eac;
  --navy: #0d245f;
  --tint: #eaf0fb;
  --head-height: 72px;
  color-scheme: light;
  background: var(--page);
  color: var(--ink);
  font: 16px/1.5 'TT Runs', Verdana, sans-serif;
}
body { background: var(--page); color: var(--ink); }
main, dialog { font-family: Inter, Arial, sans-serif; }
input, select, textarea, button { font-family: inherit; }
.rop-shell { display: grid; grid-template-columns: 235px minmax(0, 1fr); grid-template-rows: auto 1fr; min-height: 100vh; align-items: start; }
.rop-shell > .main-shell { min-width: 0; margin: 0; }
.rop-shell > .topbar {
  grid-column: 1 / -1; position: sticky; top: 0; z-index: 31; height: auto; min-height: var(--head-height);
  gap: 1rem; padding: 9px clamp(18px, 2.1vw, 32px); justify-content: flex-start;
  display: flex; align-items: center; background: white; border-bottom: 1px solid var(--border);
}
.rop-brand { display: inline-flex; align-items: center; gap: 15px; color: #1c3555; text-decoration: none; flex: none; }
.rop-brand img { width: 105px; height: 50px; object-fit: contain; }
.rop-brand span { border-left: 1px solid #cbd4e1; padding-left: 15px; font-size: 15px; font-weight: 600; }
.rop-brand small { display: block; font: 600 10px/1.4 Verdana, sans-serif; color: var(--muted); padding-top: 3px; }
.topbar .breadcrumb, .topbar .demo-badge { margin-right: auto; color: var(--muted); font-size: .85rem; }
.topbar .demo-badge { background: transparent; padding: 0; font-weight: 500; }
.rop-shell > .sidebar {
  position: sticky; top: var(--head-height); bottom: auto; left: auto; align-self: start; width: auto;
  height: calc(100dvh - var(--head-height)); background: white; border-right: 1px solid var(--border);
  overflow: auto; z-index: 2; transform: none; box-shadow: none;
}
.sidebar > nav { display: grid; align-content: start; gap: 4px; padding: 20px 14px; }
.sidebar .nav-link { margin: 0; padding: .62rem .72rem; color: #425774; border-radius: 8px; font-size: .875rem; line-height: 1.4; }
.sidebar .nav-link:is(:hover, :focus-visible) { background: var(--page); }
.sidebar .nav-link.active, .sidebar .nav-link[aria-current=page] { background: var(--tint); color: var(--blue); font-weight: 600; }
.sidebar .nav-icon { color: inherit; }
.sidebar-bottom { border-color: var(--line-soft); padding: 14px 18px; }
.sidebar-bottom small { font-size: 12px; color: var(--muted); }
.sidebar-bottom .prototype-link { margin: .25rem 0; font-size: .85rem; }
.rop-shell main { max-width: 1480px; margin: auto; padding: clamp(22px, 3.4vw, 56px) clamp(22px, 3.4vw, 56px) 4rem; }
h1, h2, h3 { font-family: 'TT Runs', Verdana, sans-serif; color: var(--ink); letter-spacing: -.035em; }
h1, .screen-heading h1 { font-size: clamp(2rem, 3.2vw, 3.45rem); line-height: 1.12; }
h2 { font-size: clamp(1.2rem, 2vw, 1.65rem); }
.document, .stat-card, .achievement-card, .trip-card, .campaign-card, .academic-panel, .table-panel, .track-card, .analysis-card, .quick-grid a, .rop-panel { border: 1px solid var(--border); border-radius: 13px; }
.document { padding: clamp(1.2rem, 3vw, 2.7rem); }
.document > :is(h1,h2,h3), .document h3 { scroll-margin-top: calc(var(--head-height) + 1.5rem); }
.document p, .document li, .document > h1+p { font-size: 1rem; line-height: 1.65; }
.document :is(td, th) { font-size: .9rem; line-height: 1.5; font-variant-numeric: tabular-nums; }
.document th { background: #f3f6fb; color: #425774; }
.document a, .pilot-content a:not(.button), .guest-links a { text-decoration: underline; text-underline-offset: .2em; }
.rop-panel { padding: clamp(1rem, 2.4vw, 1.45rem); background: white; margin-bottom: 1rem; }
.rop-panel h2:first-child { margin-top: 0; }
.rop-shell :is(.button, .page-tools button, .page-tools a), .pilot-body button, .menu-button {
  font: 600 .88rem/1.4 Inter, Arial, sans-serif; padding: .5em .86em; border: 1px solid var(--border);
  border-radius: 7px; color: var(--ink); background: white; text-decoration: none;
}
.rop-shell .button.primary, .pilot-body .primary { color: white; background: var(--blue); border-color: var(--blue); }
.rop-shell .button.primary:hover, .pilot-body .primary:hover { background: var(--navy); }
.page-tools { justify-content: flex-end; margin-bottom: 1rem; }
.page-tools > div { gap: .5rem; }
.role-controls select, .toolbar select, .period-row select, .pilot-body :is(input:not([type=hidden]), select, textarea) {
  border: 1px solid #8291a6; border-radius: 6px; min-height: 38px; padding: .5em .65em; color: var(--ink); background: white; font-size: .9rem;
}
.role-controls label, .stat-card small, .screen-heading p, .card-meta, .card-top, .card-bottom, .quick-grid span { color: var(--muted); }
.screen-heading p, .achievement-card p, .trip-card p, .campaign-body p { font-size: .94rem; }
.stat-card > span, .stat-card small, .badge, .card-meta, .card-top, .card-bottom, .campaign-details, .sidebar-bottom .text-button { font-size: .79rem; }
.badge, .nav-count, .status-chip { border-radius: 20px; }
.stat-card strong { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 3px solid #2462bc; outline-offset: 3px; }
.menu-button, .nav-close { display: none; }
@media (min-width: 761px) and (max-width: 940px) { .rop-shell { grid-template-columns: 190px minmax(0,1fr); } }
@media (max-width: 760px) {
  :root { --head-height: 58px; }
  .rop-shell { display: block; }
  .rop-shell > .topbar { flex-wrap: wrap; gap: .5rem .75rem; padding: 7px 12px; }
  .rop-brand { gap: 8px; }
  .rop-brand img { width: 72px; height: 37px; }
  .rop-brand span { padding-left: 8px; font-size: 14px; }
  .topbar .breadcrumb, .topbar .demo-badge { display: none; }
  .topbar .role-controls { width: 100%; display: flex; gap: 6px; flex-wrap: wrap; }
  .role-controls select { flex: 1; min-width: 0; max-width: 100%; }
  .rop-shell > .sidebar { display: none; }
  .rop-shell > .sidebar.open { display: flex; position: fixed; inset: 0 auto 0 0; width: min(290px, 90vw); height: 100dvh; z-index: 40; box-shadow: 0 0 0 100vmax #142b486b; }
  .nav-close, .menu-button { display: inline-flex; align-items: center; }
  .nav-close { align-self: flex-end; margin: 12px 14px 0; padding: .5rem .8rem; border: 1px solid var(--border); background: white; border-radius: 7px; }
  .rop-shell main { padding: 1.3rem 1rem 3rem; }
  .page-tools { margin-bottom: .7rem; }
  .rop-shell .screen-heading { flex-wrap: wrap; }
}
@media print {
  .rop-shell { display: block; }
  .rop-shell > .sidebar, .rop-shell > .topbar, .page-tools { display: none; }
  .rop-shell main, .document { padding: 0; border: 0; }
}
/* The scholarship dialogs are mounted outside the workspace shell. */
#dialog { border: 1px solid var(--border); border-radius: 12px; color: var(--ink); }
#dialog::backdrop { background: #142b4888; }
#dialog .dialog-head h2, .profile-intro h2 { color: var(--ink); }
#dialog form label { font-size: .9rem; color: var(--ink); }
#dialog form :is(input:not([type=checkbox],[type=radio],[type=hidden]), select, textarea) {
  border: 1px solid #8291a6; border-radius: 6px; color: var(--ink); font-size: .94rem;
}
#dialog .button { border-radius: 7px; font-size: .88rem; }
.profile-panel, .sch-contest { background: white; border: 1px solid var(--border); border-radius: 13px; }
.achievement-card, .campaign-card, .sch-contest { border-top: 4px solid #466bca; }
.achievement-card:has(.dot-sport), .campaign-card:has(.cover-1) { border-top-color: #21827b; }
.achievement-card:has(.dot-creative) { border-top-color: #b75b25; }
.achievement-card:has(.dot-project) { border-top-color: #7852bc; }
.table-panel :is(th,td) { font-variant-numeric: tabular-nums; }
.topbar > .button { margin-left: auto; }
