/*
 * OpenRTI — design system.
 * Warm off-white + stone tones + anthracite; the accent (dark petrol) is only for interaction and
 * selected states. The RTI inspection area is a neutral dark grey setting that brings out surface detail.
 * Fonts come from the system (no external requests); Turkish characters are fully supported.
 */

/* ── 1. Tokens ────────────────────────────────────────────────────────── */
:root {
  --paper: #f6f3ee;
  --paper-2: #efeae2;
  --stone: #e4ddd2;
  --line: #d8d0c4;
  --line-strong: #b9ae9e;
  --ink: #24272b;
  --ink-2: #41464c;
  --muted: #676259;
  --petrol: #1e5b63;
  --petrol-strong: #164950;
  --petrol-tint: #e0ebeb;
  --danger: #8f3a26;
  --danger-tint: #f6e5df;
  --ok: #2f6344;
  --ok-tint: #e3efe7;

  /* Inspection setting (light UI). The image area background can be light or dark. */
  --vw-bg: #dcd8d1;             /* image area background (light) */
  --vw-bg-dark: #2a2c2f;        /* image area background (dark option) */
  --vw-surface: #ffffff;
  --vw-panel: #faf8f4;
  --vw-line: #d8d0c4;
  --vw-text: #24272b;
  --vw-muted: #676259;
  --vw-accent: #1e5b63;
  --vw-chrome: rgba(255, 255, 255, .94);   /* toolbar and labels over the image */
  --vw-hover: #efeae2;
  --vw-enh-bg: #fbf3e2; --vw-enh-line: #d9b36c; --vw-enh-text: #7a4d0c;

  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "SFMono-Regular", Menlo, monospace;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 72px;
  --radius: 6px;
  --radius-sm: 4px;
  --gutter: clamp(16px, 3vw, 48px);   /* side margin in the full-width layout */
  --header-h: 64px;
  --shadow: 0 1px 2px rgba(36, 39, 43, .06), 0 4px 16px rgba(36, 39, 43, .06);
}

/* ── 2. Base ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; color: var(--ink); }
h1 { font-size: clamp(32px, 4.2vw, 50px); letter-spacing: -.01em; margin: 0 0 var(--s4); }
h2 { font-size: clamp(24px, 2.6vw, 32px); margin: 0 0 var(--s3); }
h3 { font-size: 20px; margin: 0 0 var(--s2); }
p { margin: 0 0 var(--s4); }
a { color: var(--petrol); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--petrol-strong); }
small, .small { font-size: 14px; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: .92em; }
:focus-visible { outline: 2px solid var(--petrol); outline-offset: 2px; border-radius: 2px; }
::selection { background: var(--petrol-tint); }

.skip-link {
  position: absolute; left: var(--s3); top: -60px; z-index: 100;
  background: var(--ink); color: #fff; padding: var(--s2) var(--s3); border-radius: var(--radius-sm);
}
.skip-link:focus { top: var(--s3); color: #fff; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* Full-width layout: content uses the whole screen; readability is kept by the text blocks'
   own max widths (ch). */
.wrap { width: 100%; margin: 0; padding: 0 var(--gutter); }

.eyebrow {
  font: 600 12px/1.2 var(--sans); letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 var(--s3);
}
.lede { font-size: 19px; line-height: 1.55; color: var(--ink-2); max-width: 46ch; }

