@import url("physlib-theme.css?v=24");

:root {
  --library-core: var(--accent);
  --library-alpha: #7951a8;
  --library-quantum: var(--success);
  /* Swatches shared by the atlas and library studies, matching their artwork. */
  --study-physlib: color-mix(in srgb, var(--brand-blue) 75%, white);
  --study-physlib-alpha: #f5bd65;
  --study-unformalized: #aaa;
}
[data-theme="dark"] {
  --library-alpha: #ba94ec;
}

/* ==== Document ==== */
html { scroll-padding-top: 66px; scrollbar-width: none; }
/* On a window taller than the page, the footer's grey runs to the bottom edge instead of leaving a white band. */
body { --arena-page-start: 43px; display: flex; flex-direction: column; min-height: 100dvh; }
body > main { flex: 0 0 auto; }
[data-physlib-footer] { flex: 1 0 auto; background: var(--surface-secondary); }
/* Every page but the home page is at least one window tall, so the footer never moves while a page loads. */
body > main:not(#arena-splash) { min-height: calc(100dvh - 56px); }
/* A short page with little to load keeps the footer in view, resting on the bottom of the window. */
body > main#profile-page:not(#arena-splash) { min-height: calc(100dvh - 56px - 15.2rem); }
html.route-pending :is(body > main, [data-physlib-footer]) { display: none; }
#goal-filters:focus-visible { outline: none; }
#arena-about-title:focus { outline: none; }
html::-webkit-scrollbar { display: none; }

/* ==== Shell: sticky header, theme switch, page frame ==== */
.arena-header { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--border); background: var(--background); }
.arena-header-inner { display: flex; align-items: center; gap: clamp(8px, 2.2vw, 23px); min-height: 55px; }
.arena-wordmark { margin-inline-end: auto; white-space: nowrap; }
.arena-header-auth { min-width: 0; }
#github-access, #arena-account { min-height: 32px; padding-inline: 12px; }
.arena-header-links { align-self: stretch; }
.arena-theme {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  color: var(--control-default-foreground);
  background: transparent;
}
.arena-theme:hover { background: #ebebec; }
[data-theme="dark"] .arena-theme:hover { background: #27272a; }
.arena-theme svg { width: 20px; height: 20px; }
.prototype-label {
  position: fixed;
  right: 0;
  bottom: 0;
  z-index: 50;
  pointer-events: none;
  padding: 5px 9px;
  border-radius: 6px 0 0 0;
  background: var(--foreground);
  color: var(--background);
  font: 600 10px/1 var(--mono);
  letter-spacing: .08em;
  opacity: .85;
}
@media print { .prototype-label { display: none; } }
.arena-main { padding-top: var(--arena-page-start); padding-bottom: 56px; }
:is(#about, #arena-policies, #frontier-guide, #agent-guide) .page-frame-editorial { padding-block-start: var(--arena-page-start); }

/* ==== Shared panel parts used by Goals, Activity, and dialogs ==== */
/* One card surface for guide cards, diagrams, panels, and disclosures. Its radius,
   fill, and shadow are the --card-* tokens in physlib-theme.css. */
.site-card, .guide-card, .panel, .merged-work, .timeline-control, #about .about-workflow, .agent-prompt-disclosures details {
  min-width: 0;
  border: 0;
  border-radius: var(--card-radius);
  background: var(--card-surface);
  box-shadow: var(--card-shadow);
}
/* A tinted heading band at the top of a card. */
:is(.merged-work > .panel-heading, .queue-heading) { border-radius: var(--card-radius) var(--card-radius) 0 0; }
:is(.merged-work > .panel-heading, .queue-heading, .queue-stage-heading) { padding: 9px 12px; background: var(--surface-secondary); border-bottom: 1px solid var(--border); }
.panel-heading, .dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 7px; }
.panel-heading :is(h2, h3), .issue-picker h3 { font-size: .9375rem; font-weight: 640; letter-spacing: -.015em; }
.panel-heading > :is(h2,h3) { overflow-wrap: anywhere; }
.loading { color: var(--muted); padding: 10px 12px; font-size: var(--text-sm); }

/* ==== Splash ==== */
#arena-splash { padding-block: clamp(1.25rem, 4svh, 2.75rem); min-height: 0; }
.arena-splash-hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  align-items: center;
  /* Landscape on a desktop window of any height: never taller than about half its width. */
  min-height: max(26rem, min(76svh, 46vw));
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--background);
}
.arena-splash-hero::before {
  position: absolute;
  z-index: -1;
  grid-area: 1 / 1 / 2 / 2;
  inset: 0;
  content: "";
  background-image:
    linear-gradient(to right, var(--border) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to right, #000 12%, transparent 97%);
}
.arena-splash-copy {
  display: grid;
  justify-items: start;
  align-content: center;
  gap: 1rem;
  padding: 2.6rem 0 2.6rem clamp(1.25rem, 4vw, 4.5rem);
}
.arena-splash-hero h1 {
  max-width: 14ch;
  margin: 0;
  color: var(--wordmark-accent);
  font: 620 clamp(2rem, 5.5vw, 4.5rem)/1.06 var(--mono);
  letter-spacing: -.045em;
  text-wrap: balance;
}
.arena-splash-hero p {
  margin: 0 0 .35rem;
  font-size: clamp(1rem, 1.85vw, 1.16rem);
  line-height: 1.55;
  color: var(--muted);
}
.arena-splash-globe {
  position: relative;
  display: block;
  align-self: stretch;
  container-type: size;
  overflow: hidden;
  outline-offset: -3px;
}
.arena-splash-globe::before {
  position: absolute;
  content: "";
  bottom: 0;
  right: 0;
  width: min(129%, 125cqh);
  aspect-ratio: 1;
  transform: translate(25%, 24%);
  background: url("roadmap-light.webp") center / contain no-repeat;
}
[data-theme="dark"] .arena-splash-globe::before { background-image: url("roadmap-dark.webp"); }
@media (min-width: 75rem) {
  #arena-splash:is([data-home="library"], [data-home="proof"], [data-home="waves"]) .arena-splash-hero {
    grid-template-columns: minmax(max-content, .94fr) minmax(0, 1.06fr);
  }
}
@media (max-width: 680px) and (max-height: 44rem) {
  #arena-splash[data-home="proof"] { padding-block: .5rem; }
}
@media (min-width: 681px) and (max-width: 850px) {
  .arena-splash-hero { min-height: clamp(26rem, 68svh, 34rem); }
  #arena-splash:not([data-home]) .arena-splash-hero { min-height: clamp(24rem, 53vw, 28rem); }
  #arena-splash:not([data-home]) .arena-splash-globe::before { width: min(157%, 135cqh); }
  .arena-splash-hero h1 { font-size: clamp(2.2rem, 5vw, 3rem); }
}
@media (max-width: 680px) {
  .arena-splash-hero { grid-template-columns: 1fr; grid-template-rows: auto minmax(15rem, 1fr); min-height: max(32rem, 75svh); }
  .arena-splash-copy { gap: .8rem; padding: 2.5rem 1.25rem .5rem; }
  .arena-splash-hero h1 { max-width: none; font-size: clamp(2.1rem, 8.5vw, 3.4rem); }
  .arena-splash-hero p { max-width: 32ch; }
  .arena-splash-hero::before { mask-image: linear-gradient(to bottom, #000, transparent 100%); }
  .arena-splash-globe::before { width: min(117%, 120cqh); }
}

@media (min-width: 681px) {
  #arena-splash:not([data-home]) .arena-splash-copy { transform: translateY(clamp(-1.65rem, -2.6svh, -.75rem)); }
}
.atlas-source-key { display: none; }
[data-home="atlas"] .arena-splash-hero {
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
  gap: clamp(1.25rem, 3vw, 3rem);
  border: 0;
  border-radius: 0;
}
[data-home="atlas"] .arena-splash-hero::before { content: none; }
[data-home="atlas"] .arena-splash-copy { grid-area: 1 / 2; padding-inline: 0 1rem; }
[data-home="atlas"] .arena-splash-globe { grid-area: 1 / 1; }
[data-home="atlas"] .arena-splash-globe::before {
  width: min(111%, calc(110cqh - 4rem));
  top: calc(50% - 1rem);
  left: 50%;
  right: auto;
  bottom: auto;
  transform: translate(-50%, -50%);
}
[data-home="atlas"] .atlas-source-key {
  position: absolute;
  inset: auto 0 .25rem;
  display: flex;
  justify-content: center;
  gap: clamp(.5rem, 1.4vw, 1.25rem);
  color: var(--muted);
  font: 500 .72rem/1.4 var(--mono);
}
.atlas-source-key span { display: inline-flex; align-items: center; gap: .35em; }
.atlas-source-key span::before { content: ""; width: .66em; height: .66em; background: var(--study-physlib); }
.atlas-source-key span:nth-child(2)::before { background: var(--study-physlib-alpha); }
.atlas-source-key span:nth-child(3)::before { background: var(--study-unformalized); }

[data-home="panorama"] .arena-splash-hero {
  grid-template: auto clamp(14rem, 36svh, 23rem) / minmax(0, 1fr);
  min-height: 0;
}
[data-home="panorama"] .arena-splash-hero::before {
  mask-image: linear-gradient(to right, #000, transparent 74%);
}
[data-home="panorama"] .arena-splash-copy {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: .85rem 2rem;
  padding: clamp(2rem, 6vw, 6rem) clamp(1.25rem, 4vw, 4.5rem) clamp(1.75rem, 3.5vw, 3rem);
}
[data-home="panorama"] h1 { grid-column: 1 / -1; max-width: none; font-size: clamp(2rem, 5.35vw, 4.5rem); }
[data-home="panorama"] .arena-splash-copy p { max-width: 55ch; margin: 0; }
[data-home="panorama"] .arena-splash-globe { border-top: 1px solid var(--border); }
[data-home="panorama"] .arena-splash-globe::before {
  width: max(157%, 40rem);
  top: 0;
  left: 50%;
  right: auto;
  bottom: auto;
  transform: translate(-50%, -19%);
}
@media (max-width: 680px) {
  #arena-splash:not([data-home]) .arena-splash-hero { min-height: max(29rem, 63svh); }
  #arena-splash:not([data-home]) .arena-splash-copy { padding-top: 2rem; }
  #arena-splash:not([data-home]) .arena-splash-globe::before { width: min(135%, 140cqh); }
  [data-home="atlas"] .arena-splash-hero { grid-template: auto minmax(19rem, 43svh) / 1fr; gap: .5rem; min-height: 0; }
  [data-home="atlas"] .arena-splash-copy { grid-area: 1 / 1; padding: 1.5rem .25rem 0; }
  [data-home="atlas"] .arena-splash-globe { grid-area: 2 / 1; }
  [data-home="panorama"] .arena-splash-hero { grid-template-rows: auto clamp(11.5rem, 28svh, 16rem); }
  [data-home="panorama"] .arena-splash-copy { grid-template-columns: 1fr; gap: .85rem; padding: 2.1rem 1.25rem 1.75rem; }
  [data-home="panorama"] h1 { font-size: clamp(2.1rem, 8.5vw, 3.4rem); }
}

/* ==== Guide pages (About, Resources): physlib.io guide components ==== */
/* Guide pages use the physlib.io guide components: mono label, numbered
 * sections, 14px tinted body text set flush left, cards, and step rows.
 * Source: web2/src/app/ {gh-guide,ai-guidelines,get-involved}/page.tsx and
 * web2/src/components/page-header.tsx. */
.arena-guide { --guide-text: color-mix(in srgb, var(--foreground) 70%, var(--accent)); }
.arena-guide.page-frame-editorial { max-width: 56rem; }
.arena-guide .page-intro-editorial { max-width: 42rem; }
.arena-guide .page-section-editorial { padding-top: 2.5rem; }
.arena-guide .page-section-heading { gap: .75rem; margin-bottom: 1.5rem; }
.arena-guide .page-section-heading h2 { font-size: 1.5rem; line-height: 2rem; }
.arena-guide .page-section-heading > span { font-size: var(--text-base); line-height: 1.25rem; }
.arena-guide .prose-physlib :is(p, li) {
  color: var(--guide-text);
  font-size: var(--text-base);
  line-height: 1.625;
  letter-spacing: -.01em;
  text-align: start;
}
.arena-guide .prose-physlib > :first-child { margin-top: 0; }
.arena-guide .prose-physlib > :last-child { margin-bottom: 0; }
.arena-guide .prose-physlib strong { color: var(--foreground); font-weight: 500; }
.arena-guide .prose-physlib .guide-cards { display: grid; gap: 1rem; margin: 1rem 0; padding: 0; list-style: none; }
.guide-card {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  padding: 1rem;
}
.guide-card h3 { margin: 0; color: var(--foreground); font-size: var(--text-base); font-weight: 500; line-height: 1.5rem; }
.arena-guide .prose-physlib .guide-card p { margin: 0; }
.guide-card .button { align-self: start; margin-top: auto; }
.arena-guide .prose-physlib .guide-steps { display: block; margin: 1rem 0; padding: 0; list-style: none; counter-reset: guide-step; }
.guide-steps > li {
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr);
  column-gap: 2rem;
  padding-block: 2rem;
  border-top: 1px solid var(--border);
  counter-increment: guide-step;
}
.guide-steps > li:last-child { padding-bottom: .5rem; }
.guide-steps > li::before {
  content: counter(guide-step, lower-roman) ".";
  padding-top: .4rem;
  color: var(--accent);
  font: 500 .69rem/1 var(--mono);
  letter-spacing: .055em;
}
.guide-steps h3 { margin: 0 0 .5rem; color: var(--foreground); font-size: 1.125rem; font-weight: 500; line-height: 1.75rem; letter-spacing: -.025em; }
.arena-guide .prose-physlib .guide-steps p { margin: 0; color: var(--muted); }
.arena-guide .prose-physlib .guide-steps p + p { margin-top: .5rem; }
.guide-dash-list { margin: .75rem 0; padding: 0; list-style: none; }
.guide-dash-list > li { display: flex; gap: .75rem; margin-bottom: .5rem; }
.guide-dash-list > li::before { content: "—"; flex: none; color: var(--accent); }
@media (min-width: 48rem) {
  .arena-guide .prose-physlib :is(p, li) { text-align: justify; }
  /* Cards narrower than the column keep ragged text: justified lines that short space out badly. */
  .arena-guide .prose-physlib :is(.guide-card, figure), .arena-guide .prose-physlib :is(.guide-card, figure) :is(p, li, h3) { text-align: start; }
}
@media (min-width: 40rem) {
  .guide-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .guide-cards--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.agent-prompt-disclosures { display: grid; gap: .5rem; margin-block: 1rem; }
.agent-prompt-disclosures details { overflow: hidden; }
.agent-prompt-disclosures summary { display: flex; gap: .5rem; padding: .75rem 1rem; color: var(--accent); font-size: var(--text-base); }
.agent-prompt-disclosures pre {
  margin: 0;
  padding: .75rem 1rem;
  border-top: 1px solid var(--border);
  background: var(--surface-secondary);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: .8125rem/1.6 var(--mono);
}

/* ==== About diagrams ==== */
#about {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
#about .about-workflow {
  margin-block: 1.25rem;
  padding: 1rem;
  font-size: var(--text-base);
  line-height: 1.5;
}
#about .about-workflow figcaption { margin: 0 0 .75rem; color: var(--muted); font-size: var(--text-2xs); }
#about .about-workflow :is(ol, ul) {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}
#about .ticket-stages { gap: 0; grid-auto-rows: 1fr; } /* equal steps, whatever the length of their text */
#about .ticket-stages li {
  align-items: flex-start;
  gap: .875rem;
  min-height: 0;
  font-size: inherit;
  text-align: start;
}
#about .ticket-stages li > div { padding-block: 0 .875rem; }
#about .ticket-stages li:last-child > div { padding-block-end: 0; }
#about .ticket-stages li::before { margin-top: .3rem; border-color: var(--accent); }
#about .ticket-stages li::after {
  content: "";
  position: absolute;
  inset: .65rem auto -.65rem .35rem;
  width: 1px;
  height: auto;
  background: var(--border);
}
#about .ticket-stages li:last-child::after { content: none; }
#about .about-node-title { display: block; margin-block-end: .125rem; color: var(--foreground); font-weight: 500; }
#about .ticket-stages .about-node-title { color: var(--accent); font-size: var(--text-xs); }
#about .about-handoffs { gap: 1rem; }
#about :is(.about-handoffs, .about-library-paths) li {
  position: relative;
  padding: .625rem .75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-secondary);
  color: var(--muted);
  text-align: start;
}
#about .about-handoffs li + li::before {
  content: "";
  position: absolute;
  top: -.75rem;
  left: calc(50% - .25rem);
  width: .5rem;
  height: .5rem;
  border: solid var(--accent);
  border-width: 0 1px 1px 0;
  transform: rotate(45deg);
}
@media (min-width: 40rem) {
  #about .ticket-stages li > div { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: .75rem; }
  #about .about-handoffs { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
  #about .about-handoffs li + li::before {
    top: calc(50% - .25rem);
    left: -1.125rem;
    transform: rotate(-45deg);
  }
}
#about .about-library-paths { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
#about .about-library-paths li { text-align: center; }
#about .about-library-paths li::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  height: .75rem;
  border-inline-start: 1px solid var(--accent);
}
#about .about-library-review {
  margin-top: .75rem;
  padding: .625rem .75rem;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: var(--radius);
  background: var(--accent-tint);
  text-align: center;
}
#about .arena-guide h3.about-subheading { margin: 1.5rem 0 .75rem; color: var(--muted); font-size: var(--text-2xs); line-height: 1.5; }

