/* Member workspace: the same research-desk voice as the rest of the site.
   Newsreader carries headings and figures, Inter carries prose and controls,
   and hairlines separate things instead of tinted boxes and pills. */
.ws-page {
  --panel-x: clamp(1.25rem, 2.5vw, 1.75rem);
  --rule: rgba(26,36,32,0.14);
}
.ws-page ::selection { background: var(--green-mist); color: var(--charcoal); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.ws-page h3 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--charcoal);
}
.ws-page h3 + .muted { margin-top: 0.35rem; }

/* Text actions: an underlined word, not another boxed button. */
.ws-link {
  padding: 0;
  background: none;
  border: 0;
  font: 500 var(--text-sm)/1.5 var(--font);
  color: var(--green-deep);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  cursor: pointer;
  transition: color var(--trs);
}
.ws-link:hover { color: var(--charcoal); }
.ws-link:disabled { opacity: 0.45; cursor: wait; }
.ws-link--light { color: rgba(255,255,255,0.85); }
.ws-link--light:hover { color: var(--white); }

/* ---- The forest band ---- */
.ws-hero { padding: 2.75rem 0 2.25rem; }
.ws-hero .section-headline { margin-bottom: 0; }
.ws-identity { align-items: baseline; margin-top: 1.5rem; padding-top: 1.25rem; }
#accEmail { font-size: var(--text-md); }
.tier-badge, .tier-badge.none {
  padding: 0;
  border: 0;
  border-radius: 0;
  font-size: var(--text-sm);
  font-weight: 300;
  letter-spacing: 0;
  text-transform: none;
  color: rgba(255,255,255,0.62);
}
.ws-role { color: rgba(255,255,255,0.62); }
.ws-role:not(:empty)::before { content: '·'; margin-right: 0.75rem; }
.usage-grid { gap: 1.25rem 3rem; margin-top: 1.25rem; padding-top: 1.25rem; }
.usage-grid:empty { display: none; }
.usage-stat .val { font-size: 1.75rem; }
.usage-stat .lbl {
  max-width: 22ch;
  margin-top: 0.4rem;
  font-size: var(--text-sm);
  font-weight: 300;
  line-height: 1.5;
  letter-spacing: 0;
  text-transform: none;
  color: rgba(255,255,255,0.62);
}
.usage-stat .ws-link { margin-top: 0.3rem; }

/* ---- What blocks the next step ---- */
.ws-body { padding-top: 2.25rem; }
.workspace-due { list-style: none; margin: 0 0 2.5rem; padding: 0; border-top: 1px solid var(--gold); }
.workspace-due li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 2rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--rule);
}
.workspace-due h2 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--charcoal);
}
.workspace-due p { margin-top: 0.3rem; max-width: 70ch; font-size: var(--text-sm); font-weight: 300; line-height: 1.65; color: var(--ws-muted); }
.workspace-due .btn { grid-column: 2; grid-row: 1 / span 2; }

/* ---- Tabs ---- */
.workspace-tabs {
  position: relative;
  display: flex;
  gap: 2rem;
  margin-bottom: 2.25rem;
  overflow-x: auto;
  scrollbar-width: none;
  box-shadow: inset 0 -1px 0 var(--rule);
}
.workspace-tabs::-webkit-scrollbar { display: none; }
.workspace-tabs [role=tab] {
  flex: none;
  padding: 0.85rem 0 0.75rem;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  font: 500 var(--text-sm)/1.4 var(--font);
  color: var(--ws-muted);
  white-space: nowrap;
  cursor: pointer;
  transition: color var(--trs), border-color var(--trs);
}
.workspace-tabs [role=tab]:hover { color: var(--charcoal); }
.workspace-tabs [aria-selected=true] { color: var(--charcoal); border-bottom-color: var(--forest); }
.workspace-tabs [role=tab]:focus-visible { outline-offset: -2px; }
#reviewTabBadge { display: inline-block; width: 6px; height: 6px; margin-left: 0.45rem; vertical-align: 0.15em; border-radius: 50%; background: var(--gold); }