/* ── 3. Buttons, inputs, badges ───────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 44px; padding: 0 var(--s5); border-radius: var(--radius-sm);
  font: 600 15px/1 var(--sans); text-decoration: none; cursor: pointer;
  border: 1px solid transparent; transition: background-color .15s, border-color .15s, color .15s;
}
.btn-primary { background: var(--petrol); color: #fff; }
.btn-primary:hover { background: var(--petrol-strong); color: #fff; }
.btn-secondary { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-secondary:hover { border-color: var(--ink); color: var(--ink); }
.btn-ghost { background: transparent; color: var(--petrol); padding: 0 var(--s3); }
.btn-ghost:hover { background: var(--petrol-tint); }
.btn-sm { min-height: 36px; padding: 0 var(--s4); font-size: 14px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; flex: none; }

.text-link { font-weight: 600; text-decoration: none; }
.text-link:hover { text-decoration: underline; }

.input, .select {
  width: 100%; min-height: 44px; padding: 0 var(--s3);
  background: #fff; color: var(--ink); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); font: 15px/1.2 var(--sans);
}
.input:focus, .select:focus { outline: 2px solid var(--petrol); outline-offset: 0; border-color: var(--petrol); }
.select { padding-right: var(--s6); }

.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 28px;
  padding: 0 10px; border-radius: 999px; font-size: 13px; line-height: 1;
  background: var(--paper-2); color: var(--ink-2); border: 1px solid var(--line);
}
.chip-accent { background: var(--petrol-tint); color: var(--petrol-strong); border-color: #bcd3d4; }
.chip button {
  border: 0; background: none; padding: 0; margin: 0 -4px 0 0; width: 20px; height: 20px;
  display: grid; place-items: center; cursor: pointer; color: inherit; border-radius: 50%;
}
.chip button:hover { background: rgba(0, 0, 0, .08); }
.tag {
  font: 600 11px/1 var(--sans); letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted);
}

/* ── 4. Site header and navigation ────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 50; background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; gap: var(--s5); height: var(--header-h); }
.brand {
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink);
  font: 600 21px/1 var(--serif); letter-spacing: -.01em; white-space: nowrap;
}
.brand:hover { color: var(--ink); }
.brand svg { color: var(--petrol); flex: none; }
.nav-links { display: flex; gap: var(--s1); margin-left: var(--s2); }
.nav-links a {
  color: var(--ink-2); text-decoration: none; font-size: 15px; font-weight: 500;
  padding: 8px 10px; border-radius: var(--radius-sm);
}
.nav-links a:hover { background: var(--paper-2); color: var(--ink); }
.nav-links a[aria-current="page"] { color: var(--petrol-strong); box-shadow: inset 0 -2px 0 var(--petrol); border-radius: 0; }
.nav-search { margin-left: auto; position: relative; width: 240px; }
.nav-search .input { min-height: 38px; padding-left: 34px; font-size: 14px; background: var(--paper); }
.nav-search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.nav-toggle {
  display: none; margin-left: auto; width: 44px; height: 44px; border: 1px solid var(--line);
  background: transparent; border-radius: var(--radius-sm); color: var(--ink); cursor: pointer;
}
/* Language switch (top right): EN primary, TR optional */
.lang-switch { display: flex; flex: none; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.lang-switch button {
  min-width: 38px; height: 36px; padding: 0 8px; border: 0; background: transparent; cursor: pointer;
  font: 600 12.5px/1 var(--sans); letter-spacing: .06em; color: var(--muted);
}
.lang-switch button + button { border-left: 1px solid var(--line); }
.lang-switch button:hover { background: var(--paper-2); color: var(--ink); }
.lang-switch button[aria-pressed="true"] { background: var(--petrol-tint); color: var(--petrol-strong); }
/* Language blocks in long texts (data-l) and no flicker of TR keys on first paint */
html[lang="tr"] [data-l="en"], html:not([lang="tr"]) [data-l="tr"] { display: none !important; }
html.i18n-pending [data-i18n], html.i18n-pending [data-i18n-html] { visibility: hidden; }
.needs-api { }
[data-mode="static"] .needs-api { display: none !important; }
/* Account link (added by JS only while membership is open) */
.account-link {
  display: inline-flex; align-items: center; gap: 6px; flex: 0 1 auto; min-width: 0; max-width: 18ch;
  padding: 8px 10px; border-radius: var(--radius-sm); font-weight: 600; font-size: 15px;
  color: var(--petrol); text-decoration: none;
}
.account-link svg { flex: none; }
.account-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 520px) {
  .account-link { padding: 8px; }
  .account-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
.account-link:hover { background: var(--petrol-tint); color: var(--petrol-strong); }
button.account-link { border: 0; background: none; font-family: inherit; cursor: pointer; }
/* Sign-in dialog and account menu opened from the header */
.auth-dialog {
  border: 0; padding: 0; border-radius: 10px; width: min(420px, calc(100vw - 32px));
  background: var(--paper); color: var(--ink); box-shadow: 0 24px 64px rgba(20,24,28,.28), 0 2px 8px rgba(20,24,28,.12);
}
.auth-dialog[open] { animation: auth-in .18s ease-out; }
@keyframes auth-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@media (prefers-reduced-motion: reduce) { .auth-dialog[open] { animation: none; } }
.auth-dialog::backdrop { background: rgba(28,31,35,.5); backdrop-filter: blur(3px); }
.auth-dialog-inner { position: relative; padding: 36px 32px 24px; }
.auth-close { position: absolute; top: 12px; right: 12px; display: grid; place-items: center; border: 0; background: none; padding: 6px; border-radius: var(--radius-sm); color: var(--ink-2); cursor: pointer; }
.auth-close:hover { background: var(--paper-2); color: var(--ink); }
.auth-head { text-align: center; margin-bottom: 20px; }
.auth-head svg { color: var(--petrol); }
.auth-head h2, .auth-sent h2 { margin: 10px 0 6px; font-size: 24px; }
.auth-head p { margin: 0; color: var(--ink-2); font-size: 15px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin-bottom: 20px; background: var(--paper-2); border-radius: 8px; }
.auth-tabs button {
  min-height: 38px; border: 0; border-radius: 6px; background: none; color: var(--ink-2);
  font: 600 14px var(--sans); cursor: pointer; transition: background .15s, color .15s, box-shadow .15s;
}
.auth-tabs button:hover { color: var(--ink); }
.auth-tabs button[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(20,24,28,.12); }
.auth-tabs button:focus-visible { outline: 2px solid var(--petrol); outline-offset: 1px; }
.auth-alert .alert { margin: 0 0 16px; }
/* Sign-in options (dialog and account page) */
.auth-options { display: flex; flex-direction: column; gap: 10px; }
.auth-btn {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 48px; padding: 0 44px;
  border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; color: var(--ink);
  font: 600 15px/1.2 var(--sans); text-decoration: none; cursor: pointer; transition: border-color .15s, box-shadow .15s, background .15s;
}
.auth-btn svg { position: absolute; left: 16px; }
.auth-btn:hover { border-color: var(--ink-2); box-shadow: 0 2px 8px rgba(20,24,28,.1); color: var(--ink); }
.auth-btn:focus-visible { outline: 2px solid var(--petrol); outline-offset: 2px; }
.auth-btn:disabled { opacity: .6; cursor: progress; }
.auth-btn-orcid { background: var(--petrol); border-color: var(--petrol); color: #fff; }
.auth-btn-orcid:hover { background: var(--petrol-strong); border-color: var(--petrol-strong); color: #fff; }
.auth-btn-email { background: var(--ink); border-color: var(--ink); color: #fff; }
.auth-btn-email:hover { background: #000; border-color: #000; color: #fff; }
.auth-hint { margin: -2px 0 0; font-size: 13px; color: var(--muted); text-align: center; }
.auth-or { display: flex; align-items: center; gap: 12px; margin: 16px 0; font-size: 13px; color: var(--muted); }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-email { display: flex; flex-direction: column; gap: 8px; }
.auth-email label { font-size: 14px; font-weight: 600; }
.auth-email .input { width: 100%; min-height: 46px; border-radius: 8px; }
.auth-field-error { margin: 0; min-height: 0; font-size: 14px; color: var(--danger, #a1312a); }
.auth-field-error:empty { display: none; }
.auth-note { margin: 12px 0 0; font-size: 13px; color: var(--muted); text-align: center; }
.auth-legal { margin: 20px 0 0; padding-top: 16px; border-top: 1px solid var(--line); font-size: 12.5px; line-height: 1.5; color: var(--muted); text-align: center; }
.auth-legal a { color: var(--ink-2); text-decoration: underline; text-underline-offset: 2px; }
.auth-legal a:hover { color: var(--petrol); }
.auth-sent { text-align: center; padding: 8px 0 4px; }
.auth-sent-icon { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--petrol-tint); color: var(--petrol-strong); }
.auth-sent-icon svg { width: 26px; height: 26px; }
.auth-sent p { margin: 0 0 8px; color: var(--ink-2); }
.auth-sent strong { color: var(--ink); overflow-wrap: anywhere; }
.auth-sent-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; }
.acc-signin { max-width: 460px; margin-inline: auto; padding: 32px; }
.account-menu {
  position: fixed; z-index: 50; display: flex; flex-direction: column; min-width: 200px; max-width: calc(100vw - 16px);
  padding: 6px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 8px 28px rgba(0,0,0,.16);
}
.account-menu .menu-head { padding: 8px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line); font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.account-menu [role="menuitem"] {
  display: block; padding: 8px 10px; border: 0; border-radius: var(--radius-sm); background: none; text-align: left;
  font: 15px var(--sans); color: var(--ink); text-decoration: none; cursor: pointer;
}
.account-menu [role="menuitem"]:hover, .account-menu [role="menuitem"]:focus-visible { background: var(--petrol-tint); color: var(--petrol-strong); }

@media (max-width: 900px) {
  .nav { gap: var(--s3); }
  .nav-toggle { display: grid; place-items: center; margin-left: 0; }
  .lang-switch { margin-left: auto; }
  .account-link + .lang-switch { margin-left: 0; }
  .account-link { margin-left: auto; font-size: 14px; }
  .nav-links, .nav-search { display: none; }
  .site-header.open .nav-links {
    display: flex; flex-direction: column; position: absolute; left: 0; right: 0; top: var(--header-h);
    background: var(--paper); border-bottom: 1px solid var(--line); padding: var(--s2) var(--s4) var(--s4); margin: 0;
  }
  .site-header.open .nav-links a { padding: 12px 8px; font-size: 16px; }
  .site-header.open .nav-search {
    display: block; position: absolute; left: var(--s4); right: var(--s4); width: auto;
    top: calc(var(--header-h) + 4 * 49px + 20px);
  }
}

/* ── 5. Footer ────────────────────────────────────────────────────────── */
.site-footer { border-top: 1px solid var(--line); background: var(--paper-2); margin-top: var(--s8); }
.footer-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: var(--s6);
  padding-top: var(--s7); padding-bottom: var(--s6);
}
.footer-grid p { color: var(--ink-2); font-size: 15px; max-width: 42ch; }
.footer-col h2 { font: 600 12px/1.2 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 var(--s3); }
.footer-col a { display: block; color: var(--ink-2); text-decoration: none; padding: 4px 0; font-size: 15px; }
.footer-col a:hover { color: var(--petrol); text-decoration: underline; }
.footer-bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s3);
  border-top: 1px solid var(--line); padding-top: var(--s4); padding-bottom: var(--s5);
  font-size: 14px; color: var(--muted);
}
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; gap: var(--s5); } }