/* ==== Profile ==== */
.profile-content { max-width: 48rem; margin-inline: auto; }
.profile-page-heading, .profile-identity { display: flex; align-items: baseline; gap: .75rem; }
.profile-page-heading { justify-content: space-between; margin-block-end: 2rem; }
.profile-identity { align-items: center; color: var(--muted); font-size: var(--text-xs); }
.profile-background { display: grid; gap: .6rem; margin-block-end: 2rem; }
.profile-background h2 { margin: 0; }
.profile-background-note { color: var(--muted); font-size: var(--text-xs); }
.profile-background-save { display: flex; align-items: center; gap: .75rem; margin-block-start: .4rem; }
.profile-chip-group { display: grid; grid-template-columns: 8rem minmax(0, 1fr); align-items: baseline; gap: .25rem .75rem; }
.profile-chip-label { color: var(--muted); font-size: var(--text-xs); }
.profile-background-status { color: var(--muted); font-size: var(--text-xs); }
@media (max-width: 40rem) { .profile-chip-group { grid-template-columns: 1fr; } }
.profile-tabs { flex-wrap: wrap; border-bottom: 1px solid var(--border); }
.profile-work-list { margin: 0; padding: 0; list-style: none; }
.profile-work-list li { padding-block: .85rem; border-bottom: 1px solid var(--border); }
.profile-work-meta { display: block; color: var(--muted); font-size: var(--text-xs); }
.profile-empty { margin-block: 1rem; color: var(--muted); }