[role=tabpanel] { min-width: 0; }
[role=tabpanel]:focus-visible { outline-offset: 8px; }
[role=tabpanel] > .ws-section:first-child > .ws-section-head { border-top: 0; padding-top: 0; }
.workspace-intro, .workspace-buy > .sub {
  max-width: 70ch;
  margin-bottom: 1.5rem;
  font-size: var(--text-sm);
  font-weight: 300;
  line-height: 1.75;
  color: var(--ws-muted);
}

/* ---- Panels and tables: square corners, hairlines, no lift ---- */
.ws-page .ws-panel { border-color: var(--rule); border-radius: var(--r-sm); box-shadow: none; padding: var(--panel-x); }
.ws-page .ws-panel--flush { padding: 0.25rem 0; }
.ws-page .input, .ws-page .notice, .ws-page .review-open, .ws-page .plan { border-radius: var(--r-sm); }
.ws-page .reports-table :is(th, td):first-child { padding-left: var(--panel-x); }
.ws-page .reports-table :is(th, td):last-child { padding-right: var(--panel-x); }
.workspace-loading { color: var(--ws-muted); }
.workspace-pending-target td, .workspace-pending-target:hover td { background: var(--gold-faint); }

.workspace-report-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 0.5rem; }
.workspace-row-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.15rem 1rem; }
.workspace-row-actions .ws-link { font-size: 0.8125rem; white-space: nowrap; }

/* ---- Your reports ---- */
.workspace-help { margin-top: 0.75rem; }
.workspace-help > summary, .workspace-buy > summary { list-style: none; cursor: pointer; }
.workspace-help > summary::-webkit-details-marker, .workspace-buy > summary::-webkit-details-marker { display: none; }
.workspace-help > summary { width: fit-content; font-size: var(--text-sm); font-weight: 500; color: var(--green-deep); }
.workspace-help > summary::before { content: '+ '; }
.workspace-help[open] > summary::before { content: '– '; }
.workspace-help ol { margin: 0.75rem 0 0 1.2rem; padding: 0; }
.workspace-help li + li { margin-top: 0.35rem; }
/* Below the report list: starting a new one, and publishing the one that is due. */
.workspace-block { display: flex; flex-direction: column; gap: 1rem; padding: 1.5rem var(--panel-x) calc(var(--panel-x) - 0.25rem); border-top: 1px solid var(--rule); }
.workspace-block:not(:has(> :not([hidden], :empty))) { display: none; }
.workspace-block > :empty { display: none; }
.workspace-block > h3 + .muted, #genStatus + .workspace-commit { margin-top: -0.65rem; max-width: 70ch; }
.workspace-commit { font-size: var(--text-sm); line-height: 1.65; color: var(--gold-ink); }

.workspace-buy { border-top: 1px solid var(--ws-hairline); padding-top: 1.1rem; }
.workspace-buy > summary {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.15;
  color: var(--charcoal);
}
.workspace-buy > summary::after { content: '+'; font: 300 var(--text-xl)/1 var(--font); color: var(--ws-muted); }
.workspace-buy[open] > summary::after { content: '–'; }
.workspace-buy > .sub { margin-top: 0.5rem; }
#buyGenPrice { margin-top: 1rem; }

/* ---- Analyst reports ---- */
.workspace-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1rem 2rem; margin-bottom: 1.25rem; }
.workspace-toolbar > .form-row { flex: 1 1 400px; }
.workspace-toolbar .field { flex: 0 1 220px; }
#myReviewsPanel { margin-bottom: 1.25rem; }
#myReviewsPanel > .muted { margin-bottom: 1rem; }
.ws-page .review-open { margin: 0 0 1.25rem; }
.review-open h3 { color: var(--gold-ink); }
.workspace-review-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0 0.5rem; }
.review-open .workspace-help { margin-top: 0.75rem; }
#reviewPromptsText { max-height: 18rem; margin-top: 0.5rem; overflow: auto; white-space: pre-wrap; font: 300 var(--text-sm)/1.7 var(--font); color: var(--charcoal); }
.review-open .form-row { margin-top: 1.25rem; }