/* ── 6. Sections, page headings ───────────────────────────────────────── */
.section { padding: var(--s8) 0 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s5); flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.section-head p { margin: var(--s2) 0 0; color: var(--ink-2); max-width: 60ch; }
.page-head { padding: var(--s7) 0 var(--s5); border-bottom: 1px solid var(--line); margin-bottom: var(--s6); }
.page-head p { color: var(--ink-2); max-width: 62ch; margin: 0; font-size: 17px; }
@media (max-width: 640px) { .section { padding-top: var(--s7); } .page-head { padding-top: var(--s6); } }

/* ── 7. Home page ─────────────────────────────────────────────────────── */
.hero { padding: var(--s7) 0 var(--s6); border-bottom: 1px solid var(--line); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: var(--s7); align-items: center; }
.hero h1 { font-size: clamp(34px, 4.6vw, 56px); margin-bottom: var(--s4); }
.hero .lede { margin-bottom: var(--s5); max-width: 52ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--s3); }
.hero-note { margin: var(--s5) 0 0; font-size: 14px; color: var(--muted); }
.specimen { margin: 0; }
.specimen-frame {
  position: relative; aspect-ratio: 4 / 3; background: var(--vw-bg); border-radius: var(--radius);
  overflow: hidden; display: grid; place-items: center;
}
.specimen-frame img { width: 100%; height: 100%; object-fit: contain; }
.specimen-frame canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.specimen-empty { color: var(--vw-muted); padding: var(--s5); text-align: center; font-size: 15px; }
.specimen-live {
  position: absolute; left: var(--s3); bottom: var(--s3); display: inline-flex; gap: var(--s2);
}
.specimen-live .btn { background: var(--vw-chrome); color: var(--vw-text); border-color: var(--vw-line); min-height: 38px; font-size: 14px; }
.specimen-live .btn:hover { background: #fff; color: var(--petrol-strong); }
.specimen figcaption {
  display: flex; justify-content: space-between; gap: var(--s3); flex-wrap: wrap;
  padding-top: var(--s3); font-size: 14px; color: var(--muted);
}
.specimen figcaption a { font-weight: 600; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; gap: var(--s5); } .hero { padding-top: var(--s6); } }

.identity {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s5);
  padding: var(--s5) 0; border-bottom: 1px solid var(--line); font-size: 15px; color: var(--ink-2);
}
.identity strong { display: block; color: var(--ink); font-weight: 600; margin-bottom: 2px; }
@media (max-width: 760px) { .identity { grid-template-columns: 1fr; gap: var(--s3); } }

.features { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s5); }
.feature { border-top: 2px solid var(--ink); padding-top: var(--s4); }
.feature svg { color: var(--petrol); margin-bottom: var(--s3); }
.feature h3 { font-size: 19px; }
.feature p { font-size: 15px; color: var(--ink-2); margin: 0; }
@media (max-width: 900px) { .features { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .features { grid-template-columns: 1fr; } }

.founder {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: var(--s6);
  padding: var(--s6); background: var(--paper-2); border-radius: var(--radius); border: 1px solid var(--line);
}
.founder p { color: var(--ink-2); margin: 0 0 var(--s3); }
@media (max-width: 760px) { .founder { grid-template-columns: 1fr; gap: var(--s3); padding: var(--s5); } }

/* ── 8. Artifact cards and grids ──────────────────────────────────────── */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--s5); }
.card {
  display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); color: var(--ink); }
