/* ------------------------------------------------------------------
   app.css — my design system for the Phaworma SPA.

   I keep every design token in :root so my components reference the same
   values instead of hard-coding colors. My palette is a warm cream
   surface with a dark-chocolate text color and a single burnt-orange
   accent (the bao.finance pattern): it reads "warm tool" without a CSS
   framework, and if I ever want dark mode I rewrite this one block.
   ------------------------------------------------------------------ */

:root {
  --color-bg: #fff8ee;
  --color-surface: #fffdf9;
  --color-surface-soft: #efeae7;
  --color-border: #e2d6cf;
  --color-text: #50251c;
  --color-text-muted: #7d6459;
  --color-accent: #ce6509;
  --color-accent-strong: #a35007;
  --color-accent-soft: #fdeedd;
  --color-primary: #50251c;
  --color-primary-hover: #63301f;
  --color-on-primary: #fff8ee;
  --color-danger: #c03d33;
  --color-danger-soft: #f9e3e0;
  --color-success: #3a6e4c;
  --color-success-soft: #e4efe6;
  --color-warn: #8f5b00;
  --color-warn-soft: #f6e7c8;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-card: 0 1px 2px rgba(80, 37, 28, 0.06), 0 4px 14px rgba(80, 37, 28, 0.05);
  --shadow-card-hover: 0 2px 4px rgba(80, 37, 28, 0.07), 0 10px 24px rgba(80, 37, 28, 0.09);
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --font-stack: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-stack);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* My soft center vignette, fixed behind everything (the bao.finance
   treatment): a barely-there wash of --color-surface-soft that fades out
   to the cream base. Because it's centered and fixed, it has already
   faded to --color-bg at the viewport edges — so the solid header
   always matches it at every scroll position.
   pointer-events: none means it can never swallow a click. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(50% 50% at 50% 50%, var(--color-surface-soft) 0%, var(--color-bg) 100%);
  opacity: 0.15;
}

/* My app shell is a three-row CSS Grid: auto header, stretching main, auto
   footer. I use 100dvh so mobile browser chrome doesn't clip my footer. */
.app-shell {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100dvh;
}

/* ------------------------------ header ------------------------------ */

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  padding: var(--space-3) var(--space-6);
  background: var(--color-bg);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.03em;
  color: var(--color-text);
  text-decoration: none;
}

.brand svg {
  display: block;
  color: var(--color-accent);
}

/* margin-left: auto pushes the nav — and everything after it — to the
   right edge of the header, so the menu sits next to the auth buttons
   instead of floating between the brand and them (the bao.finance
   layout). */
.app-nav {
  display: flex;
  gap: var(--space-6);
  margin-left: auto;
}

/* My bao.finance menu links: regular weight, full text color, 24px
   apart, and the signature hover nudge (a small translate toward the
   bottom-right) instead of a background pill. */
.app-nav a {
  padding: var(--space-2) 0;
  border-radius: var(--radius-md);
  color: var(--color-text);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 400;
  transition: color 120ms ease, transform 450ms cubic-bezier(0.19, 1, 0.22, 1);
}

.app-nav a:hover {
  color: var(--color-accent);
  transform: translate3d(2px, 2px, 10px);
}

/* aria-current is set by app.js — I style the active link from that same
   attribute so the "current page" state is driven by what screen readers
   hear too. Flat accent color, matching bao.finance's pill-free menu. */
.app-nav a[aria-current="page"] {
  color: var(--color-accent);
}

/* My auth area lives on the right side of the header: the signed-in
   identity plus sign-in/out buttons. */
