:root {
  color-scheme: light;
  --bg: #f4f6f3;
  --ink: #17201c;
  --muted: #62706b;
  --line: #d8ded9;
  --panel: #ffffff;
  --panel-strong: #eef4ef;
  --accent: #126d63;
  --accent-ink: #ffffff;
  --warn: #a85f00;
  --danger: #b73535;
  --blue: #2f5f98;
  --shadow: 0 18px 44px rgba(20, 31, 27, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(180deg, rgba(244, 246, 243, 0.92), rgba(231, 237, 235, 0.98)),
    radial-gradient(circle at top left, rgba(18, 109, 99, 0.14), transparent 32rem);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.shell {
  width: min(1440px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
  gap: 18px;
}

.workspace,
.transcript-panel {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(216, 222, 217, 0.95);
  box-shadow: var(--shadow);
}

.workspace {
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto minmax(320px, 1fr) auto auto auto;
  gap: 16px;
  padding: 18px;
  border-radius: 8px;
}

.topbar,
.control-strip,
.metrics,
.panel-head,
.panel-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar {
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  display: block;
  border-radius: 8px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--line);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(1.25rem, 1.8vw, 1.75rem);
  line-height: 1.05;
  letter-spacing: 0;
}

h2 {
  font-size: 1.08rem;
  line-height: 1.2;
  letter-spacing: 0;
}

.brand p,
.panel-head p,
.notice {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.35;
}

.intro {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid #cfe0dc;
  border-radius: 8px;
  background: #f3faf7;
  color: #26342f;
  font-size: 0.94rem;
  line-height: 1.42;
}

.intro-photo {
  width: 96px;
  height: 96px;
  flex: 0 0 auto;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid #cfe0dc;
  background: #fff;
}

.intro-copy {
  min-width: 0;
}

.intro p {
  margin: 0;
}

.intro p + p,
.intro ol + p {
  margin-top: 8px;
}

.intro-lead {
  font-weight: 800;
}

.intro ol {
  margin: 8px 0 0;
  padding-left: 22px;
}

.intro li + li {
  margin-top: 3px;
}

.intro a {
  color: var(--accent);
  font-weight: 800;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--accent);
  background: #e7f3ef;
  border: 1px solid #c8e2db;
  white-space: nowrap;
}

.status-pill.recording {
  color: var(--danger);
  background: #fff0ef;
  border-color: #f1c9c4;
}

.status-pill.paused {
  color: var(--warn);
  background: #fff5e4;
  border-color: #f2d9a7;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.language-select {
  display: grid;
  gap: 6px;
}

.language-select span,
.metrics span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
}

input,
select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

input {
  width: 100%;
  padding: 0 12px;
}

input[readonly] {
  color: var(--ink);
  background: #f7f9f7;
  cursor: default;
}

select {
  padding: 0 34px 0 10px;
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(18, 109, 99, 0.14);
}

.stage {
  position: relative;
  overflow: hidden;
  min-height: 320px;
  border-radius: 8px;
  background:
    linear-gradient(45deg, rgba(255, 255, 255, 0.06) 25%, transparent 25% 75%, rgba(255, 255, 255, 0.06) 75%),
    #121816;
  border: 1px solid #0d1311;
}

video {
  width: 100%;
  height: 100%;
  min-height: 320px;
  display: block;
  object-fit: contain;
  background: #121816;
}

.empty-preview {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  color: #dbe7e1;
  text-align: center;
  padding: 24px;
}

.empty-preview.hidden {
  display: none;
}

.empty-icon {
  width: 54px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 2px solid currentColor;
  border-radius: 8px;
}

.control-strip {
  flex-wrap: wrap;
}

.primary,
.danger,
.icon-button {
  min-height: 42px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 14px;
  transition:
    transform 0.16s ease,
    background 0.16s ease,
    border-color 0.16s ease;
}

.primary {
  color: var(--accent-ink);
  background: var(--accent);
  font-weight: 800;
}

.danger {
  color: #fff;
  background: var(--danger);
  font-weight: 800;
}

.icon-button {
  min-width: 42px;
  color: var(--ink);
  background: var(--panel-strong);
  border: 1px solid var(--line);
  font-weight: 750;
}

.icon-button.wide {
  min-width: 112px;
}

.icon-button.active {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
}

button:not(:disabled):hover {
  transform: translateY(-1px);
}

.record-glyph {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ffdad6;
  box-shadow: 0 0 0 3px rgba(255, 218, 214, 0.22);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metrics div {
  min-width: 0;
  padding: 12px;
  border-radius: 8px;
  background: #f7f9f7;
  border: 1px solid var(--line);
}

.metrics strong {
  display: block;
  margin-top: 5px;
  font-size: 1.05rem;
  overflow-wrap: anywhere;
}

.recordings-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 8px;
  background: #f7f9f7;
  border: 1px solid var(--line);
}

.recordings-head,
.recording-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.recordings-head h2 {
  font-size: 1rem;
}

.recordings-head span,
.recordings-empty,
.recording-meta span {
  color: var(--muted);
  font-size: 0.86rem;
}

.recordings-list {
  display: grid;
  gap: 8px;
}

.recording-item {
  min-height: 52px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
}

.recording-meta {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.recording-meta strong,
.recording-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.transcript-panel {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(260px, 1fr) auto auto;
  gap: 14px;
  padding: 18px;
  border-radius: 8px;
}

.panel-head {
  justify-content: space-between;
  align-items: start;
  flex-wrap: wrap;
}

.punctuation-toggle {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f9f7;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 750;
}

.punctuation-toggle input {
  width: 16px;
  height: 16px;
  min-height: 0;
  accent-color: var(--accent);
}

.transcript-box {
  position: relative;
  overflow: auto;
  padding: 14px;
  border-radius: 8px;
  background: #fbfcfb;
  border: 1px solid var(--line);
  line-height: 1.5;
}

.transcript-box p {
  margin-bottom: 12px;
}

.placeholder {
  color: var(--muted);
}

.interim {
  color: var(--blue);
}

.transcript-line {
  margin: 0 0 12px;
}

.transcript-time {
  display: inline-block;
  margin-right: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}

.panel-actions {
  flex-wrap: wrap;
}

.notice {
  padding: 12px;
  border-radius: 8px;
  background: #fff8ea;
  border: 1px solid #f0ddb5;
  color: #6f4b16;
}

@media (max-width: 980px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .transcript-panel {
    min-height: 520px;
  }
}

@media (max-width: 640px) {
  .shell {
    padding: 12px;
  }

  .workspace,
  .transcript-panel {
    padding: 12px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .intro {
    gap: 12px;
  }

  .intro-photo {
    width: 72px;
    height: 72px;
  }

  .status-pill {
    width: fit-content;
  }

  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .primary,
  .danger {
    flex: 1 1 150px;
  }
}