.card:focus-visible { outline-offset: 3px; }
.card-media {
  aspect-ratio: 4 / 3; background: var(--vw-bg); display: grid; place-items: center; overflow: hidden;
}
/* Surface detail is never cropped: the image is fitted into the area (contain). */
.card-media img { width: 100%; height: 100%; object-fit: contain; }
.card-media .placeholder { color: var(--vw-muted); font-size: 14px; padding: var(--s4); text-align: center; }
.card-body { padding: var(--s4); display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-body h3 { font-size: 19px; margin: 0; }
.card-meta { font-size: 14px; color: var(--muted); margin: 0; }
.card-foot { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: var(--s2); }

.coll-card .card-media { aspect-ratio: 16 / 9; }
.coll-card .count { font-size: 14px; color: var(--muted); }

/* ── 9. States (empty, error, loading) ────────────────────────────────── */
.state {
  border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: var(--s6) var(--s5);
  text-align: center; color: var(--ink-2); background: var(--paper);
}
.state h2, .state h3 { font-size: 20px; margin-bottom: var(--s2); }
.state p { margin: 0 auto var(--s4); max-width: 52ch; }
.state:last-child p:last-child { margin-bottom: 0; }
.state-error { border-style: solid; border-color: #e3c2b7; background: var(--danger-tint); }
.alert { padding: var(--s3) var(--s4); border-radius: var(--radius-sm); font-size: 15px; margin: var(--s3) 0; border: 1px solid; }
.alert-err { background: var(--danger-tint); border-color: #e3c2b7; color: var(--danger); }
.alert-ok { background: var(--ok-tint); border-color: #bcd5c5; color: var(--ok); }
.alert-info { background: var(--petrol-tint); border-color: #bcd3d4; color: var(--petrol-strong); }
.skeleton { background: linear-gradient(90deg, var(--paper-2), var(--stone), var(--paper-2)); background-size: 200% 100%; animation: skel 1.4s linear infinite; border-radius: var(--radius); }
@keyframes skel { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } * { scroll-behavior: auto !important; } }

/* ── 10. Discovery (Artifacts) page ───────────────────────────────────── */
.browse { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: var(--s6); align-items: start; }
.filters { position: sticky; top: calc(var(--header-h) + var(--s4)); display: flex; flex-direction: column; gap: var(--s5); }
.filters fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.filters legend, .filters .label { font: 600 12px/1.2 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: var(--s2); padding: 0; }
.check { display: flex; align-items: center; gap: var(--s2); min-height: 32px; font-size: 15px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--petrol); margin: 0; }
.check .n { margin-left: auto; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.results-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s3); }
.results-bar .count { font-weight: 600; }
.active-filters { display: flex; flex-wrap: wrap; gap: var(--s2); margin-bottom: var(--s4); min-height: 0; }
.filters-toggle { display: none; }
@media (max-width: 900px) {
  .browse { grid-template-columns: 1fr; gap: var(--s4); }
  .filters { position: static; display: none; padding: var(--s4); border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
  .filters.open { display: flex; }
  .filters-toggle { display: inline-flex; }
}

/* ── 11. Long text pages (About RTI / the Project) ────────────────────── */
/* Information pages (About RTI, About the Project): on wide screens the content sits in a centred
   reading block, with no empty third on the right. */
body[data-page="about-rti"] main.wrap, body[data-page="about"] main.wrap { max-width: 980px; margin-inline: auto; }
.prose-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: var(--s7); align-items: start; }
.toc { position: sticky; top: calc(var(--header-h) + var(--s4)); display: flex; flex-direction: column; gap: 2px; font-size: 15px; }
.toc a { color: var(--ink-2); text-decoration: none; padding: 6px 10px; border-left: 2px solid var(--line); transition: color .15s, border-color .15s; }
.toc a[aria-current="true"] { color: var(--petrol-strong); border-color: var(--petrol); font-weight: 600; }
.toc a:hover { color: var(--petrol); border-color: var(--petrol); }
.prose { max-width: 70ch; }
.prose section { scroll-margin-top: calc(var(--header-h) + var(--s4)); }   /* keep headings clear of the sticky menu when following an anchor link */
.prose section { padding-bottom: var(--s6); margin-bottom: var(--s6); border-bottom: 1px solid var(--line); }
.prose section:last-child { border-bottom: 0; }
.prose p, .prose li { color: var(--ink-2); font-size: 17px; line-height: 1.7; }
.prose li { margin-bottom: var(--s2); }
.prose h2 { margin-bottom: var(--s4); }
.prose .note { border-left: 3px solid var(--petrol); padding: var(--s3) var(--s4); background: var(--petrol-tint); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.prose .note p { margin: 0; font-size: 16px; color: var(--ink); }
/* Chronology: year column + description */
.timeline { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 0 var(--s4); margin: var(--s4) 0; }
.timeline dt { font: 600 15px/1.4 var(--serif); color: var(--petrol-strong); padding: var(--s3) 0; border-top: 1px solid var(--line); }
.timeline dd { margin: 0; padding: var(--s3) 0; border-top: 1px solid var(--line); color: var(--ink-2); font-size: 16px; line-height: 1.65; }
.timeline dd strong { color: var(--ink); }
@media (max-width: 520px) { .timeline { grid-template-columns: 1fr; } .timeline dd { border-top: 0; padding-top: 0; } }
.references { padding-left: var(--s5); }
.references li p { margin: 2px 0 0; font-size: 15px; color: var(--muted); }
@media (max-width: 860px) {
  .prose-layout { grid-template-columns: 1fr; gap: var(--s4); }
  /* On mobile the table of contents is one scrollable row that sticks below the menu */
  .toc {
    position: sticky; top: var(--header-h); z-index: 5; flex-direction: row; flex-wrap: nowrap; overflow-x: auto;
    gap: 0; margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter); background: var(--paper);
    border-bottom: 1px solid var(--line); scrollbar-width: none;
  }
  .toc::-webkit-scrollbar { display: none; }
  .toc a { border-left: 0; border-bottom: 2px solid transparent; white-space: nowrap; padding: 10px 10px; font-size: 14px; }
  .toc a[aria-current="true"] { border-bottom-color: var(--petrol); }
  .prose section { scroll-margin-top: calc(var(--header-h) + 56px); }
  body[data-page="about-rti"] .page-head, body[data-page="about"] .page-head { margin-bottom: 0; border-bottom: 0; padding-bottom: var(--s4); }
}

/* ── 12. Artifact page: heading ───────────────────────────────────────── */
.record-head { padding: var(--s5) 0 var(--s4); }
.crumbs { font-size: 14px; color: var(--muted); margin-bottom: var(--s2); display: flex; gap: 6px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); }
.record-head h1 { font-size: clamp(28px, 3.2vw, 40px); margin-bottom: var(--s2); }
.record-sub { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); align-items: center; font-size: 15px; color: var(--ink-2); }
.record-sub .sep { color: var(--line-strong); }

