:root {
  --bg: #f7f3ea;
  --surface: #fffdf8;
  --line: #ded6c7;
  --text: #27231f;
  --muted: #6b6259;
  --accent: #1d7a72;
  --accent-dark: #155b56;
  --warm: #a44d32;
  --danger: #b42318;
  --screen-bg: #eee6d8;
  --panel-tint: rgba(255, 253, 248, 0.62);
  --panel-tint-strong: rgba(255, 253, 248, 0.76);
  --input-bg: #fff;
  --hover-bg: #f1eadf;
  --segment-bg: #ece4d6;
  --reply-bg: #edf7f4;
  --shadow: 0 18px 50px rgba(35, 31, 26, 0.12);
}

:root.theme-dark {
  --bg: #141311;
  --surface: #211f1c;
  --line: #3b3630;
  --text: #f5efe6;
  --muted: #b9ad9f;
  --accent: #46a69b;
  --accent-dark: #2f8077;
  --warm: #c26a4a;
  --danger: #ff756b;
  --screen-bg: #0f0e0c;
  --panel-tint: rgba(33, 31, 28, 0.84);
  --panel-tint-strong: rgba(38, 35, 31, 0.94);
  --input-bg: #181614;
  --hover-bg: #302c27;
  --segment-bg: #2a2621;
  --reply-bg: #1c2b28;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.app-shell {
  height: 100dvh;
  overflow: hidden;
}