.auth-area {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.auth-user {
  font-size: 0.88rem;
  color: var(--color-text-muted);
  max-width: 16rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ------------------------------- views ------------------------------ */

.app-main {
  width: 100%;
}

.view {
  width: min(100% - 2 * var(--space-6), 60rem);
  margin-inline: auto;
  padding-block: var(--space-12);
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

/* The hidden attribute is my view-switching mechanism. I enforce it with
   !important so no other rule can accidentally reveal a hidden pane. */
[hidden] {
  display: none !important;
}

.view-head h1 {
  margin: 0;
  font-size: 1.75rem;
  letter-spacing: -0.02em;
}

.view-sub {
  margin: var(--space-1) 0 0;
  color: var(--color-text-muted);
  max-width: 46rem;
}

/* --------------------------- cards & buttons ------------------------ */

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-6);
}

/* The hover lift for my interactive cards — a subtler version of
   bao.finance's scale(1.03); a small lift reads better in an app
   than a page-style zoom. */
.hero-card,
.form-card {
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.hero-card:hover,
.form-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  text-align: center;
  padding: var(--space-12) var(--space-6);
}

.empty-state svg {
  color: var(--color-accent);
  opacity: 0.85;
}

.empty-state h2 {
  margin: 0;
  font-size: 1.15rem;
}

.empty-state p {
  margin: 0;
  color: var(--color-text-muted);
  max-width: 34rem;
}

.empty-state .btn {
  margin-top: var(--space-3);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

/* My primary CTA: dark chocolate with cream type — the brand color.
   Burnt orange is reserved for accent states (focus, tabs, hovers). */
.btn-primary {
  background: var(--color-primary);
  color: var(--color-on-primary);
}

.btn-primary:hover {
  background: var(--color-primary-hover);
}

/* Ghost buttons for secondary actions — my dashboard card buttons, the
   dialog cancel, the builder toolbar. */
.btn-ghost {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-border);
}

.btn-ghost:hover {
  border-color: var(--color-accent);
  color: var(--color-accent-strong);
  background: var(--color-accent-soft);
}

.btn-danger {
  background: transparent;
  color: var(--color-danger);
  border-color: var(--color-danger);
}

.btn-danger:hover {
  background: var(--color-danger-soft);
}

.btn-sm {
  padding: var(--space-1) var(--space-3);
  font-size: 0.88rem;
}

/* My pill button — a faithful port of bao.finance's Mainnet/xDai links:
   warm gray fill, hairline border, bold text, and their dual shadow
   (gray bottom-right, cream top-left). Hover presses it in with the
   same translate nudge their links use. */
.btn-pill {
  padding: var(--space-1) var(--space-4);
  background: var(--color-surface-soft);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-weight: 700;
  box-shadow: rgb(181 176 174) 1px 1px 2px, rgb(255 252 245 / 50%) -1px -1px 2px;
  transition: transform 450ms cubic-bezier(0.19, 1, 0.22, 1);
}

.btn-pill:hover {
  transform: translate3d(2px, 2px, 5px);
}

/* ------------------- sign-in prompts (creator views) ---------------- */

/* The "sign in to see this" card I show on creator views when the auth
   store is empty. */
.prompt-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
}

.prompt-card h2 {
  margin: 0;
  font-size: 1.15rem;
}

.prompt-card p {
  margin: 0;
  color: var(--color-text-muted);
  max-width: 38rem;
}

/* --------------------- dashboard form list -------------------------- */

.form-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-3);
}

/* One card per form: title + badges on top, meta line, short link, and
   the action buttons on the right. */
.form-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-6);
}

.form-card-main {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
}

.form-card-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.form-card-title-row h2 {
  margin: 0;
  font-size: 1.05rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 26rem;
}

.form-card-meta {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.short-link {
  align-self: flex-start;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88rem;
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 2px 10px;
  cursor: pointer;
  color: var(--color-accent-strong);
}

.short-link:hover {
  border-color: var(--color-accent);
}

.form-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: flex-end;
  flex-shrink: 0;
}

/* Status/password badges I render next to each form title. */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.badge-active {
  color: var(--color-success);
  background: var(--color-success-soft);
}

.badge-expired {
  color: var(--color-text-muted);
  background: var(--color-surface-soft);
  border-color: var(--color-border);
}

.badge-lock {
  color: var(--color-warn);
  background: var(--color-warn-soft);
}

/* ------------------------- respondent form --------------------------- */