/* ── 13. Inspection workspace (dark) ──────────────────────────────────── */
.workspace {
  --panel-w: 320px;
  display: grid; grid-template-columns: minmax(0, 1fr) 10px var(--panel-w);
  height: calc(100vh - var(--header-h) - 24px); height: calc(100dvh - var(--header-h) - 24px);
  min-height: 520px; max-height: 1100px;
  background: var(--vw-bg); color: var(--vw-text); border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line);
}
.workspace.panel-closed { grid-template-columns: minmax(0, 1fr) 10px 0; }
/* The stage spans all three columns; the handle and the panel sit on top of it in the same row */
.ws-stage { grid-column: 1 / -1; grid-row: 1; }
.ws-resizer { grid-column: 2; grid-row: 1; z-index: 6; }
.ws-panel { grid-column: 3; grid-row: 1; z-index: 6; position: relative; }
.workspace.resizing { user-select: none; cursor: col-resize; }
.workspace.resizing canvas { pointer-events: none; }
/* Panel handle: drag to resize, the middle button hides/shows */
.ws-resizer { position: relative; background: transparent; cursor: col-resize; touch-action: none; }
.ws-resizer:hover::before, .ws-resizer:focus-visible::before, .workspace.resizing .ws-resizer::before { background: var(--vw-accent); opacity: .7; }
.ws-resizer::before { content: ""; position: absolute; left: 4px; width: 3px; top: 50%; height: 40px; margin-top: -72px; border-radius: 2px; background: rgba(36,39,43,.22); transition: background .15s, opacity .15s; }
.ws-collapse {
  position: absolute; top: 50%; left: -6px; width: 22px; height: 36px; margin-top: -18px; z-index: 5;
  border: 1px solid rgba(255,255,255,.7); border-radius: 8px; background: rgba(255,255,255,.6); color: var(--vw-muted);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  cursor: pointer; display: grid; place-items: center; box-shadow: 0 2px 8px rgba(36,39,43,.12); font: 600 14px/1 var(--sans);
}
.ws-collapse:hover { background: var(--petrol-tint); color: var(--petrol-strong); }
.workspace.panel-closed .ws-panel { visibility: hidden; }
.workspace:fullscreen { border-radius: 0; height: 100vh; max-height: none; }

.ws-stage { position: relative; min-width: 0; min-height: 0; display: flex; }
.ws-panes { flex: 1; display: grid; grid-template-columns: 1fr; gap: 2px; min-width: 0; min-height: 0; background: var(--line); }
.ws-panes.compare { grid-template-columns: 1fr 1fr; }
/* When comparing, both views split the area not covered by the panel equally (same size, same scale) */
.ws-panes.compare { margin-right: var(--panel-cover, 0px); }
.pane { position: relative; min-width: 0; min-height: 0; background: var(--vw-bg); outline: none; }
.pane canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.pane[data-tool="light"] canvas { cursor: crosshair; }
.pane canvas:active { cursor: grabbing; }
.pane[data-tool="light"] canvas:active { cursor: crosshair; }
.pane .underlay {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain;
  pointer-events: none; opacity: .55; transition: opacity .6s;
}
.pane .underlay.hide { opacity: 0; }
.ws-panes.compare .pane.active { box-shadow: inset 0 0 0 2px var(--vw-accent); }
.pane-label {
  position: absolute; top: 64px; right: var(--s3); z-index: 2; pointer-events: none; max-width: calc(100% - 24px);
  font: 600 12px/1 var(--sans); letter-spacing: .08em; padding: 6px 8px; border-radius: var(--radius-sm);
  background: var(--vw-chrome); color: var(--vw-text); border: 1px solid var(--vw-line);
}
.ws-panes:not(.compare) .pane-label { display: none; }
/* View B has no toolbar on top; its label sits near the corner. */
.ws-panes.compare .pane[data-pane="b"] .pane-label { top: var(--s3); }