.auth-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-panel {
  width: min(100%, 420px);
  display: grid;
  gap: 18px;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.auth-panel h1,
.thread-screen-header h1,
.conversation-header h2,
.section-heading h2,
.empty-state h2 {
  margin: 0;
  letter-spacing: 0;
}

.auth-panel h1 {
  font-size: 2rem;
}

.auth-mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  background: var(--segment-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.auth-mode-button {
  min-height: 40px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-weight: 900;
}

.auth-mode-button[aria-pressed="true"] {
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 1px 4px rgba(35, 31, 26, 0.12);
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--text);
  background: var(--input-bg);
  border: 1px solid var(--line);
  border-radius: 6px;
}

input:focus,
select:focus,
button:focus-visible {
  outline: 3px solid rgba(29, 122, 114, 0.22);
  outline-offset: 2px;
}

.main-view {
  height: 100%;
  overflow: hidden;
}

.thread-screen {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 18px;
  padding: 20px;
  background: var(--screen-bg);
  overflow: hidden;
}

.thread-screen-header,
.conversation-header,
.account-row {
  display: flex;
  align-items: center;
}

.thread-screen-header,
.conversation-header {
  justify-content: space-between;
  gap: 16px;
}

.thread-screen-header h1,
.conversation-header h2 {
  font-size: 1.45rem;
}

.account-row {
  min-width: min(100%, 380px);
  gap: 12px;
  padding: 10px 12px;
  background: var(--panel-tint-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.account-details {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  gap: 2px;
}

.account-row span:last-child,
.thread-members {
  color: var(--muted);
  font-size: 0.84rem;
}

.account-menu {
  position: relative;
  flex: 0 0 auto;
}

.account-menu summary {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-weight: 900;
  list-style: none;
  cursor: pointer;
}

.account-menu summary::-webkit-details-marker {
  display: none;
}

.account-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 5;
  width: 220px;
  display: grid;
  gap: 6px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.menu-action {
  min-height: 40px;
  padding: 0 10px;
  text-align: left;
  color: var(--text);
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-weight: 800;
}

.menu-toggle {
  min-height: 40px;
  display: flex;
  grid-template-columns: none;
  grid-auto-flow: column;
  align-items: center;
  justify-content: start;
  gap: 10px;
  padding: 0 10px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 800;
}

.menu-toggle input {
  width: 18px;
  min-height: 18px;
}

.menu-version {
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 10px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 0.78rem;
  font-weight: 800;
}

.menu-version span {
  color: var(--text);
}

.menu-action:hover {
  background: var(--hover-bg);
}

.avatar {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--warm);
  border-radius: 50%;
  font-weight: 800;
}

.primary-action,
.secondary-action,
.icon-button {
  min-height: 42px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-weight: 800;
}

.primary-action {
  color: #fff;
  background: var(--accent);
}

.primary-action:hover {
  background: var(--accent-dark);
}

.secondary-action {
  color: var(--text);
  background: var(--surface);
  border-color: var(--line);
}

.secondary-action:hover {
  border-color: #bcae99;
}

.icon-button {
  width: 42px;
  flex: 0 0 auto;
  color: var(--text);
  background: var(--surface);
  border-color: var(--line);
}

.text-action {
  min-height: 36px;
  flex: 0 0 auto;
  padding: 0 12px;
  color: var(--accent-dark);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.86rem;
  font-weight: 800;
}

.text-action:hover {
  border-color: var(--accent);
}

.thread-list {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 8px;
  overflow: auto;
  padding-right: 4px;
}

.thread-button {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 12px;
  text-align: left;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.thread-button[aria-current="true"] {
  background: var(--surface);
  border-color: var(--accent);
}

.thread-button:hover {
  background: var(--hover-bg);
}

.thread-button strong {
  overflow-wrap: anywhere;
}

.thread-button span {
  color: var(--muted);
  font-size: 0.82rem;
}

.unread-badge,
.live-badge {
  min-width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  padding: 0 7px;
  color: #fff;
  background: var(--warm);
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
}

.live-badge {
  min-width: 42px;
  background: var(--accent);
}

.thread-builder {
  min-height: 0;
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 16px;
  background: var(--panel-tint);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: auto;
}

.thread-builder h2 {
  margin: 0;
  font-size: 1rem;
}

.thread-screen-body {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 18px;
}

.thread-list-panel {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  padding: 16px;
  background: var(--panel-tint);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.section-heading h2 {
  font-size: 1.1rem;
}

.user-picker {
  display: grid;
  gap: 8px;
}

.user-select {
  min-height: 110px;
  max-height: 150px;
  padding: 6px;
  overflow: auto;
}

.user-select option {
  padding: 7px 8px;
  border-radius: 4px;
  color: var(--text);
  background: var(--input-bg);
}

.conversation {
  height: 100%;
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  padding: 20px;
  overflow: hidden;
}

.conversation-header {
  min-height: 58px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.conversation-header > div {
  min-width: 0;
  flex: 1 1 auto;
}

.recorder-panel {
  min-height: 0;
  display: grid;
}

.stage-layout {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
}

.stage-column {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
}

.live-panel {
  width: min(100%, 920px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: 8px;
}

.live-panel h3 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0;
}

.stage-frame {
  position: relative;
  width: 100%;
  min-height: 0;
  max-height: 100%;
  aspect-ratio: var(--stage-aspect-ratio, 16 / 9);
  overflow: hidden;
  background: #161412;
  border-radius: 8px;
}

.stage-frame.is-portrait {
  width: min(100%, 430px);
  justify-self: center;
}

.stage-frame.is-landscape {
  width: 100%;
}

.stage-frame video,
.camera-placeholder,
.audio-standby {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.stage-frame video {
  object-fit: contain;
  object-position: center center;
}

.camera-placeholder {
  display: grid;
  place-items: center;
  color: #f4efe6;
  font-weight: 800;
}

.audio-standby {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  color: #fffdf8;
  text-align: center;
  background:
    radial-gradient(circle at center, rgba(29, 122, 114, 0.42), transparent 42%),
    #161412;
}

.audio-standby strong {
  font-size: 1.25rem;
}

.audio-standby span {
  color: rgba(255, 253, 248, 0.78);
  font-size: 0.9rem;
  font-weight: 800;
}

.audio-pulse {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: rgba(29, 122, 114, 0.82);
  box-shadow: 0 0 0 0 rgba(29, 122, 114, 0.5);
  animation: audio-pulse 1.8s ease-out infinite;
}

@keyframes audio-pulse {
  0% {
    transform: scale(0.92);
    box-shadow: 0 0 0 0 rgba(29, 122, 114, 0.5);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 26px rgba(29, 122, 114, 0);
  }
  100% {
    transform: scale(0.92);
    box-shadow: 0 0 0 0 rgba(29, 122, 114, 0);
  }
}

.stage-hint {
  position: absolute;
  left: 50%;
  bottom: 96px;
  z-index: 5;
  max-width: min(82%, 300px);
  padding: 7px 10px;
  color: #fffdf8;
  background: rgba(22, 20, 18, 0.76);
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 800;
  pointer-events: none;
  text-align: center;
  transform: translateX(-50%) translateY(6px);
  opacity: 0;
  transition: opacity 160ms ease, transform 160ms ease;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.stage-hint::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 10px;
  height: 10px;
  background: rgba(22, 20, 18, 0.76);
  transform: translate(-50%, -5px) rotate(45deg);
}

.stage-hint.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.stage-volume-control {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 5;
  width: min(220px, calc(100% - 24px));
  height: 42px;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 6px;
  color: #fffdf8;
  background: rgba(22, 20, 18, 0.58);
  border: 1px solid rgba(255, 253, 248, 0.26);
  border-radius: 6px;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.stage-volume-button {
  width: 64px;
  height: 30px;
  color: #fffdf8;
  background: rgba(255, 253, 248, 0.12);
  border: 1px solid rgba(255, 253, 248, 0.4);
  border-radius: 5px;
  font-size: 0.78rem;
  font-weight: 900;
}

.stage-volume-slider {
  width: 100%;
  min-width: 0;
  accent-color: #1d7a72;
}

.record-dock {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 4;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  grid-template-rows: auto;
  align-items: center;
  justify-items: center;
  column-gap: 14px;
  row-gap: 4px;
  min-height: 0;
  pointer-events: none;
}

.record-dock > * {
  pointer-events: auto;
}

.record-menu {
  position: relative;
  grid-column: 1;
  grid-row: 1;
  justify-self: end;
}

.record-menu summary {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  color: #fffdf8;
  background: rgba(22, 20, 18, 0.48);
  border: 1px solid rgba(255, 253, 248, 0.5);
  border-radius: 50%;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
  font-weight: 900;
  list-style: none;
  cursor: pointer;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.record-menu summary::-webkit-details-marker {
  display: none;
}

.record-menu-panel {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 5;
  width: min(260px, 72vw);
  display: grid;
  gap: 10px;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.record-toggle {
  grid-column: 2;
  grid-row: 1;
  width: 72px;
  height: 72px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  background: rgba(255, 253, 248, 0.16);
  border: 4px solid rgba(255, 253, 248, 0.7);
  border-radius: 50%;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.32);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.camera-toggle {
  grid-column: 3;
  grid-row: 1;
  justify-self: start;
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: #fffdf8;
  background: rgba(22, 20, 18, 0.48);
  border: 1px solid rgba(255, 253, 248, 0.5);
  border-radius: 50%;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
  font-size: 0.82rem;
  font-weight: 900;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.camera-toggle span {
  font-size: 0;
}

.camera-toggle span::before {
  content: "Flip";
  font-size: 0.82rem;
}

.camera-toggle:disabled {
  color: rgba(255, 253, 248, 0.72);
  background: rgba(22, 20, 18, 0.28);
  box-shadow: none;
}

.record-toggle:disabled {
  background: rgba(22, 20, 18, 0.24);
}

.record-icon {
  width: 42px;
  height: 42px;
  display: block;
  background: #d92d20;
  border-radius: 50%;
}

.record-toggle.is-audio .record-icon {
  width: auto;
  height: auto;
  color: #d92d20;
  background: transparent;
  border-radius: 0;
  font-size: 0;
}

.record-toggle.is-audio .record-icon::before {
  content: "Mic";
  font-size: 1rem;
  font-weight: 900;
}

.record-toggle.is-recording .record-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
}

.record-toggle.is-audio.is-recording .record-icon {
  width: auto;
  height: auto;
  border-radius: 0;
}

.record-copy {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 4;
  max-width: min(54%, 320px);
  display: grid;
  gap: 1px;
  justify-items: end;
  text-align: right;
  padding: 5px 7px;
  color: #fffdf8;
  background: rgba(22, 20, 18, 0.36);
  border: 1px solid rgba(255, 253, 248, 0.18);
  border-radius: 6px;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  pointer-events: none;
}

.record-copy strong {
  font-size: 0.68rem;
  line-height: 1.1;
}

.record-copy .status-text {
  color: rgba(255, 253, 248, 0.86);
  font-size: 0.62rem;
  line-height: 1.15;
}

.reply-overlay-button {
  position: absolute;
  top: 48px;
  right: 12px;
  z-index: 5;
  max-width: min(62%, 260px);
  min-height: 38px;
  padding: 8px 10px;
  color: #fffdf8;
  background: rgba(29, 122, 114, 0.82);
  border: 1px solid rgba(255, 253, 248, 0.5);
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
  font-size: 0.78rem;
  font-weight: 900;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.file-capture {
  width: 100%;
}

.file-capture input {
  min-height: 40px;
}

.status-text,
.error-text {
  min-height: 1.2em;
  margin: 0;
  font-size: 0.9rem;
}

.status-text {
  color: var(--muted);
}

.error-text {
  color: var(--danger);
  font-weight: 700;
}

.empty-state {
  align-self: start;
  max-width: 520px;
  padding-top: 38px;
  color: var(--muted);
}

.empty-state h2 {
  color: var(--text);
}

.history-panel .empty-state {
  padding-top: 0;
}

.history-panel {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 12px;
  padding-left: 18px;
  border-left: 1px solid var(--line);
}

.history-heading h3 {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: 0;
}

.timeline {
  min-width: 0;
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 10px;
  overflow: auto;
  padding-right: 4px;
}

.history-item {
  position: relative;
  width: 100%;
  min-height: 76px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px;
  text-align: left;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.history-item[aria-current="true"] {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.history-play-button {
  min-width: 0;
  min-height: 58px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 58px;
  gap: 10px;
  align-items: center;
  padding: 2px;
  color: inherit;
  text-align: left;
  background: transparent;
  border: 0;
}

.history-thumbnail {
  width: 58px;
  height: 48px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: rgba(255, 253, 248, 0.86);
  background: #171512;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.history-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.history-thumbnail.is-audio {
  background: var(--accent);
}

.history-thumbnail.is-unavailable {
  background: #3c3730;
}

.history-menu-button {
  align-self: start;
  justify-self: end;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-weight: 900;
  list-style: none;
  cursor: pointer;
}

.danger-action {
  color: var(--danger) !important;
}

.history-reply-item {
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
  border-color: var(--accent);
  background: var(--reply-bg);
}

.history-reply-item .history-avatar {
  background: var(--warm);
}

.history-avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--accent);
  border-radius: 50%;
  font-weight: 800;
}

.history-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.history-copy strong,
.history-copy span,
.history-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-copy span,
.history-copy small {
  color: var(--muted);
  font-size: 0.88rem;
}

.toast-region {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 10;
  display: grid;
  gap: 10px;
}

.toast {
  max-width: 340px;
  padding: 12px 14px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(18, 16, 14, 0.58);
}

.video-action-sheet {
  position: relative;
  width: min(100%, 360px);
  display: grid;
  gap: 14px;
  padding: 16px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.modal-close-button {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 34px;
  height: 34px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-weight: 900;
}

.video-action-thumbnail {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: rgba(255, 253, 248, 0.86);
  background: #171512;
  border-radius: 8px;
  font-weight: 900;
  text-transform: uppercase;
}

.video-action-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-action-copy {
  display: grid;
  gap: 4px;
}

.video-action-copy h2,
.video-action-copy p {
  margin: 0;
}

.video-action-copy p:not(.eyebrow) {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.video-action-buttons {
  display: grid;
  gap: 8px;
}

.modal-action {
  width: 100%;
}

[hidden] {
  display: none !important;
}

@media (max-width: 820px) {
  .thread-screen {
    padding: 14px;
    gap: 12px;
  }

  .thread-screen-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .account-row {
    width: 100%;
    min-width: 0;
  }

  .thread-screen-body {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 12px;
  }

  .thread-builder {
    max-height: 34dvh;
  }

  .conversation {
    padding: max(10px, env(safe-area-inset-top)) 12px max(10px, env(safe-area-inset-bottom));
    gap: 8px;
  }

  .conversation-header {
    min-height: 48px;
    gap: 8px;
    padding-bottom: 8px;
  }

  .conversation-header h2 {
    font-size: 1.08rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .stage-layout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 8px;
    overflow: hidden;
  }

  .stage-column {
    gap: 8px;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .stage-frame {
    width: min(100%, 430px);
    min-height: 0;
    max-height: 100%;
    justify-self: center;
    aspect-ratio: var(--stage-aspect-ratio, 9 / 16);
  }

  .record-dock {
    left: 10px;
    right: 10px;
    bottom: 10px;
    min-height: 0;
    column-gap: 10px;
  }

  .record-toggle {
    width: 62px;
    height: 62px;
  }

  .record-icon {
    width: 36px;
    height: 36px;
  }

  .camera-toggle {
    width: 48px;
    height: 48px;
  }

  .record-menu-panel {
    width: min(240px, 82vw);
  }

  .history-panel {
    min-height: 112px;
    max-height: 148px;
    padding-left: 0;
    border-left: 0;
    border-top: 1px solid var(--line);
    padding-top: 8px;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 8px;
  }

  .history-panel .empty-state {
    display: none;
  }

  .history-heading h3 {
    font-size: 0.95rem;
  }

  .timeline {
    display: flex;
    flex-direction: row-reverse;
    align-items: stretch;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 0 6px;
  }

  .history-item {
    flex: 0 0 min(70vw, 260px);
    min-height: 64px;
  }

}