#form-mount {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.question {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.question-label {
  font-weight: 600;
}

/* The little asterisk for required questions. */
.question-label .req {
  color: var(--color-danger);
  margin-left: 2px;
}

.question-hint {
  margin: 0;
  font-size: 0.88rem;
  color: var(--color-text-muted);
}

.field-text {
  font: inherit;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
  width: 100%;
}

.field-text:focus {
  border-color: var(--color-accent);
  outline: none;
}

.field-narrow {
  width: 8rem;
}

/* My "choice" questions render as a radio group laid out with flexbox so
   long option labels wrap gracefully on phones. */
.field-choice {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.field-choice label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color 120ms ease, background-color 120ms ease;
}

.field-choice label:hover {
  border-color: var(--color-accent);
}

.field-choice label:has(input:checked) {
  border-color: var(--color-accent);
  background: var(--color-accent-soft);
}

.field-dropdown {
  font: inherit;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
  max-width: 24rem;
  width: 100%;
}

.field-dropdown:focus {
  border-color: var(--color-accent);
  outline: none;
}

.question-error {
  margin: 0;
  font-size: 0.85rem;
  color: var(--color-danger);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  margin-top: var(--space-2);
}

/* Password gate card. */
.password-gate {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  align-items: flex-start;
  max-width: 34rem;
}

.password-gate h2 {
  margin: 0;
  font-size: 1.15rem;
}

.inline-form {
  display: flex;
  gap: var(--space-2);
  width: 100%;
}

.inline-form .field-text {
  flex: 1;
}

/* --------------------------- results panel --------------------------- */

.results-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

.results-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
}

.results-head .chart-title {
  margin-bottom: 0;
}

/* The picker: one button row per form. */
.picker-list {
  display: grid;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.picker-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font: inherit;
  text-align: left;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color 120ms ease, background-color 120ms ease;
}

.picker-item:hover {
  border-color: var(--color-accent);
  background: var(--color-accent-soft);
}

.picker-title {
  font-weight: 600;
}

.picker-meta {
  color: var(--color-text-muted);
  font-size: 0.88rem;
  white-space: nowrap;
}

/* One figure per question, stacked vertically. */
.charts-stack {
  display: grid;
  gap: var(--space-4);
}

.chart-figure {
  margin: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-4) var(--space-6);
}

.chart-figure figcaption {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 600;
  margin-bottom: var(--space-3);
}

