/* Tokens come from brand.css (loaded first): --ink, --muted, --leaf,
   --danger, --surface, --paper, --line, --radius, --radius-lg, --shadow. This
   sheet used to carry its own separate palette (plus a dark-mode variant no
   other page has), which made this the one page that didn't look like the
   rest of the site. */

* { box-sizing: border-box; }

/* Same fix as admin.css: the site stylesheet overrides the UA [hidden] rule. */
[hidden] {
  display: none !important;
}

body {
  margin: 0;
  /* No padding on `body`: the injected header and footer are full-bleed and
     padding here would inset them. The content column below carries it. */
  padding: 0;
  /* `background-color`, not the shorthand, so the hero in `brand.css` survives. */
  background-color: transparent;
}

/* The dense transcription controls need a readable surface over the hero, the
   same way the admin pages do. */
body > *:not([id="thr-header"]):not([id="thr-footer"]) {
  background-color: var(--paper);
  /* Extra top padding: the page's own <header> sits flush against the injected
     site header without it, and the heading was clipped. */
  padding: 1.75rem 1rem 1.25rem;
}

main { max-width: 46rem; margin: 0 auto; }

main header {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.75rem;
}

h1 { font-size: 1.5rem; margin: 0; }

.subtitle { margin: 0; color: var(--muted); flex: 1 1 auto; }

/* `site-auth.js` wraps the two in `.header-account`; the name sits over the
   sign-out rather than beside it. */
.header-account {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  margin-left: auto;
  text-align: right;
}

.header-account .header-identity,
.header-account .header-logout {
  margin-left: 0;
  font-size: 13px;
}

.header-account .header-identity {
  color: var(--muted);
}

.controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

/* Start/stop are filled, like the rest of the site's buttons (brand.css),
   colored for their meaning rather than left as brand.css's default slate. */
#start:not(:disabled) { background: var(--leaf); border-color: var(--leaf); }
#start:not(:disabled):hover { background: var(--leaf-dark); border-color: var(--leaf-dark); }
#stop:not(:disabled) { background: var(--danger); border-color: var(--danger); }
#stop:not(:disabled):hover { opacity: 0.9; }

.dot {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  background: var(--muted);
  opacity: 0.4;
}

.dot.recording { background: var(--danger); opacity: 1; animation: pulse 1.4s ease-in-out infinite; }

@keyframes pulse { 50% { opacity: 0.35; } }

#status { color: var(--muted); }
#status.problem { color: var(--danger); }

.meter {
  height: 0.5rem;
  border-radius: 0.25rem;
  background: color-mix(in srgb, var(--muted) 25%, transparent);
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.level-fill {
  height: 100%;
  width: 0%;
  background: var(--leaf);
  transition: width 80ms linear;
}

/* A card, like every other panel on the site (admin.css `main > section`):
   shadow-only elevation, no border. */
.transcript {
  min-height: 12rem;
  max-height: 60vh;
  overflow-y: auto;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.transcript-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.transcript-header h2 {
  margin: 0;
  font-size: 1rem;
  color: var(--muted);
}

.transcript p {
  margin: 0 0 0.6rem;
  overflow-wrap: break-word;
}

.partial { color: var(--muted); font-style: italic; }
.partial.abandoned { opacity: 0.5; text-decoration: line-through; }

/* `:not(#colophon)`: this page's own "Offline. Nothing leaves this machine."
   note, not the injected site footer (`brand.css` centers that one, and a
   bare `footer` selector would otherwise add a lopsided top margin to it). */
footer:not(#colophon) { margin-top: 1.5rem; color: var(--muted); font-size: 0.875rem; }