.ws-toolbar {
  /* in the middle of the visible area (excluding the side panel) */
  position: absolute; top: var(--s3); left: calc((100% - var(--panel-cover, 0px)) / 2); transform: translateX(-50%); z-index: 3; display: flex; flex-wrap: wrap; gap: 4px;
  max-width: calc(100% - var(--panel-cover, 0px) - 24px); width: max-content; justify-content: center;
}
.tool-group {
  display: flex; gap: 2px; padding: 3px; border-radius: var(--radius);
  background: rgba(250,248,244,.4); border: 1px solid rgba(255,255,255,.6);
  backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 6px 20px rgba(36,39,43,.10), 0 1px 2px rgba(36,39,43,.06);
}
.tbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 40px; height: 40px; padding: 0 10px; border: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--vw-text); font: 500 13px/1 var(--sans); cursor: pointer;
}
.tbtn:hover { background: rgba(255,255,255,.55); }
.tbtn[aria-pressed="true"] { background: var(--vw-accent); color: #fff; }
.tbtn:disabled { opacity: .4; cursor: not-allowed; }
.tbtn svg { width: 18px; height: 18px; flex: none; }
.tbtn .lbl { white-space: nowrap; }
.workspace :focus-visible { outline: 2px solid var(--vw-accent); outline-offset: 2px; }

.ws-readout {
  position: absolute; left: var(--s3); right: calc(var(--s3) + var(--panel-cover, 0px)); bottom: var(--s3); z-index: 3;
  display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-end; pointer-events: none;
}
.ws-readout > * { pointer-events: auto; }
.rchip {
  font: 500 12px/1.3 var(--sans); padding: 6px 9px; border-radius: var(--radius-sm);
  background: rgba(250,248,244,.7); color: var(--vw-text); border: 1px solid rgba(255,255,255,.6);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  font-variant-numeric: tabular-nums;
}
.rchip.changed { border-color: var(--vw-accent); color: var(--petrol-strong); }
.rchip.enhanced { border-color: var(--vw-enh-line); color: var(--vw-enh-text); background: var(--vw-enh-bg); }
.ws-status { margin-left: auto; }

.ws-overlay {
  position: absolute; inset: 0 var(--panel-cover, 0px) 0 0; z-index: 4; display: grid; place-items: center; padding: var(--s5);
  background: rgba(246, 243, 238, .82); text-align: center;
}
.ws-overlay .box { max-width: 420px; background: var(--vw-panel); border: 1px solid var(--vw-line); border-radius: var(--radius); padding: var(--s5); }
.ws-overlay h2 { color: var(--vw-text); font-size: 20px; margin-bottom: var(--s2); }
.ws-overlay p { color: var(--vw-muted); font-size: 15px; }
.ws-overlay ul { text-align: left; color: var(--vw-text); font-size: 15px; padding-left: var(--s5); margin: 0 0 var(--s4); }
.ws-overlay li { margin-bottom: 6px; }
.ws-overlay kbd, .ws-panel kbd { font: 12px var(--mono); border: 1px solid var(--vw-line); border-bottom-width: 2px; border-radius: 3px; padding: 1px 5px; color: var(--vw-text); }
.ws-overlay .box { box-shadow: var(--shadow); }
.ws-overlay .btn-secondary { color: var(--vw-text); border-color: var(--vw-line); }
.ws-overlay .btn-secondary:hover { border-color: var(--vw-text); }

/* Side panel */
.ws-panel {
  display: flex; flex-direction: column; min-height: 0; margin: 10px 10px 10px 0; overflow: hidden;
  background: rgba(250,248,244,.4); border: 1px solid rgba(255,255,255,.6); border-radius: 12px;
  backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 10px 30px rgba(36,39,43,.10), 0 1px 2px rgba(36,39,43,.06);
  --vw-line: rgba(36,39,43,.12);
}
.ws-tabs { display: flex; border-bottom: 1px solid var(--vw-line); flex: none; padding: 0 6px; }
.ws-tabs button {
  flex: 1; min-height: 38px; border: 0; background: none; color: var(--vw-muted); cursor: pointer;
  font: 600 12.5px/1 var(--sans); border-bottom: 2px solid transparent;
}
.ws-tabs button[aria-selected="true"] { color: var(--vw-text); border-bottom-color: var(--vw-accent); }
.ws-tabs button:hover { color: var(--vw-text); }
.ws-body { overflow-y: auto; padding: 12px 14px; flex: 1; min-height: 0; scrollbar-width: thin; }
.ws-section { border-bottom: 1px solid var(--vw-line); padding-bottom: 12px; margin-bottom: 12px; }
.ws-section:last-child { border-bottom: 0; margin-bottom: 0; }
.ws-section > h2, .ws-section > h3 {
  font: 600 10.5px/1.2 var(--sans); letter-spacing: .1em; text-transform: uppercase;
  color: var(--vw-muted); margin: 0 0 8px; display: flex; justify-content: space-between; align-items: center; min-height: 22px;
}
.ws-section p, .ws-help { color: var(--vw-muted); font-size: 12px; line-height: 1.5; margin: 6px 0 0; }
.ws-section { position: relative; }
.ws-subhead { font: 600 10.5px/1.2 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--vw-muted); margin: 12px 0 6px; }
.ws-section .h-t { display: inline-flex; align-items: center; gap: 6px; }
/* Explanation attached to a heading: a small "?" and a note that opens below the heading (does not push the flow) */
.help-q {
  width: 16px; height: 16px; flex: none; padding: 0; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--vw-line); background: var(--vw-surface); color: var(--vw-muted);
  font: 700 10px/1 var(--sans); letter-spacing: 0; text-transform: none; display: inline-grid; place-items: center;
}
.help-q:hover, .help-q[aria-expanded="true"] { border-color: var(--vw-accent); color: var(--vw-accent); background: var(--petrol-tint); }
.help-pop {
  position: absolute; left: 0; right: 0; z-index: 20; margin-top: -4px;
  background: var(--vw-surface); color: var(--vw-text); border: 1px solid var(--vw-line); border-radius: var(--radius-sm);
  box-shadow: 0 6px 20px rgba(36,39,43,.16); padding: 10px 12px;
  font: 400 12.5px/1.5 var(--sans); letter-spacing: normal; text-transform: none;
}
.help-pop[hidden] { display: none; }
/* Dark glass: if the image behind is dark, the panel, toolbar and bottom labels switch to light text */
.glass-dark {
  --vw-text: #f3f1ec; --vw-muted: rgba(243,241,236,.74); --vw-line: rgba(255,255,255,.18);
  --vw-surface: #2c2f33; --vw-hover: rgba(255,255,255,.12);
  --vw-accent: #7cc3cb; --petrol-strong: #a6dce1; --petrol-tint: rgba(111,176,184,.24);
}
.ws-panel, .tool-group, .rchip { transition: background-color .3s, border-color .3s, color .3s; }
.ws-panel.glass-dark { background: rgba(24,26,29,.4); border-color: rgba(255,255,255,.14); color: var(--vw-text); }
.ws-toolbar.glass-dark .tool-group { background: rgba(24,26,29,.4); border-color: rgba(255,255,255,.14); }
.ws-toolbar.glass-dark .tbtn { color: var(--vw-text); }
.ws-toolbar.glass-dark .tbtn:hover { background: rgba(255,255,255,.12); }
.ws-toolbar.glass-dark .tbtn[aria-pressed="true"] { background: #2a7a84; color: #fff; }
.ws-readout.glass-dark .rchip:not(.enhanced) { background: rgba(24,26,29,.7); border-color: rgba(255,255,255,.14); color: var(--vw-text); }
.glass-dark .pbtn { background: rgba(255,255,255,.08); }
.glass-dark .pbtn:hover { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.3); }
.glass-dark .field-dark input[type="number"], .glass-dark .field-dark input[type="text"] { background: rgba(0,0,0,.25); }
.glass-dark .views-list li { background: rgba(255,255,255,.06); }
.glass-dark .cite-box { background: rgba(0,0,0,.25); }
.glass-dark .ws-tabs button[aria-selected="true"] { color: #fff; }
.panel-dark .ws-collapse { background: rgba(24,26,29,.55); color: #f3f1ec; border-color: rgba(255,255,255,.2); }
.help-pop p { margin: 0; color: var(--vw-text); }
.help-pop p + p { margin-top: 6px; }
.ws-row { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; }
.ws-row + .ws-row { margin-top: var(--s2); }
.pbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 32px; padding: 0 10px; border-radius: 7px; cursor: pointer;
  background: rgba(255,255,255,.45); color: var(--vw-text); border: 1px solid var(--vw-line); font: 500 12.5px/1.1 var(--sans);
}
.pbtn:hover { border-color: rgba(36,39,43,.25); background: rgba(255,255,255,.8); }
.pbtn[aria-pressed="true"] { border-color: var(--vw-accent); color: var(--petrol-strong); background: var(--petrol-tint); font-weight: 600; }
.pbtn:disabled { opacity: .45; cursor: not-allowed; }
.pbtn svg { width: 14px; height: 14px; flex: none; }
.pbtn.grow { flex: 1; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.seg .pbtn { justify-content: flex-start; text-align: left; }
.field-dark { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; color: var(--vw-muted); min-width: 0; }
.field-dark input[type="number"], .field-dark input[type="text"] {
  min-height: 30px; background: rgba(255,255,255,.6); color: var(--vw-text); border: 1px solid var(--vw-line);
  border-radius: 7px; padding: 0 8px; font: 13px var(--sans); width: 100%; font-variant-numeric: tabular-nums;
}
.field-dark .val { color: var(--vw-text); font-variant-numeric: tabular-nums; }
.field-dark .fd-head { display: flex; justify-content: space-between; align-items: baseline; }
.range { width: 100%; accent-color: var(--vw-accent); min-height: 20px; margin: 0; }
.light-row { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; align-items: center; }
.light-row .field-dark + .field-dark { margin-top: 6px; }
/* Angle boxes next to their labels; rotate light below them */
.light-fields { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-inline { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11.5px; color: var(--vw-muted); }
.field-inline span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.field-inline input {
  width: 58px; flex: none; min-height: 28px; padding: 0 6px; text-align: right; font: 13px var(--sans); font-variant-numeric: tabular-nums;
  background: rgba(255,255,255,.6); color: var(--vw-text); border: 1px solid var(--vw-line); border-radius: 7px;
}
.glass-dark .field-inline input { background: rgba(0,0,0,.25); }
.light-fields .pbtn { min-height: 28px; font-size: 12px; padding: 0 8px; }
.light-trackball { display: block; width: 96px; height: 96px; touch-action: none; cursor: crosshair; border-radius: 50%; }

.views-list { list-style: none; margin: var(--s3) 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.views-list li { display: flex; align-items: center; gap: 4px; background: rgba(255,255,255,.5); border: 1px solid var(--vw-line); border-radius: 7px; padding: 4px 4px 4px 8px; }
.views-list .name { flex: 1; min-width: 0; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.views-list .when { font-size: 11px; color: var(--vw-muted); }
.views-list .pbtn { min-height: 26px; padding: 0 6px; font-size: 12px; }
.toast { min-height: 16px; font-size: 12px; color: var(--vw-accent); margin-top: var(--s2); }

/* Record and citation (in the panel, dark) */
.meta-group { margin-bottom: var(--s4); }
.meta-group h3 { font: 600 10.5px/1.2 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--vw-muted); margin: 0 0 var(--s2); }
.meta-dl { display: grid; grid-template-columns: minmax(90px, 38%) minmax(0, 1fr); gap: 5px 10px; margin: 0; font-size: 12.5px; }
.meta-dl dt { color: var(--vw-muted); }
.meta-dl dd { margin: 0; color: var(--vw-text); overflow-wrap: anywhere; }
.meta-dl dd.empty { color: var(--vw-muted); font-style: italic; }
.meta-dl a { color: var(--vw-accent); }
.cite-box {
  white-space: pre-wrap; overflow-wrap: anywhere; font: 12px/1.5 var(--mono); color: var(--vw-text);
  background: rgba(255,255,255,.55); border: 1px solid var(--vw-line); border-radius: var(--radius-sm);
  padding: var(--s3); margin: var(--s3) 0; max-height: 260px; overflow: auto; user-select: all;
}
.ws-panel a { color: var(--vw-accent); }
.fmt-seg { display: flex; gap: 4px; }
.fmt-seg .pbtn { min-height: 28px; font-size: 12px; }
.ws-panel .check { font-size: 12.5px; min-height: 28px; gap: 8px; }   /* the general .check is 15px; in the panel the same size as the other controls */

/* Mobile: the viewer fills the whole area; controls live in a translucent bottom sheet
   (when closed only the tabs show; tapping a tab opens it). */
.ws-sheet-handle { display: none; }
@media (max-width: 900px) {
  .ws-resizer { display: none; }
  .workspace, .workspace.panel-closed {
    position: relative; grid-template-columns: 1fr; grid-template-rows: 1fr;
    border-radius: 0; margin: 0 calc(-1 * var(--gutter)); min-height: 360px;
  }
  .ws-stage { grid-column: 1; grid-row: 1; }
  .ws-panel {
    position: absolute; left: 0; right: 0; bottom: 0; margin: 0; z-index: 6;
    max-height: 58%; border-radius: 14px 14px 0 0; border-bottom: 0;
    transition: max-height .25s ease, background-color .3s;
  }
  .workspace.panel-closed .ws-panel { visibility: visible; max-height: 64px; }
  .workspace.panel-closed .ws-body { visibility: hidden; }
  .ws-sheet-handle {
    display: grid; place-items: center; width: 100%; height: 18px; border: 0; padding: 0; background: none; cursor: pointer; flex: none;
  }
  .ws-sheet-handle span { width: 40px; height: 4px; border-radius: 2px; background: currentColor; opacity: .35; }
  .ws-panel { color: var(--vw-text); }
  .ws-tabs button { min-height: 40px; font-size: 13.5px; }
  .ws-body { overflow-y: auto; overscroll-behavior: contain; padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .ws-panes.compare { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; margin-right: 0; margin-bottom: var(--panel-cover-b, 0px); }
  .ws-toolbar { top: 8px; left: 50%; max-width: calc(100% - 16px); flex-wrap: nowrap; }
  .field-inline input { min-height: 36px; font-size: 16px; width: 64px; }
  .tool-group { padding: 2px; }
  .tbtn .lbl { display: none; }
  .tbtn { min-width: 40px; height: 40px; padding: 0 8px; }
  .ws-readout { bottom: calc(8px + var(--panel-cover-b, 0px)); left: 8px; right: 8px; transition: bottom .25s ease; }
  .rchip { padding: 4px 7px; font-size: 11.5px; }
  .ws-overlay { inset: 0 0 var(--panel-cover-b, 0px) 0; }
  .pane-label { top: 60px; }
  .ws-panes.compare .pane[data-pane="b"] .pane-label { top: var(--s2); }
  .hide-mobile { display: none !important; }
  .light-row { grid-template-columns: 104px minmax(0, 1fr); }
  .light-trackball { width: 104px; height: 104px; }
  .pbtn { min-height: 38px; }
  .field-dark input[type="number"], .field-dark input[type="text"] { min-height: 38px; font-size: 16px; }   /* prevent iOS from zooming */
  .help-q { width: 22px; height: 22px; font-size: 12px; }
}
}

/* The standalone viewer page (viewer/index.html) */
.standalone { height: 100vh; height: 100dvh; margin: 0; display: flex; flex-direction: column; background: var(--vw-bg); }
.standalone-bar { display: flex; align-items: center; gap: var(--s4); padding: 0 var(--s4); height: 52px; background: var(--vw-panel); color: var(--vw-text); border-bottom: 1px solid var(--vw-line); flex: none; }
.standalone-bar .brand { color: var(--vw-text); font-size: 18px; }
.standalone-bar .brand svg { color: var(--vw-accent); }
.standalone-bar .title { color: var(--vw-muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.standalone-bar a.back { margin-left: auto; color: var(--vw-accent); font-size: 14px; white-space: nowrap; }
.standalone .workspace { flex: 1; height: auto; max-height: none; min-height: 0; border-radius: 0; border: 0; }
@media (max-width: 900px) { .standalone { height: auto; min-height: 100vh; } .standalone .workspace { margin: 0; } }

/* ── 14. Upload page (local development only; hidden on the live site) ─── */
.form-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: var(--s5); }
.card-box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s5); margin-bottom: var(--s4); }
.card-box h2 { font-size: 20px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--s3); font-size: 14px; }
.field input, .field select, .field textarea { min-height: 42px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 8px 10px; font: 15px var(--sans); background: #fff; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.req { color: var(--danger); }
.help { font-size: 14px; color: var(--muted); }
.dropzone { border: 2px dashed var(--line-strong); border-radius: var(--radius); padding: var(--s6); text-align: center; cursor: pointer; }
.dropzone:hover, .dropzone.over { border-color: var(--petrol); background: var(--petrol-tint); }
.dz-sub { display: block; color: var(--muted); font-size: 14px; }
.file-pill { display: none; align-items: center; gap: var(--s2); margin-top: var(--s3); }
.file-pill.show { display: flex; }
.fp-remove { border: 0; background: none; cursor: pointer; font-size: 18px; }
.stages { list-style: none; padding: 0; }
.progressbar { height: 6px; background: var(--paper-2); border-radius: 3px; overflow: hidden; }
@media (max-width: 760px) { .form-grid, .field-row { grid-template-columns: 1fr; } }

/* ── 15. Artifact page: full-screen inspection setting ─────────────────────
   The viewer spans edge to edge and the full height below the header strip;
   it behaves like the page itself, not like an embedded box. */
.page-object { --record-h: 56px; }
.page-object main.wrap { padding: 0; }
.page-object #record-state { margin: var(--s7) var(--gutter); }
.page-object .record-head {
  display: flex; align-items: center; gap: var(--s2) var(--s4); flex-wrap: nowrap;
  height: var(--record-h); padding: 0 var(--gutter); border-bottom: 1px solid var(--line); overflow: hidden;
}
.page-object .crumbs { margin: 0; flex: none; }
.page-object .crumbs #crumb-title, .page-object .crumbs span[aria-hidden] { display: none; }
.page-object .record-head h1 {
  font-size: 22px; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 0 1 auto;
}
.page-object .record-sub { flex-wrap: nowrap; overflow: hidden; white-space: nowrap; font-size: 14px; min-width: 0; }
.page-object .workspace {
  border: 0; border-radius: 0; max-height: none;
  height: calc(100vh - var(--header-h) - var(--record-h));
  height: calc(100dvh - var(--header-h) - var(--record-h));
}
.page-object .site-footer { margin-top: 0; }
@media (max-width: 900px) {
  /* One-line title; details are in the Record tab. The viewer fills the rest of the screen. */
  .page-object { --record-h: 44px; }
  .page-object .record-head { gap: var(--s2); }
  .page-object .record-head h1 { font-size: 17px; }
  .page-object .record-sub { display: none; }
  .page-object .workspace, .page-object .workspace.panel-closed {
    margin: 0;
    height: calc(100vh - var(--header-h) - var(--record-h));
    height: calc(100dvh - var(--header-h) - var(--record-h));
  }
}

/* ── Account page (account.html) ──────────────────────────────────────── */
.acc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s5); }
.acc-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); padding: var(--s5); min-width: 0; }
.acc-card h2 { font-size: 20px; margin: 0 0 var(--s3); }
.acc-card > p:last-child { margin-bottom: 0; }
.acc-wide { grid-column: 1 / -1; }
.acc-buttons { display: flex; flex-wrap: wrap; gap: var(--s3); margin: var(--s4) 0; }
.btn-orcid svg { width: 20px; height: 20px; }
.acc-privacy { margin-top: var(--s4); font-size: 15px; color: var(--ink-2); }
.acc-privacy summary { cursor: pointer; font-weight: 600; color: var(--ink); }
.acc-privacy ul { margin: var(--s2) 0 0; padding-left: 1.2em; }
.acc-form { display: flex; flex-direction: column; gap: var(--s2); }
.acc-form label:not(.check) { font-weight: 600; font-size: 15px; }
.acc-form .small { margin: 0; }
.acc-orcid { margin: var(--s2) 0 0; font-size: 15px; }
.acc-orcid a { display: inline-flex; align-items: center; gap: 6px; word-break: break-all; }
.acc-methods, .acc-list { list-style: none; margin: 0 0 var(--s3); padding: 0; }
.acc-methods li, .acc-list li {
  display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap;
  padding: var(--s3) 0; border-bottom: 1px solid var(--line);
}
.acc-methods li > span:first-child { font-weight: 600; margin-right: auto; }
.acc-list li > :first-child { font-weight: 600; margin-right: auto; }
@media (max-width: 760px) { .acc-grid { grid-template-columns: 1fr; } .acc-card { padding: var(--s4); } }