/* ---- Income ---- */
.ws-page .earn-grid { padding-bottom: 1.5rem; margin-bottom: 1.25rem; border-bottom: 1px solid var(--rule); }
.ws-page .earn-stat .lbl { font-size: var(--text-sm); font-weight: 300; letter-spacing: 0; text-transform: none; }

/* ---- Account ---- */
.workspace-coverage { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; margin-bottom: 0.75rem; }
.workspace-profile { list-style: none; margin: 0; padding: 0; }
.workspace-profile li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 1rem; padding: 0.75rem 0; border-bottom: 1px solid var(--ws-hairline); }
.workspace-profile li:first-child { padding-top: 0; }

#notice:not(:empty) { position: sticky; top: calc(var(--nav-h) + 0.5rem); z-index: 6; box-shadow: var(--shadow-sm); }
#notice:empty { display: none; }
.ws-page .btn:disabled { cursor: wait; }

@media (max-width: 700px) {
  .ws-hero { padding: 2rem 0 1.75rem; }
  .env-badge { white-space: normal; }
  .ws-identity { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .ws-identity-who { gap: 0.15rem 0.75rem; }
  #accEmail { flex-basis: 100%; }
  .usage-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem 1.5rem; }
  .usage-stat .val { font-size: 1.5rem; }
  .ws-body { padding-top: 1.75rem; }
  .workspace-due li { grid-template-columns: minmax(0, 1fr); row-gap: 0.85rem; }
  .workspace-due .btn { grid-column: 1; grid-row: auto; justify-self: start; }
  .workspace-tabs { gap: 1.5rem; margin: 0 calc(-1 * var(--page-x)) 1.75rem; padding: 0 var(--page-x); }
  .form-row > .btn { width: 100%; }
  .workspace-toolbar .form-row, .workspace-toolbar .field { flex: 1 1 100%; }

  :is(#generationsTable, #reportsTable),
  :is(#generationsTable, #reportsTable) tbody { display: block; width: 100%; }
  :is(#generationsTable, #reportsTable) tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0.75rem 1rem; padding: 1.25rem var(--panel-x); border-bottom: 1px solid var(--ws-hairline); }
  :is(#generationsTable, #reportsTable) tr:last-child { border-bottom: 0; }
  :is(#generationsTable, #reportsTable) tr:has(th) { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .ws-page :is(#generationsTable, #reportsTable) td { display: block; min-width: 0; padding: 0; border: 0; white-space: normal; overflow-wrap: anywhere; }
  :is(#generationsTable, #reportsTable) td:first-child { grid-column: 1 / -1; font-family: var(--font-display); font-size: var(--text-md); font-weight: 400; }
  :is(#generationsTable, #reportsTable) td:last-child { grid-column: 1 / -1; grid-row: 2; text-align: left !important; }
  :is(#generationsTable, #reportsTable) td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 0.15rem; font-size: var(--text-xs); color: var(--ws-muted); }
  :is(#generationsTable, #reportsTable) td[colspan] { grid-column: 1 / -1; grid-row: auto; font-family: var(--font); font-size: var(--text-sm); }
  :is(#generationsTable, #reportsTable) td:last-child > div { justify-content: flex-start !important; align-items: flex-start; flex-wrap: wrap; }
  :is(#generationsTable, #reportsTable) tr:hover td { background: none; }
  :is(#generationsTable, #reportsTable) .btn { white-space: normal; max-width: 100%; }
  .workspace-row-actions { justify-content: flex-start; }
}