.chart-figure figcaption .chart-qtype {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-text-muted);
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 1px 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.chart-empty {
  min-height: 6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

/* My inline SVG bar charts: no charting library, just rects and text.
   The SVG inherits my palette through these classes. */
.bar-chart {
  width: 100%;
  height: auto;
  display: block;
}

.bar-chart .chart-label {
  font-size: 12px;
  fill: var(--color-text-muted);
}

.bar-chart .chart-bar {
  fill: var(--color-accent);
}

.bar-chart .chart-bar-track {
  fill: var(--color-surface-soft);
}

.bar-chart .chart-count {
  font-size: 12px;
  fill: var(--color-text);
  font-weight: 600;
}

.text-stat {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  padding: var(--space-2) 0;
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.text-stat strong {
  font-size: 1.4rem;
  color: var(--color-text);
}

.datasheet-card {
  padding: var(--space-4) var(--space-6);
}

.datasheet-scroll {
  overflow-x: auto;
}

.datasheet {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.datasheet th,
.datasheet td {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  white-space: nowrap;
}

.datasheet td {
  max-width: 22rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.datasheet th {
  color: var(--color-text-muted);
  font-weight: 600;
}

.datasheet .empty-row {
  text-align: center;
  color: var(--color-text-muted);
  padding-block: var(--space-6);
}

.chart-title {
  margin: 0 0 var(--space-3);
  font-size: 1rem;
}

/* ------------------------------ builder ------------------------------ */

.builder-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.builder-meta {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.field-label {
  font-weight: 600;
  font-size: 0.92rem;
  display: block;
  margin-bottom: var(--space-1);
}

.builder-meta-row {
  display: flex;
  gap: var(--space-6);
  flex-wrap: wrap;
}

.builder-meta-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.builder-meta-grow {
  flex: 1;
  min-width: 14rem;
}

.builder-meta-field .field-text {
  width: 100%;
}

#builder-lifespan {
  width: 8rem;
}

.check-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.92rem;
  color: var(--color-text-muted);
  cursor: pointer;
  font-weight: 500;
}

.builder-error {
  margin: 0;
}

.builder-questions {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* One editor block per draft question. */
.builder-question {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  background: var(--color-surface-soft);
}

.builder-question-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.builder-q-type {
  max-width: 12rem;
}

/* The type select + remove button row in my builder question head. A
   class (not an inline style) on purpose: my CSP sends style-src 'self',
   so every style in the SPA has to live in app.css. */
.builder-q-actions {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

.builder-q-index {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.builder-q-label {
  width: 100%;
}

/* Option rows inside choice/dropdown editors. */
.builder-options {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.builder-option-row {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

.builder-option-row .field-text {
  flex: 1;
}

/* Read-only summary blocks (edit mode). */
.builder-question-readonly {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
}

.builder-question-readonly .qro-label {
  font-weight: 600;
}

.builder-question-readonly .qro-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}

.option-chip {
  display: inline-block;
  font-size: 0.82rem;
  border: 1px solid var(--color-border);
  background: var(--color-surface-soft);
  border-radius: 999px;
  padding: 1px 10px;
  color: var(--color-text-muted);
}

.builder-note {
  border-left: 3px solid var(--color-accent);
  padding-left: var(--space-3);
}

.builder-toolbar {
  display: flex;
}

/* --------------------------- sign-in dialog -------------------------- */

/* Native <dialog> styling: the ::backdrop darkens the page behind me. */
.dialog {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-6);
  width: min(100% - 2rem, 26rem);
  margin: auto;
}

.dialog::backdrop {
  background: rgba(80, 37, 28, 0.45);
}

.dialog h2 {
  margin: 0 0 var(--space-2);
  font-size: 1.2rem;
}

.dialog-sub {
  margin: 0 0 var(--space-4);
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.dialog form {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  margin-top: var(--space-3);
}

/* ------------------------------- toasts ------------------------------ */

/* Fixed stack, bottom-right. app.js animates .toast-out before removal. */
.toast-wrap {
  position: fixed;
  bottom: var(--space-4);
  right: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  z-index: 100;
  max-width: min(100% - 2rem, 24rem);
}

.toast {
  background: var(--color-text);
  color: #ffffff;
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-size: 0.92rem;
  box-shadow: var(--shadow-card);
  animation: toast-in 160ms ease-out;
  transition: opacity 300ms ease, transform 300ms ease;
}

.toast-error {
  background: var(--color-danger);
}

.toast-success {
  background: var(--color-success);
}

.toast-out {
  opacity: 0;
  transform: translateY(6px);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ------------------------------- footer ------------------------------ */

.app-footer {
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
  padding: var(--space-4) var(--space-6);
}

.app-footer p {
  margin: 0;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.88rem;
}

/* ------------------ accessibility & responsiveness ------------------- */

/* I make keyboard focus unmistakable — my respondents include people who
   only use a keyboard. */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* My single breakpoint: below this I stack the header vertically and relax
   padding so the panes don't feel cramped on a phone. */
@media (max-width: 640px) {
  .app-header {
    flex-wrap: wrap;
    padding: var(--space-3);
  }

  .view {
    padding-block: var(--space-8);
  }

  .card {
    padding: var(--space-4);
  }

  .empty-state {
    padding: var(--space-8) var(--space-4);
  }

  .form-card {
    flex-direction: column;
  }

  .form-card-actions {
    justify-content: flex-start;
  }
}

/* ============================ Stage 3 additions ========================
   Everything below belongs to the multi-user stage: the guest hero, the
   shared/pending badges, the tabbed auth dialog, and the share screen.
   ====================================================================== */

/* My dashboard head row: title + sub on the left, New form button right. */
.view-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
}

.btn-lg {
  padding: var(--space-3) var(--space-6);
  font-size: 1.05rem;
}

/* ------------------------------- guest hero --------------------------- */

/* The landing page for guests. I keep it left-aligned and quiet — the
   product pitch is the ephemeral promise, so it gets the big type. The
   shawarma mascot (hero-art) sits to the right of the copy on wide
   screens, the way bao.finance floats its bun. */
.hero {
  display: flex;
  align-items: flex-start;
  gap: var(--space-8);
  padding-block: var(--space-8) 0;
  max-width: 46rem;
}

/* The copy stays a column at every width. Below 900px the art is hidden
   and this is the only visible child, so the hero reads exactly as the
   old single-column layout did. */
.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-4);
}

/* The mascot is off by default so small screens stay uncluttered. */
.hero-art {
  display: none;
}

@media (min-width: 900px) {
  .hero {
    align-items: center;
    justify-content: space-between;
    max-width: none;
  }

  .hero-copy {
    max-width: 40rem;
  }

  .hero-art {
    display: block;
    flex: 0 0 auto;
    width: min(15rem, 22vw);
    height: auto;
    animation: hero-float 4s ease-in-out infinite;
  }
}

/* A gentle bob for the mascot — bao.finance's bun floats the same way. */
@keyframes hero-float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* I respect the user's motion preference — no bob for reduced motion. */
@media (prefers-reduced-motion: reduce) {
  .hero-art {
    animation: none;
  }
}

.hero h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 2.75rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.hero-sub {
  font-size: 1.05rem;
}

.hero-note {
  margin: 0;
  font-size: 0.88rem;
  color: var(--color-text-muted);
}

.hero code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85em;
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 0 5px;
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: var(--space-4);
  width: 100%;
}

.hero-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.hero-card h2 {
  margin: 0;
  font-size: 1rem;
}

.hero-card p {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.92rem;
}

/* "Shared with you" — I hold a co-creator seat on a form I don't own. */
.badge-shared {
  color: var(--color-accent-strong);
  background: var(--color-accent-soft);
}

/* A co-creator invite that's still waiting for the address to sign up. */
.badge-pending {
  color: var(--color-warn);
  background: var(--color-warn-soft);
}

/* ------------------------- tabbed auth dialog ------------------------- */

/* My sign-in / create tabs. aria-selected drives the active look — app.js
   keeps the attribute and the CSS in agreement, so the visual state and
   the screen-reader state can't drift apart. */
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}

.dialog-head h2 {
  margin: 0;
}

.auth-tabs {
  display: flex;
  gap: var(--space-1);
  margin-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-border);
}

.auth-tab {
  appearance: none;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font: inherit;
  font-weight: 600;
  color: var(--color-text-muted);
  padding: var(--space-2) var(--space-3);
  margin-bottom: -1px;
  cursor: pointer;
}

.auth-tab:hover {
  color: var(--color-accent-strong);
}

.auth-tab[aria-selected="true"] {
  color: var(--color-accent-strong);
  border-bottom-color: var(--color-accent);
}

/* ------------------------------- share -------------------------------- */

/* The public-link row: a read-only input (so I can select it) plus Copy. */
.share-link-row {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.share-link-row .field-text {
  flex: 1;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.92rem;
}

/* One row per co-creator seat on the share screen. */
.collab-list {
  list-style: none;
  margin: var(--space-4) 0 0;
  padding: 0;
  display: grid;
  gap: var(--space-2);
}

.collab-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
}

.collab-row-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.collab-row-email {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.collab-row-sub {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The one-time claim link under a pending seat (audit #2). Same shape as
   my share-link row — a read-only input plus a Copy button — nested in
   the seat's main column so the Remove button stays aligned on the right. */
.collab-claim-row {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  margin-top: var(--space-2);
}

.collab-claim-row .field-text {
  flex: 1;
  min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
}