/* ==== Workspace intro and Goals filters ==== */
.arena-intro { display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: 12px; padding-bottom: 21px; border-bottom: 1px solid var(--border); }
[data-view="priorities"] .arena-intro { display: grid; align-items: start; padding-bottom: 0; }
@media (min-width: 48rem) {
  [data-view="priorities"] .arena-intro { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); column-gap: 24px; }
  [data-view="priorities"] .arena-intro > div:first-child { align-self: stretch; display: flex; flex-direction: column; padding-bottom: 21px; }
  [data-view="priorities"] .arena-intro p { margin-top: auto; padding-top: 7px; }
}
@media (min-width: 64rem) {
  [data-view="priorities"] .arena-intro { grid-template-columns: minmax(0, 9fr) minmax(0, 11fr); }
}
.arena-intro .page-title-editorial { margin-bottom: 0; }
#goal-filters { min-width: 0; align-self: end; row-gap: .875rem; }
#goal-filters .goal-filter-group { grid-area: 1 / 1; align-self: end; visibility: hidden; }
#goal-filters:has(#filter-by-types:checked) #type-filters,
#goal-filters:has(#filter-by-fields:checked) #question-fields,
#goal-filters:has(#filter-by-folders:checked) #folder-filters,
#goal-filters:has(#filter-by-status:checked) #status-filters { visibility: visible; }
#goal-filters .goal-filter-controls { grid-area: 2 / 1; }
.goal-filter-controls { display: flex; align-items: end; flex-wrap: wrap; gap: .25rem 1rem; }
.ticket-order { display: inline-flex; align-items: center; gap: 2px; }
.ticket-order summary { min-height: 26px; }
.ticket-order summary:is(:hover, :focus-visible), .ticket-order details[open] summary { color: var(--accent); }
.ticket-order .site-arrow { width: 26px; min-height: 26px; color: var(--muted); }
@media (min-width: 48rem) {
  .goal-filter-controls, #goal-filters .site-filter-row { justify-content: flex-end; }
}
@media (max-width: 47.99rem) {
  .goal-filter-controls, .goal-filter-controls .site-filter-tabs { column-gap: .375rem; }
  .goal-filter-controls { flex-wrap: wrap-reverse; }
  .ticket-order { margin-inline-start: auto; }
}
@media (max-width: 23rem) {
  .goal-filter-controls { flex-direction: column-reverse; align-items: stretch; }
  .goal-filter-controls .site-filter-tabs { column-gap: .75rem; }
}
[data-view="work"] #arena-description { display: none; }
.arena-intro p { color: var(--muted); margin-top: 7px; }
.workspace, #activity-content { padding-top: 20px; }
.goal-brief-action, .ticket-results [data-status-actions]:not(:empty) { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin-block: 8px; font-size: var(--text-base); }
.workspace-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(16rem, 28%); gap: 28px; align-items: start; }
.goal-board { min-width: 0; }

/* ==== Goals board: ticket list, votes, search, edit forms ==== */
/* Goals workspace: question list, interest voting, and approach discussion.
   Shared colors and controls come from physlib-theme.css in both themes. */
:is(#goal-workspace, #goal-reading) {
  --goal-vote-width: 3rem;
  --goal-column-gap: 1.25rem;
}
#goal-workspace :is(.prompt-list, .task-source-results) { display: block; margin: 0; padding: 0; list-style: none; }
#goal-workspace .goal { min-width: 0; border-bottom: 1px solid var(--border); background: transparent; }
#goal-workspace .goal-open { background: color-mix(in srgb, var(--surface-secondary) 65%, var(--background)); }
#goal-workspace .goal-row { display: grid; grid-template-columns: var(--goal-vote-width) minmax(0, 1fr); align-items: start; gap: var(--goal-column-gap); padding: 1.375rem .5rem 1.25rem 0; cursor: pointer; }
#goal-workspace .goal-row:focus-visible { outline-offset: -3px; }
#goal-workspace .goal-copy { min-width: 0; }
#goal-workspace .goal h3 { margin: 0 0 .25rem; font-size: 1.0625rem; font-weight: 550; line-height: 1.45; letter-spacing: -.012em; overflow-wrap: anywhere; text-wrap: wrap; }
#goal-workspace .goal-title-row h3 { margin-block-end: 0; }
#goal-workspace .goal-open .goal-title-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: .125rem .75rem; }
#goal-workspace .goal-open .goal-title-row h3 { flex: 1 1 12rem; min-width: 0; }
#goal-workspace .goal-question-actions { margin-inline-start: auto; font-size: var(--text-sm); }
#goal-workspace .goal-question-actions .ticket-history-link { color: var(--muted); font: inherit; text-decoration: none; white-space: nowrap; }
#goal-workspace .goal-question-actions .ticket-history-link:is(:hover, :focus-visible) { color: var(--accent); text-decoration: underline; }
#goal-workspace .goal-question-actions :is([data-action="edit-proposal"], [data-action="proposal-history"]) { color: var(--muted); }
#goal-workspace .goal-title { padding: 0; border: 0; background: transparent; color: var(--accent); font: inherit; text-align: start; }
#goal-workspace .goal-title:is(:hover, :focus-visible) { text-decoration: underline; text-underline-offset: 3px; }
#goal-workspace .goal-title:focus-visible, #agent-queue .queue-card-link:focus-visible { outline: none; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
#goal-workspace .goal-summary { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; margin-top: .5rem; color: var(--foreground); font-size: var(--text-base); line-height: 1.65; overflow-wrap: anywhere; }
#goal-workspace .goal-open .goal-summary { display: block; -webkit-line-clamp: unset; overflow: visible; white-space: pre-wrap; }
:is(#goal-workspace, #goal-reading) mjx-container[display="true"] { max-width: 100%; overflow-x: auto; overflow-y: hidden; white-space: normal; }
#goal-workspace .goal-reference { margin-top: .5rem; font-size: var(--text-xs); overflow-wrap: anywhere; }
#goal-workspace .goal-vote { display: grid; justify-items: center; gap: .1875rem; }
#goal-workspace .goal-vote .vote-controls { display: flex; flex-direction: column; border: 0; background: transparent; }
#goal-workspace .goal-vote .vote-button { width: 2.5rem; min-height: 2.5rem; border-radius: var(--radius); font-size: var(--text-xs); }
#goal-workspace .goal-vote .vote-score { min-height: 1.5625rem; color: var(--foreground); font-size: 1.1875rem; line-height: 1.5625rem; font-weight: 500; }
:is(#goal-workspace, #goal-reading) .question-footer { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: .625rem 1rem; margin-top: .8125rem; }
:is(#goal-workspace, #goal-reading) .question-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.sr-only, :is(#goal-workspace, #goal-reading) .question-tag-full { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
:is(#goal-workspace, #goal-reading) .question-activity { display: flex; align-items: baseline; flex-wrap: wrap; gap: .4375rem .75rem; color: var(--muted); font-size: var(--text-xs); }
:is(#goal-workspace, #goal-reading) .question-activity a { font-size: inherit; }
:is(#goal-workspace, #goal-reading) .question-activity img { display: none; }
#goal-workspace .goal-details { margin: 0 .5rem 1.5rem calc(var(--goal-vote-width) + var(--goal-column-gap)); padding-top: .75rem; border-top: 1px solid var(--border); overflow-wrap: anywhere; }
/* Prose that fills its column is justified, on every page. Narrow cards stay ragged. */
@media (min-width: 48rem) { :is(#goal-workspace, #goal-reading) :is(.goal-summary, .goal-details .direction-text) { text-align: justify; hyphens: auto; } }
#goal-workspace .goal-details p { font-size: var(--text-base); line-height: 1.65; }
#goal-workspace .goal-details h4 { margin-bottom: .375rem; font-size: var(--text-base); font-weight: 600; }
#goal-workspace .goal-details a { font-size: inherit; }
#goal-workspace .goal-details > .directions { margin: 0; padding: 0; border: 0; }
.discussion-heading { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; }
.discussion-heading .proposal-draft-note { min-width: 0; max-width: 28rem; margin-inline-start: auto; color: var(--muted); font-size: var(--text-xs); font-weight: 400; line-height: 1.45; text-align: end; }
:is(#goal-workspace, #goal-reading) .discussion-heading a { font-size: var(--text-sm); text-align: end; }
.proposal-edit-form { margin-top: .75rem; }
.proposal-edit-form textarea { field-sizing: content; min-height: 5rem; }
.proposal-edit-form > .proposal-facet { margin-top: .25rem; }
.proposal-edit-form > .form-note:empty { display: none; }
.proposal-edit-form > button[type="submit"] { justify-self: start; margin-top: .375rem; }
.draft-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .25rem .75rem; }
#goal-workspace .goal-list-empty { padding: 1.75rem .5rem; color: var(--muted); font-size: var(--text-base); line-height: 1.7; }
.goal-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; color: var(--muted); font-size: var(--text-xs); }
.vote-controls { display: inline-grid; grid-template-columns: 24px minmax(18px, max-content) 24px; place-items: center; align-self: start; border: 1px solid var(--border); border-radius: var(--radius); color: var(--muted); background: var(--surface); }
.vote-button { display: grid; place-items: center; width: 24px; min-height: 26px; padding: 0; border: 0; border-radius: var(--radius); background: none; color: inherit; font-size: 10px; }
.vote-button:hover, .vote-button[aria-pressed="true"] { color: var(--accent); }
.vote-button[aria-pressed="true"] { background: var(--accent-tint); }
.vote-score { padding-inline: 2px; font-size: var(--text-sm); line-height: 1.15; font-weight: 600; font-variant-numeric: tabular-nums; }
.goal-edit-form { display: grid; gap: 8px; margin-bottom: 10px; }
.ticket-edit-section { min-width: 0; display: grid; gap: .75rem; padding: .875rem 1rem 1rem; border: 1px solid var(--border); border-radius: var(--radius); }
.ticket-edit-section legend { padding-inline: .25rem; font-weight: 600; color: var(--foreground); }
.goal-edit-form label { display: grid; gap: 3px; color: var(--muted); font-size: var(--text-sm); }
.goal-edit-form :is(input, textarea, select) { min-width: 0; width: 100%; }
.ticket-edit-form textarea:not([hidden]) {
  field-sizing: content;
  min-height: 4.5rem;
  line-height: 1.6;
  overflow-y: hidden;
  resize: none;
}
.ticket-edit-form :is(textarea[name="roadmap"], textarea[data-roadmap-field="steps"]):not([hidden]) {
  min-height: 7rem;
}
.goal-edit-form .button--blue-dark:disabled {
  border-color: transparent;
  background: var(--accent-tint);
  color: var(--muted);
  opacity: 1;
}
.goal-edit-form .proposal-actions { justify-content: flex-start; }
.prompt-tools, .comment-actions { display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 10px; }
.prompt-body p { color: var(--foreground); white-space: pre-wrap; }
.prompt-body p + p { margin-top: 6px; }
.goal-search-actions { display: flex; align-items: stretch; gap: .5rem; margin-bottom: 9px; }
.task-source-filter { display: flex; flex: 1; min-width: 0; margin: 0; }
.task-source-filter input { width: 100%; min-width: 0; margin: 0; }
.task-source-status { margin: 0; padding: 10px 0; color: var(--muted); font-size: var(--text-xs); font-variant-numeric: tabular-nums; }
.task-source-footer { display: flex; align-items: center; justify-content: end; min-height: 28px; margin-top: 3px; }
.task-source-pages { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: var(--text-xs); font-variant-numeric: tabular-nums; }

/* ==== Agent Queue panel ==== */
.queue-stage + .queue-stage { border-top: 1px solid var(--border); }
.queue-count, .queue-stage small, .queue-stage p, .queue-claim-line time { color: var(--muted); font-size: var(--text-xs); font-weight: 400; font-variant-numeric: tabular-nums; }
.queue-stage :is(ol, ul) { list-style: none; margin: 0; padding: 0; }
.queue-stage li { min-width: 0; padding: 6px 12px; overflow-wrap: anywhere; }
.queue-stage > p { padding: 9px 12px; }
#queue-next li { position: relative; }
#queue-order { max-height: calc(4 * 33px); overflow-y: auto; scrollbar-width: none; }
#queue-order:focus-visible { outline-offset: -2px; }
#queue-next li:not(:last-child)::after { content: ""; position: absolute; top: 16px; bottom: -16px; left: 22px; width: 1px; background: var(--border); pointer-events: none; }
#queue-next li:has([aria-current="true"]) { background: color-mix(in srgb, var(--accent-tint) 70%, var(--surface)); }
.queue-stage small { display: block; margin-top: 1px; }
.queue-card-link { color: var(--foreground); font-size: var(--text-sm); line-height: 1.35; text-decoration: none; }
.queue-claim-line { display: grid; grid-template-columns: 21px minmax(0, 1fr) auto; align-items: center; gap: 9px; }
.queue-owner { width: 21px; height: 21px; border-radius: 50%; }
.sample-avatar {
  --sample-avatar-lightness: 48%;
  display: block;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: color-mix(in oklab, currentColor 15%, var(--background));
}
[data-theme="dark"] .sample-avatar { --sample-avatar-lightness: 76%; }
#queue-next .queue-card-link { display: grid; grid-template-columns: 21px minmax(0, 1fr); align-items: start; gap: 9px; }
.queue-title { align-self: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-ticket { display: grid; min-width: 0; align-self: center; }
.queue-position { position: relative; z-index: 1; display: grid; place-items: center; width: 21px; height: 21px; border: 1px solid var(--border); border-radius: 50%; background: var(--surface); color: var(--muted); font-size: var(--text-2xs); font-variant-numeric: tabular-nums; font-weight: 500; }
.queue-card-link[aria-current="true"] { color: var(--accent); }
.queue-card-link:is(:hover, :focus-visible) .queue-title { text-decoration: underline; }
#workers li { border-top: 1px solid transparent; }
#workers li + li { border-color: var(--border); }
.agent-queue .queue-copy { border-radius: 0 0 var(--card-radius) var(--card-radius); grid-template-columns: minmax(0, 1fr); gap: 8px; margin: 0; border-top: 1px solid var(--border); }
/* The card is narrow: the helper text takes the full width and the button sits under it. */
.agent-queue .issue-copy { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.agent-queue .issue-copy .button { justify-self: stretch; }
.agent-queue .issue-copy p { margin: 0; font-size: var(--text-xs); line-height: 1.4; text-wrap: wrap; }

/* ==== Ticket reader: layout, stages, prompt, roadmap ==== */
#goal-reading { width: 100%; margin-inline: auto; overflow-wrap: anywhere; }
#goal-reading h1 { font-size: clamp(2rem, 4vw, 2.75rem); font-weight: 600; line-height: 1.14; letter-spacing: -.04em; }
#goal-reading h2 { font-size: 1.125rem; font-weight: 600; letter-spacing: -.012em; }

.ticket-actions { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; font-size: var(--text-base); }
.ticket-page-header { display: grid; justify-items: start; gap: .625rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border); }
.ticket-page-header .question-footer { margin-top: 0; }
.ticket-layout { display: grid; grid-template: "nav document status" auto / minmax(7.5rem, 1fr) minmax(0, 76ch) minmax(9rem, 1fr); gap: clamp(1rem, 2.5vw, 2.5rem); align-items: start; }
.ticket-layout > article { grid-area: document; min-width: 0; }
.ticket-sidebar, .ticket-status { position: sticky; top: 5rem; }
.ticket-sidebar.page-editorial-sidebar { grid-area: nav; display: block; padding: 0; }
.ticket-sidebar nav { position: static; max-height: calc(100vh - 6rem); padding: 0; }
.ticket-status { grid-area: status; }
.ticket-layout .draft-heading:has(> h1) { margin-bottom: 1rem; }
.ticket-actions .ticket-history-link {
  color: var(--muted);
  opacity: .6;
  font: inherit;
  text-decoration: none;
}

.ticket-heading { display: grid; justify-items: start; gap: .5rem; }
.ticket-byline { display: flex; flex-wrap: wrap; align-items: center; gap: .375rem .875rem; max-width: 100%; color: var(--muted); font-size: var(--text-xs); }
.ticket-byline :is(.ticket-opener, .ticket-input) { display: flex; flex-wrap: wrap; align-items: center; gap: .375rem; min-width: 0; }
.ticket-stages { display: grid; margin: 0; padding: 0; list-style: none; }
.ticket-stages li { position: relative; display: flex; align-items: center; gap: .625rem; min-height: 2rem; color: var(--muted); font-size: var(--text-xs); }
.ticket-stages li::before { content: ""; z-index: 1; box-sizing: border-box; width: .7rem; height: .7rem; flex: none; border: 2px solid var(--muted); border-radius: 50%; background: var(--background); }
.ticket-stages li + li::after { content: ""; position: absolute; bottom: 50%; left: .35rem; width: 1px; height: 100%; background: var(--border); }
.ticket-stages :is(.stage-passed, [aria-current="step"])::before { border-color: var(--accent); background: var(--accent); }
.ticket-stages :is(.stage-passed, [aria-current="step"])::after { background: var(--accent); }
.ticket-stages [aria-current="step"] { color: var(--accent); font-weight: 600; }
.ticket-stages [aria-current="step"]::before { outline: 1px solid var(--accent); outline-offset: 2px; }
.ticket-work { display: grid; justify-items: start; gap: .5rem; margin-top: .625rem; color: var(--muted); font-size: var(--text-xs); font-variant-numeric: tabular-nums; }
.ticket-work button { max-width: 100%; white-space: normal; }
@media (max-width: 47.99rem) {
  .ticket-layout { grid-template-areas: "nav status" "document document"; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ticket-sidebar, .ticket-status { position: static; }
  .ticket-status { justify-self: end; }
}
.ticket-page .goal-details { margin-top: 1.5rem; }
.ticket-page .goal-details p { font-size: .9375rem; line-height: 1.65; }
.ticket-page .directions { margin-top: 0; padding-top: 0; border: 0; }
.ticket-page .directions h2 { margin-bottom: .5rem; }
.ticket-layout :is(h1, h2, h3, h4, h5)[tabindex="-1"]:focus, .ticket-progress:focus { outline: none; }
.goal-roadmap .draft-heading { margin-bottom: 1rem; }
.reader-prompt { background: var(--surface-secondary); border: 1px solid var(--border); padding: clamp(.875rem, 2vw, 1.25rem); }
.reader-prompt .draft-heading { margin-bottom: .5rem; }
.reader-prompt .prompt-body p { font-size: .9375rem; line-height: 1.65; }
.reader-roadmap { margin-top: 1.25rem; }
.goal-roadmap > :is(.ticket-results, .goal-details) {
  margin-top: clamp(2rem, 4vw, 3rem);
  border-top: 1px solid var(--border);
  padding-top: clamp(1.25rem, 3vw, 2rem);
}

.roadmap-prose :is(h4, h5) { margin: 0; font-weight: 600; line-height: 1.4; }
.roadmap-prose h3.label-mono { margin: 0; color: var(--accent); font-size: var(--text-xs); line-height: 1.625; }
.roadmap-prose h4 { font-size: 1rem; }
.roadmap-prose h5 { font-size: .9375rem; }
.roadmap-prose > section {
  margin-top: 1rem;
  padding: clamp(.875rem, 2vw, 1.25rem);
  border: 1px solid var(--border);
}
.roadmap-prose > section:has(> h3.label-mono) { padding: 0; border: 0; }
.roadmap-prose > h3.label-mono:not(:first-child),
.roadmap-prose > section:has(> h3.label-mono):not(:first-child) {
  margin-top: 1.25rem;
  padding-top: .875rem;
  border-top: 1px solid var(--border);
}
.roadmap-prose p { margin-block: .5rem; font-size: .9375rem; line-height: 1.65; }
@media (min-width: 48rem) { :is(.roadmap-prose, .reader-prompt .prompt-body) :is(p, li) { text-align: justify; hyphens: auto; } }
.roadmap-prose > section > :last-child { margin-bottom: 0; }
.roadmap-prose pre { overflow-x: auto; margin-block: .75rem; padding: .75rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-secondary); }
.goal-details .draft-empty, .roadmap-dependencies { color: var(--muted); }
.goal-roadmap textarea { width: 100%; min-width: 0; }

/* ==== Ticket Status: checkpoints, submissions, review, activity log ==== */
.ticket-results { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
.result-status-heading { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: .75rem 1.125rem; }
.result-status-state { display: flex; align-items: baseline; flex-wrap: wrap; gap: .375rem .75rem; }
.result-status-state [data-status-context], .result-status-state .result-context { display: contents; }
.result-status-heading :is([data-status-context], [data-status-actions]):empty { display: none; }
.ticket-results .result-status-heading [data-status-actions] { margin-block: 0; }
.ticket-results :is(.result-artifacts, .result-log) {
  list-style: none;
  margin: 1rem 0;
  padding: 0 clamp(.625rem, 1.7vw, 1rem);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.ticket-results :is(.result-artifacts, .result-log) > li:last-child { border-bottom: 0; }
/* Checkpoint rows follow the guide step rows: mono number, title, one state tag,
   and at most one action. Each row shows exactly one state. */
.checkpoint-guide { max-width: 44rem; margin-top: .625rem; line-height: 1.55; }
.checkpoint-list { margin: .75rem 0 1rem; padding: 0; list-style: none; border-top: 1px solid var(--border); }
.checkpoint-row { display: grid; grid-template-columns: 1.75rem minmax(0, 1fr); column-gap: .75rem; padding-block: .75rem; border-bottom: 1px solid var(--border); }
.checkpoint-number { padding-top: .3rem; color: var(--accent); font: 500 var(--text-2xs)/1 var(--mono); letter-spacing: .055em; }
.checkpoint-heading { display: flex; flex-wrap: wrap; align-items: center; gap: .375rem .625rem; }
#goal-reading .checkpoint-heading h3 { flex: 1 1 14rem; margin: 0; color: var(--foreground); font-size: var(--text-base); font-weight: 550; line-height: 1.45; }
.checkpoint-note { display: flex; flex-wrap: wrap; gap: .125rem .75rem; margin-top: .125rem; line-height: 1.5; }
.checkpoint-note a { color: var(--muted); white-space: nowrap; }
.checkpoint-note a:is(:hover, :focus-visible) { color: var(--accent); }
  color: var(--muted); font-size: var(--text-xs); }
/* With nothing after the list, the section's own rule closes it. */
.checkpoint-list:last-child { margin-bottom: 0; }
.checkpoint-list:last-child .checkpoint-row:last-child { border-bottom: 0; }
.checkpoint-row:is([data-state="blocked"], [data-state="accepted"]) h3 { font-weight: 450; }
.checkpoint-row[data-state="blocked"] :is(h3, .checkpoint-number) { color: var(--muted); }
.checkpoint-row .result-artifacts { margin-block: .625rem .125rem; }
.result-verdicts { list-style: none; padding: 0; margin: .625rem 0 0; border-top: 1px solid var(--border); }
.result-verdicts > li { padding-top: .625rem; }
.result-verdicts strong, .result-log-byline strong { font-weight: 500; }
.result-activity summary { width: fit-content; }
.result-context, .result-claimant, .result-meta, .result-log-time { color: var(--muted); font-size: var(--text-xs); }
.contributor.result-artifact {
  grid-template: "icon source claimant state date" minmax(26px, auto)
    "detail detail detail detail detail" auto / 26px minmax(0, 1fr) fit-content(9.5rem) max-content max-content;
  height: auto;
  min-height: 46px;
  padding: .5rem .375rem;
}
.result-artifact .result-source-icon { grid-area: icon; color: var(--muted); width: 16px; height: 16px; justify-self: center; }
.result-artifact > .contributor-task { grid-area: source; overflow: visible; white-space: normal; overflow-wrap: anywhere; font-weight: 560; }
.result-claimant { grid-area: claimant; overflow-wrap: anywhere; }
.result-artifact .result-claimant a { white-space: normal; overflow: visible; }
.result-artifact .contributor-kind { grid-area: state; justify-self: start; }
.result-artifact .contributor-count { grid-area: date; min-width: 0; }
.result-artifact-detail { grid-area: detail; min-width: 0; }
.result-summary { margin-top: .25rem; font-size: var(--text-base); line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (min-width: 48rem) { .ticket-results .result-summary { text-align: justify; } }
.result-log-byline { font-size: var(--text-base); overflow-wrap: anywhere; }
.result-log-time { margin-inline-start: auto; }
.result-meta { overflow-wrap: anywhere; }
@media (max-width: 700px) {
  .contributor.result-artifact {
    grid-template: "icon source state" minmax(26px, auto) "claimant claimant date" auto
      "detail detail detail" auto / 26px minmax(0, 1fr) max-content;
  }
  .result-artifact .contributor-kind { justify-self: end; }
}
.result-review-form { display: grid; gap: .5rem; margin-top: .75rem; }
.result-review-form label { display: grid; gap: .375rem; font-size: var(--text-base); }
.result-review-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.result-evidence-feedback { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; }
.result-evidence-feedback .button { font-size: var(--text-xs); }
.result-evidence-feedback .button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-tint); color: var(--accent); }

/* ==== Ticket history and revision comparison ==== */
.ticket-history { width: 100%; border-collapse: collapse; margin-block: .5rem .75rem; font-size: var(--text-base); line-height: 1.35; }
.ticket-history :is(th, td), .result-log > li { text-align: start; padding: .625rem .375rem; border-bottom: 1px solid var(--border); }
.ticket-history :is(th, td) { padding-block: .25rem; }
.ticket-history th { color: var(--muted); font-size: var(--text-xs); font-weight: 500; }
.ticket-history .history-radio { width: 1%; text-align: center; white-space: nowrap; }
.history-radio input { margin: 0; accent-color: var(--accent); vertical-align: middle; }
.history-radio input:not(:disabled) { cursor: pointer; }
.goal-inline-history { width: 100%; min-width: 0; margin: 0; padding-top: .5rem; font-size: var(--text-xs); line-height: 1.45; cursor: auto; }
.goal-inline-history [data-inline-history-heading] { margin: 0 0 .25rem; font-size: var(--text-base); font-weight: 600; line-height: inherit; }
.goal-inline-history :is(.ticket-history, .history-caption) { font-size: inherit; }
.goal-inline-history :is(.history-version-link, .history-current) { font-weight: 400; }
.history-entry, .history-caption { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .75rem; }
.history-entry + .history-entry, .history-caption { margin-top: .375rem; font-size: var(--text-base); }
.history-entry time, .history-caption time { color: var(--muted); }
.ticket-history .history-entry { align-items: center; gap: .125rem .5rem; }
.history-author a { color: inherit; text-decoration: none; }
.history-author a:is(:hover, :focus-visible) { text-decoration: underline; }
.history-version-link { color: var(--foreground); font-family: var(--font-sans); text-decoration: none; text-underline-offset: 2px; }
.history-version-link:is(:hover, :focus-visible) { text-decoration-line: underline; }
.ticket-history .history-summary { margin-top: .125rem; color: var(--muted); font-size: var(--text-xs); }
.history-current { color: var(--foreground); font-weight: 550; }
.revision-fields { margin: .75rem 0; }
.revision-fields dt { margin-block-start: .75rem; font-size: var(--text-xs); font-weight: 600; }
.revision-fields dd { margin: .25rem 0 .625rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.revision-fields dd:has(.revision-context, ins, del) { white-space: normal; }
.revision-fields :is(.revision-added, .revision-removed, .revision-context) { margin-block: .375rem; }
.revision-fields :is(.revision-added, .revision-removed) { padding: .375rem .625rem; border-inline-start: 2px solid var(--border); }
.revision-fields .revision-added { border-color: var(--accent); background: var(--accent-tint); }
.revision-fields :is(ins, del, .revision-context p) { display: block; white-space: pre-wrap; }
.revision-fields ins { text-decoration: none; }
.revision-fields :is(.revision-added, .revision-removed) > span, .revision-context summary { color: var(--muted); font-size: var(--text-xs); }
.revision-context p { margin-block: .375rem; padding-inline-start: .625rem; }

/* ==== Discussion ==== */
.directions { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.directions > summary { width: fit-content; font-size: var(--text-sm); font-weight: 580; cursor: pointer; }
.direction-list { list-style: none; padding: 0; margin: 0; }
:is(#goal-workspace, #goal-reading) .direction-row { display: flex; align-items: start; gap: .75rem; padding: .875rem 0; margin: 0; background: transparent; font-size: var(--text-base); }
.direction-list > .direction-row + .direction-row { border-top: 1px solid var(--border); }
.comment-reply { display: inline-grid; place-items: center; width: 24px; min-height: 24px; color: inherit; }
.comment-reply:disabled { color: inherit; cursor: default; }
.reply-reference { justify-self: start; max-width: 100%; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: start; color: var(--muted); font-size: var(--text-xs); font-weight: 400; }
.goal-details .deleted-comment { color: var(--muted); }
.comment-time-reaction { display: inline-flex; flex-wrap: wrap; align-items: center; column-gap: .5rem; }
.comment-like { display: inline-flex; align-items: center; gap: .25rem; min-height: 24px; color: inherit; font: inherit; font-variant-numeric: tabular-nums; }
.comment-like svg { fill: none; }
.comment-like[aria-pressed="true"] svg { fill: currentColor; }
.comment-like:disabled { color: inherit; opacity: 1; cursor: default; }
.direction-comment { display: grid; flex: 1; min-width: 0; gap: 2px; }
.comment-byline { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 8px; color: var(--muted); font-size: var(--text-xs); }
.arena-profile, .arena-profile a, .goal-details .arena-profile { display: inline-flex; align-items: baseline; gap: 5px; max-width: 100%; color: var(--muted); font-size: var(--text-sm); line-height: 1.3; text-decoration: none; overflow-wrap: anywhere; }
a.arena-profile:hover, .arena-profile a:hover { text-decoration: underline; }
.direction-comment .comment-byline :is(.arena-profile, time, .comment-like) { font: inherit; letter-spacing: inherit; }
.arena-profile img { display: block; flex: 0 0 20px; width: 20px; height: 20px; border-radius: 50%; object-fit: cover; }
.goal-details .direction-text { flex: 1; min-width: 0; color: var(--foreground); overflow-wrap: anywhere; white-space: pre-wrap; }
.direction-delete { flex-shrink: 0; padding-inline: 4px; color: var(--muted); }
.direction-form { display: flex; align-items: flex-start; gap: 7px; margin-top: 7px; }
.direction-form textarea { min-width: 0; flex: 1; }
.direction-compose { display: grid; grid-template-columns: minmax(0, 1fr); gap: .5rem; }
.direction-compose textarea, .reply-compose textarea { width: 100%; }
.direction-form.reply-compose { display: grid; }
.reply-actions { display: flex; align-items: center; justify-content: end; gap: .75rem; }
.direction-compose .button { justify-self: end; }
.goal-details .discussion-notice { margin: 0; color: var(--muted); font-size: var(--text-xs); }
 .direction-comment { scroll-margin-top: 5rem; }

/* ==== GitHub-linked issue panel ==== */
.task-byline { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 18px; margin-top: 9px; border-top: 1px solid var(--border); padding-top: 7px; color: var(--muted); font-size: var(--text-xs); }
.task-byline > div:not([hidden]) { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; }
.issue-task-byline { margin-top: 0; border-top: 0; padding: 0 0 8px; }
.issue-task-byline:not(:has(> div:not([hidden]))) { display: none; }
.issue-actions { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px clamp(8px, 2vw, 15px); margin-top: 7px; }
.issue-actions .text-button { display: inline-grid; place-items: center; min-height: 24px; line-height: 1; color: var(--muted); font-size: var(--text-xs); font-weight: 400; font-variant-numeric: tabular-nums; }
.issue-actions .issue-context-note { margin: 0; }
.issue-actions .issue-read-button { display: inline; min-height: 0; font-size: inherit; line-height: inherit; text-decoration: underline; }
.issue-actions .issue-read-button,
.issue-actions .text-button:is(:hover, :focus-visible), .issue-actions [aria-expanded="true"] { color: var(--accent); }
.issue-body { border-top: 1px solid var(--border); padding-top: 7px; }
.issue-prompt-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; }
.prompt-actions { display: flex; align-items: center; gap: 12px; }
.prompt-actions .text-button { font-size: var(--text-xs); }
.issue-panel:empty { display: none; }
.issue-panel { display: grid; gap: 5px; margin: 9px 0 0; min-width: 0; color: var(--muted); font-size: var(--text-xs); }
:is(.issue-panel, .prompt-revisions) summary { width: fit-content; }
.issue-thread, .issue-composer, .issue-revisions { margin-inline-start: clamp(10px, 1.4vw, 20px); }
.issue-revisions { display: grid; gap: 9px; }
.prompt-revisions { margin-top: 8px; }
.prompt-revisions > summary { color: var(--accent); font-size: var(--text-xs); }
.prompt-revisions ol { list-style: none; padding: 0; margin: 6px 0 0 12px; }
.prompt-revisions li { padding: 7px 0; border-top: 1px solid var(--border); color: var(--muted); font-size: var(--text-xs); }
.prompt-revisions li span { margin-inline-start: 7px; }
.prompt-revisions .issue-comment-body { margin-inline-start: 0; }
.prompt-discussion { margin: 9px 0 0; }
.prompt-discussion .issue-comment-body p, .prompt-revisions .issue-comment-body p { white-space: normal; }
.issue-full { border-top: 1px solid var(--border); padding: 8px 0 0; }
.issue-full .issue-revision-body { margin-inline-start: 12px; }
.issue-revision { border-top: 1px solid var(--border); }
.issue-panel .issue-revision > summary { width: auto; min-height: 32px; padding-block: 4px; gap: 8px; }
.issue-revision > summary :is(strong, span) { color: var(--foreground); }
.issue-revision > summary time { margin-inline-start: auto; text-align: end; }
.issue-revision .issue-revision-body { margin: 0 0 10px 13px; }
.issue-revision-body h4 { font-size: var(--text-base); overflow-wrap: anywhere; }
.issue-revision-link { margin-top: 5px; }
.issue-thread > ul { list-style: none; padding: 0; margin: 4px 0 0; }
.issue-thread > ul > li { border-top: 1px solid var(--border); padding: 12px 0; }
.issue-thread .comment-byline { align-items: center; gap: 4px 10px; }
.issue-thread .arena-profile { color: var(--foreground); font-weight: 600; }
.issue-thread .comment-date { color: var(--muted); text-decoration: none; }
.issue-thread .comment-date:hover { text-decoration: underline; }
.issue-thread .comment-follow-up { margin-inline-start: auto; color: var(--muted); font-size: var(--text-xs); font-weight: 400; }
.issue-comment-body { color: var(--foreground); overflow-wrap: anywhere; margin: 6px 0 0 25px; }
.goal-details .issue-comment-body :is(p, li, blockquote) { color: var(--foreground); font-size: var(--text-base); line-height: 1.55; }
.issue-thread > ul > li > .issue-history { margin: 4px 0 0 25px; }
.issue-comment-body > * + * { margin-top: 8px; }
.issue-comment-body :is(ul, ol) { padding-inline-start: 22px; }
.issue-comment-body code { background: var(--surface-secondary); }
:is(.issue-panel, .issue-full) .issue-comment-body pre { line-height: 1.5; white-space: pre; overflow-x: auto; overflow-wrap: normal; }
.issue-comment-body blockquote { border-inline-start: 2px solid var(--border); padding-inline-start: 10px; color: var(--muted); }
.issue-history details { margin-inline-start: 12px; }
:is(.issue-panel, .issue-full) pre { margin-top: 4px; padding: 8px; max-width: 100%; border-radius: var(--radius); background: var(--surface-secondary); white-space: pre-wrap; overflow-wrap: anywhere; }
.issue-editor { display: grid; gap: 9px; margin-top: 4px; }
.issue-editor-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 12px; }
.issue-editor-footer .prompt-tools { justify-content: end; margin-inline-start: auto; }
.issue-editor .issue-feedback { color: var(--muted); font-size: var(--text-xs); }
.issue-editor .button:disabled { border-color: var(--border); background: var(--surface-secondary); color: var(--muted); cursor: default; }
.issue-editor label { display: grid; gap: 6px; color: var(--foreground); font-size: var(--text-sm); font-weight: 550; }
.issue-editor textarea { width: 100%; min-width: 0; resize: vertical; font-size: var(--text-base); font-weight: 400; line-height: 1.5; }
.issue-composer { border-top: 1px solid var(--border); padding-top: 12px; }
.issue-editor .issue-feedback:empty { display: none; }
.upvote-avatars { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.arena-avatar, .arena-avatar img { display: block; width: 20px; height: 20px; border-radius: 50%; }
.arena-avatar img { object-fit: cover; }
.task-byline + .directions { margin-top: 9px; padding-top: 0; border-top: 0; }

/* ==== Activity: timeline, Globe adjustments, Recent Contributions ==== */
.timeline-heading { display: flex; align-items: center; gap: 6px; font-size: var(--text-xs); }
.timeline-heading label { color: var(--muted); }
.timeline-heading output { font-weight: 640; }
.timeline-heading button { margin-left: auto; }
.timeline-range { margin-top: 7px; }
.timeline-range input { appearance: none; width: 100%; height: 14px; margin: 0; display: block; border: 0; padding: 0; background: transparent; cursor: ew-resize; }
.timeline-range input:focus-visible { outline: none; }
.timeline-range input::-webkit-slider-runnable-track { height: 3px; background: linear-gradient(to right, var(--accent) 0 var(--position, 0%), var(--border) var(--position, 0%) 100%); }
.timeline-range input::-moz-range-track { height: 3px; background: linear-gradient(to right, var(--accent) 0 var(--position, 0%), var(--border) var(--position, 0%) 100%); }
.timeline-range input::-webkit-slider-thumb { appearance: none; width: 12px; height: 12px; margin-top: -4.5px; border: 0; border-radius: 50%; background: var(--accent); }
.timeline-range input::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: var(--accent); }
.timeline-range input:focus-visible::-webkit-slider-thumb { box-shadow: inset 0 0 0 2px var(--foreground); }
.timeline-range input:focus-visible::-moz-range-thumb { box-shadow: inset 0 0 0 2px var(--foreground); }
.timeline-ticks { height: 14px; display: flex; align-items: end; gap: 2px; padding: 0 7px; pointer-events: none; }
.timeline-ticks i, .contributor-spark > i { flex: 1; background: color-mix(in srgb, var(--accent) 47%, var(--surface)); border-radius: 2px 2px 0 0; }
.timeline-ticks i { height: var(--tick); }
.timeline-ticks i.future { background: color-mix(in srgb, var(--muted) 28%, var(--surface)); }
.timeline-ticks i.partial { background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 47%, var(--surface)) 50%, color-mix(in srgb, var(--muted) 28%, var(--surface)) 50%); }
.timeline-control { padding: 10px 12px 8px; margin-bottom: 13px; }
.timeline-heading select { margin-right: 7px; }
/* Hold the globe's height while it loads, so the panels below it don't jump. */
.literal-globe-mount { min-width: 0; min-height: calc(clamp(30rem, 69svh, 52rem) + 6.1rem); }
@media (min-width: 768px) {
  #globe-plot div:has(> aside[aria-label="Physlib Globe information"]) {
    grid-template-columns: clamp(16.5rem, 22%, 17.5rem) minmax(0, 1fr);
  }
}
#globe-plot aside[aria-label="Physlib Globe information"] dl > div { display: flex; justify-content: space-between; align-items: baseline; column-gap: .5rem; }
#globe-plot aside[aria-label="Physlib Globe information"] dd { margin-inline-start: 0; }
#globe-plot aside[aria-label="Physlib Globe information"] h2[title$=".lean"] { text-wrap: wrap; }
#globe-plot :is(a[data-context-action], aside a[href*="/api-maps"]) { color: var(--accent); }
.merged-work { margin-top: 12px; }
.contributor-list { margin: 0; padding: 0 12px; list-style: none; }
.contributor { display: grid; grid-template-columns: 26px minmax(6rem, 15%) minmax(0, 1fr) clamp(6.75rem, 12vw, 9.5rem) 8.25rem 4.8rem; align-items: center; gap: 3px 9px; min-width: 0; height: 46px; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: var(--text-sm); }
.contributor:last-child { border-bottom: 0; }
.contributor img { width: 26px; height: 26px; border-radius: 50%; background: var(--surface-secondary); flex-shrink: 0; }
.contributor .contributor-name, .contributor-task { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contributor .contributor-name { color: var(--muted); text-decoration: none; }
.contributor a.contributor-name:hover, .contributor a.contributor-name:focus-visible { text-decoration: underline; }
.contributor-task { grid-column: 3; color: var(--muted); }
a.contributor-task { color: var(--accent); }
.contributor-metrics { grid-column: 4; display: grid; grid-template-columns: minmax(0, 1fr) 5.15rem; align-items: end; gap: 7px; min-width: 0; }
.contributor-spark { display: flex; align-items: end; gap: 1px; min-width: 0; height: 20px; }
.contributor-spark > i { min-width: 0; height: max(3px, var(--activity)); background: color-mix(in srgb, var(--muted) 54%, var(--surface)); }
.contributor-spark > i.idle { height: 2px; background: color-mix(in srgb, var(--muted) 18%, var(--surface)); }
.contributor-additions { display: grid; justify-items: end; line-height: 1.15; font-variant-numeric: tabular-nums; white-space: nowrap; }
.contributor-total { color: var(--muted); font-size: var(--text-base); font-weight: 400; }
.contributor-delta { color: var(--accent); font-size: var(--text-2xs); font-weight: 400; }
.contributor-kind { grid-column: 5; justify-self: end; }
.contributor-pr-kind { display: inline-flex; align-items: center; justify-content: center; width: 5.5rem; height: 23px; text-align: center; }
.contributor-count { grid-column: 6; color: var(--muted); min-width: 4.8em; text-align: end; white-space: nowrap; font-size: var(--text-xs); }
.contributor .sample-avatar { width: 26px; height: 26px; }
.contributor-footer { display: flex; align-items: center; justify-content: end; gap: 8px; padding: 8px 12px; color: var(--muted); font-size: var(--text-xs); font-variant-numeric: tabular-nums; }

/* ==== Add your agent picker ==== */
.issue-picker { display: grid; grid-template-columns: minmax(13rem, 26%) minmax(0, 1fr); align-items: start; gap: 12px 24px; margin-top: 12px; padding: 14px; background: var(--surface-secondary); }
.issue-picker p { margin-top: 3px; color: var(--muted); font-size: var(--text-sm); }
.issue-picker-form { display: grid; gap: 8px; min-width: 0; }
.issue-picker select { min-width: 0; width: 100%; min-height: 34px; }
.issue-copy { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.issue-copy input { min-width: 0; flex: 1 1 200px; height: 34px; font-family: var(--mono); font-size: var(--text-2xs); }
.issue-picker-form p { margin: 0; font-size: var(--text-xs); }
.issue-picker-form p:empty { display: none; }
.agent-guide-link { white-space: nowrap; }
.agent-choice { position: relative; min-width: 0; }
.agent-choice-trigger, .agent-choice-option { display: flex; width: 100%; align-items: center; gap: 9px; min-height: 34px; padding: 5px 8px; color: var(--foreground); background: var(--surface); text-align: left; font-size: var(--text-sm); }
.agent-choice-trigger { border: 1px solid var(--border); border-radius: var(--radius); }
.agent-choice-trigger .site-chevron { color: var(--muted); }
.agent-choice-list { position: absolute; inset: calc(100% + 4px) 0 auto; z-index: 12; max-height: min(17rem, 50vh); margin: 0; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-popover); }
.agent-choice-option { border: 0; cursor: pointer; }
.agent-choice-option[aria-selected="true"], .agent-choice-option:hover { background: var(--surface-secondary); }
.agent-choice-option:focus-visible { outline-offset: -2px; }
.agent-choice-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-choice-count { color: var(--muted); white-space: nowrap; font-size: var(--text-xs); font-variant-numeric: tabular-nums; }

/* ==== Dialogs, forms, toast ==== */
dialog { width: min(540px, calc(100% - 24px)); max-height: calc(100% - 32px); color: var(--foreground); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; overflow: auto; }
dialog::backdrop { background: rgb(0 0 0 / .38); }
dialog h2 { font-size: 22px; letter-spacing: -.04em; }
dialog p { color: var(--muted); font-size: var(--text-sm); margin: 7px 0; }
#access-dialog { width: min(24rem, calc(100% - 2rem)); padding: 1.5rem; }
#access-dialog .dialog-heading { min-height: 2rem; }
#access-dialog [data-action="close-access"] { display: grid; place-items: center; width: 2rem; min-height: 2rem; color: var(--muted); }
#access-dialog #access-description { margin: .5rem 0 1.25rem; font-size: var(--text-base); line-height: 1.55; }
#github-sign-in { width: 100%; min-height: 44px; padding: 10px 16px; font-size: var(--text-base); }
dialog label { display: block; margin-top: 8px; font-size: var(--text-sm); }
dialog input, dialog textarea, dialog select { display: block; width: 100%; margin-top: 4px; }
.form-note { min-height: 16px; }
.proposal-actions { display: flex; flex-wrap: wrap; justify-content: end; gap: 8px; }
#proposal-form > :is(.proposal-actions, .proposal-facet, #proposal-description-label) { margin-top: .875rem; }
.proposal-facet, .proposal-follow-up { min-width: 0; margin-inline: 0; padding: 0; border: 0; }
.proposal-facet legend { padding: 0; margin-bottom: .375rem; font-size: var(--text-sm); }
.proposal-facet .proposal-chip { position: relative; display: block; margin: 0; cursor: pointer; }
.proposal-chip input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  clip-path: inset(50%);
}
#worker-brief { margin-bottom: 8px; font: 12px/1.45 var(--mono); }
.toast { position: fixed; right: 14px; bottom: 14px; z-index: 2; max-width: calc(100% - 28px); padding: 8px 12px; font-size: var(--text-sm); background: var(--toast-bg); color: var(--toast-fg); border-radius: var(--radius); }
.toast:empty { padding: 0; }

/* ==== Responsive overrides. Keep these after the component sections. ==== */
@media (max-width: 600px) {
  #goal-workspace { --goal-vote-width: 2.75rem; --goal-column-gap: .75rem; }
  #goal-workspace .goal-row { padding-block: 1.125rem; }
  #goal-workspace .goal-vote .vote-button { width: 2.75rem; min-height: 2.75rem; }
  #goal-workspace .goal-details { margin-inline: 0; }
  #goal-workspace .goal h3 { font-size: 1rem; }
}
@media (max-width: 700px) {
  body { --arena-page-start: 25px; }
}
@media (max-width: 420px) {
  .arena-intro p { font-size: var(--text-base); }
  .direction-form { flex-direction: column; }
  .direction-form textarea { align-self: stretch; }
  .direction-form .button { align-self: start; }
  .timeline-heading { flex-wrap: wrap; }
}
@media (max-width: 38rem) {
  html { scroll-padding-top: 98px; }
  .arena-header-inner { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 0 6px; padding-top: 7px; }
  .arena-wordmark { grid-area: 1 / 1; }
  .arena-header-auth { grid-area: 1 / 2; justify-self: end; max-width: min(45vw, 9rem); }
  .arena-header-links { grid-area: 2 / 1 / 3 / -1; justify-self: start; }
  .arena-theme { grid-area: 1 / 3; justify-self: end; }
}
@media (max-width: 23.5rem) {
  .arena-header-auth { max-width: 6.25rem; }
}
@media (max-width: 22rem) {
  .arena-header-inner { padding-inline: .75rem; }
  #arena-splash { padding-inline: .75rem; }
}
@media (max-width: 700px) {
  .workspace-columns { grid-template-columns: 1fr; gap: 12px; }
  .contributor { grid-template-columns: 26px minmax(0, 1fr) auto 4.8rem; grid-template-rows: 26px 18px 26px; height: 89px; }
  .contributor-task { grid-column: 2 / -1; grid-row: 2; }
  .contributor-metrics { grid-column: 2 / -1; grid-row: 3; width: min(100%, 9.5rem); justify-self: end; }
  .contributor-spark { height: 15px; }
  .contributor-kind { grid-column: 3; grid-row: 1; }
  .contributor-count { grid-column: 4; grid-row: 1; }
  .issue-picker { grid-template-columns: minmax(0, 1fr); }
}

/* ==== Roadmap text: inline code and the Output / Check lines of a step ==== */
.roadmap-line-label { color: var(--muted); font-size: var(--text-xs); font-weight: 600; letter-spacing: .02em; }
.roadmap-prose :is(p, li) code { padding: .05em .3em; border-radius: 4px; background: var(--surface-secondary); font-size: .9em; overflow-wrap: anywhere; }
.roadmap-prose ul { margin-block: .5rem; padding-inline-start: 1.2rem; font-size: .9375rem; line-height: 1.65; }
/* A name with its avatar sits on the text baseline of the sentence around it; the avatar centres on the name. */
.arena-profile :is(img, svg, .identicon) { align-self: center; }
/* Activity is a quiet dropdown inside Status, not a panel of its own. */
.result-activity { margin-block: 1rem .25rem; }
.result-activity summary { color: var(--muted); font-size: var(--text-xs); }
.ticket-results .result-activity .result-log { margin: .5rem 0 0; padding: 0; border: 0; border-radius: 0; }
.ticket-results .result-activity .result-log > li { padding-inline: 0; }
.result-activity .result-log-byline { font-size: var(--text-sm); }
.change-review[data-review="danger"] a { color: var(--danger, #b42318); }

/* Signed out, the proposal form is shown but can't be filled in: the button says what is needed. */
#proposal-form[data-locked] > :not(.proposal-actions, #proposal-status) { opacity: .45; }
:is(p, #x).sign-in-note { margin: 0 auto 0 0; color: var(--muted); font-size: var(--text-xs); line-height: 1.4; text-align: start; }
.sign-in-note .text-button { padding: 0; color: var(--accent); font: inherit; text-decoration: underline; }
.proposal-actions { align-items: center; }
.direction-compose:has(.sign-in-note) { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.direction-compose:has(.sign-in-note) textarea { grid-column: 1 / -1; opacity: .45; }
.direction-compose p.sign-in-note { margin: 0; font-size: var(--text-xs); }
button.ticket-history-link { padding: 0; border: 0; background: none; cursor: pointer; }
.ticket-actions .ticket-history-link:is(:hover, :focus-visible) { opacity: 1; }

/* Frontier Guide diagrams (arena-guides.js). Colours come from the theme, so they follow light and dark. */
.guide-diagram { margin: 1.5rem 0; padding: 1.25rem; border: 1px solid var(--border); border-radius: var(--card-radius); background: var(--surface); overflow-x: auto; }
.guide-diagram svg { display: block; width: 100%; min-width: 34rem; height: auto; font-family: var(--font-sans); }
.guide-diagram text { fill: var(--muted); font-size: 12.5px; text-anchor: middle; }
.guide-diagram .diagram-title { fill: var(--foreground); font-size: 14px; font-weight: 600; }
.guide-diagram .diagram-label { fill: var(--foreground); font-size: 12px; }
.guide-diagram .diagram-label[text-anchor="start"] { text-anchor: start; }
.guide-diagram .diagram-group { fill: none; stroke: var(--muted); stroke-dasharray: 4 4; opacity: .6; }
.guide-diagram .diagram-group-label { fill: var(--muted); font: 500 11px var(--mono); text-anchor: start; }
.guide-diagram .diagram-arrow { fill: none; stroke: var(--muted); stroke-width: 1.4; }
.guide-diagram .diagram-arrow--dashed { stroke-dasharray: 4 4; }
.guide-diagram marker path { fill: var(--muted); }
.diagram-box rect { fill: var(--surface-secondary); stroke: var(--border); stroke-width: 1.2; }
.diagram-box--code rect { fill: color-mix(in srgb, var(--warning) 10%, var(--surface)); stroke: color-mix(in srgb, var(--warning) 55%, transparent); }
.diagram-box--trusted rect { fill: var(--accent-tint); stroke: color-mix(in srgb, var(--accent) 55%, transparent); }
.diagram-box--pass rect { fill: color-mix(in srgb, var(--success) 12%, var(--surface)); stroke: var(--success); }
.diagram-box--stop rect { fill: color-mix(in srgb, var(--danger) 9%, var(--surface)); stroke: color-mix(in srgb, var(--danger) 60%, transparent); }
.arena-guide .prose-physlib .diagram-legend { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin: 1rem 0 0; padding: 0; list-style: none; color: var(--muted); font-size: var(--text-xs); }
.diagram-key { display: flex; align-items: center; gap: .45rem; margin: 0; }
.diagram-key::before { content: ""; width: .8rem; height: .8rem; border-radius: 3px; border: 1px solid; }
.diagram-key--code::before { background: color-mix(in srgb, var(--warning) 10%, var(--surface)); border-color: color-mix(in srgb, var(--warning) 55%, transparent); }
.diagram-key--trusted::before { background: var(--accent-tint); border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.proposal-help { margin: .5rem 0 0; color: var(--muted); font-size: var(--text-xs); line-height: 1.5; }
.activity-sort { display: flex; align-items: center; gap: .4rem; color: var(--muted); font-size: var(--text-xs); white-space: nowrap; }
.activity-sort select { font: inherit; color: var(--foreground); }
.result-endorsements { color: var(--muted); font-size: var(--text-xs); white-space: nowrap; }
