:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --ink: #19202a;
  --muted: #667085;
  --border: #d9dee7;
  --accent: #1f5f99;
  --accent-ink: #0b3d66;
  --actor-bg: #e9f2fb;
  --active-bg: #fff4c7;
  --action-bg: #f1f3f6;
  --danger: #a33a3a;
  --record: #bf1d07;
  --good: #287a4d;
  --nabros-focus-ring: 3px solid #07538c;
  --nabros-focus-ring-inverse: 3px solid #eaf2f8;
  --nabros-focus-halo: 0 0 0 6px #111111;
  --nabros-focus-offset: 2px;
  --brand-paper: #deccba;
  --brand-olive: #62633a;
  --brand-red: #bf1d07;
  --brand-ink: #060b0b;
  --brand-blue: #183f5d;
  --brand-paper-shadow: #baa999;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.45;
}

.client-update-notice {
  position: fixed;
  z-index: 10000;
  right: 16px;
  bottom: 16px;
  display: flex;
  max-width: min(520px, calc(100vw - 32px));
  align-items: center;
  gap: 16px;
  padding: 12px 14px;
  border: 1px solid #475569;
  border-radius: 6px;
  background: #0f172a;
  color: #f8fafc;
  box-shadow: 0 12px 32px rgb(15 23 42 / 28%);
}

.client-update-notice button {
  min-height: 40px;
  flex: 0 0 auto;
}

.client-update-notice.requires-action {
  border-color: #f59e0b;
}

@media (max-width: 600px) {
  .client-update-notice {
    right: 8px;
    bottom: 8px;
    left: 8px;
    max-width: none;
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }
}

.boot-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
}

.boot-view[hidden] {
  display: none;
}

.boot-view-inner {
  display: grid;
  justify-items: center;
  gap: 10px;
  color: var(--muted);
  text-align: center;
}

.boot-view-inner img {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
}

.boot-view-inner strong {
  color: var(--ink);
  font-size: 24px;
}

.boot-view-inner span:not(.boot-progress) {
  font-size: 14px;
}

.page-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 160px;
  padding: 24px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  text-align: center;
}

.page-loading.error {
  flex-wrap: wrap;
  border-color: rgba(185, 28, 28, 0.34);
  color: var(--danger);
}

.app-page-status {
  width: min(1080px, calc(100% - 32px));
  margin: 12px auto 0;
}

.app-page-status[hidden] {
  display: none;
}

.boot-progress {
  width: 180px;
  height: 3px;
  overflow: hidden;
  border-radius: 2px;
  background: var(--border);
}

.boot-progress::after {
  content: "";
  display: block;
  width: 45%;
  height: 100%;
  background: var(--accent);
  animation: boot-progress 1.1s ease-in-out infinite alternate;
}

@keyframes boot-progress {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(122%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .boot-progress::after {
    width: 100%;
    animation: none;
  }
}

button,
select,
input {
  font: inherit;
}

button {
  min-height: 38px;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  padding: 0 12px;
  cursor: pointer;
  line-height: 1.2;
  white-space: normal;
  overflow-wrap: anywhere;
}

button:hover {
  border-color: var(--accent);
}

button:disabled {
  cursor: default;
  opacity: 0.55;
}

#mainView :focus-visible,
.pmf-pilot-dialog :focus-visible {
  outline: var(--nabros-focus-ring);
  outline-offset: var(--nabros-focus-offset);
}

:is(.prompter-panel, .self-tape-panel).is-fullscreen {
  --nabros-focus-ring: var(--nabros-focus-ring-inverse);
}

/* The dark halo keeps focus visible over both camera footage and a light cue. */
:is(.prompter-panel, .self-tape-panel).is-fullscreen :focus-visible {
  outline: var(--nabros-focus-ring);
  outline-offset: var(--nabros-focus-offset);
  box-shadow: var(--nabros-focus-halo);
}

.button-icon {
  display: block;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  pointer-events: none;
}

.button-icon-play,
.button-icon-stop {
  fill: currentColor;
  stroke-width: 1.75;
}

.button-icon-record {
  fill: var(--brand-red);
  stroke: var(--brand-red);
}

button.has-button-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

button.icon-only-button {
  display: inline-grid;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  place-items: center;
}

.button-label {
  min-width: 0;
}

select,
input {
  min-width: 170px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  padding: 0 10px;
}

label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 13px;
}

.public-beta-view {
  min-height: 100vh;
  background: #f4f1e8;
  color: #111111;
}

.public-beta-header {
  position: relative;
  z-index: 2;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 8px max(20px, calc((100vw - 1120px) / 2));
  background: #f7f4ec;
  border-bottom: 1px solid #161616;
}

.public-beta-brand {
  min-width: 0;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #111111;
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", "Arial Black", sans-serif;
  font-size: 28px;
  line-height: 1;
  letter-spacing: 0;
  text-decoration: none;
}

.public-beta-brand img {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  object-fit: cover;
}

.public-beta-header nav {
  display: flex;
  align-items: center;
  gap: 22px;
}

.public-beta-header nav a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  color: #111111;
  font-weight: 700;
  text-decoration: none;
}

.public-beta-header nav a:hover {
  text-decoration: underline;
}

.public-beta-header nav button {
  min-height: 40px;
  border-color: #111111;
  border-radius: 0;
  background: transparent;
  color: #111111;
  font-weight: 700;
}

.public-beta-hero {
  overflow: hidden;
  background: #101010;
}

.public-beta-hero .public-beta-poster {
  width: min(100%, calc(135.3svh - 244px), 1000px);
  margin: 0 auto;
  border: 0;
  border-radius: 0;
}

.public-beta-intro {
  min-height: 330px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  align-items: center;
  gap: 48px;
  padding: 42px max(24px, calc((100vw - 1040px) / 2)) 50px;
  background: #f7f4ec;
}

.public-beta-copy {
  max-width: 760px;
}

.public-beta-copy h1 {
  margin: 0 0 14px;
  color: #111111;
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", "Arial Black", sans-serif;
  font-size: 88px;
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: 0;
}

.public-beta-copy h1::first-letter {
  color: #111111;
}

.public-beta-copy > p:not(.public-beta-note) {
  max-width: 700px;
  margin: 0;
  font-size: 25px;
  font-weight: 700;
  line-height: 1.25;
}

.public-beta-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 30px;
}

.public-beta-primary,
.public-beta-secondary {
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  border: 2px solid #d52216;
  border-radius: 0;
  background: #d52216;
  color: #ffffff;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
}

.public-beta-primary:hover {
  background: #b91810;
  border-color: #b91810;
}

.public-beta-secondary {
  min-width: 150px;
  background: transparent;
  border-color: #111111;
  color: #111111;
}

.public-beta-secondary:hover {
  border-color: #d52216;
  color: #b91810;
}

.public-beta-note {
  margin: 12px 0 0;
  color: #646762;
  font-size: 14px;
}

.public-beta-mark {
  width: 156px;
  height: 156px;
  justify-self: end;
  border-radius: 28px;
  object-fit: cover;
}

.public-beta-demo {
  background: #07538c;
  color: #ffffff;
}

.public-beta-demo-inner {
  width: min(100%, 1040px);
  margin: 0 auto;
  padding: 40px 24px 0;
}

.public-beta-demo h2 {
  margin: 0 0 18px;
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", "Arial Black", sans-serif;
  font-size: 34px;
  line-height: 1;
  letter-spacing: 0;
}

.public-beta-video-frame {
  overflow: hidden;
  border: 5px solid #f7f4ec;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: #111111;
  aspect-ratio: 16 / 9;
}

.public-beta-video-frame video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #111111;
}

.public-beta-steps {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  padding: 26px max(24px, calc((100vw - 1040px) / 2)) 34px;
  background: #f7f4ec;
  color: #111111;
  list-style: none;
}

.public-beta-steps li {
  min-width: 0;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 4px 24px;
  border-right: 1px solid #9b9a95;
}

.public-beta-steps li:first-child {
  padding-left: 0;
}

.public-beta-steps li:last-child {
  padding-right: 0;
  border-right: 0;
}

.public-beta-steps span {
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", "Arial Black", sans-serif;
  font-size: 72px;
  line-height: 1;
}

.public-beta-steps li:nth-child(1) span {
  color: #d52216;
}

.public-beta-steps li:nth-child(2) span {
  color: #07538c;
}

.public-beta-steps li:nth-child(3) span {
  color: #637b43;
}

.public-beta-steps strong {
  overflow-wrap: anywhere;
  font-size: 18px;
  line-height: 1.2;
}

.public-beta-features {
  background: #f7f4ec;
}

.public-beta-section-heading {
  padding: 64px max(24px, calc((100vw - 1040px) / 2)) 52px;
  border-bottom: 1px solid #9b9a95;
  background: #f7f4ec;
}

.public-beta-section-heading > p,
.public-beta-feature-copy > span {
  margin: 0 0 10px;
  color: #b91810;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.public-beta-section-heading h2,
.public-beta-feature-copy h3,
.public-beta-trust h2,
.public-beta-faq h2 {
  letter-spacing: 0;
}

.public-beta-section-heading h2 {
  max-width: 820px;
  margin: 0;
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", "Arial Black", sans-serif;
  font-size: 50px;
  line-height: 1;
}

.public-beta-section-heading > span {
  display: block;
  max-width: 690px;
  margin-top: 18px;
  color: #51534f;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.35;
}

.public-beta-feature {
  min-height: 500px;
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1.28fr);
  align-items: center;
  gap: 54px;
  padding: 60px max(24px, calc((100vw - 1040px) / 2));
  border-bottom: 1px solid #9b9a95;
}

.public-beta-feature-copy {
  min-width: 0;
  max-width: 420px;
}

.public-beta-feature-copy h3 {
  margin: 0;
  font-size: 38px;
  line-height: 1.05;
}

.public-beta-feature-copy p {
  margin: 20px 0 0;
  font-size: 18px;
  line-height: 1.5;
}

.public-beta-feature-media {
  min-width: 0;
  display: block;
  overflow: hidden;
  border: 4px solid #111111;
  border-radius: 8px;
  background: #eef1f4;
  box-shadow: 10px 10px 0 rgba(17, 17, 17, 0.12);
}

.public-beta-feature-media img {
  width: 100%;
  height: auto;
  display: block;
}

.public-beta-feature-prompter {
  grid-template-columns: minmax(0, 1.28fr) minmax(260px, 0.72fr);
  background: #101010;
  color: #ffffff;
}

.public-beta-feature-prompter .public-beta-feature-copy {
  order: 2;
}

.public-beta-feature-prompter .public-beta-feature-media {
  order: 1;
  border-color: #f7f4ec;
  background: #020617;
  box-shadow: 10px 10px 0 rgba(213, 34, 22, 0.72);
}

.public-beta-feature-prompter .public-beta-feature-copy > span {
  color: #f4483d;
}

.public-beta-feature-self-tape {
  background: #e3ead8;
}

.public-beta-feature-self-tape .public-beta-feature-copy > span {
  color: #3e5f2e;
}

.public-beta-trust {
  background: #07538c;
  color: #ffffff;
}

.public-beta-trust-inner,
.public-beta-faq-inner {
  width: min(100%, 1040px);
  margin: 0 auto;
  padding: 60px 24px;
}

.public-beta-trust h2,
.public-beta-faq h2 {
  margin: 0;
  font-size: 38px;
  line-height: 1.1;
}

.public-beta-trust dl {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 36px 0 0;
}

.public-beta-trust dl > div {
  min-width: 0;
  padding: 2px 24px;
  border-left: 1px solid rgba(255, 255, 255, 0.44);
}

.public-beta-trust dl > div:first-child {
  padding-left: 0;
  border-left: 0;
}

.public-beta-trust dt {
  font-size: 17px;
  font-weight: 800;
}

.public-beta-trust dd {
  margin: 10px 0 0;
  color: #dcebf6;
  font-size: 14px;
  line-height: 1.45;
}

.public-beta-faq {
  background: #f7f4ec;
  color: #111111;
}

.public-beta-faq-list {
  margin-top: 28px;
  border-bottom: 1px solid #9b9a95;
}

.public-beta-faq details {
  border-top: 1px solid #9b9a95;
}

.public-beta-faq summary {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 0;
  cursor: pointer;
  font-size: 18px;
  font-weight: 800;
  list-style: none;
}

.public-beta-faq summary::-webkit-details-marker {
  display: none;
}

.public-beta-faq summary::after {
  content: "+";
  flex: 0 0 auto;
  color: #d52216;
  font-size: 30px;
  font-weight: 400;
  line-height: 1;
}

.public-beta-faq details[open] summary::after {
  content: "−";
}

.public-beta-faq details p {
  max-width: 760px;
  margin: -2px 0 20px;
  color: #51534f;
  font-size: 16px;
  line-height: 1.5;
}

.public-beta-closing {
  min-height: 280px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px 32px;
  padding: 48px max(24px, calc((100vw - 1040px) / 2));
  background: #637b43;
  color: #ffffff;
}

.public-beta-closing h2 {
  max-width: 720px;
  margin: 0;
  font-size: 34px;
  line-height: 1.15;
}

.public-beta-closing p {
  grid-column: 1 / -1;
  margin: 0;
  color: #ffffff;
  font-size: 14px;
}

@media (min-width: 701px) {
  .public-beta-hero .public-beta-poster {
    width: min(100%, clamp(320px, calc(135.3svh - 484px), 1000px));
  }

  .public-beta-intro {
    min-height: 220px;
    grid-template-columns: minmax(0, 1fr) 96px;
    gap: 24px;
    padding: 18px max(24px, calc((100vw - 1040px) / 2)) 22px;
  }

  .public-beta-copy h1 {
    margin-bottom: 8px;
    font-size: 64px;
  }

  .public-beta-copy > p:not(.public-beta-note) {
    font-size: 20px;
  }

  .public-beta-actions {
    margin-top: 18px;
  }

  .public-beta-actions .public-beta-primary,
  .public-beta-actions .public-beta-secondary {
    min-height: 46px;
  }

  .public-beta-note {
    margin-top: 8px;
  }

  .public-beta-mark {
    width: 96px;
    height: 96px;
    border-radius: 20px;
  }
}

@media (max-width: 700px) {
  .public-beta-header {
    min-height: 58px;
    gap: 12px;
    padding: 7px 12px;
  }

  .public-beta-brand {
    gap: 7px;
    font-size: 23px;
  }

  .public-beta-brand img {
    width: 26px;
    height: 26px;
  }

  .public-beta-header nav {
    gap: 10px;
  }

  .public-beta-header nav a {
    font-size: 13px;
  }

  .public-beta-header nav button {
    min-height: 40px;
    padding: 0 10px;
  }

  .public-beta-hero .public-beta-poster {
    width: 100%;
  }

  .public-beta-intro {
    min-height: 390px;
    grid-template-columns: minmax(0, 1fr) 64px;
    align-items: start;
    gap: 10px;
    padding: 28px 18px 34px;
  }

  .public-beta-copy h1 {
    margin-bottom: 12px;
    font-size: 58px;
  }

  .public-beta-copy > p:not(.public-beta-note) {
    font-size: 19px;
    line-height: 1.3;
  }

  .public-beta-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    margin-top: 24px;
  }

  .public-beta-primary,
  .public-beta-secondary {
    min-height: 48px;
    padding: 9px 14px;
    font-size: 15px;
  }

  .public-beta-secondary {
    min-width: 104px;
  }

  .public-beta-note {
    grid-column: 1 / -1;
  }

  .public-beta-mark {
    width: 64px;
    height: 64px;
    border-radius: 14px;
  }

  .public-beta-demo-inner {
    padding: 28px 12px 0;
  }

  .public-beta-demo h2 {
    margin-left: 6px;
    font-size: 29px;
  }

  .public-beta-video-frame {
    border-width: 3px;
    border-bottom: 0;
  }

  .public-beta-steps {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .public-beta-steps li,
  .public-beta-steps li:first-child,
  .public-beta-steps li:last-child {
    min-height: 82px;
    grid-template-columns: 46px minmax(0, 1fr);
    padding: 10px 0;
    border-right: 0;
    border-bottom: 1px solid #b8b6af;
  }

  .public-beta-steps li:last-child {
    border-bottom: 0;
  }

  .public-beta-steps span {
    font-size: 58px;
  }

  .public-beta-steps strong {
    font-size: 17px;
  }

  .public-beta-section-heading {
    padding: 42px 18px 36px;
  }

  .public-beta-section-heading h2 {
    font-size: 38px;
  }

  .public-beta-section-heading > span {
    margin-top: 14px;
    font-size: 17px;
  }

  .public-beta-feature {
    min-height: 0;
    grid-template-columns: 1fr;
    gap: 26px;
    padding: 38px 18px 42px;
  }

  .public-beta-feature-prompter {
    grid-template-columns: 1fr;
  }

  .public-beta-feature .public-beta-feature-media {
    order: 1;
  }

  .public-beta-feature .public-beta-feature-copy {
    order: 2;
    max-width: none;
  }

  .public-beta-feature-copy h3 {
    font-size: 31px;
  }

  .public-beta-feature-copy p {
    margin-top: 14px;
    font-size: 16px;
  }

  .public-beta-feature-media {
    border-width: 3px;
    box-shadow: 6px 6px 0 rgba(17, 17, 17, 0.12);
  }

  .public-beta-feature-prompter .public-beta-feature-media {
    box-shadow: 6px 6px 0 rgba(213, 34, 22, 0.72);
  }

  .public-beta-feature-self-tape .public-beta-feature-media img {
    height: 210px;
    object-fit: cover;
    object-position: left center;
  }

  .public-beta-trust-inner,
  .public-beta-faq-inner {
    padding: 42px 18px;
  }

  .public-beta-trust h2,
  .public-beta-faq h2 {
    font-size: 31px;
  }

  .public-beta-trust dl {
    grid-template-columns: 1fr;
    margin-top: 26px;
  }

  .public-beta-trust dl > div,
  .public-beta-trust dl > div:first-child {
    padding: 18px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.44);
    border-left: 0;
  }

  .public-beta-trust dl > div:last-child {
    padding-bottom: 0;
  }

  .public-beta-faq-list {
    margin-top: 22px;
  }

  .public-beta-faq summary {
    min-height: 56px;
    font-size: 16px;
  }

  .public-beta-closing {
    min-height: 260px;
    grid-template-columns: 1fr;
    align-content: center;
    padding: 36px 18px;
  }

  .public-beta-closing h2 {
    font-size: 27px;
  }

  .public-beta-closing .public-beta-primary {
    justify-self: stretch;
  }

  .public-beta-closing p {
    grid-column: auto;
  }
}

@media (max-width: 360px) {
  .public-beta-header nav a {
    display: none;
  }

  .public-beta-intro {
    grid-template-columns: minmax(0, 1fr) 54px;
  }

  .public-beta-copy h1 {
    font-size: 52px;
  }

  .public-beta-copy > p:not(.public-beta-note) {
    font-size: 18px;
  }

  .public-beta-mark {
    width: 54px;
    height: 54px;
    border-radius: 12px;
  }
}

.auth-dialog {
  width: min(420px, calc(100vw - 28px));
  max-height: calc(100dvh - 28px);
  margin: auto;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
}

.auth-dialog::backdrop {
  background: rgb(17 17 17 / 72%);
  backdrop-filter: blur(2px);
}

.auth-dialog-close {
  position: absolute;
  z-index: 2;
  top: 8px;
  right: 8px;
  width: 40px;
  min-width: 40px;
  height: 40px;
  padding: 0;
  border-color: transparent;
  background: transparent;
  color: #ffffff;
  font-size: 25px;
  line-height: 1;
}

.auth-dialog-close:hover {
  border-color: #111111;
  background: #111111;
  color: #ffffff;
}

.auth-dialog :focus-visible {
  outline: 3px solid #07538c;
  outline-offset: 2px;
}

.login-view {
  width: 100%;
  max-height: calc(100dvh - 28px);
  padding: 0;
  overflow: auto;
}

#loginMessage[data-kind="success"],
#loginMessage:not(:empty) {
  color: var(--good);
}

.admin-password-reset-action {
  grid-column: 1 / -1;
  min-width: 0;
}

.admin-password-reset-action > summary {
  min-height: 38px;
  display: flex;
  align-items: center;
  cursor: pointer;
  color: var(--accent-ink);
  font-weight: 700;
}

.admin-password-reset-action > p {
  margin: 4px 0 8px;
  color: var(--muted);
  font-size: 13px;
}

.admin-password-reset-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.login-stack {
  width: 100%;
  max-width: 400px;
  min-width: 0;
  display: grid;
  gap: 0;
  overflow: hidden;
  border: 2px solid #111111;
  border-radius: 8px;
  background: #f7f4ec;
  box-shadow: 0 18px 48px rgb(17 17 17 / 32%);
}

.auth-brand {
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 56px 8px 14px;
  border-bottom: 2px solid #111111;
  background: #d52216;
  color: #ffffff;
}

.auth-brand img {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border: 1px solid #111111;
  border-radius: 6px;
}

.auth-brand strong {
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", "Arial Black", sans-serif;
  font-size: 28px;
  line-height: 1;
  letter-spacing: 0;
}

.login-panel {
  width: 100%;
  min-width: 0;
  display: grid;
  gap: 10px;
  padding: 16px 18px 18px;
  background: #f7f4ec;
  border: 0;
  border-radius: 0;
}

.login-panel input {
  width: 100%;
  min-width: 0;
  height: 40px;
  border-color: #111111;
  background: #ffffff;
}

.auth-field,
.auth-fields {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.auth-fields {
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}

.password-input-wrap {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
}

.password-input-wrap input {
  grid-column: 1 / -1;
  grid-row: 1;
  padding-right: 48px;
}

.login-panel .password-toggle {
  z-index: 1;
  grid-column: 2;
  grid-row: 1;
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border: 0;
  border-left: 1px solid #111111;
  border-radius: 0 5px 5px 0;
  background: #f7f4ec;
  color: #111111;
}

.login-poster-frame {
  position: relative;
  width: 100%;
  container-type: inline-size;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #0b1020;
}

.login-poster {
  width: 100%;
  height: auto;
  display: block;
}

.login-poster-phrase {
  position: absolute;
  left: 83.2%;
  top: 38.3%;
  width: 15.7%;
  height: 21%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f5efe1;
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", "Arial Black", sans-serif;
  font-size: var(--login-poster-phrase-size, clamp(10px, calc(var(--login-poster-phrase-factor, 4.2) * 1cqw), 32px));
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.02em;
  text-align: center;
  text-transform: uppercase;
  overflow-wrap: normal;
  word-break: normal;
  white-space: pre-line;
  overflow: hidden;
  pointer-events: none;
}

.login-panel h1,
.login-panel h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}

.login-panel p {
  margin: 0 0 2px;
  color: #4d4b46;
  font-size: 14px;
  line-height: 1.35;
}

@media (max-width: 600px) {
  .about-panel {
    width: calc(100% - 28px);
    min-width: 0;
  }
}

@media (min-width: 760px) {
  .login-stack {
    max-width: 400px;
  }

  .login-panel {
    width: min(100%, 400px);
    justify-self: center;
  }
}

.login-panel button {
  background: #d52216;
  border-color: #d52216;
  color: white;
}

.play-scene {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.login-panel button {
  min-height: 40px;
  height: auto;
}

.login-panel .secondary-button {
  background: transparent;
  border-color: #111111;
  color: #111111;
}

.auth-help {
  color: #07538c;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  text-underline-offset: 3px;
}

.auth-feedback {
  min-height: 20px;
  display: grid;
  align-items: start;
}

.auth-feedback > :empty {
  display: none;
}

.form-error,
.form-message {
  min-height: 0;
  color: #9e1b14;
  font-size: 13px;
  line-height: 1.35;
}

.form-message {
  color: var(--good);
}

.form-message[data-kind="error"] {
  color: var(--danger);
}

.form-message[data-kind="status"] {
  color: var(--muted);
}

.form-message[data-kind="success"] {
  color: var(--good);
}

.global-shell {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--border);
}

.workspace-context-bar {
  display: flex;
  gap: 10px;
  align-items: end;
  max-width: 1120px;
  margin: 0 auto;
  padding: 8px 24px 0;
}

.workspace-context-bar[hidden] {
  display: none;
}

.workspace-context-field {
  display: grid;
  grid-template-columns: auto minmax(180px, 260px);
  gap: 8px;
  align-items: center;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
}

.workspace-context-field select {
  width: 100%;
  min-width: 0;
}

.workspace-context-status {
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
}

.voice-create-workspace {
  display: flex;
  gap: 8px;
  align-items: baseline;
  margin-bottom: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
}

.voice-create-workspace strong {
  color: var(--text);
}

.global-shell h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.1;
}

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

.about-icon-button {
  flex: 0 0 32px;
  width: 32px;
  min-width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 999px;
  color: var(--accent-ink);
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
}

.global-nav,
.global-userbox {
  display: flex;
  gap: 8px;
  align-items: center;
}

.global-nav {
  justify-content: center;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}

.global-nav .nav-button {
  flex: 0 0 auto;
}

.global-userbox {
  justify-content: flex-end;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
}

.global-userbox span {
  overflow: hidden;
  max-width: 220px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-logo {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border-radius: 8px;
  object-fit: cover;
}

.nav-button.active,
.about-icon-button.active {
  border-color: var(--accent);
  background: var(--actor-bg);
  color: var(--accent-ink);
  font-weight: 600;
}

.material-toolbar {
  display: grid;
  max-width: 1120px;
  margin: 0 auto;
  gap: 8px;
  padding: 12px 24px 0;
}

.material-info-panel {
  display: grid;
  max-width: 1120px;
  margin: 0 auto;
  padding: 12px 24px 0;
}

.material-info-panel:not([hidden]) + .material-toolbar {
  padding-top: 8px;
}

.material-toolbar-primary {
  display: grid;
  grid-template-columns:
    minmax(180px, 1fr)
    minmax(120px, 0.65fr)
    minmax(660px, auto);
  gap: 10px 12px;
  align-items: end;
  justify-content: stretch;
}

.material-toolbar-advanced {
  min-width: 0;
}

.material-toolbar-advanced summary {
  width: max-content;
  min-height: 32px;
  padding: 5px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--accent-ink);
  cursor: pointer;
  font-size: 13px;
}

.material-toolbar-advanced summary:hover {
  border-color: var(--border);
  background: white;
}

.material-toolbar-advanced-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 12px;
  align-items: end;
  padding-top: 8px;
}

.control-field {
  position: relative;
  display: grid;
  gap: 4px;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
}

.control-field select,
.control-field input,
.actor-roles-button {
  width: 100%;
  min-width: 0;
}

.actor-roles-button {
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.actor-roles-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 30;
  width: min(320px, 88vw);
  max-height: 320px;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: white;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
}

.actor-role-option {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 5px 6px;
  border-radius: 5px;
  color: var(--ink);
  font-size: 13px;
}

.actor-role-option:hover {
  background: var(--bg);
}

.actor-role-option input {
  width: 14px;
  min-width: 14px;
  height: 14px;
  margin: 0;
}

.actor-role-option span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.material-field {
  grid-column: 1;
}

.character-field {
  grid-column: 2;
}

.pause-field {
  grid-column: 2;
}

.actor-mode-field {
  grid-column: 1;
}

.vad-field {
  grid-column: 3;
}

#pauseMultiplier {
  min-width: 0;
}

#actorLineMode,
#vadSilence {
  min-width: 0;
}

.icon-button {
  width: 42px;
  min-width: 42px;
  padding: 0;
}

.top-play-actions {
  display: grid;
  grid-template-columns: max-content max-content minmax(178px, max-content) minmax(210px, 250px);
  grid-column: 3;
  gap: 8px;
  align-items: end;
  justify-self: end;
  min-width: 0;
}

.actor-wait-mode {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px 4px;
  min-width: 178px;
}

.actor-wait-label {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.1;
}

.actor-wait-mode-button {
  min-width: 0;
  height: 28px;
  padding: 0 7px;
  color: var(--accent-ink);
  font-size: 13px;
  line-height: 1.1;
  white-space: nowrap;
}

.actor-wait-mode-button.active {
  border-color: var(--accent);
  background: var(--actor-bg);
  color: var(--accent-ink);
  font-weight: 700;
}

.tempo-control {
  display: grid;
  grid-template-columns: auto minmax(72px, 1fr) auto;
  gap: 2px 7px;
  align-items: center;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.15;
}

.tempo-label {
  color: var(--ink);
  font-weight: 700;
}

.tempo-status {
  min-width: 116px;
  color: var(--muted);
  text-align: right;
  white-space: nowrap;
}

.tempo-control input[type="range"] {
  width: 100%;
  min-width: 0;
  height: 28px;
  padding: 0;
  accent-color: var(--accent);
}

.tempo-control.is-disabled {
  opacity: 0.65;
}

.playback-button {
  color: var(--accent-ink);
}

.material-playback-button {
  min-width: 148px;
  padding-inline: 10px;
  white-space: nowrap;
}

.random-cue-button {
  min-width: 108px;
  border-color: #121212;
  background: #050505;
  color: #ff4438;
  font-family: Impact, Haettenschweiler, "Arial Black", Arial, Helvetica, sans-serif;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.random-cue-button:hover {
  border-color: #ff4438;
  background: #0d0d0d;
}

.random-cue-button:disabled {
  border-color: #333;
  background: #111;
  color: #9b2c23;
}

.playback-button.is-playing {
  color: var(--danger);
}

.line-play.is-playing {
  border-color: var(--danger);
  color: var(--danger);
}

.admin-panel,
.about-panel,
.import-panel,
.cast-panel,
.voices-panel,
.recordings-panel,
.app {
  max-width: 1120px;
  margin: 0 auto;
}

@media (max-width: 1040px) {
  .global-shell {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .global-userbox {
    grid-column: 2;
    grid-row: 1;
  }

  .global-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
  }

  .material-toolbar-primary {
    grid-template-columns:
      minmax(0, 1.15fr)
      minmax(0, 0.85fr);
  }

  .top-play-actions {
    grid-column: 1 / -1;
    justify-self: stretch;
    grid-template-columns: max-content max-content minmax(178px, max-content) minmax(210px, 1fr);
  }

  .material-playback-button {
    min-width: 144px;
  }

  .random-cue-button {
    min-width: 104px;
  }

  .voice-filters {
    top: 96px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.admin-panel,
.about-panel,
.import-panel,
.cast-panel,
.voices-panel,
.recordings-panel {
  padding: 18px 24px 0;
}

.admin-panel,
.import-panel {
  display: grid;
  gap: 12px;
}

.about-panel {
  display: grid;
  width: min(1120px, calc(100% - 28px));
  gap: 10px;
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
}

.about-copy {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.about-lede,
.about-author {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.about-lede p,
.about-meta {
  min-width: 0;
}

.about-mark {
  display: block;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
}

.about-mascot {
  display: block;
  width: 48px;
  max-height: 44px;
  object-fit: contain;
}

.about-meta {
  display: grid;
  gap: 2px;
  margin: 0;
}

.about-meta div {
  display: flex;
  gap: 6px;
  align-items: baseline;
}

.about-meta dt {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.3;
}

.about-meta dd {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.3;
}

.about-meta a {
  color: var(--accent);
  text-decoration: none;
}

.about-meta a:hover {
  text-decoration: underline;
}

.about-codex {
  max-width: 760px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.admin-subpanel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
}

.poster-phrases-form textarea {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  font: inherit;
}

.poster-phrase-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-panel h2,
.admin-panel h3,
.about-panel h2,
.import-panel h2,
.cast-panel h2,
.voices-panel h2 {
  margin: 0;
  font-size: 18px;
  color: var(--accent-ink);
}

.admin-panel h3 {
  font-size: 16px;
}

.admin-panel p,
.about-panel p,
.import-panel p,
.cast-panel p,
.voices-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.profile-header {
  display: grid;
  gap: 3px;
}

.profile-privacy-note {
  max-width: 760px;
  padding: 8px 10px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1e3a8a !important;
}

.profile-account-details {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
}

.profile-account-details summary {
  display: flex;
  gap: 8px;
  align-items: baseline;
  min-width: 0;
  color: var(--accent-ink);
  font-weight: 700;
  cursor: pointer;
}

.profile-account-details summary small {
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
}

.profile-account-details .account-form {
  margin-top: 10px;
  padding: 0;
  border: 0;
}

.profile-devices-panel,
.profile-workspaces-panel {
  display: grid;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
}

.profile-workspaces-panel[hidden] {
  display: none;
}

.scene.deep-linked {
  outline: 3px solid #f59e0b;
  outline-offset: 3px;
}

.push-notifications-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
}

.push-notifications-panel h3,
.push-notifications-panel p {
  margin: 0;
}

.push-notifications-panel p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.push-notifications-panel > .form-message {
  grid-column: 1 / -1;
}

.push-notification-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.push-devices-heading,
.push-devices {
  grid-column: 1 / -1;
}

.push-devices-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  align-items: start;
  padding-top: 9px;
  border-top: 1px solid var(--border);
}

.push-devices-heading h4,
.push-devices-heading p,
.push-devices-empty {
  margin: 0;
}

.push-device-list {
  display: grid;
  gap: 6px;
}

.push-device-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #e5e7eb;
}

.push-device-row:last-child {
  border-bottom: 0;
}

.push-device-body,
.push-device-title {
  min-width: 0;
}

.push-device-title {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.push-device-title strong {
  max-width: min(100%, 520px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.push-device-badge {
  flex: 0 0 auto;
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.push-device-badge.current {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
}

.push-device-status,
.push-device-meta,
.push-devices-empty,
.push-devices-inactive summary {
  color: var(--muted);
  font-size: 13px;
}

.push-device-row[data-status="active"] .push-device-status {
  color: #166534;
}

.push-device-row[data-status="admin_blocked"] .push-device-status {
  color: #991b1b;
}

.push-devices-inactive {
  padding-top: 4px;
}

.push-devices-inactive summary {
  width: fit-content;
  cursor: pointer;
  font-weight: 600;
}

.push-devices-inactive .push-device-list {
  padding-top: 5px;
}

@media (max-width: 640px) {
  .push-notifications-panel {
    grid-template-columns: minmax(0, 1fr);
  }

  .push-notification-actions {
    justify-content: flex-start;
  }

  .push-devices-heading,
  .push-device-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .push-devices-heading > button,
  .push-device-row > button {
    min-height: 40px;
    justify-self: stretch;
  }
}

.profile-devices-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.profile-devices {
  display: grid;
  gap: 8px;
}

.profile-device-card {
  display: grid;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #f8fafc;
}

.profile-device-card.current {
  border-color: #93c5fd;
  background: #eff6ff;
}

.profile-device-card.online {
  border-color: #86efac;
}

.profile-device-header,
.profile-device-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  min-width: 0;
}

.profile-device-header strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--accent-ink);
  font-size: 13px;
}

.profile-device-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1e40af;
  font-size: 13px;
  font-weight: 700;
}

.profile-device-badge.online {
  background: #dcfce7;
  color: #166534;
}

.profile-device-meta,
.profile-device-line,
.profile-device-empty {
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
}

.profile-device-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-devices-more {
  border-top: 1px solid var(--border);
  padding-top: 8px;
}

.profile-devices-more > summary {
  color: var(--accent-ink);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.profile-devices-more-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.admin-tabs {
  display: grid;
  gap: 12px;
}

.admin-tablist {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.admin-tablist button {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 12px;
  border-color: var(--border);
  background: white;
  color: var(--accent-ink);
}

.admin-tablist button.active {
  border-color: var(--accent);
  background: var(--action-bg);
}

.admin-tab-panel {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.admin-workspace-view-tabs {
  display: inline-flex;
  gap: 6px;
  justify-self: start;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
}

.admin-workspace-view-tabs button {
  min-height: 34px;
  border-color: transparent;
  background: transparent;
}

.admin-workspace-view-tabs button.active {
  border-color: var(--border);
  background: white;
  color: var(--accent-ink);
}

.admin-workspace-view {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.admin-personal-workspace-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.admin-personal-workspace-search {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.admin-personal-workspace-search > span,
.admin-personal-workspace-empty-toggle,
.admin-personal-workspace-count,
.admin-personal-workspace-identity span,
.admin-personal-material-copy span,
.admin-personal-material-unavailable,
.admin-personal-workspace-empty {
  color: var(--muted);
  font-size: 13px;
}

.admin-personal-workspace-empty-toggle {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 38px;
}

.admin-personal-workspaces {
  display: grid;
  min-width: 0;
  border-top: 1px solid var(--border);
}

.admin-personal-workspace {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.admin-personal-workspace-heading,
.admin-personal-material {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.admin-personal-workspace-identity,
.admin-personal-material-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.admin-personal-workspace-identity strong,
.admin-personal-material-copy strong,
.admin-personal-workspace-identity span,
.admin-personal-material-copy span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.admin-personal-workspace-identity strong,
.admin-personal-material-copy strong {
  color: var(--accent-ink);
}

.admin-personal-materials {
  display: grid;
  min-width: 0;
}

.admin-personal-material {
  min-height: 46px;
  padding: 7px 0 7px 18px;
}

.admin-personal-material + .admin-personal-material {
  border-top: 1px solid #e5e7eb;
}

.admin-personal-material-warning {
  color: var(--danger) !important;
  font-weight: 700;
}

.admin-personal-material-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--accent-ink);
  text-decoration: none;
}

.admin-personal-material-open:hover {
  border-color: var(--accent);
}

.admin-personal-workspace-empty {
  margin: 0;
  padding: 10px 0;
}

.admin-workspace-create-form,
.admin-workspace-edit,
.admin-workspace-add-member {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 8px;
  align-items: end;
  min-width: 0;
}

.admin-workspace-create-form label {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.admin-workspace-create-form label > span {
  color: var(--muted);
  font-size: 13px;
}

.admin-workspaces,
.admin-workspace-members,
.admin-workspace-invites {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.admin-workspace-item {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
}

.admin-workspace-item.archived {
  background: #f8fafc;
}

.admin-workspace-item > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 44px;
  padding: 8px 12px;
  cursor: pointer;
}

.admin-workspace-summary-title {
  display: flex;
  gap: 8px;
  align-items: baseline;
  min-width: 0;
  flex-wrap: wrap;
}

.admin-workspace-summary-title strong {
  color: var(--accent-ink);
}

.admin-workspace-summary-title span,
.admin-workspace-counts,
.admin-workspace-member-identity span,
.admin-workspace-empty,
.admin-workspace-invite > span {
  color: var(--muted);
  font-size: 13px;
}

.admin-workspace-body {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 12px;
  border-top: 1px solid var(--border);
}

.admin-workspace-edit {
  grid-template-columns: minmax(220px, 1fr) auto auto;
}

.admin-workspace-section {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.admin-workspace-section h4 {
  margin: 0;
  color: var(--accent-ink);
  font-size: 14px;
}

.admin-workspace-section-heading {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.admin-workspace-member,
.admin-workspace-invite {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding-block: 6px;
  border-bottom: 1px solid #e5e7eb;
}

.admin-workspace-member-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.admin-workspace-member-actions select {
  min-width: 130px;
}

.admin-workspace-role {
  color: var(--muted);
  font-size: 13px;
}

.admin-workspace-member:last-child,
.admin-workspace-invite:last-child {
  border-bottom: 0;
}

.admin-workspace-member-identity {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.admin-workspace-member-identity strong,
.admin-workspace-member-identity span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.admin-workspace-invite {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.admin-tab-heading {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  align-items: start;
}

.about-panel p {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

.account-form,
.admin-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: end;
}

.account-form {
  display: grid;
  grid-template-columns: minmax(240px, 1.2fr) minmax(180px, 0.8fr) auto;
  align-items: end;
}

.account-readonly-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

.account-readonly-field {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.account-readonly-field span {
  color: var(--muted);
  font-size: 13px;
}

.account-readonly-field strong {
  min-height: 38px;
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #f8fafc;
  color: var(--ink);
  font-size: 13px;
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.script-import-form {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
}

.account-form label,
.script-import-form label {
  display: grid;
  gap: 4px;
  min-width: 180px;
}

.account-form label span,
.script-import-form label span {
  color: var(--muted);
  font-size: 13px;
}

.account-form .form-message,
.script-import-form .form-message {
  grid-column: 1 / -1;
  align-self: center;
}

.script-import-form {
  display: grid;
  gap: 12px;
  align-items: stretch;
}

.script-import-draft {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--action-bg);
}

.script-import-draft[hidden] {
  display: none;
}

.script-import-draft > div {
  display: flex;
  gap: 4px 12px;
  align-items: baseline;
  flex-wrap: wrap;
  min-width: 0;
}

.script-import-draft strong {
  color: var(--accent-ink);
}

.script-import-draft span,
.script-import-destination {
  color: var(--muted);
  font-size: 13px;
}

.script-import-step {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.script-import-step-number {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--action-bg);
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 700;
}

.script-import-step-body {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.script-import-step-body small {
  color: var(--muted);
  font-size: 13px;
}

.script-import-access {
  margin: 0;
  padding: 0;
  border: 0;
}

.script-import-access legend {
  margin-bottom: 6px;
  padding: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.script-import-visibility-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.script-import-visibility-options label,
.material-sharing-options label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fbfcff;
  cursor: pointer;
}

.script-import-visibility-options input[type="radio"],
.material-sharing-options input[type="radio"] {
  min-width: 0;
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  padding: 0;
  accent-color: var(--accent);
}

.script-import-visibility-options label > span,
.material-sharing-options label > span {
  display: grid;
  gap: 2px;
  min-width: 0;
  color: var(--ink);
}

.script-import-visibility-options strong,
.material-sharing-options strong {
  font-size: 13px;
}

.script-import-visibility-options small,
.material-sharing-options small {
  line-height: 1.3;
}

.script-import-sharing {
  display: grid;
  gap: 7px;
  padding-top: 4px;
}

.script-import-sharing[hidden] {
  display: none;
}

.script-import-sharing-search {
  min-width: 0 !important;
}

.script-import-sharing-list,
.project-sharing-list {
  display: grid;
  gap: 2px;
  max-height: 220px;
  overflow-y: auto;
  border-block: 1px solid var(--border);
}

.project-sharing-user {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 9px !important;
  align-items: center;
  min-width: 0 !important;
  padding: 7px 4px;
  border-bottom: 1px solid #edf0f5;
  cursor: pointer;
}

.project-sharing-user:last-child {
  border-bottom: 0;
}

.project-sharing-user input[type="checkbox"] {
  min-width: 17px;
  min-height: 17px;
  width: 17px;
  height: 17px;
  margin: 0;
}

.project-sharing-user > span {
  display: flex !important;
  gap: 7px;
  align-items: baseline;
  min-width: 0;
  color: var(--ink) !important;
}

.project-sharing-user strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.project-sharing-user small {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-sharing-empty {
  margin: 0;
  padding: 9px 4px;
  color: var(--muted);
  font-size: 13px;
}

.script-import-file-field {
  display: grid;
  gap: 6px;
}

.script-import-dropzone {
  display: grid;
  gap: 6px;
  min-height: 84px;
  padding: 12px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: #fbfcff;
  transition: border-color 120ms ease, background 120ms ease;
}

.script-import-dropzone input[type="file"] {
  max-width: 100%;
}

.script-import-dropzone.is-dragging {
  border-color: var(--accent);
  background: #eef6ff;
}

.script-import-dropzone.is-ready {
  border-color: var(--good);
  background: #f2fbf5;
}

.script-import-dropzone.is-error {
  border-color: var(--danger);
  background: #fff7f6;
}

.script-import-dropzone-title {
  color: var(--ink);
  font-weight: 600;
}

.script-import-dropzone-meta,
.script-import-constraints {
  color: var(--muted);
  font-size: 13px;
}

.script-import-submit-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.script-import-destination {
  flex: 1 0 100%;
  margin: 0;
  color: var(--ink);
  font-weight: 600;
}

.script-import-preview {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--action-bg);
  color: var(--ink);
  font-size: 13px;
}

.script-import-preview strong {
  color: var(--accent-ink);
}

.script-import-warnings {
  display: grid;
  gap: 2px;
  margin: 2px 0 0 18px;
  padding: 0;
  color: var(--danger);
}

.script-import-constraints {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.script-import-constraints span {
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: white;
}

.voice-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  align-items: end;
  align-self: start;
}

.voice-form h3,
.voice-form .form-help {
  grid-column: 1 / -1;
}

.voice-form label {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.voice-form label span {
  color: var(--muted);
  font-size: 13px;
}

.voice-form textarea {
  min-height: 48px;
  resize: vertical;
}

.voice-form input,
.voice-form select,
.voice-form textarea {
  min-width: 0;
  max-width: 100%;
  width: 100%;
}

.voice-form .wide-field,
.voice-form .form-help-details {
  grid-column: 1 / -1;
}

.voice-form .form-help-details {
  color: var(--muted);
  font-size: 13px;
}

.voice-form .form-help-details summary {
  cursor: pointer;
  color: var(--accent-ink);
  font-weight: 700;
}

.admin-users {
  display: grid;
  gap: 5px;
}

.admin-users-table {
  display: grid;
  gap: 0;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
}

.admin-users-table-row {
  display: grid;
  grid-template-columns:
    minmax(190px, 1.2fr)
    minmax(88px, 0.45fr)
    minmax(74px, 0.35fr)
    minmax(140px, 0.7fr)
    minmax(120px, 0.65fr)
    minmax(110px, 0.55fr)
    minmax(112px, 0.55fr);
  gap: 8px;
  align-items: center;
  min-width: 960px;
  padding: 7px 8px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
}

.admin-users-table-item {
  display: grid;
  min-width: 960px;
  border-bottom: 1px solid var(--border);
}

.admin-users-table-item .admin-users-table-row {
  min-width: 0;
  border-bottom: 0;
}

.admin-users-table-item:last-child {
  border-bottom: 0;
}

.admin-users-table-row:last-child {
  border-bottom: 0;
}

.admin-users-table-row.header {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  color: var(--accent-ink);
  font-weight: 700;
}

.admin-users-table-row.disabled {
  background: #fbfbfc;
}

.admin-users-table-identity .admin-user-identity {
  align-items: center;
}

.admin-user-sort-button {
  min-height: 26px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
}

.admin-user-sort-button:hover {
  text-decoration: underline;
}

.admin-user-row-details summary,
.admin-user-actions-toggle {
  width: fit-content;
  min-height: 26px;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #f8fafc;
  color: var(--accent-ink);
  font-weight: 700;
  cursor: pointer;
}

.admin-user-actions-toggle[aria-expanded="true"] {
  border-color: var(--accent);
  background: var(--action-bg);
}

.admin-user-row-details-body {
  display: grid;
  gap: 8px;
  min-width: 0;
  margin: 0 8px 8px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.admin-user-row-details-body[hidden] {
  display: none;
}

.admin-user-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
  gap: 8px;
  align-items: end;
}

.admin-user-search {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.admin-user-search span {
  color: var(--muted);
  font-size: 13px;
}

.admin-user-search input {
  width: 100%;
  min-width: 0;
}

.admin-user-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.admin-user-filters button {
  min-height: 34px;
  padding: 0 10px;
  background: white;
  color: var(--accent-ink);
}

.admin-user-filters button.active {
  border-color: var(--accent);
  background: var(--action-bg);
}

.admin-audit-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 280px) minmax(160px, 240px);
  gap: 10px;
  align-items: end;
}

.admin-audit-action-filter {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 13px;
}

.admin-audit-action-filter select {
  height: 36px;
  min-width: 0;
}

.admin-audit-log {
  display: grid;
  gap: 8px;
}

.admin-audit-item,
.admin-audit-empty {
  display: grid;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
}

.admin-audit-item-header {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
}

.admin-audit-item-header strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--accent-ink);
  font-size: 13px;
}

.admin-audit-action {
  flex: 0 0 auto;
  padding: 2px 7px;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 700;
}

.admin-audit-meta {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 13px;
}

.admin-audit-details summary {
  width: fit-content;
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.admin-audit-details pre {
  max-height: 220px;
  overflow: auto;
  margin: 6px 0 0;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #f8fafc;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.4;
  white-space: pre-wrap;
}

.admin-create-user {
  display: grid;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
}

.admin-create-user summary {
  width: fit-content;
  color: var(--accent-ink);
  font-weight: 700;
  cursor: pointer;
}

.admin-users-empty {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  color: var(--muted);
  font-size: 13px;
}

.admin-invites {
  display: grid;
  gap: 8px;
}

.admin-invite {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
}

.admin-invite.empty {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.invite-meta {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.invite-meta strong {
  font-size: 13px;
  color: var(--accent-ink);
}

.invite-meta input {
  width: 100%;
  min-width: 0;
  font-size: 13px;
}

.invite-row-actions,
.invite-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-user-identity {
  display: flex;
  gap: 6px;
  align-items: baseline;
  flex-wrap: wrap;
  min-width: 0;
}

.admin-user-identity strong {
  color: var(--accent-ink);
  font-size: 13px;
}

.admin-user-identity span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.online-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: max-content;
  padding: 1px 6px;
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
  font-size: 13px;
  font-weight: 700;
}

.online-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
}

.admin-user-actions {
  display: grid;
  grid-template-columns: minmax(175px, 220px) minmax(130px, 150px) repeat(3, max-content);
  gap: 6px;
  justify-content: flex-end;
  align-items: center;
  min-width: 0;
}

.admin-name-edit,
.admin-balance-edit {
  display: flex;
  gap: 6px;
  min-width: 0;
}

.admin-name-edit input,
.admin-balance-edit input {
  min-width: 0;
  flex: 1 1 120px;
  height: 32px;
  font-size: 13px;
  padding: 0 8px;
}

.admin-balance-edit input {
  flex-basis: 70px;
}

.admin-user-actions button {
  height: 32px;
  padding: 0 8px;
  font-size: 13px;
}

.admin-material-access,
.admin-voice-permissions {
  margin: 0 8px 6px;
  color: var(--muted);
  font-size: 13px;
}

.admin-material-access.static,
.admin-voice-permissions.static {
  width: fit-content;
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #f8fafc;
}

.admin-material-access summary,
.admin-voice-permissions summary,
.admin-user-devices summary,
.admin-device-technical summary {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #f8fafc;
  color: var(--accent-ink);
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}

.admin-material-access summary::-webkit-details-marker,
.admin-voice-permissions summary::-webkit-details-marker,
.admin-user-devices summary::-webkit-details-marker,
.admin-device-technical summary::-webkit-details-marker {
  display: none;
}

.admin-material-access summary::before,
.admin-voice-permissions summary::before,
.admin-user-devices summary::before,
.admin-device-technical summary::before {
  content: "▸";
  color: var(--muted);
  font-size: 13px;
}

.admin-material-access[open] summary::before,
.admin-voice-permissions[open] summary::before,
.admin-user-devices[open] summary::before,
.admin-device-technical[open] summary::before {
  content: "▾";
}

.admin-material-access summary small,
.admin-voice-permissions summary small,
.admin-user-devices summary small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

.admin-devices-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 6px;
  padding-top: 6px;
}

.admin-devices {
  display: grid;
  gap: 8px;
}

.admin-push-heading {
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.admin-push-registrations {
  display: grid;
  gap: 8px;
}

.admin-push-registration {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px 12px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
}

.admin-push-registration.blocked {
  border-color: #fca5a5;
  background: #fff7f7;
}

.admin-push-registration-header,
.admin-push-device,
.admin-push-meta,
.admin-push-technical {
  grid-column: 1;
  min-width: 0;
}

.admin-push-registration-header {
  display: flex;
  gap: 10px;
  align-items: start;
  justify-content: space-between;
}

.admin-push-registration-header > div {
  display: grid;
  min-width: 0;
}

.admin-push-registration-header strong,
.admin-push-registration-header span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-push-registration-header > div > span,
.admin-push-meta,
.admin-push-technical {
  color: var(--muted);
  font-size: 13px;
}

.admin-push-device {
  color: var(--accent-ink);
  font-weight: 600;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
}

.admin-push-status {
  flex: 0 0 auto;
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}

.admin-push-status.active {
  border-color: #86efac;
  background: #f0fdf4;
  color: #166534;
}

.admin-push-status.blocked {
  border-color: #fca5a5;
  background: #fef2f2;
  color: #991b1b;
}

.admin-push-status.disabled,
.admin-push-status.expired {
  border-color: #d1d5db;
  background: #f9fafb;
  color: #4b5563;
}

.admin-push-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 3px 12px;
}

.admin-push-meta strong {
  color: var(--ink);
  font-weight: 500;
}

.admin-push-technical summary {
  width: fit-content;
  cursor: pointer;
}

.admin-push-technical div {
  padding-top: 4px;
  overflow-wrap: anywhere;
}

.admin-push-registration > button {
  grid-column: 2;
  grid-row: 1 / span 4;
  align-self: center;
}

.admin-device-card {
  display: grid;
  grid-template-columns: minmax(160px, 0.45fr) minmax(0, 1fr);
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
}

.admin-device-owner {
  display: grid;
  gap: 2px;
  align-content: start;
  min-width: 0;
}

.admin-device-owner strong,
.admin-device-owner span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-device-owner strong {
  color: var(--accent-ink);
  font-size: 13px;
}

.admin-device-owner span {
  color: var(--muted);
  font-size: 13px;
}

.admin-device-row {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #f8fafc;
}

.admin-device-row.online {
  border-color: #86efac;
  background: #f0fdf4;
}

.admin-device-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--accent-ink);
  font-size: 13px;
}

.admin-device-meta,
.admin-device-screen,
.admin-device-info,
.admin-device-ua,
.admin-device-empty {
  min-width: 0;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.admin-device-info {
  color: var(--accent-ink);
}

.admin-device-technical {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.admin-device-technical summary {
  width: fit-content;
  min-height: 22px;
  padding: 1px 7px;
  font-size: 13px;
}

.admin-device-technical .admin-device-ua {
  display: block;
  padding-top: 2px;
}

.admin-device-camera-diagnostics {
  margin: 4px 0 0;
  max-height: 150px;
  overflow: auto;
  white-space: pre-wrap;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.35;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 8px;
  background: #fff;
}

.admin-device-caps {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.device-capability {
  padding: 1px 5px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: white;
  font-size: 13px;
  line-height: 1.4;
}

.device-capability.ok {
  border-color: #bbf7d0;
  color: #166534;
}

.device-capability.missing {
  border-color: #fecaca;
  color: #991b1b;
}

.material-access-grid,
.voice-permissions-grid {
  display: grid;
  grid-template-columns: minmax(220px, 420px);
  gap: 4px;
  padding-top: 6px;
  max-width: 100%;
}

.material-access-choice,
.voice-permission-choice {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 6px;
  align-items: center;
  min-height: 26px;
  padding: 3px 6px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.2;
}

.voice-permissions-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 180px));
}

.voice-permission-choice {
  grid-template-columns: minmax(0, 1fr) auto;
}

.voice-permissions-section {
  padding-top: 8px;
}

.voice-permissions-section + .voice-permissions-section {
  margin-top: 8px;
  border-top: 1px solid var(--border);
}

.voice-permissions-section h4,
.voice-permissions-help {
  margin: 0;
}

.voice-permissions-section h4 {
  color: var(--text);
  font-size: 13px;
}

.voice-permissions-help {
  max-width: 620px;
  padding-top: 3px;
  line-height: 1.35;
}

.material-access-switch {
  appearance: none;
  width: 28px;
  min-width: 28px;
  max-width: 28px;
  height: 16px;
  margin: 0;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #e2e8f0;
  cursor: pointer;
  position: relative;
  justify-self: end;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.material-access-switch::before {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  left: 1px;
  top: 1px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.18);
  transition: transform 0.15s ease;
}

.material-access-switch:checked {
  border-color: #22c55e;
  background: #22c55e;
}

.material-access-switch:checked::before {
  transform: translateX(12px);
}

.material-access-switch:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.material-access-title {
  min-width: 0;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.material-access-choice em {
  color: #7a4c00;
  font-size: 13px;
  font-style: normal;
  font-weight: 700;
}

.material-access-choice.restricted {
  border-color: #f3c267;
  background: #fff8e7;
  color: #7a4c00;
}

.admin-artifacts-panel {
  display: grid;
  gap: 8px;
  padding: 0 8px 8px;
  border-top: 1px solid var(--border);
  background: #fbfdff;
}

.artifact-panel-summary,
.artifact-empty {
  color: var(--muted);
  font-size: 13px;
  padding-top: 8px;
}

.artifact-empty.error {
  color: var(--danger);
}

.artifact-section {
  display: grid;
  gap: 4px;
}

.artifact-section h4 {
  margin: 0;
  color: var(--accent-ink);
  font-size: 13px;
}

.artifact-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 5px 6px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: white;
}

.artifact-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

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

.artifact-text strong {
  color: var(--ink);
  font-size: 13px;
}

.artifact-text span {
  color: var(--muted);
  font-size: 13px;
}

.artifact-actions {
  display: flex;
  gap: 5px;
}

.artifact-actions button {
  min-width: 30px;
  height: 28px;
  padding: 0 7px;
  font-size: 13px;
}

.role-badge {
  min-width: 62px;
  padding: 2px 7px;
  border-radius: 999px;
  text-align: center;
  font-weight: 700;
  font-size: 13px;
}

.role-badge.admin {
  background: #e8f1ff;
  color: var(--accent-ink);
}

.role-badge.participant {
  background: #eef8f1;
  color: var(--good);
}

.material-info {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
}

.material-info summary {
  display: flex;
  gap: 8px;
  align-items: baseline;
  padding: 10px 12px;
  cursor: pointer;
}

.material-info summary strong {
  color: var(--accent-ink);
  font-size: 15px;
}

.material-info summary span {
  color: var(--muted);
  font-size: 13px;
}

.material-info-body {
  display: grid;
  gap: 8px;
  padding: 0 12px 12px;
}

.material-info-lead,
.material-info-source {
  margin: 0;
  color: #344054;
  font-size: 13px;
}

.material-info-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 6px 10px;
  margin: 0;
}

.material-info-list div {
  min-width: 0;
}

.material-info-list dt {
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 700;
}

.material-info-list dd {
  margin: 1px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.material-info-source {
  color: var(--muted);
  font-size: 13px;
}

.material-info-source a {
  color: var(--accent-ink);
}

.material-provenance {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px 12px;
  margin: 2px 0 0;
  padding-top: 9px;
  border-top: 1px solid var(--border);
}

.material-provenance div {
  min-width: 0;
}

.material-provenance dt {
  color: var(--muted);
  font-size: 13px;
}

.material-provenance dd {
  margin: 2px 0 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}

.material-sharing-toggle {
  justify-self: start;
}

.material-sharing-editor {
  display: grid;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.material-sharing-editor[hidden] {
  display: none;
}

.material-sharing-form {
  display: grid;
  gap: 9px;
}

.material-sharing-form h3 {
  margin: 0;
  color: var(--accent-ink);
  font-size: 14px;
}

.material-sharing-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.material-sharing-selected {
  display: grid;
  gap: 7px;
}

.material-sharing-selected[hidden] {
  display: none;
}

.material-sharing-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.material-sharing-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

@media (max-width: 600px) {
  .script-import-visibility-options,
  .material-sharing-options,
  .material-provenance {
    grid-template-columns: 1fr;
  }

  .script-import-visibility-options label,
  .material-sharing-options label {
    min-height: 52px;
  }

  .project-sharing-user > span {
    display: grid !important;
    gap: 1px;
  }

  .material-sharing-actions button {
    min-height: 40px;
  }
}

.cast-panel {
  display: grid;
  gap: 10px;
}

.cast-head,
.voices-head {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.cast-title {
  display: grid;
  gap: 4px;
  min-width: min(420px, 100%);
}

.cast-title-row {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.cast-title-row h2 {
  margin: 0;
}

.cast-summary {
  display: flex;
  gap: 0;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
}

.cast-summary span + span::before {
  content: "·";
  margin: 0 8px;
  color: #98a2b3;
}

.cast-warning {
  margin-top: 8px;
  padding: 8px 10px;
  border-left: 3px solid #a33;
  background: #fff4f2;
  color: #6f2720;
  font-size: 13px;
  line-height: 1.35;
}

.cast-picker-option.disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.cast-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.cast-toggle {
  width: 34px;
  min-width: 34px;
  height: 34px;
  padding: 0;
  border-color: var(--accent);
  color: var(--accent-ink);
  font-size: 17px;
}

.cast-toggle.active {
  background: var(--actor-bg);
  font-weight: 700;
}

.cast-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 6px 8px;
}

.cast-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 34px max-content;
  gap: 4px 6px;
  min-width: 0;
}

.cast-row.no-generate-source {
  grid-template-columns: minmax(0, 1fr) auto;
}

.cast-row.browser-source {
  grid-template-columns: minmax(0, 1fr);
}

.cast-character-head {
  grid-column: 1 / -1;
  display: flex;
  gap: 6px;
  align-items: center;
  min-width: 0;
}

.cast-character-name {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  line-height: 1.2;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.cast-character-name:hover,
.cast-character-name:focus-visible {
  color: var(--accent-ink);
  text-decoration: underline;
}

.character-gender-badge {
  flex: 0 0 auto;
  max-width: 94px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.2;
}

.cast-row select {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 0 24px 0 8px;
  font-size: 13px;
}

.cast-row .character-gender-select {
  width: auto;
  max-width: 112px;
  height: 24px;
  padding: 0 20px 0 6px;
  flex: 0 0 auto;
  font-size: 13px;
}

.cast-picker-field {
  position: relative;
  min-width: 0;
}

.cast-picker-trigger {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 3px 26px 3px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  display: grid;
  gap: 0;
  align-content: center;
  text-align: left;
  position: relative;
}

.cast-picker-trigger::after {
  content: "▾";
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 13px;
}

.cast-picker-trigger[aria-expanded="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(14, 116, 144, 0.12);
}

.cast-picker-trigger-text,
.cast-picker-trigger-meta {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cast-picker-trigger-text {
  font-size: 13px;
  line-height: 1.05;
}

.cast-picker-trigger-meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.1;
}

.cast-picker {
  position: absolute;
  z-index: 80;
  top: calc(100% + 6px);
  left: 0;
  width: min(520px, calc(100vw - 32px));
  max-height: min(520px, calc(100vh - 120px));
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.18);
  display: grid;
  gap: 8px;
}

body.cast-picker-open {
  overflow: hidden;
}

.cast-picker-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(15, 23, 42, 0.24);
}

.cast-picker.mobile-drawer {
  position: fixed;
  z-index: 100;
  left: 0;
  right: 0;
  bottom: 0;
  top: auto;
  width: 100vw;
  max-width: 100vw;
  padding: 12px;
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  border-radius: 10px 10px 0 0;
  box-shadow: 0 -18px 48px rgba(15, 23, 42, 0.24);
}

.cast-picker.mobile-drawer.above {
  top: auto;
  bottom: 0;
}

.cast-picker.mobile-drawer .cast-picker-options {
  max-height: var(--cast-picker-options-max, 360px);
}

.cast-picker.mobile-drawer .cast-picker-option {
  grid-template-columns: minmax(0, 1fr) auto;
}

.cast-picker.mobile-drawer .cast-picker-test {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.cast-picker.above {
  top: auto;
  bottom: calc(100% + 6px);
}

.cast-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.cast-picker-head strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--accent-ink);
  font-size: 14px;
}

.cast-picker-close {
  width: 32px;
  min-width: 32px;
  height: 32px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border-radius: 6px;
  font-size: 18px;
  line-height: 1;
}

.cast-picker-search {
  width: 100%;
  height: 30px;
  min-width: 0;
  padding: 0 9px;
  border: 1px solid #dbe3ee;
  border-radius: 6px;
  background: #f8fafc;
  color: var(--ink);
  font-size: 13px;
}

.cast-picker-search:focus {
  background: #fff;
  border-color: var(--accent);
  outline: 2px solid rgba(14, 116, 144, 0.12);
  outline-offset: 0;
}

.cast-picker-filters {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.cast-picker-filter {
  height: 28px;
  padding: 0 9px;
  border-radius: 6px;
  white-space: nowrap;
  font-size: 13px;
}

.cast-picker-filter[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--actor-bg);
  color: var(--accent-ink);
  font-weight: 600;
}

.cast-picker-options {
  max-height: min(340px, var(--cast-picker-options-max, 340px));
  overflow: auto;
  display: grid;
  gap: 4px;
}

.cast-picker-option {
  min-width: 0;
  padding: 7px;
  border: 1px solid transparent;
  border-radius: 6px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 7px;
  align-items: center;
  cursor: pointer;
}

.cast-picker-option:hover,
.cast-picker-option:focus {
  border-color: var(--border);
  background: #f8fafc;
  outline: none;
}

.cast-picker-option[aria-selected="true"] {
  border-color: var(--accent);
  background: var(--actor-bg);
}

.cast-picker-option.fallback {
  border-color: #e5e7eb;
  border-style: dashed;
  background: #f8fafc;
}

.cast-picker-option.fallback .cast-picker-option-main {
  color: var(--muted);
  font-weight: 500;
}

.cast-picker-option.fallback .cast-picker-option-status {
  color: #92400e;
}

.cast-picker-option.fallback[aria-selected="true"] {
  border-color: #f59e0b;
  background: #fffbeb;
}

.cast-picker-option-content {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.cast-picker-option-main,
.cast-picker-option-meta,
.cast-picker-option-status {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cast-picker-option-main {
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}

.cast-picker-option-meta,
.cast-picker-option-status {
  color: var(--muted);
  font-size: 13px;
}

.cast-picker-option-coverage {
  min-width: 43px;
  height: 26px;
  padding: 0 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  display: inline-grid;
  place-items: center;
  color: var(--muted);
  background: #fff;
  font-size: 13px;
  white-space: nowrap;
}

.cast-picker-option-coverage.full {
  border-color: #86efac;
  color: #15803d;
  background: #f0fdf4;
  font-weight: 600;
}

.cast-picker-option-coverage.partial {
  border-color: #fde68a;
  color: #a16207;
  background: #fffbeb;
  font-weight: 600;
}

.cast-picker-test {
  width: auto;
  min-width: 68px;
  max-width: none;
  height: 28px;
  padding: 0 6px;
  overflow: visible;
  text-overflow: clip;
  font-size: 13px;
  white-space: nowrap;
  display: inline-grid;
  place-items: center;
}

.cast-picker-empty {
  padding: 10px;
  color: var(--muted);
  font-size: 13px;
}

.cast-row option.cache-full {
  color: #15803d;
  font-weight: 600;
}

.cast-row option.cache-partial {
  color: #a16207;
  font-weight: 600;
}

.cast-coverage {
  min-width: 43px;
  height: 34px;
  padding: 0 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  display: inline-grid;
  place-items: center;
  color: var(--muted);
  background: #fff;
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
}

.cast-coverage[hidden] {
  display: none;
}

.cast-coverage.full {
  border-color: #86efac;
  color: #15803d;
  background: #f0fdf4;
  font-weight: 600;
}

.cast-coverage.partial {
  border-color: #fde68a;
  color: #a16207;
  background: #fffbeb;
  font-weight: 600;
}

.cast-generate {
  min-width: 34px;
  width: 34px;
  height: 34px;
  padding: 0;
  font-size: 13px;
  white-space: nowrap;
  display: inline-grid;
  place-items: center;
}

.cast-test-slot {
  min-width: 0;
}

.cast-test {
  width: auto;
  min-width: 44px;
  height: 34px;
  padding: 0 6px;
  font-size: 13px;
  white-space: nowrap;
  display: inline-grid;
  place-items: center;
}

.cast-test.cache-needed {
  color: var(--accent-ink);
}

.cast-test.cache-running {
  border-color: #93c5fd;
  color: #1d4ed8;
  background: #eff6ff;
  font-size: 13px;
  font-weight: 700;
}

.cast-generate[hidden] {
  display: none;
}

.cast-generate .button-icon {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.cast-generate.cache-needed {
  color: var(--accent-ink);
}

.cast-generate.cache-ready {
  border-color: #86efac;
  color: #166534;
  background: #f0fdf4;
}

.cast-generate.cache-running {
  border-color: #93c5fd;
  color: #1d4ed8;
  background: #eff6ff;
  font-size: 13px;
  font-weight: 700;
}

.cast-generate.cache-ready:disabled {
  opacity: 1;
}

.cast-generate.cache-not-needed,
.cast-generate.cache-unavailable {
  color: var(--muted);
}

.voices-panel {
  display: grid;
  gap: 14px;
}

.provider-grid,
.voice-forms,
.voice-filters,
.voice-list {
  display: grid;
  gap: 10px;
}

.voice-tabs {
  display: flex;
  gap: 6px;
  align-items: center;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.voice-tab {
  flex: 0 0 auto;
  height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

.voice-tab.active {
  border-color: var(--accent);
  background: var(--actor-bg);
  color: var(--accent-ink);
  font-weight: 700;
}

.voice-tab-panel,
.voice-catalog {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.voice-access-note {
  margin: 0;
  padding: 8px 10px;
  border-left: 3px solid var(--accent);
  background: #f6f8fb;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.paid-cache-transfer {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
}

.paid-cache-transfer-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.paid-cache-transfer-head h3,
.paid-cache-transfer-head p,
.paid-cache-message,
.paid-cache-code p,
.paid-cache-import p {
  margin: 0;
}

.paid-cache-transfer-head h3 {
  color: var(--accent-ink);
  font-size: 16px;
}

.paid-cache-transfer-head p,
.paid-cache-code p,
.paid-cache-message,
.paid-cache-import p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.paid-cache-mode {
  flex: 0 0 auto;
  padding: 4px 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.paid-cache-mode.authority {
  border-color: #86a889;
  background: #edf7ee;
  color: #24572b;
}

.paid-cache-export-form,
.paid-cache-import-form {
  display: grid;
  grid-template-columns: minmax(190px, 0.8fr) minmax(280px, 1.7fr) max-content;
  gap: 10px;
  align-items: end;
}

.paid-cache-import-form {
  grid-template-columns: minmax(240px, 1fr) max-content;
}

.paid-cache-export-form > label,
.paid-cache-import-form > label,
.paid-cache-code label {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
}

.paid-cache-export-form select,
.paid-cache-import-form input,
.paid-cache-code input {
  width: 100%;
  min-width: 0;
}

.paid-cache-profile-list {
  display: flex;
  min-width: 0;
  max-height: 128px;
  margin: 0;
  padding: 6px 8px;
  gap: 6px 12px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  flex-wrap: wrap;
}

.paid-cache-profile-list legend {
  padding: 0 4px;
  color: var(--muted);
  font-size: 13px;
}

.paid-cache-profile-list label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: min(100%, 260px);
  color: var(--ink);
  font-size: 13px;
}

.paid-cache-profile-list input {
  width: auto;
  min-width: auto;
  height: auto;
}

.paid-cache-message {
  grid-column: 1 / -1;
}

.paid-cache-message[data-kind="error"],
.paid-cache-import.failed strong,
.paid-cache-import.failed p {
  color: var(--danger);
}

.paid-cache-message[data-kind="success"],
.paid-cache-import.succeeded strong {
  color: var(--good);
}

.paid-cache-code {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px solid #86a889;
  border-radius: 6px;
  background: #f3faf4;
}

.paid-cache-code p {
  grid-column: 1 / -1;
}

.paid-cache-history {
  border-top: 1px solid var(--border);
  padding-top: 8px;
}

.paid-cache-history summary {
  color: var(--accent-ink);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.paid-cache-history-list,
.paid-cache-import-list {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.paid-cache-history-row,
.paid-cache-import > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.paid-cache-history-row span,
.paid-cache-import span {
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.paid-cache-history-row button {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 0 8px;
  font-size: 13px;
}

.paid-cache-import {
  display: grid;
  gap: 5px;
  padding: 8px 10px;
  border-left: 3px solid var(--border);
  background: #f8fafc;
}

.paid-cache-import.running,
.paid-cache-import.queued {
  border-left-color: var(--accent);
}

.paid-cache-import.succeeded {
  border-left-color: var(--good);
}

.paid-cache-import.failed {
  border-left-color: var(--danger);
}

.paid-cache-import progress {
  width: 100%;
  height: 6px;
}

.voice-filter-more {
  display: contents;
}

.voice-filter-toggle {
  display: none;
}

.voice-filters {
  position: sticky;
  top: 64px;
  z-index: 12;
  grid-template-columns:
    minmax(180px, 1.4fr)
    minmax(110px, 0.8fr)
    minmax(250px, 1.25fr)
    minmax(120px, 0.9fr)
    minmax(110px, 0.75fr)
    minmax(110px, 0.75fr);
  align-items: end;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  background: rgba(246, 247, 249, 0.97);
  backdrop-filter: blur(6px);
}

.voice-filter-field {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 13px;
}

.voice-filters select,
.voice-filters input {
  min-width: 0;
  width: 100%;
  height: 34px;
  font-size: 13px;
}

.voice-search-field {
  min-width: 0;
}

.voice-list-empty {
  margin: 0;
  padding: 10px 12px;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
}

.voice-list-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: center;
  padding: 8px 0 2px;
  color: var(--muted);
  font-size: 13px;
}

.voice-list-pagination button {
  min-height: 34px;
}

.provider-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: start;
}

.provider-status,
.voice-card,
.voice-form {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
}

.provider-status {
  display: grid;
  align-self: start;
  gap: 5px;
  font-size: 13px;
}

.provider-status.ok strong {
  color: var(--good);
}

.provider-status.missing strong {
  color: var(--danger);
}

.provider-status.offline strong {
  color: #a16207;
}

.provider-status.disabled strong {
  color: #a16207;
}

.provider-status span,
.voice-card-note {
  color: var(--muted);
}

.provider-status .provider-price {
  color: var(--ink);
}

.provider-job-progress {
  color: var(--accent-ink);
  font-size: 13px;
  line-height: 1.25;
}

.provider-status-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.provider-jobs {
  border-top: 1px solid var(--border);
  margin-top: 4px;
  padding-top: 6px;
}

.provider-job-journal {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
}

.provider-jobs summary,
.provider-job-journal summary {
  cursor: pointer;
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 700;
}

.provider-job-journal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.provider-job-journal-actions button {
  height: 28px;
  padding: 0 8px;
  font-size: 13px;
}

.provider-job-section {
  margin-top: 8px;
}

.provider-job-section-title {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 4px;
}

.provider-job-list {
  display: grid;
  gap: 6px;
  margin-top: 6px;
  max-height: 360px;
  overflow: auto;
  padding-right: 2px;
}

.provider-job-journal .journal-list {
  max-height: 520px;
}

.provider-job-empty {
  color: var(--muted);
  font-size: 13px;
}

.provider-job {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px;
  background: #fff;
}

.provider-job.running {
  border-color: #93c5fd;
  background: #eff6ff;
}

.provider-job.queued {
  border-color: #fde68a;
  background: #fffbeb;
}

.provider-job.error {
  border-color: #fecaca;
  background: #fef2f2;
}

.provider-job.ready {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.provider-job.partial {
  border-color: #fde68a;
  background: #fffbeb;
}

.provider-job.stale {
  border-color: #d6d3d1;
  background: #fafaf9;
}

.provider-job-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.provider-job-main strong,
.provider-job-main span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.provider-job-main strong {
  font-size: 13px;
}

.provider-job-main span {
  color: var(--muted);
  font-size: 13px;
}

.provider-job-error-details {
  font-size: 13px;
}

.provider-job-error-details summary {
  color: #991b1b;
  cursor: pointer;
  font-weight: 700;
}

.provider-job-error-details pre {
  background: #fff7f7;
  border: 1px solid #fecaca;
  border-radius: 4px;
  color: #7f1d1d;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.35;
  margin: 4px 0 0;
  max-height: 140px;
  overflow: auto;
  padding: 6px;
  white-space: pre-wrap;
  word-break: break-word;
}

.provider-job-actions {
  display: flex;
  gap: 4px;
}

.provider-job-actions button {
  height: 28px;
  padding: 0 8px;
  font-size: 13px;
}

.voice-forms {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  align-items: start;
}

.voice-form h3,
.voice-card h3 {
  margin: 0;
  color: var(--accent-ink);
  font-size: 16px;
}

.provider-fields,
.voice-sliders {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.provider-fields {
  grid-column: 1 / -1;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  align-items: end;
}

.provider-fields[hidden] {
  display: none;
}

.voice-provider-row {
  display: flex;
  gap: 8px;
  align-items: center;
  grid-column: 1 / -1;
  min-width: 0;
}

.provider-fields .voice-sliders {
  grid-column: 1 / -1;
}

.voice-provider-row select {
  flex: 1 1 180px;
  min-width: 0;
  max-width: 100%;
}

.voice-provider-row button {
  flex: 0 0 auto;
}

.voice-sliders {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.voice-card {
  display: grid;
  gap: 10px;
}

.voice-card-head {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
}

.voice-card-title {
  display: flex;
  gap: 7px;
  align-items: center;
  flex-wrap: wrap;
  min-width: 0;
}

.voice-card-head span {
  color: var(--muted);
  font-size: 13px;
}

.voice-card-description {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-height: 1.35;
}

.voice-card-more {
  min-width: 0;
  border-top: 1px solid var(--border);
  padding-top: 7px;
}

.voice-card-more > summary {
  color: var(--accent-ink);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.voice-card-more-body {
  display: grid;
  gap: 10px;
  min-width: 0;
  margin-top: 9px;
}

.qwen-gender-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 8px;
  border: 1px solid #c8d8ea;
  border-radius: 999px;
  background: #eef6ff;
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.qwen-profile-details {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 9px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 13px;
}

.qwen-profile-details summary {
  cursor: pointer;
  color: var(--accent-ink);
  font-weight: 700;
}

.qwen-param-grid {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 3px 10px;
  margin: 8px 0;
}

.qwen-param-grid dt {
  color: var(--muted);
}

.qwen-param-grid dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
}

.qwen-param-text {
  margin: 6px 0 0;
  overflow-wrap: anywhere;
}

.qwen-accent-ab {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 9px;
  background: #fff;
}

.qwen-accent-summary {
  appearance: none;
  display: inline-flex;
  align-items: center;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 700;
}

.qwen-accent-intro {
  margin: 8px 0;
  color: var(--muted);
  font-size: 13px;
}

.qwen-accent-phrase {
  display: grid;
  grid-template-columns: 70px minmax(0, 260px);
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.qwen-accent-phrase select {
  width: 100%;
  min-width: 0;
  height: 32px;
  font-size: 13px;
}

.qwen-accent-variants {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.qwen-accent-variant {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 10px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #f8fafc;
}

.qwen-accent-variant-head {
  display: flex;
  gap: 8px;
  align-items: baseline;
  flex-wrap: wrap;
  min-width: 0;
}

.qwen-accent-variant-head strong {
  color: var(--accent-ink);
  font-size: 13px;
}

.qwen-accent-status,
.qwen-accent-text {
  color: var(--muted);
  font-size: 13px;
}

.qwen-accent-text {
  margin: 0;
  overflow-wrap: anywhere;
}

.qwen-accent-controls {
  display: flex;
  gap: 6px;
  align-items: center;
  grid-row: span 2;
}

.qwen-accent-controls button {
  height: 30px;
  padding: 0 8px;
  font-size: 13px;
}

.qwen-accent-ratings {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  grid-column: 1 / -1;
}

.qwen-accent-rating {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.2;
}

.qwen-accent-rating input {
  width: auto;
  min-width: 0;
  height: auto;
  margin: 0;
}

.qwen-accent-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.qwen-accent-actions button {
  height: 30px;
  padding: 0 9px;
  font-size: 13px;
}

.voice-cache-status {
  margin: 0;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 13px;
}

.voice-cache-status.needs-regeneration {
  border-color: #f59e0b;
  background: #fffbeb;
  color: #92400e;
}

.voice-card-controls,
.voice-test {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.voice-profile-edit {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 9px;
  background: #fff;
}

.voice-profile-edit summary {
  cursor: pointer;
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 700;
}

.voice-profile-edit-form {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.voice-profile-edit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

.voice-profile-edit-grid label {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.voice-profile-edit-grid label span {
  color: var(--muted);
  font-size: 13px;
}

.voice-profile-edit-grid input,
.voice-profile-edit-grid select,
.voice-profile-edit-grid textarea {
  min-width: 0;
  width: 100%;
}

.voice-profile-edit-grid textarea {
  resize: vertical;
}

.voice-profile-edit-grid .wide-field {
  grid-column: 1 / -1;
}

.voice-profile-edit-actions {
  display: flex;
  justify-content: flex-end;
}

.sample-source-block {
  flex: 1 1 100%;
  display: grid;
  gap: 6px;
  min-width: min(320px, 100%);
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.sample-source-block strong {
  color: var(--accent-ink);
  font-size: 13px;
}

.sample-source-block p,
.sample-details p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.sample-details {
  color: var(--muted);
  font-size: 13px;
}

.sample-details summary {
  cursor: pointer;
  color: var(--accent-ink);
}

.sample-details ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

.sample-details li {
  margin: 2px 0;
}

.voice-card-controls input[type="file"] {
  min-width: 220px;
  padding-top: 7px;
}

.recording-sample-list {
  flex: 1 1 260px;
  min-width: 0;
  max-width: 100%;
  max-height: 150px;
  overflow: auto;
  display: grid;
  gap: 4px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
}

.recording-sample-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px;
  align-items: start;
  font-size: 13px;
  line-height: 1.25;
}

.recording-sample-option input {
  width: auto;
  min-width: 0;
  height: auto;
  margin-top: 1px;
}

.recording-sample-option span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inline-check {
  display: flex;
  grid-auto-flow: column;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  color: var(--ink);
}

.inline-check input {
  min-width: auto;
  height: auto;
}

.voice-test input {
  flex: 1 1 360px;
}

.voice-test-note {
  flex: 1 1 240px;
  color: var(--muted);
  font-size: 13px;
}

.voice-standard-test {
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.voice-standard-test .voice-test-note {
  color: var(--ink);
  line-height: 1.35;
}

.voice-standard-test button {
  flex: 0 0 auto;
}

.voice-custom-test {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #f8fafc;
}

.voice-custom-test h4,
.voice-custom-test p {
  margin: 0;
}

.voice-custom-test h4 {
  font-size: 14px;
}

.voice-custom-test p,
.voice-custom-test-actions span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.voice-custom-test textarea {
  width: 100%;
  min-width: 0;
  resize: vertical;
}

.voice-custom-test-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.danger-button {
  color: var(--danger);
}

.app {
  padding: 22px 24px 42px;
}

.scene-filter {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
}

.scene-filter-copy {
  display: flex;
  gap: 8px;
  align-items: baseline;
  flex-wrap: wrap;
  min-width: 0;
}

.scene-filter-copy strong {
  color: var(--accent-ink);
}

.scene-filter-copy span {
  color: var(--muted);
  font-size: 13px;
}

.scene-filter-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.scene-filter-button.active,
.material-mode-button.active,
.event-edit-button.active {
  border-color: var(--accent);
  background: var(--actor-bg);
  color: var(--accent-ink);
  font-weight: 700;
}

.record-character-select {
  min-width: 220px;
}

.call-mute-panel {
  margin: -4px 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
}

.call-mute-panel summary {
  display: flex;
  gap: 8px;
  align-items: center;
  cursor: pointer;
}

.call-mute-panel summary strong {
  color: var(--accent-ink);
  font-size: 13px;
  line-height: 1.25;
}

.call-mute-panel summary span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.25;
}

.call-mute-panel p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.call-mute-panel p {
  margin: 8px 0;
}

.mute-character-grid {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.mute-character {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  font-size: 13px;
}

.mute-character input {
  min-width: auto;
  height: auto;
}

.clear-muted-button {
  margin-top: 8px;
}

.scene-empty {
  padding: 18px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
}

.scene {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  content-visibility: auto;
  contain-intrinsic-size: auto 900px;
  margin: 0 0 18px;
  overflow: clip;
}

.scene-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.scene-head > div:first-child {
  min-width: 0;
}

.scene h2 {
  margin: 0;
  font-size: 19px;
  line-height: 1.25;
  color: var(--accent-ink);
}

.scene-meta {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.scene-actions {
  display: flex;
  gap: 8px;
  align-items: end;
  flex: 0 0 auto;
}

.scene-actions.has-scene-tempo {
  display: grid;
  grid-template-columns: max-content max-content max-content minmax(210px, 250px);
}

.scene-actions .play-scene {
  white-space: nowrap;
}

.scene-tempo-control {
  align-self: end;
  min-width: 210px;
}

.scene-tempo-control .tempo-status {
  min-width: 108px;
}

.self-tape-button {
  width: 38px;
  padding: 0;
  display: inline-grid;
  place-items: center;
}

.self-tape-button .button-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.prompter-button {
  height: 38px;
  padding-inline: 12px;
  border-color: #111827;
  background: #111827;
  color: #fff;
  white-space: nowrap;
}

body.prompter-fullscreen-open {
  overflow: hidden;
}

.prompter-panel {
  display: grid;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
}

.prompter-panel.is-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 1200;
  grid-template-rows: minmax(0, 1fr) auto;
  padding: max(14px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  border: 0;
  background: radial-gradient(circle at top left, rgba(11, 74, 111, 0.18), transparent 34%), #08111f;
  color: #f8fafc;
}

.prompter-close-button {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  z-index: 2;
  display: inline-grid;
  place-items: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(15, 23, 42, 0.56);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  backdrop-filter: blur(8px);
}

.prompter-cue {
  display: grid;
  align-content: center;
  justify-items: stretch;
  gap: 18px;
  min-height: 0;
  overflow: auto;
  padding: clamp(24px, 5vw, 64px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  box-shadow: 0 22px 64px rgba(0, 0, 0, 0.28);
  text-align: center;
}

.prompter-cue .self-tape-cue-eyebrow {
  width: 100%;
  color: rgba(226, 232, 240, 0.76);
  font-size: var(--prompter-eyebrow-font-size, clamp(12px, 1.4vw, 18px));
}

.prompter-cue strong {
  display: block;
  width: 100%;
  color: #fff;
  font-size: var(--prompter-speaker-font-size, clamp(18px, 2.8vw, 42px));
  line-height: 1.08;
}

.prompter-cue > span {
  display: block;
  width: 100%;
  color: #f8fafc;
  font-size: var(--prompter-text-font-size, clamp(26px, 6vw, 76px));
  line-height: 1.14;
}

.prompter-cue .self-tape-coach-note {
  display: grid;
  justify-items: center;
  width: 100%;
  max-width: none;
  background: rgba(255, 255, 255, 0.15);
  color: #f8fafc;
  font-size: var(--prompter-coach-font-size, clamp(14px, 2.2vw, 20px));
  text-align: center;
}

.prompter-cue .self-tape-coach-note strong {
  font-size: var(--prompter-coach-label-font-size, 12px);
}

.prompter-cue .self-tape-coach-note span {
  font-size: var(--prompter-coach-font-size, clamp(14px, 2.2vw, 20px));
}

.prompter-controls {
  --prompter-control-surface: rgba(255, 255, 255, 0.72);
  --prompter-control-surface-muted: rgba(15, 23, 42, 0.38);
  --prompter-control-border: rgba(11, 74, 111, 0.24);
  --prompter-control-ink: #08324d;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 16px;
  background: rgba(248, 250, 252, 0.14);
  box-shadow: 0 18px 48px rgba(2, 6, 23, 0.22);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.prompter-audio-mode {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: rgba(248, 250, 252, 0.82);
  font-size: 13px;
  white-space: nowrap;
}

.prompter-settings {
  display: inline-flex;
  flex: 1 1 auto;
  min-width: 0;
}

.prompter-settings-toggle {
  display: none;
}

.prompter-settings-panel {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.prompter-audio-mode select,
.prompter-color-control input {
  height: 32px;
  border: 1px solid var(--prompter-control-border);
  border-radius: 999px;
  background: var(--prompter-control-surface);
  color: var(--prompter-control-ink);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.prompter-audio-mode select {
  min-width: 76px;
  padding-inline: 12px 28px;
}

.prompter-visual-controls {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.prompter-panel.is-running .prompter-settings {
  display: none;
}

.prompter-font-controls,
.prompter-color-control {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: rgba(248, 250, 252, 0.82);
  font-size: 13px;
  white-space: nowrap;
}

.prompter-font-controls button {
  display: inline-grid;
  place-items: center;
  width: 32px;
  min-width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--prompter-control-border);
  border-radius: 999px;
  background: var(--prompter-control-surface);
  color: var(--prompter-control-ink);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
}

.prompter-font-size-value {
  min-width: 38px;
  color: rgba(248, 250, 252, 0.78);
  font-size: 13px;
  text-align: center;
}

.prompter-color-control input {
  width: 40px;
  min-width: 40px;
  padding: 3px 5px;
}

.prompter-run-cluster {
  display: inline-flex;
  flex: 0 1 auto;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  min-width: min(100%, 260px);
  margin-left: auto;
}

.prompter-status {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  max-width: min(100%, 220px);
  height: 28px;
  padding: 0 9px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.24);
  color: rgba(248, 250, 252, 0.78);
  font-size: 13px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.prompter-status-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.prompter-status-value {
  min-width: 0;
  overflow: hidden;
  color: rgba(248, 250, 252, 0.96);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prompter-status[hidden] {
  display: none;
}

.prompter-buttons {
  display: flex;
  gap: 6px;
  margin-left: 0;
  justify-content: flex-end;
}

.prompter-buttons button {
  min-width: 84px;
  height: 32px;
  padding-inline: 12px;
  border: 1px solid var(--prompter-control-border);
  border-radius: 999px;
  background: var(--prompter-control-surface);
  color: var(--prompter-control-ink);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

.prompter-buttons .prompter-run-toggle-button {
  border-color: var(--prompter-control-border);
  background: var(--prompter-control-surface);
  color: var(--prompter-control-ink);
}

.prompter-panel.is-running .prompter-buttons .prompter-run-toggle-button {
  border-color: rgba(220, 38, 38, 0.26);
  background: rgba(255, 255, 255, 0.78);
  color: #991b1b;
}

.prompter-buttons .prompter-coach-toggle-button[aria-pressed="false"] {
  border-color: rgba(255, 255, 255, 0.22);
  background: var(--prompter-control-surface-muted);
  color: rgba(255, 255, 255, 0.9);
}

.prompter-buttons .prompter-next-button[hidden] {
  display: none;
}

.self-tape-panel {
  display: grid;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: #fbfcff;
}

.self-tape-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.self-tape-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.self-tape-title {
  display: flex;
  gap: 8px;
  align-items: baseline;
}

.self-tape-title strong {
  color: var(--accent-ink);
}

.self-tape-title span {
  color: var(--muted);
  font-size: 13px;
}

.self-tape-grid {
  display: grid;
  grid-template-columns: minmax(260px, 420px) minmax(240px, 1fr);
  gap: 14px;
  align-items: start;
}

.self-tape-preview-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: #111827;
  aspect-ratio: 16 / 9;
}

.self-tape-preview,
.self-tape-result video {
  display: block;
  width: 100%;
  height: 100%;
  background: #111827;
}

.self-tape-preview {
  object-fit: cover;
}

.self-tape-golden-grid {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.55;
  background:
    linear-gradient(to right, transparent calc(38.2% - 0.5px), rgba(245, 190, 70, 0.74) calc(38.2% - 0.5px), rgba(245, 190, 70, 0.74) calc(38.2% + 0.5px), transparent calc(38.2% + 0.5px)),
    linear-gradient(to right, transparent calc(61.8% - 0.5px), rgba(245, 190, 70, 0.74) calc(61.8% - 0.5px), rgba(245, 190, 70, 0.74) calc(61.8% + 0.5px), transparent calc(61.8% + 0.5px)),
    linear-gradient(to bottom, transparent calc(38.2% - 0.5px), rgba(245, 190, 70, 0.74) calc(38.2% - 0.5px), rgba(245, 190, 70, 0.74) calc(38.2% + 0.5px), transparent calc(38.2% + 0.5px)),
    linear-gradient(to bottom, transparent calc(61.8% - 0.5px), rgba(245, 190, 70, 0.74) calc(61.8% - 0.5px), rgba(245, 190, 70, 0.74) calc(61.8% + 0.5px), transparent calc(61.8% + 0.5px));
}

.self-tape-countdown {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  background: rgba(17, 24, 39, 0.34);
  color: #fff;
  font-size: 64px;
  font-weight: 800;
  line-height: 1;
}

.self-tape-controls {
  display: grid;
  gap: 10px;
}

.self-tape-settings {
  display: contents;
}

.self-tape-settings-toggle {
  display: none;
}

.self-tape-settings-panel {
  display: contents;
}

.self-tape-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.self-tape-buttons button {
  min-width: 0;
  height: 32px;
  padding: 0 10px;
  font-size: 13px;
  line-height: 1;
}

.self-tape-buttons button.is-placeholder {
  visibility: hidden;
  pointer-events: none;
}

.self-tape-buttons .self-tape-icon-button,
.self-tape-camera-label .self-tape-icon-button,
.self-tape-diagnostics-actions .self-tape-icon-button {
  display: inline-grid;
  place-items: center;
  width: 32px;
  min-width: 32px;
  height: 32px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
}

.self-tape-preview-icon-button {
  position: absolute;
  z-index: 4;
  display: inline-grid;
  place-items: center;
  width: 36px;
  min-width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.46);
  color: #fff;
  line-height: 1;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.22);
  backdrop-filter: blur(5px);
}

.self-tape-preview-icon-button:hover {
  background: rgba(15, 23, 42, 0.6);
}

.self-tape-fullscreen-button {
  top: 10px;
  right: 10px;
}

.self-tape-camera-toggle-button {
  right: 10px;
  bottom: 10px;
}

.self-tape-record-toggle {
  position: absolute;
  left: 50%;
  bottom: 10px;
  z-index: 4;
  display: inline-grid;
  place-items: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  transform: translateX(-50%);
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(5px);
}

.self-tape-record-toggle .button-icon {
  width: 20px;
  height: 20px;
}

.self-tape-record-toggle[data-state="stop"] .button-icon {
  color: #111827;
  fill: currentColor;
  stroke: currentColor;
}

.self-tape-countdown-label {
  display: inline-grid;
  grid-template-columns: auto auto;
  gap: 6px;
  align-items: center;
  justify-self: start;
}

.self-tape-camera-label {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 6px;
  min-width: 0;
}

.self-tape-camera-label select {
  min-width: 0;
}

.self-tape-countdown-control {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.self-tape-countdown-stepper {
  display: inline-grid;
  grid-template-columns: 30px 38px 30px;
  align-items: center;
  justify-self: start;
  overflow: hidden;
  height: 32px;
  width: max-content;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

.self-tape-countdown-stepper button {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--accent-ink);
  font-size: 20px;
  line-height: 1;
}

.self-tape-countdown-stepper input {
  display: block;
  box-sizing: border-box;
  width: 38px;
  min-width: 0;
  height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  line-height: 30px;
  text-align: center;
  appearance: textfield;
}

.self-tape-countdown-stepper input:disabled {
  color: var(--ink);
  opacity: 1;
  -webkit-text-fill-color: var(--ink);
}

.self-tape-countdown-stepper input::-webkit-outer-spin-button,
.self-tape-countdown-stepper input::-webkit-inner-spin-button {
  margin: 0;
  appearance: none;
}

.self-tape-countdown-unit {
  color: var(--muted);
  font-size: 13px;
}

.self-tape-toggle {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 4px;
  width: max-content;
  max-width: 100%;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
}

.self-tape-toggle input {
  flex: 0 0 15px;
  margin: 0;
  width: 15px;
  min-width: 15px;
  height: 15px;
}

.self-tape-toggle span {
  flex: 0 0 auto;
}

.self-tape-buttons .primary-button {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.self-tape-status {
  min-height: 20px;
  color: var(--muted);
  font-size: 13px;
}

.self-tape-recovery {
  display: none;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid rgba(180, 35, 24, 0.22);
  border-radius: 8px;
  background: rgba(180, 35, 24, 0.08);
  color: #8a1f11;
}

.self-tape-recovery-copy {
  display: grid;
  gap: 2px;
}

.self-tape-recovery-copy strong,
.self-tape-recovery-copy span {
  font-size: 13px;
  line-height: 1.25;
}

.self-tape-recovery-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.self-tape-recovery-actions button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
}

.self-tape-status[data-kind="error"] {
  color: #8a1f11;
  border: 1px solid rgba(180, 35, 24, 0.28);
  border-radius: 6px;
  background: rgba(180, 35, 24, 0.08);
  padding: 7px 9px;
  font-weight: 700;
}

.self-tape-diagnostics {
  white-space: pre-line;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.72);
}

.self-tape-diagnostics-wrap {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.72);
}

.self-tape-diagnostics-wrap > summary {
  cursor: pointer;
  padding: 7px 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.self-tape-diagnostics-wrap .self-tape-diagnostics {
  margin: 0;
  border: 0;
  border-top: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
}

.self-tape-diagnostics-actions {
  display: flex;
  justify-content: flex-end;
  padding: 0 8px 8px;
}

.self-tape-diagnostics-actions:empty {
  display: none;
}

.self-tape-camera-controls {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #cdd9e8;
  border-radius: 8px;
  background: #fff;
}

.self-tape-preview-wrap > .self-tape-camera-controls {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 5;
  max-height: calc(100% - 20px);
  overflow: auto;
  background: rgba(255, 255, 255, 0.24);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.14);
  backdrop-filter: blur(5px);
}

.self-tape-camera-controls-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.self-tape-camera-controls-header > strong {
  color: var(--accent-ink);
  font-size: 13px;
}

.self-tape-camera-controls-close {
  display: inline-grid;
  place-items: center;
  width: 32px;
  min-width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 999px;
  font-size: 20px;
  line-height: 1;
}

.self-tape-camera-grid {
  display: grid;
  gap: 8px;
}

.self-tape-camera-control {
  min-width: 0;
  gap: 4px;
}

.self-tape-camera-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.self-tape-camera-row output {
  color: var(--muted);
  font-size: 13px;
}

.self-tape-camera-control input[type="range"] {
  width: 100%;
  min-width: 0;
  height: 24px;
  padding: 0;
}

.self-tape-camera-toggle {
  display: flex;
  grid-template-columns: none;
  gap: 8px;
  align-items: center;
}

.self-tape-camera-toggle input {
  min-width: 0;
  width: 16px;
  height: 16px;
}

.self-tape-camera-empty {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.self-tape-cue {
  display: grid;
  gap: 4px;
  min-height: 88px;
  padding: 10px 12px;
  border: 1px solid #cdd9e8;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  align-content: start;
}

.self-tape-cue-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.self-tape-cue-eyebrow {
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
}

.self-tape-cue strong {
  color: var(--accent-ink);
  font-size: 15px;
}

.self-tape-cue span {
  font-size: 15px;
  line-height: 1.35;
}

.self-tape-coach-note {
  display: grid;
  gap: 3px;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid #e0e7ef;
  color: #475569;
}

.self-tape-coach-note strong {
  color: var(--accent-ink);
  font-size: 13px;
  text-transform: uppercase;
}

.self-tape-coach-note span {
  font-size: 14px;
}

.self-tape-coach-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 74px;
  height: 28px;
  padding: 0 8px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #fff;
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

/* Prompter reuses self-tape cue markup; keep explicit contrast on the light cue panel. */
.prompter-panel.is-fullscreen .prompter-cue.self-tape-cue {
  border-color: rgba(148, 163, 184, 0.42);
  background: var(--prompter-cue-bg, #f8fafc);
  color: var(--prompter-cue-text, #0f172a);
}

.prompter-panel.is-fullscreen .prompter-cue .self-tape-cue-heading {
  position: relative;
  justify-content: center;
  width: 100%;
  text-align: center;
}

.prompter-panel.is-fullscreen .prompter-cue .self-tape-cue-heading .self-tape-coach-toggle {
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
}

.prompter-panel.is-fullscreen .prompter-cue .self-tape-cue-eyebrow {
  width: 100%;
  color: var(--prompter-cue-text, #0f172a);
  font-size: var(--prompter-eyebrow-font-size, clamp(12px, 1.4vw, 18px));
  opacity: 0.72;
}

.prompter-panel.is-fullscreen .prompter-cue .self-tape-cue-heading strong,
.prompter-panel.is-fullscreen .prompter-cue strong {
  color: var(--prompter-cue-text, #0f172a);
  font-size: var(--prompter-speaker-font-size, clamp(18px, 2.8vw, 42px));
}

.prompter-panel.is-fullscreen .prompter-cue > span {
  color: var(--prompter-cue-text, #0f172a);
  font-size: var(--prompter-text-font-size, clamp(26px, 6vw, 76px));
}

.prompter-panel.is-fullscreen .prompter-cue .self-tape-coach-note {
  width: 100%;
  max-width: none;
  border-top-color: #cbd5e1;
  background: color-mix(in srgb, var(--prompter-cue-text, #0f172a) 8%, var(--prompter-cue-bg, #f8fafc));
  color: var(--prompter-cue-text, #0f172a);
  font-size: var(--prompter-coach-font-size, clamp(14px, 2.2vw, 20px));
}

.prompter-panel.is-fullscreen .prompter-cue .self-tape-coach-note strong {
  color: var(--prompter-cue-text, #0f172a);
  font-size: var(--prompter-coach-label-font-size, 12px);
}

.prompter-panel.is-fullscreen .prompter-cue .self-tape-coach-note span {
  color: var(--prompter-cue-text, #0f172a);
  font-size: var(--prompter-coach-font-size, clamp(14px, 2.2vw, 20px));
}

.prompter-panel.is-fullscreen .prompter-cue.self-tape-cue-hide-coach-notes .self-tape-coach-note {
  display: none;
}

.self-tape-result {
  display: grid;
  gap: 8px;
}

.self-tape-result-note {
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 700;
}

.self-tape-panel.is-fullscreen .self-tape-result-note {
  color: #f8fafc;
}

.self-tape-result video {
  max-height: 260px;
  border-radius: 8px;
  object-fit: contain;
}

.self-tape-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.self-tape-download {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: var(--accent-ink);
  background: #fff;
  text-decoration: none;
  font-size: 14px;
}

body.self-tape-fullscreen-open {
  overflow: hidden;
}

.self-tape-panel.is-fullscreen {
  --self-tape-fullscreen-controls-bottom: max(12px, env(safe-area-inset-bottom));
  --self-tape-fullscreen-controls-max-height: min(30dvh, 260px);
  --self-tape-fullscreen-surface: rgba(248, 250, 252, 0.14);
  --self-tape-fullscreen-surface-recording: rgba(248, 250, 252, 0.1);
  --self-tape-fullscreen-cue-bg: rgba(255, 255, 255, 0.22);
  --self-tape-fullscreen-cue-bg-recording: rgba(255, 255, 255, 0.16);
  position: fixed;
  inset: 0;
  z-index: 80;
  display: block;
  gap: 0;
  width: 100vw;
  height: 100dvh;
  padding: 0;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  background: #020617;
}

.self-tape-panel.is-fullscreen .self-tape-header {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  padding: 0;
  border: 0;
  background: transparent;
}

.self-tape-panel.is-fullscreen .self-tape-title {
  display: none;
}

.self-tape-panel.is-fullscreen .self-tape-header-actions {
  gap: 6px;
}

.self-tape-panel.is-fullscreen .self-tape-header-actions button {
  display: inline-grid;
  place-items: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(16, 24, 40, 0.68);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  backdrop-filter: blur(6px);
}

.self-tape-panel.is-fullscreen .self-tape-preview-icon-button {
  width: 44px;
  min-width: 44px;
  height: 44px;
  border-color: rgba(255, 255, 255, 0.26);
  background: rgba(15, 23, 42, 0.42);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.2);
}

.self-tape-panel.is-fullscreen .self-tape-fullscreen-button {
  top: 8px;
  right: 60px;
}

.self-tape-panel.is-fullscreen .self-tape-camera-toggle-button {
  right: 12px;
  bottom: calc(env(safe-area-inset-bottom) + 18px);
  z-index: 6;
}

.self-tape-panel.is-fullscreen .self-tape-record-toggle {
  bottom: calc(env(safe-area-inset-bottom) + 18px);
  z-index: 6;
  width: 46px;
  min-width: 46px;
  height: 46px;
}

.self-tape-panel.is-fullscreen .self-tape-grid {
  position: relative;
  display: block;
  height: 100%;
  width: 100%;
  min-height: 0;
  overflow: hidden;
}

.self-tape-panel.is-fullscreen .self-tape-preview-wrap {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  border-radius: 0;
  aspect-ratio: auto;
}

.self-tape-panel.is-fullscreen .self-tape-preview {
  object-fit: cover;
}

.self-tape-panel.is-fullscreen .self-tape-controls {
  position: absolute;
  left: max(12px, env(safe-area-inset-left));
  right: max(12px, env(safe-area-inset-right));
  bottom: var(--self-tape-fullscreen-controls-bottom);
  z-index: 5;
  grid-template-columns: max-content minmax(0, 1fr) auto;
  grid-template-areas:
    "status settings buttons"
    "recovery recovery recovery"
    "cue cue cue"
    "result result result";
  align-items: center;
  gap: 8px 12px;
  min-height: 0;
  max-height: var(--self-tape-fullscreen-controls-max-height);
  overflow: hidden;
  padding: 10px 12px 56px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 16px;
  background: var(--self-tape-fullscreen-surface);
  box-shadow: 0 18px 48px rgba(2, 6, 23, 0.22);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  overscroll-behavior: contain;
  scrollbar-width: none;
}

.self-tape-panel.is-fullscreen .self-tape-controls::-webkit-scrollbar,
.self-tape-panel.is-fullscreen .self-tape-cue::-webkit-scrollbar {
  display: none;
}

.self-tape-panel.is-fullscreen .self-tape-buttons,
.self-tape-panel.is-fullscreen .self-tape-status,
.self-tape-panel.is-fullscreen .self-tape-diagnostics-wrap,
.self-tape-panel.is-fullscreen .self-tape-result {
  min-width: 0;
}

.self-tape-panel.is-fullscreen .self-tape-camera-label {
  grid-area: camera;
  width: min(100%, 320px);
}

.self-tape-panel.is-fullscreen .self-tape-countdown-label {
  grid-area: countdown;
}

.self-tape-panel.is-fullscreen .self-tape-toggle {
  grid-area: partner;
}

.self-tape-panel.is-fullscreen .self-tape-buttons {
  grid-area: buttons;
}

.self-tape-panel.is-fullscreen .self-tape-status {
  grid-area: status;
}

.self-tape-panel.is-fullscreen .self-tape-recovery {
  grid-area: recovery;
  border-color: rgba(248, 113, 113, 0.58);
  background: rgba(254, 242, 242, 0.9);
  color: #7f1d1d;
}

.self-tape-panel.is-fullscreen .self-tape-status[data-status-level="critical"] + .self-tape-recovery {
  display: grid;
}

.self-tape-panel.is-fullscreen .self-tape-settings {
  display: inline-flex;
  grid-area: settings;
  align-items: center;
  min-width: 0;
}

.self-tape-panel.is-fullscreen .self-tape-settings-toggle {
  display: none;
}

.self-tape-panel.is-fullscreen .self-tape-settings-panel {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.self-tape-panel.is-fullscreen .self-tape-cue {
  grid-area: cue;
}

.self-tape-panel.is-fullscreen .self-tape-result {
  grid-area: result;
}

.self-tape-panel.is-fullscreen .self-tape-diagnostics-wrap {
  display: none;
}

.self-tape-panel.is-fullscreen .self-tape-diagnostics-open-button {
  display: none;
}

.self-tape-panel.is-fullscreen .self-tape-status {
  justify-self: start;
  width: max-content;
  max-width: 180px;
  min-height: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  line-height: 30px;
  font-size: 13px;
}

.self-tape-panel.is-fullscreen .self-tape-buttons {
  display: inline-flex;
  flex-wrap: wrap;
  justify-self: start;
  gap: 6px;
  white-space: nowrap;
}

.self-tape-panel.is-fullscreen .self-tape-buttons button {
  width: auto;
  min-width: 78px;
  padding-inline: 12px;
}

.self-tape-panel.is-fullscreen .self-tape-buttons .self-tape-icon-button {
  width: 32px;
  min-width: 32px;
  padding-inline: 0;
}

.self-tape-panel.is-fullscreen .self-tape-buttons button.is-placeholder {
  display: none;
}

.self-tape-panel.is-fullscreen .self-tape-cue {
  min-height: clamp(78px, 13dvh, 122px);
  max-height: min(18dvh, 150px);
  overflow: auto;
  background: var(--self-tape-fullscreen-cue-bg);
  scrollbar-width: none;
}

.self-tape-panel.is-fullscreen .self-tape-cue.has-coach-note .self-tape-cue-heading {
  margin-right: -2px;
}

.self-tape-panel.is-fullscreen .self-tape-coach-note {
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.64);
  color: rgba(248, 250, 252, 0.94);
}

.self-tape-panel.is-fullscreen .self-tape-coach-note strong {
  color: #93c5fd;
}

.self-tape-panel.is-fullscreen .self-tape-coach-note span {
  color: rgba(248, 250, 252, 0.94);
}

.self-tape-panel.is-fullscreen .self-tape-coach-toggle {
  display: inline-flex;
  border-color: rgba(11, 74, 111, 0.24);
  background: rgba(255, 255, 255, 0.72);
  color: #08324d;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
}

.self-tape-panel.is-fullscreen .self-tape-coach-toggle[aria-pressed="false"] {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(15, 23, 42, 0.38);
  color: rgba(255, 255, 255, 0.88);
}

.self-tape-panel.is-fullscreen .self-tape-cue.self-tape-cue-hide-coach-notes .self-tape-coach-note {
  display: none;
}

.self-tape-panel.is-fullscreen.is-recording .self-tape-header-actions,
.self-tape-panel.is-fullscreen.is-recording .self-tape-camera-toggle-button,
.self-tape-panel.is-fullscreen.is-recording .self-tape-camera-controls,
.self-tape-panel.is-fullscreen.is-recording .self-tape-controls > label,
.self-tape-panel.is-fullscreen.is-recording .self-tape-settings,
.self-tape-panel.is-fullscreen.is-recording .self-tape-recovery,
.self-tape-panel.is-fullscreen.is-recording .self-tape-buttons,
.self-tape-panel.is-fullscreen.is-recording .self-tape-status,
.self-tape-panel.is-fullscreen.is-recording .self-tape-result,
.self-tape-panel.is-fullscreen.is-recording .self-tape-diagnostics-wrap {
  display: none;
}

.self-tape-panel.is-fullscreen.is-recording .self-tape-status[data-status-level="critical"] + .self-tape-recovery {
  display: none;
}

.self-tape-panel.is-fullscreen.is-recording .self-tape-controls {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "cue";
  max-height: min(72dvh, calc(100dvh - 96px));
  padding: 10px 10px 66px;
  border-color: rgba(255, 255, 255, 0.22);
  background: var(--self-tape-fullscreen-surface-recording);
}

.self-tape-panel.is-fullscreen.is-recording .self-tape-cue {
  min-height: clamp(92px, 16dvh, 150px);
  max-height: min(62dvh, calc(100dvh - 150px));
  background: var(--self-tape-fullscreen-cue-bg-recording);
}

.self-tape-panel.is-fullscreen.is-recording .self-tape-coach-note {
  margin-top: 6px;
  padding: 7px 9px;
  background: rgba(15, 23, 42, 0.5);
  font-size: 0.92em;
}

.self-tape-panel.is-fullscreen .self-tape-controls label {
  min-width: 0;
  justify-self: start;
  gap: 6px;
  font-size: 13px;
}

.self-tape-panel.is-fullscreen .self-tape-countdown-label {
  width: max-content;
  justify-self: start;
}

.self-tape-panel.is-fullscreen .self-tape-countdown-label > span:first-child {
  display: none;
}

.self-tape-panel.is-fullscreen .self-tape-countdown-stepper {
  height: 32px;
}

.self-tape-panel.is-fullscreen .self-tape-toggle {
  justify-self: start;
  gap: 6px;
  width: max-content;
  white-space: nowrap;
}

.self-tape-panel.is-fullscreen .self-tape-toggle input {
  flex: 0 0 auto;
}

.self-tape-panel.is-fullscreen .self-tape-controls select,
.self-tape-panel.is-fullscreen .self-tape-controls button,
.self-tape-panel.is-fullscreen .self-tape-download {
  height: 32px;
  font-size: 13px;
}

.self-tape-panel.is-fullscreen .self-tape-controls select {
  width: min(100%, 320px);
  min-width: 0;
  max-width: 320px;
}

.self-tape-panel.is-fullscreen .self-tape-camera-label select,
.self-tape-panel.is-fullscreen .self-tape-reset-button,
.self-tape-panel.is-fullscreen .self-tape-countdown-stepper,
.self-tape-panel.is-fullscreen .self-tape-toggle,
.self-tape-panel.is-fullscreen .self-tape-status {
  border: 1px solid rgba(11, 74, 111, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #08324d;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.self-tape-panel.is-fullscreen .self-tape-camera-label select {
  padding-inline: 14px 28px;
}

.self-tape-panel.is-fullscreen .self-tape-reset-button {
  color: #08324d;
  font-size: 16px;
}

.self-tape-panel.is-fullscreen .self-tape-countdown-control {
  gap: 6px;
}

.self-tape-panel.is-fullscreen .self-tape-countdown-stepper {
  grid-template-columns: 32px 38px 32px;
  overflow: hidden;
}

.self-tape-panel.is-fullscreen .self-tape-countdown-stepper button {
  color: #08324d;
  font-size: 18px;
}

.self-tape-panel.is-fullscreen .self-tape-countdown-stepper input {
  color: #08324d;
  -webkit-text-fill-color: #08324d;
}

.self-tape-panel.is-fullscreen .self-tape-countdown-unit {
  color: rgba(255, 255, 255, 0.76);
  text-shadow: 0 1px 8px rgba(15, 23, 42, 0.35);
}

.self-tape-panel.is-fullscreen .self-tape-toggle {
  min-height: 32px;
  padding: 0 12px;
  color: #08324d;
  line-height: 30px;
}

.self-tape-panel.is-fullscreen .self-tape-toggle input {
  accent-color: #0b4a6f;
}

.self-tape-panel.is-fullscreen .self-tape-status {
  box-sizing: border-box;
  padding: 0 12px;
  color: #08324d;
  font-weight: 700;
}

.self-tape-panel.is-fullscreen .self-tape-status-dot {
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18);
}

.self-tape-panel.is-fullscreen .self-tape-status-text {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.self-tape-panel.is-fullscreen .self-tape-status[data-status-level="ok"] .self-tape-status-dot {
  background: #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.18);
}

.self-tape-panel.is-fullscreen .self-tape-status[data-status-level="warning"] .self-tape-status-dot {
  background: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18);
}

.self-tape-panel.is-fullscreen .self-tape-status[data-status-level="critical"] .self-tape-status-dot {
  background: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.18);
}

.self-tape-panel.is-fullscreen .self-tape-status[data-kind="error"] {
  height: 32px;
  min-height: 32px;
  padding: 0 12px;
  line-height: 30px;
  border-color: rgba(11, 74, 111, 0.24);
  background: rgba(255, 255, 255, 0.72);
  color: #08324d;
}

.self-tape-panel.is-fullscreen .self-tape-camera-label select {
  flex: 1 1 auto;
  width: auto;
  max-width: calc(100% - 38px);
}

.self-tape-panel.is-fullscreen .self-tape-camera-controls {
  width: 100%;
  margin-top: 2px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.28);
  box-shadow: none;
}

.self-tape-panel.is-fullscreen .self-tape-camera-controls[hidden] {
  display: none;
}

@media (max-width: 1200px) {
  .self-tape-panel.is-fullscreen {
    --self-tape-fullscreen-controls-max-height: min(40dvh, 340px);
  }

  .self-tape-panel.is-fullscreen .self-tape-controls {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "status buttons"
      "settings settings"
      "recovery recovery"
      "cue cue"
      "result result";
  }

  .self-tape-panel.is-fullscreen .self-tape-status {
    max-width: 180px;
  }
}

@media (max-width: 760px) {
  .self-tape-panel.is-fullscreen {
    --self-tape-fullscreen-controls-bottom: max(8px, env(safe-area-inset-bottom));
    --self-tape-fullscreen-controls-max-height: min(32dvh, 240px);
  }

  .self-tape-panel.is-fullscreen .self-tape-controls {
    left: max(8px, env(safe-area-inset-left));
    right: max(8px, env(safe-area-inset-right));
    bottom: calc(var(--self-tape-fullscreen-controls-bottom) + 62px);
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "status settings"
      "recovery recovery"
      "cue cue"
      "result result";
    gap: 6px 8px;
    overflow: hidden;
    padding: 8px 10px;
    border-radius: 14px;
  }

  .self-tape-panel.is-fullscreen .self-tape-controls:has(.self-tape-settings.is-expanded) {
    max-height: min(46dvh, 380px);
    overflow: auto;
  }

  .self-tape-panel.is-fullscreen .self-tape-controls select {
    width: min(100%, 240px);
    max-width: 240px;
  }

  .self-tape-panel.is-fullscreen .self-tape-settings {
    justify-self: end;
    width: max-content;
  }

  .self-tape-panel.is-fullscreen .self-tape-settings.is-expanded {
    grid-area: auto;
    grid-column: 1 / -1;
    justify-self: stretch;
    width: 100%;
  }

  .self-tape-panel.is-fullscreen .self-tape-settings-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 104px;
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid rgba(11, 74, 111, 0.24);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    color: #08324d;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    font-size: 13px;
    font-weight: 700;
  }

  .self-tape-panel.is-fullscreen .self-tape-settings-panel {
    display: none;
    width: 100%;
    gap: 8px;
  }

  .self-tape-panel.is-fullscreen .self-tape-settings.is-expanded .self-tape-settings-panel {
    display: flex;
  }

  .self-tape-panel.is-fullscreen .self-tape-camera-label {
    width: 100%;
  }

  .self-tape-panel.is-fullscreen .self-tape-status {
    max-width: 170px;
  }

  .self-tape-panel.is-fullscreen .self-tape-recovery {
    padding: 7px 8px;
    gap: 6px;
  }

  .self-tape-panel.is-fullscreen .self-tape-recovery-copy strong,
  .self-tape-panel.is-fullscreen .self-tape-recovery-copy span {
    font-size: 13px;
    line-height: 1.2;
  }

  .self-tape-panel.is-fullscreen .self-tape-recovery-actions button {
    min-height: 32px;
    padding-inline: 8px;
  }

  .self-tape-panel.is-fullscreen:not(.is-recording):has(.self-tape-status[data-status-level="critical"]) .self-tape-cue {
    display: none;
  }

  .self-tape-panel.is-fullscreen .self-tape-camera-label select {
    width: auto;
    max-width: calc(100% - 38px);
  }
}

@media (orientation: landscape) and (max-height: 520px) {
  .self-tape-panel.is-fullscreen {
    --self-tape-fullscreen-controls-bottom: max(6px, env(safe-area-inset-bottom));
    --self-tape-fullscreen-controls-max-height: calc(100dvh - max(12px, env(safe-area-inset-top)) - var(--self-tape-fullscreen-controls-bottom));
  }

  .self-tape-panel.is-fullscreen .self-tape-header {
    top: max(6px, env(safe-area-inset-top));
    right: max(6px, env(safe-area-inset-right));
  }

  .self-tape-panel.is-fullscreen .self-tape-fullscreen-button {
    top: max(6px, env(safe-area-inset-top));
    right: calc(max(6px, env(safe-area-inset-right)) + 52px);
  }

  .self-tape-panel.is-fullscreen .self-tape-controls {
    left: max(8px, env(safe-area-inset-left));
    right: max(8px, env(safe-area-inset-right));
    bottom: var(--self-tape-fullscreen-controls-bottom);
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "status settings"
      "recovery recovery"
      "cue cue"
      "result result";
    gap: 6px 8px;
    max-height: var(--self-tape-fullscreen-controls-max-height);
    overflow: auto;
    padding: 8px 10px 58px;
    border-radius: 12px;
  }

  .self-tape-panel.is-fullscreen .self-tape-settings {
    justify-self: end;
    width: max-content;
  }

  .self-tape-panel.is-fullscreen .self-tape-settings.is-expanded {
    grid-column: 1 / -1;
    justify-self: stretch;
    width: 100%;
  }

  .self-tape-panel.is-fullscreen .self-tape-settings-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 104px;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid rgba(11, 74, 111, 0.24);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.78);
    color: #08324d;
    font-size: 13px;
    font-weight: 700;
  }

  .self-tape-panel.is-fullscreen .self-tape-settings-panel {
    display: none;
    width: 100%;
    gap: 8px;
  }

  .self-tape-panel.is-fullscreen .self-tape-settings.is-expanded .self-tape-settings-panel {
    display: flex;
  }

  .self-tape-panel.is-fullscreen:not(.is-recording) .self-tape-cue {
    min-height: 52px;
    max-height: 68px;
    padding: 6px 8px;
  }

  .self-tape-panel.is-fullscreen:not(.is-recording) .self-tape-cue strong {
    font-size: 14px;
  }

  .self-tape-panel.is-fullscreen:not(.is-recording) .self-tape-cue span {
    font-size: 13px;
    line-height: 1.18;
  }

  .self-tape-panel.is-fullscreen.is-recording .self-tape-controls {
    max-height: min(62dvh, calc(100dvh - 16px));
    padding: 8px 10px 58px;
  }

  .self-tape-panel.is-fullscreen.is-recording .self-tape-cue {
    min-height: 58px;
    max-height: min(36dvh, 92px);
  }

  .self-tape-panel.is-fullscreen .self-tape-preview-wrap > .self-tape-camera-controls {
    bottom: calc(var(--self-tape-fullscreen-controls-bottom) + 8px);
    max-height: calc(100dvh - 24px);
  }
}

.self-tape-panel.is-fullscreen .self-tape-preview-wrap > .self-tape-camera-controls {
  left: max(8px, env(safe-area-inset-left));
  right: max(8px, env(safe-area-inset-right));
  bottom: calc(var(--self-tape-fullscreen-controls-bottom) + var(--self-tape-fullscreen-controls-max-height) + 12px);
  z-index: 8;
  max-height: min(46dvh, calc(100% - var(--self-tape-fullscreen-controls-bottom) - var(--self-tape-fullscreen-controls-max-height) - 72px));
  overflow: auto;
  padding: 8px;
  background: var(--self-tape-fullscreen-surface);
  box-shadow: 0 18px 42px rgba(2, 6, 23, 0.28);
}

@media (orientation: landscape) and (max-height: 520px) {
  .self-tape-panel.is-fullscreen .self-tape-preview-wrap > .self-tape-camera-controls {
    bottom: calc(var(--self-tape-fullscreen-controls-bottom) + 8px);
    max-height: calc(100dvh - 24px);
  }
}

.self-tape-panel.is-fullscreen .self-tape-camera-grid {
  grid-template-columns: minmax(0, 1fr);
}

.self-tape-panel.is-fullscreen .self-tape-cue {
  padding: 9px 10px;
}

.self-tape-panel.is-fullscreen .self-tape-coach-note {
  margin-top: 6px;
  padding: 8px 9px;
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(15, 23, 42, 0.64);
}

.self-tape-panel.is-fullscreen .self-tape-cue strong {
  font-size: 16px;
}

.self-tape-panel.is-fullscreen .self-tape-cue span {
  font-size: clamp(14px, 4.3vw, 18px);
  line-height: 1.24;
}

@media (max-width: 760px) {
  .self-tape-panel.is-fullscreen:not(.is-recording) .self-tape-cue {
    min-height: 56px;
    max-height: 82px;
    padding: 7px 8px;
    gap: 2px;
  }

  .self-tape-panel.is-fullscreen:not(.is-recording) .self-tape-cue-heading {
    gap: 6px;
  }

  .self-tape-panel.is-fullscreen:not(.is-recording) .self-tape-cue strong {
    font-size: 14px;
  }

  .self-tape-panel.is-fullscreen:not(.is-recording) .self-tape-cue span {
    font-size: 13px;
    line-height: 1.2;
  }

  .self-tape-panel.is-fullscreen:not(.is-recording) .self-tape-coach-toggle {
    min-width: 68px;
    height: 26px;
    font-size: 13px;
  }
}

.self-tape-panel.is-fullscreen .self-tape-result video {
  max-height: 180px;
}

.self-tape-panel.is-fullscreen.has-result .self-tape-controls {
  top: max(64px, calc(env(safe-area-inset-top) + 64px));
  bottom: max(8px, env(safe-area-inset-bottom));
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "result";
  max-height: none;
  padding: 10px 12px;
  overflow: auto;
}

.self-tape-panel.is-fullscreen.has-result .self-tape-record-toggle,
.self-tape-panel.is-fullscreen.has-result .self-tape-camera-toggle-button,
.self-tape-panel.is-fullscreen.has-result .self-tape-status,
.self-tape-panel.is-fullscreen.has-result .self-tape-recovery,
.self-tape-panel.is-fullscreen.has-result .self-tape-settings,
.self-tape-panel.is-fullscreen.has-result .self-tape-buttons,
.self-tape-panel.is-fullscreen.has-result .self-tape-cue {
  display: none;
}

.self-tape-panel.is-fullscreen.has-result .self-tape-result {
  display: grid;
  align-content: center;
  min-height: 0;
  gap: 8px;
}

.self-tape-panel.is-fullscreen.has-result .self-tape-result video {
  width: 100%;
  max-height: min(68dvh, calc(100dvh - 180px));
}

.self-tape-panel.is-fullscreen.has-result .self-tape-result-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
}

.self-tape-panel.is-fullscreen.has-result .self-tape-result-actions > * {
  justify-content: center;
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding-inline: 6px;
  text-align: center;
}

.stage-notes {
  border-bottom: 1px solid var(--border);
  background: #fbfcff;
}

.stage-notes.empty {
  background: #fff;
}

.stage-notes summary {
  display: flex;
  gap: 8px;
  align-items: baseline;
  padding: 8px 18px;
  cursor: pointer;
}

.stage-notes summary strong {
  color: var(--accent-ink);
  font-size: 13px;
}

.stage-notes summary span {
  color: var(--muted);
  font-size: 13px;
}

.stage-notes-body {
  display: grid;
  gap: 8px;
  padding: 0 18px 10px;
}

.stage-notes-view {
  display: grid;
  gap: 5px;
}

.stage-notes-body p {
  margin: 0;
  color: #344054;
  font-size: 13px;
  line-height: 1.35;
}

.stage-notes-empty,
.stage-notes-message {
  color: var(--muted);
  font-size: 13px;
}

.stage-notes-source a {
  color: var(--accent-ink);
}

.stage-notes-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 3px;
}

.stage-notes-actions button {
  height: 30px;
  padding: 0 9px;
  font-size: 13px;
}

.stage-notes-editor {
  display: grid;
  gap: 8px;
}

.stage-notes-source-editor {
  display: grid;
  gap: 8px;
}

.stage-notes-source-editor label {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 13px;
}

.stage-notes-source-editor input {
  width: 100%;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0 9px;
  font: inherit;
  font-size: 13px;
  color: var(--text);
  background: #fff;
}

.stage-notes-editor textarea {
  width: 100%;
  min-height: 88px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  font: inherit;
  font-size: 13px;
  line-height: 1.4;
  color: var(--text);
  background: #fff;
}

.events {
  list-style: none;
  margin: 0;
  padding: 0;
}

.event {
  display: grid;
  grid-template-columns: 54px 142px 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 11px 18px;
  border-bottom: 1px solid #edf0f4;
}

.event:last-child {
  border-bottom: 0;
}

.event.action {
  background: var(--action-bg);
  color: #475467;
  font-style: italic;
}

.event.actor-line {
  background: var(--actor-bg);
}

.event.muted-line {
  background: #fff7ed;
}

.event.muted-line .speaker {
  color: #9a3412;
}

.event.active {
  background: var(--active-bg);
}

.event.recording {
  outline: 2px solid var(--record);
  outline-offset: -2px;
}

.recording-scene .event {
  grid-template-columns: 54px 1fr minmax(280px, 4fr) auto;
}

.record-mode-line .speaker {
  color: var(--record);
}

.event-number {
  display: grid;
  gap: 2px;
  justify-items: start;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.1;
}

.event-number-main {
  min-width: 34px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #ffffff;
  color: var(--accent-ink);
  font-weight: 800;
  padding: 4px 6px;
  text-align: center;
}

.event-number-kind {
  color: #596579;
  white-space: nowrap;
}

.speaker {
  font-weight: 700;
  color: var(--accent-ink);
  font-size: 13px;
  padding-top: 3px;
}

.action .speaker {
  color: var(--muted);
}

.line-text {
  min-width: 0;
}

.line-note,
.record-note {
  display: block;
  margin-top: 4px;
  color: #596579;
  font-size: 13px;
}

.record-note {
  color: #4c5b6b;
}

.coach-note {
  display: grid;
  gap: 3px;
  margin-top: 9px;
  padding: 8px 10px;
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.78);
  color: #23384f;
  font-size: 13px;
  line-height: 1.35;
}

.coach-note strong {
  color: var(--accent-ink);
  font-size: 13px;
}

.line-actions {
  display: flex;
  gap: 8px;
}

.line-actions button {
  width: 38px;
  padding: 0;
}

.record-button {
  color: var(--record);
}

.event-edit-button {
  color: var(--accent-ink);
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
}

.status {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  padding-top: 8px;
}

.vad-continue-button {
  width: auto;
  min-height: 28px;
  padding: 3px 8px;
  border-radius: 6px;
  color: var(--accent-ink);
  font-size: 13px;
  line-height: 1.1;
}

.event.script-editing {
  row-gap: 8px;
}

.event-editor {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(320px, 1.35fr) minmax(260px, 0.95fr);
  grid-template-areas:
    "meta meta"
    "main support"
    "actions actions";
  gap: 10px 12px;
  align-items: start;
  margin-top: 2px;
  padding: 12px;
  border: 1px solid #cfdae8;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.event-editor label,
.event-text-editor {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.event-editor-meta {
  grid-area: meta;
  display: grid;
  grid-template-columns: minmax(120px, 150px) minmax(180px, 340px);
  gap: 8px 10px;
  align-items: end;
  min-width: 0;
}

.event-editor-main {
  grid-area: main;
}

.event-editor-support {
  grid-area: support;
  display: grid;
  gap: 8px;
  min-width: 0;
}

.event-editor .disabled {
  opacity: 0.55;
}

.event-editor-field-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.event-editor-field-title {
  min-width: 0;
  color: var(--accent-ink);
}

.event-editor-clear-button {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  min-width: 32px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--accent-ink);
  font-size: 18px;
  line-height: 1;
}

.event-editor-clear-button:hover:not(:disabled),
.event-editor-clear-button:focus-visible:not(:disabled) {
  border-color: #bfd0e4;
  background: #eef6ff;
}

.event-editor-clear-button:disabled {
  color: var(--muted);
  cursor: default;
  opacity: 0.35;
}

.event-editor-details {
  min-width: 0;
  border: 1px solid #d6e2ef;
  border-radius: 7px;
  background: #f8fbff;
}

.event-editor-details[open] {
  padding-bottom: 8px;
}

.event-editor-details-summary {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 7px 8px;
  color: var(--accent-ink);
  font-weight: 600;
  cursor: pointer;
}

.event-editor-details-summary > span:first-child {
  min-width: 0;
}

.event-editor-details .tts-text-editor {
  padding: 0 8px;
}

.tts-editor-header {
  display: flex;
  align-items: center;
  gap: 5px;
}

.tts-editor-filled {
  margin-left: auto;
  border: 1px solid #c8d8e8;
  border-radius: 999px;
  padding: 1px 6px;
  color: var(--muted);
  background: #fff;
  font-size: 13px;
  font-weight: 500;
}

.tts-help {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border: 1px solid #bfd0e4;
  border-radius: 50%;
  color: var(--accent-ink);
  background: #eef6ff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  cursor: help;
}

.tts-help-links {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.2;
}

.tts-help-links a {
  color: var(--accent-ink);
  text-decoration: none;
}

.event-editor select,
.event-editor input,
.event-editor textarea {
  width: 100%;
  min-width: 0;
  font-size: 13px;
}

.event-editor textarea {
  min-height: 60px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  font: inherit;
  font-size: 13px;
  line-height: 1.35;
  color: var(--ink);
  background: #fff;
}

.event-editor-main textarea {
  min-height: 96px;
}

.event-editor-support textarea {
  min-height: 68px;
}

.event-editor-support .tts-text-editor textarea {
  min-height: 58px;
}

.event-editor-actions {
  grid-area: actions;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
  padding-top: 2px;
  border-top: 1px solid #e2ebf5;
}

.event-editor-actions button {
  height: 34px;
  min-width: 150px;
  white-space: nowrap;
}

.event-editor-message {
  flex: 1 1 auto;
  min-height: 16px;
  color: var(--muted);
  font-size: 13px;
  text-align: left;
}

.toast-host {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 50;
  display: grid;
  gap: 8px;
  max-width: min(420px, calc(100vw - 32px));
}

.toast {
  border: 1px solid #d6dfeb;
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 35px rgba(18, 31, 43, 0.16);
  color: var(--text);
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.35;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.error {
  border-left-color: var(--record);
}

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

.app-live-status {
  position: fixed;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(13, 26, 36, 0.36);
}

.confirm-dialog {
  width: min(420px, 100%);
  border: 1px solid #d6dfeb;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(18, 31, 43, 0.24);
  padding: 16px;
}

.confirm-dialog h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.confirm-dialog p {
  margin: 0;
  color: var(--muted);
  white-space: pre-line;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.owner-scope-control {
  position: relative;
  min-width: 0;
}

.owner-scope-control.has-visible-label {
  display: grid;
  gap: 4px;
}

.owner-scope-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.owner-scope-modes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2px;
  min-width: 0;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #eef1f5;
}

.owner-scope-mode {
  min-width: 0;
  height: 30px;
  padding: 0 6px;
  border-color: transparent;
  background: transparent;
  color: #596579;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.owner-scope-mode.active {
  border-color: var(--border);
  background: white;
  color: var(--accent-ink);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
  font-weight: 700;
}

.owner-picker {
  position: absolute;
  z-index: 115;
  top: calc(100% + 6px);
  left: 0;
  display: grid;
  gap: 8px;
  width: min(360px, calc(100vw - 32px));
  max-height: min(460px, calc(100vh - 120px));
  padding: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.2);
}

.owner-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.owner-picker-head strong {
  color: var(--accent-ink);
  font-size: 14px;
}

.owner-picker-help,
.owner-picker-validation {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.owner-picker-validation {
  color: #9a3412;
}

.owner-picker-close {
  display: inline-grid;
  width: 32px;
  min-width: 32px;
  height: 32px;
  padding: 0;
  place-items: center;
  font-size: 18px;
}

.owner-picker-search {
  width: 100%;
  min-width: 0;
}

.owner-picker-options {
  display: grid;
  min-height: 42px;
  max-height: 280px;
  overflow: auto;
  overscroll-behavior: contain;
}

.owner-picker-option {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  min-width: 0;
  min-height: 38px;
  padding: 6px 4px;
  border-bottom: 1px solid #edf0f5;
  color: var(--ink);
  font-size: 13px;
  cursor: pointer;
}

.owner-picker-option:last-child {
  border-bottom: 0;
}

.owner-picker-option input {
  width: 17px;
  min-width: 17px;
  height: 17px;
  margin: 0;
}

.owner-picker-option span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.owner-picker-empty {
  margin: 0;
  padding: 9px 4px;
  color: var(--muted);
  font-size: 13px;
}

.owner-picker-apply {
  justify-self: end;
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.owner-picker-apply:disabled {
  border-color: var(--border);
  background: #e5e7eb;
  color: #6b7280;
}

.owner-scope-selection-summary {
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.owner-picker-backdrop {
  position: fixed;
  z-index: 108;
  inset: 0;
  background: rgba(15, 23, 42, 0.28);
}

body.owner-picker-open {
  overflow: hidden;
}

.cast-picker-owner-filter {
  width: min(100%, 320px);
}

.cast-picker-option.outside-owner-filter {
  border-style: dashed;
  border-color: #d3a642;
}

.voice-owner-field .owner-scope-control {
  width: 100%;
}

.recordings-panel {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.recordings-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(310px, auto);
  gap: 4px 18px;
  align-items: end;
}

.recordings-head h2,
.recordings-head p {
  margin: 0;
}

.recordings-head h2 {
  color: var(--accent-ink);
  font-size: 24px;
}

.recordings-head p {
  color: var(--muted);
  font-size: 13px;
}

.recordings-head > .owner-scope-control {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  width: min(420px, 100%);
}

.recordings-head .owner-scope-mode {
  height: auto;
  min-height: 34px;
  overflow: visible;
  line-height: 1.15;
  text-overflow: clip;
  white-space: normal;
}

.recording-library-filters {
  display: grid;
  grid-template-columns: minmax(260px, 1.5fr) minmax(180px, 0.75fr) minmax(180px, 0.75fr);
  gap: 8px;
  min-width: 0;
}

.recording-library-filters input,
.recording-library-filters select {
  width: 100%;
  min-width: 0;
}

.recording-library-status {
  min-height: 20px;
  color: var(--muted);
  font-size: 13px;
}

.recording-library-groups {
  display: grid;
  gap: 10px;
}

.recording-material-group {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
}

.recording-material-group > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 48px;
  padding: 9px 12px;
  color: var(--accent-ink);
  cursor: pointer;
}

.recording-material-group > summary::marker {
  color: var(--accent);
}

.recording-material-group > summary strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recording-material-group > summary span,
.recording-character-head span {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.recording-character-group {
  display: grid;
  border-top: 1px solid var(--border);
}

.recording-character-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  padding: 7px 12px;
  background: #f8fafc;
}

.recording-character-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
}

.recording-library-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 104px minmax(140px, auto);
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 9px 12px;
  border-top: 1px solid #edf0f5;
}

.recording-character-head + .recording-library-row {
  border-top: 0;
}

.recording-library-row.orphaned {
  background: #fffaf0;
}

.recording-library-play {
  display: inline-grid;
  width: 40px;
  min-width: 40px;
  height: 40px;
  padding: 0;
  place-items: center;
  color: var(--accent-ink);
}

.recording-library-content {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.recording-library-content strong,
.recording-library-content p,
.recording-library-content small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recording-library-content strong {
  color: var(--ink);
  font-size: 13px;
}

.recording-library-character {
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.recording-library-content p {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
}

.recording-library-content small {
  color: var(--muted);
  font-size: 13px;
}

.recording-library-media {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 5px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.recording-library-progress {
  width: 100%;
  height: 5px;
}

.recording-library-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  min-width: 0;
}

.recording-library-actions button {
  min-height: 34px;
  padding-inline: 9px;
  font-size: 13px;
  white-space: nowrap;
}

.recording-library-delete {
  color: var(--danger);
}

.recording-library-empty {
  padding: 24px 16px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: white;
  color: var(--muted);
  text-align: center;
}

.recording-library-pagination {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 13px;
}

.recording-return-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin: 0 0 10px;
}

.recording-return-bar button {
  min-height: 36px;
  color: var(--accent-ink);
}

.recording-return-message {
  color: var(--danger);
  font-size: 13px;
}

.record-mode-line.deep-linked {
  outline: 3px solid #f59e0b;
  outline-offset: -3px;
  background: #fffbeb;
}

[hidden] {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (min-width: 781px) and (max-width: 1100px) {
  .voice-filters {
    grid-template-columns: minmax(200px, 1.2fr) minmax(120px, 0.8fr) minmax(250px, 1fr);
  }
}

@media (max-width: 780px) {
  .global-shell {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 2px 8px;
    padding: 4px 8px;
  }

  .workspace-context-bar {
    display: grid;
    gap: 2px;
    padding: 6px 12px 0;
  }

  .workspace-context-field {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
    width: 100%;
  }

  .workspace-context-field select {
    min-height: 40px;
    font-size: 16px;
  }

  .voice-create-workspace {
    display: grid;
    gap: 3px;
    font-size: 13px;
  }

  .global-shell h1 {
    font-size: 20px;
  }

  .global-shell .brand-logo {
    width: 26px;
    height: 26px;
  }

  .about-icon-button {
    flex-basis: 40px;
    width: 40px;
    min-width: 40px;
    height: 40px;
    font-size: 14px;
  }

  .global-nav {
    grid-column: 1 / -1;
    padding-bottom: 0;
  }

  .global-userbox {
    grid-column: 2;
    grid-row: 1;
  }

  .global-userbox span {
    display: none;
  }

  .material-toolbar {
    padding: 8px 12px 0;
  }

  .material-toolbar-primary {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
  }

  .material-toolbar-advanced-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .material-toolbar-advanced summary {
    display: flex;
    align-items: center;
    min-height: 40px;
    padding: 6px 8px;
  }

  .material-toolbar label,
  .material-toolbar .control-field {
    gap: 2px;
    font-size: 13px;
  }

  .cast-picker {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    width: 100vw;
    max-height: min(76vh, 640px);
    padding: 12px;
    border-radius: 8px 8px 0 0;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
  }

  .cast-picker-options {
    max-height: calc(76vh - 150px);
  }

  .cast-picker-option {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .cast-picker-test {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  .global-shell button,
  .material-toolbar button,
  .material-toolbar select,
  .material-toolbar input {
    height: 40px;
    min-height: 40px;
    font-size: 13px;
  }

  .voices-panel {
    padding: 12px 12px 0;
  }

  .voice-tabs {
    margin-right: -12px;
    padding-right: 12px;
  }

  .voice-filters {
    position: static;
    grid-template-columns: minmax(0, 1fr) max-content;
    gap: 6px 8px;
    padding: 6px 0;
    border-bottom: 0;
    background: transparent;
    backdrop-filter: none;
  }

  .voice-filters select,
  .voice-filters input {
    height: 32px;
  }

  .voice-search-field {
    grid-column: 1 / -1;
  }

  .paid-cache-transfer-head {
    align-items: start;
  }

  .paid-cache-export-form,
  .paid-cache-import-form,
  .paid-cache-code {
    grid-template-columns: minmax(0, 1fr);
  }

  .paid-cache-export-form > button,
  .paid-cache-import-form > button,
  .paid-cache-code > button {
    width: 100%;
  }

  .paid-cache-code p {
    grid-column: auto;
  }

  .paid-cache-history-row {
    align-items: start;
  }

  .voice-provider-field {
    grid-column: 1;
  }

  .voice-filter-toggle {
    display: inline-flex;
    grid-column: 2;
    align-items: center;
    justify-content: center;
    align-self: end;
    height: 32px;
    padding: 0 10px;
    white-space: nowrap;
    font-size: 13px;
  }

  .voice-filter-more {
    display: none;
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    padding-top: 2px;
  }

  .voice-filters.expanded .voice-filter-more {
    display: grid;
  }

  .voice-filter-field {
    gap: 2px;
  }

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

  .scene-actions.has-scene-tempo {
    width: 100%;
    grid-template-columns: max-content max-content minmax(0, 1fr);
    align-items: center;
  }

  .scene-actions.has-scene-tempo .play-scene {
    grid-column: 1 / -1;
    width: 100%;
    min-height: 40px;
  }

  .scene-actions.has-scene-tempo .self-tape-button,
  .scene-actions.has-scene-tempo .prompter-button,
  .scene-actions.has-scene-tempo .scene-invite-button {
    min-height: 40px;
  }

  .scene-actions.has-scene-tempo .self-tape-button {
    width: 40px;
    min-width: 40px;
  }

  .qwen-accent-phrase,
  .qwen-accent-variant {
    grid-template-columns: minmax(0, 1fr);
  }

  .qwen-accent-controls {
    grid-row: auto;
  }

  .qwen-accent-actions {
    justify-content: flex-start;
  }

  .scene-tempo-control {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
  }

  .prompter-panel.is-fullscreen {
    gap: 10px;
    padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  }

  .prompter-cue {
    padding: 18px;
  }

  .prompter-controls {
    gap: 6px;
    padding: 4px 10px;
  }

  .prompter-settings {
    display: grid;
    gap: 8px;
    width: 100%;
  }

  .prompter-settings-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 40px;
    border: 1px solid var(--prompter-control-border);
    border-radius: 999px;
    background: var(--prompter-control-surface-muted);
    color: rgba(255, 255, 255, 0.94);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
    font-size: 13px;
    font-weight: 700;
  }

  .prompter-settings.is-expanded .prompter-settings-toggle {
    background: var(--prompter-control-surface);
    color: var(--prompter-control-ink);
  }

  .prompter-settings-panel {
    display: none;
    width: 100%;
    gap: 8px;
  }

  .prompter-settings.is-expanded .prompter-settings-panel {
    display: flex;
  }

  .prompter-panel.is-running .prompter-settings {
    display: none;
  }

  .prompter-audio-mode,
  .prompter-visual-controls,
  .prompter-run-cluster,
  .prompter-buttons {
    width: 100%;
  }

  .prompter-run-cluster {
    gap: 4px;
  }

  .prompter-panel:not(.is-running) .prompter-status {
    display: none;
  }

  .prompter-panel.is-running .prompter-run-cluster {
    flex-direction: column;
    align-items: stretch;
  }

  .prompter-panel.is-running .prompter-status {
    align-self: flex-end;
    height: 24px;
    max-width: 100%;
    padding-inline: 8px;
    font-size: 13px;
  }

  .prompter-visual-controls {
    justify-content: flex-start;
  }

  .prompter-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(84px, 1fr));
  }

  .prompter-buttons button {
    width: 100%;
    min-width: 0;
    min-height: 40px;
    height: 40px;
    padding-inline: 8px;
  }

  .self-tape-header,
  .self-tape-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .self-tape-header-actions {
    justify-content: flex-start;
  }

  .self-tape-grid {
    grid-template-columns: 1fr;
  }

  .self-tape-panel {
    padding: 10px 12px;
  }

  .self-tape-panel:not(.is-fullscreen) .self-tape-camera-label {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 40px;
    justify-self: stretch;
    width: 100%;
    max-width: 100%;
  }

  .self-tape-panel:not(.is-fullscreen) .self-tape-camera-label select {
    width: 100%;
    max-width: 100%;
  }

  .self-tape-controls {
    gap: 8px;
  }

  .self-tape-buttons {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .self-tape-buttons button {
    width: 100%;
    padding-inline: 6px;
  }

  .self-tape-toggle {
    white-space: normal;
  }

  .self-tape-countdown {
    font-size: 52px;
  }

  .material-toolbar-primary .material-field {
    grid-column: 1;
  }

  .material-toolbar-primary .character-field {
    grid-column: 2;
  }

  .material-toolbar-primary .top-play-actions {
    grid-column: 1 / -1;
  }

  .material-toolbar-advanced-grid .pause-field,
  .material-toolbar-advanced-grid .actor-mode-field,
  .material-toolbar-advanced-grid .vad-field {
    grid-column: 1;
  }

  .top-play-actions {
    justify-self: stretch;
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content;
    justify-content: stretch;
  }

  .actor-wait-mode {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tempo-control {
    grid-column: 1 / -1;
    grid-template-columns: auto minmax(96px, 1fr) auto;
  }

  .tempo-status {
    min-width: 124px;
  }

  .material-toolbar-primary,
  .scene-actions,
  .scene-filter,
  .admin-form {
    justify-content: flex-start;
  }

  .account-form,
  .profile-devices-heading,
  .admin-user-toolbar,
  .admin-audit-toolbar,
  .admin-tab-heading,
  .admin-device-card {
    grid-template-columns: 1fr;
  }

  .admin-tab-heading {
    display: grid;
  }

  .script-import-submit-row > button {
    height: auto;
    min-height: 40px;
    padding-block: 6px;
    white-space: normal;
  }

  .script-import-draft {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

  .script-import-draft > button {
    width: 100%;
    min-height: 40px;
    white-space: normal;
  }

  .project-sharing-user > span {
    display: grid !important;
    gap: 2px;
    align-items: start;
  }

  .project-sharing-user strong,
  .project-sharing-user small {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  #adminPanel button,
  .voices-panel button,
  .voices-panel textarea {
    min-height: 40px;
  }

  .admin-tab-heading > button,
  .admin-audit-toolbar > button {
    width: 100%;
    height: auto;
    min-height: 40px;
    justify-self: stretch;
    white-space: normal;
  }

  .admin-push-registration {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-push-registration > button {
    grid-column: 1;
    grid-row: auto;
    min-height: 40px;
    justify-self: stretch;
  }

  .admin-push-registration-header {
    align-items: start;
  }

  .admin-users-table {
    display: grid;
    gap: 6px;
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .admin-users-table-row.header {
    position: absolute;
    width: 1px;
    height: 1px;
    min-width: 0;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .admin-users-table-item {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: white;
  }

  .admin-users-table .admin-users-table-item:last-child {
    border-bottom: 1px solid var(--border);
  }

  .admin-users-table-item .admin-users-table-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 5px;
    min-width: 0;
    padding: 8px;
  }

  .admin-users-table-item [role="cell"] {
    display: grid;
    grid-template-columns: minmax(94px, 34%) minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    min-width: 0;
  }

  .admin-users-table-item [role="cell"]::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
  }

  .admin-users-table-identity .admin-user-identity {
    align-items: flex-start;
  }

  .admin-user-row-details-body {
    margin: 0 8px 8px;
  }

  .account-readonly-grid {
    grid-template-columns: 1fr;
  }

  .admin-tablist {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin-inline: 0;
    padding-inline: 0;
    overflow: visible;
  }

  .admin-tablist [role="tab"] {
    width: 100%;
    min-width: 0;
    height: auto;
    min-height: 40px;
    padding-block: 6px;
    line-height: 1.2;
    white-space: normal;
  }

  .admin-workspace-create-form,
  .admin-workspace-edit,
  .admin-workspace-add-member,
  .admin-workspace-member,
  .admin-workspace-invite,
  .admin-workspace-item > summary {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-workspace-member-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-content: stretch;
  }

  .admin-workspace-member-actions select,
  .admin-workspace-member-actions button {
    width: 100%;
    min-height: 40px;
  }

  .profile-workspaces-panel .admin-workspace-member-actions.has-multiple-actions {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .profile-workspaces-panel .admin-workspace-member-actions.has-multiple-actions button {
    width: auto;
    min-width: 72px;
  }

  .admin-workspace-create-form > button,
  .admin-workspace-edit > button,
  .admin-workspace-add-member > button,
  .admin-workspace-member > button,
  .admin-workspace-invite > button {
    width: 100%;
    min-height: 40px;
  }

  .admin-workspace-counts {
    padding-left: 0;
  }

  .admin-workspace-view-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .admin-workspace-view-tabs button {
    min-width: 0;
    min-height: 40px;
  }

  .admin-personal-workspace-toolbar,
  .admin-personal-workspace-heading,
  .admin-personal-material {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-personal-workspace-empty-toggle {
    min-height: 40px;
  }

  .admin-personal-material {
    gap: 8px;
    padding-left: 0;
  }

  .admin-personal-material-open {
    width: 100%;
    min-height: 40px;
  }

  #adminPersonalWorkspacesMore {
    width: 100%;
    min-height: 40px;
  }

  .admin-user-actions {
    grid-template-columns: minmax(160px, 1fr) minmax(130px, 150px);
    justify-content: flex-start;
  }

  .material-access-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-user-identity span,
  .artifact-text strong,
  .artifact-text span {
    white-space: normal;
  }

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

  .scene-filter-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: auto;
    align-items: stretch;
    justify-content: flex-start;
  }

  .scene-filter-actions button {
    width: 100%;
    min-width: 0;
    height: auto;
    min-height: 40px;
    padding-block: 6px;
    line-height: 1.2;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .actor-roles-panel {
    position: fixed;
    inset: auto 12px calc(12px + env(safe-area-inset-bottom));
    z-index: 80;
    width: auto;
    max-width: none;
    max-height: min(70dvh, 480px);
    overscroll-behavior: contain;
    border-radius: 8px;
  }

  .actor-role-option {
    min-height: 40px;
    padding: 8px 10px;
  }

  .cast-toggle {
    width: 40px;
    min-width: 40px;
    height: 40px;
  }

  .call-mute-panel summary,
  .voice-card-more > summary,
  .qwen-profile-details summary,
  .qwen-accent-summary,
  .voice-profile-edit > summary,
  .sample-details > summary,
  .voice-form .form-help-details > summary,
  .stage-notes > summary,
  .admin-create-user > summary,
  .admin-user-row-details > summary,
  .admin-material-access > summary,
  .admin-voice-permissions > summary,
  .admin-user-devices > summary,
  .admin-device-technical > summary,
  .admin-push-technical > summary,
  .profile-account-details > summary,
  .push-devices-inactive > summary,
  .profile-devices-more > summary {
    display: flex;
    align-items: center;
    min-height: 40px;
  }

  .voice-custom-test textarea {
    min-height: 44px;
  }

  .actor-role-option span {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .cast-summary span:nth-child(n + 3) {
    display: none;
  }

  .event {
    grid-template-columns: 46px 1fr;
    gap: 6px;
  }

  .speaker {
    grid-column: 2;
  }

  .line-text,
  .line-actions {
    grid-column: 1 / -1;
  }

  .line-actions {
    justify-content: flex-start;
  }

  .event-editor {
    grid-template-columns: 1fr;
    grid-template-areas:
      "meta"
      "main"
      "support"
      "actions";
    padding: 10px;
  }

  .event-editor-meta {
    grid-template-columns: 1fr;
  }

  .event-editor-actions {
    min-width: 0;
    align-items: stretch;
    flex-direction: column;
  }

  .event-editor-actions button {
    width: 100%;
    min-width: 0;
  }

  .provider-job {
    grid-template-columns: 1fr;
  }

  .provider-job-actions {
    justify-content: flex-start;
  }

  .about-lede,
  .about-author {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 8px;
  }

  .about-mark {
    width: 38px;
    height: 38px;
  }

  .about-mascot {
    width: 42px;
    max-height: 38px;
  }
}

@media (min-width: 361px) and (max-width: 420px) {
  .global-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 6px;
    overflow: visible;
  }

  .global-nav .nav-button {
    width: 100%;
    min-width: 0;
  }
}

.pmf-pilot-dialog {
  width: min(620px, calc(100% - 24px));
  max-height: min(90dvh, 760px);
  margin: auto;
  padding: 0;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.28);
}

.pmf-pilot-dialog::backdrop {
  background: rgba(15, 23, 42, 0.58);
}

#pmfPilotDialogHost {
  padding: 24px;
}

.pmf-pilot-dialog-close {
  position: sticky;
  z-index: 1;
  top: 8px;
  float: right;
  width: 40px;
  height: 40px;
  margin: 8px 8px -48px 0;
  padding: 0;
  border-radius: 50%;
  font-size: 24px;
}

.pmf-pilot-title {
  margin: 0;
  letter-spacing: 0;
}

.pmf-pilot-lead,
.pmf-pilot-note,
.pmf-pilot-profile-window,
.pmf-pilot-admin-status {
  margin: 6px 0 0;
  color: var(--muted);
}

.pmf-pilot-privacy {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 4px 12px;
  margin: 18px 0;
  padding: 14px;
  border-left: 3px solid var(--accent);
  background: var(--actor-bg);
}

.pmf-pilot-privacy p {
  margin: 0;
}

.pmf-pilot-contact-choice,
.pmf-pilot-choice,
.pmf-pilot-admin-flag {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.pmf-pilot-contact-choice input,
.pmf-pilot-choice input,
.pmf-pilot-admin-flag input {
  margin-top: 4px;
}

.pmf-pilot-actions,
.pmf-pilot-role-actions,
.pmf-pilot-admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.pmf-pilot-message {
  min-height: 20px;
  margin-top: 8px;
  color: var(--muted);
}

.pmf-pilot-message[data-kind="error"] {
  color: var(--danger);
}

.pmf-pilot-fieldset {
  display: grid;
  gap: 8px;
  margin: 16px 0 0;
  padding: 0;
  border: 0;
}

.pmf-pilot-fieldset-title,
.pmf-pilot-field-label {
  font-weight: 700;
}

.pmf-pilot-field {
  display: grid;
  gap: 5px;
  margin-top: 14px;
}

.pmf-pilot-field textarea {
  width: 100%;
  min-height: 88px;
  resize: vertical;
}

.pmf-pilot-field-hint {
  color: var(--muted);
  font-size: 13px;
}

#pmfPilotRoleConfirmation:not([hidden]) {
  display: block;
  grid-column: 1 / -1;
  width: 100%;
}

.pmf-pilot-role-confirmation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.pmf-pilot-role-copy {
  margin: 0;
}

.pmf-pilot-profile {
  padding: 16px 0;
  border-top: 1px solid var(--border);
}

.pmf-pilot-profile-progress,
.pmf-pilot-organic-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 14px;
  max-width: 520px;
  margin: 14px 0;
}

.pmf-pilot-profile-progress dt,
.pmf-pilot-profile-progress dd,
.pmf-pilot-organic-list dt,
.pmf-pilot-organic-list dd {
  margin: 0;
}

.pmf-pilot-profile-pending,
.pmf-pilot-admin-header,
.pmf-pilot-admin-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pmf-pilot-profile-pending {
  margin: 12px 0;
  padding: 10px 0;
  border-block: 1px solid var(--border);
}

.pmf-pilot-admin-summary {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-top: 14px;
  color: var(--muted);
}

.pmf-pilot-release-markers {
  margin: 16px 0;
}

.pmf-pilot-release-markers h4 {
  margin: 0 0 6px;
  font-size: 14px;
}

.pmf-pilot-release-list {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 13px;
}

.pmf-pilot-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin: 16px 0;
}

.pmf-pilot-metric {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.pmf-pilot-metric-title {
  margin: 0 0 6px;
  font-size: 14px;
}

.pmf-pilot-metric-value {
  display: block;
  font-size: 20px;
}

.pmf-pilot-metric-target {
  color: var(--muted);
  font-size: 13px;
}

.pmf-pilot-participants-table {
  margin-top: 18px;
  overflow-x: auto;
}

.pmf-pilot-participant-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.2fr) 100px 160px minmax(170px, 1fr) minmax(160px, 1fr) minmax(210px, 1.3fr);
  gap: 10px;
  align-items: center;
  min-width: 980px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.pmf-pilot-participant-header {
  color: var(--muted);
  font-weight: 700;
}

.pmf-pilot-participant-identity,
.pmf-pilot-admin-flags {
  display: grid;
  gap: 3px;
}

.pmf-pilot-admin-flags select {
  min-width: 0;
}

@media (max-width: 780px) {
  #pmfPilotDialogHost {
    padding: 20px 16px calc(18px + env(safe-area-inset-bottom));
  }

  .pmf-pilot-privacy {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }

  .pmf-pilot-privacy p + strong {
    margin-top: 8px;
  }

  .pmf-pilot-actions button,
  .pmf-pilot-role-actions button,
  .pmf-pilot-admin-actions button,
  .pmf-pilot-profile-pending button {
    min-height: 40px;
  }

  .pmf-pilot-role-confirmation,
  .pmf-pilot-admin-header,
  .pmf-pilot-profile-pending {
    align-items: stretch;
    flex-direction: column;
  }

  .pmf-pilot-role-actions,
  .pmf-pilot-admin-actions {
    margin-top: 0;
  }

  .pmf-pilot-role-actions button {
    flex: 1;
  }

  .pmf-pilot-participants-table {
    overflow: visible;
  }

  .pmf-pilot-participant-header {
    display: none;
  }

  .pmf-pilot-participant-row {
    grid-template-columns: minmax(0, 1fr);
    min-width: 0;
    gap: 6px;
    padding: 12px 0;
  }

  .pmf-pilot-participant-row [role="cell"]::before {
    content: attr(data-label) ": ";
    color: var(--muted);
    font-weight: 400;
  }
}

@media (max-width: 360px) {
  .global-shell {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px;
    padding-inline: 6px;
  }

  .global-brand {
    gap: 4px;
  }

  .global-shell .brand-logo {
    width: 24px;
    height: 24px;
  }

  .global-userbox {
    grid-column: 2;
    grid-row: 1;
    gap: 2px;
    justify-content: flex-end;
    overflow: visible;
  }

  .global-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    gap: 6px;
    overflow: visible;
  }

  .global-nav .nav-button {
    width: 100%;
    min-width: 0;
  }

  .global-shell h1 {
    font-size: 16px;
  }

  .global-userbox button {
    min-width: 0;
    padding-inline: 6px;
    font-size: 13px;
  }

  .voice-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    margin-right: 0;
    padding-right: 0;
    overflow: visible;
  }

  .voice-tab {
    width: 100%;
    min-width: 0;
    height: auto;
    min-height: 40px;
    padding: 4px 6px;
  }
}

@media (max-width: 900px), (hover: none) and (pointer: coarse) {
  button {
    min-width: 40px;
    min-height: 40px;
  }

  button.icon-only-button {
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
  }

  select,
  input {
    min-height: 40px;
  }

  .about-icon-button,
  .self-tape-button,
  .self-tape-buttons .self-tape-icon-button,
  .self-tape-camera-label .self-tape-icon-button,
  .self-tape-diagnostics-actions .self-tape-icon-button {
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
  }

  .about-icon-button {
    flex-basis: 40px;
  }

  .prompter-font-controls button {
    width: 40px;
    min-width: 40px;
    height: 40px;
  }

  .prompter-buttons button,
  .prompter-audio-mode select,
  .prompter-color-control input {
    min-height: 40px;
    height: 40px;
  }
}

/* Preserve the compact phone navigation independently of the deferred palette. */
@media (min-width: 361px) and (max-width: 420px) {
  .global-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
  }

  .global-nav .nav-button {
    min-width: 0;
    padding-inline: 4px;
  }
}

@media (max-width: 360px) {
  .global-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 780px) {
  .recordings-panel {
    padding: 12px 12px 0;
  }

  .recordings-head {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }

  .recordings-head > .owner-scope-control {
    grid-column: 1;
    grid-row: auto;
    width: 100%;
  }

  .recordings-head .owner-scope-mode {
    min-height: 40px;
  }

  .recording-library-filters {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }

  .recording-material-group > summary {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }

  .recording-material-group > summary span {
    white-space: normal;
  }

  .recording-library-row {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 6px 9px;
    padding: 10px;
  }

  .recording-library-content p,
  .recording-library-content small {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .recording-library-content p {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
  }

  .recording-library-media {
    grid-column: 2;
    width: min(180px, 100%);
  }

  .recording-library-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .recording-library-actions button {
    min-height: 40px;
  }

  .owner-scope-mode {
    min-height: 40px;
    height: 40px;
    padding-inline: 5px;
  }

  .owner-picker.mobile-drawer {
    position: fixed;
    z-index: 116;
    inset: auto 0 0;
    width: 100%;
    max-height: min(76dvh, 620px);
    padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 10px 10px 0 0;
    box-shadow: 0 -18px 48px rgba(15, 23, 42, 0.24);
  }

  .owner-picker-options {
    max-height: min(48dvh, 360px);
  }

  .owner-picker-option,
  .owner-picker-apply,
  .owner-picker-close {
    min-height: 40px;
  }

  .cast-picker-owner-filter {
    width: 100%;
  }

  .voice-owner-field .owner-scope-mode {
    min-height: 34px;
    height: 34px;
  }

  .recording-return-bar button {
    width: 100%;
    min-height: 40px;
  }
}

/* Responsive typography and control-size gates. */
.global-shell h1 {
  font-size: 28px;
  letter-spacing: 0;
}

#mainView :is(h2, h3, h4, h5, h6) {
  font-size: 18px;
  letter-spacing: 0;
}

#mainView :is(.voice-card, .recording-character-group, .pmf-pilot-metric) :is(h3, h4, h5, h6) {
  font-size: 16px;
}

#mainView p,
#mainView :is(.speaker, .line-text, .event-text, .cue-text, .recording-library-text, .material-info-lead) {
  font-size: 16px;
}

#mainView a[href] {
  font-size: 14px;
}

#mainView :is(.event-number-main, .event-number-kind, .tempo-label, .tempo-status, .actor-wait-label) {
  font-size: 13px;
}

.auth-dialog :is(.login-panel, .invite-panel, .password-reset-panel) > p {
  font-size: 16px;
}

.auth-dialog :is(button, input, select, textarea, summary) {
  font-size: 14px;
}

#mainView :is(
  .profile-device-header strong,
  .profile-device-meta,
  .push-device-title strong,
  .admin-device-owner strong,
  .admin-device-owner span,
  .admin-device-row strong,
  .admin-device-meta,
  .admin-device-info
) {
  overflow: visible;
  white-space: normal;
  text-overflow: clip;
  overflow-wrap: anywhere;
}

#mainView .admin-user-sort-button {
  min-width: 32px;
}

#mainView :is(
  .actor-roles-button,
  .actor-wait-mode-button,
  .owner-scope-mode,
  .nav-button,
  .voice-tab,
  .voice-filter-toggle,
  .qwen-accent-summary,
  .admin-user-sort-button,
  .admin-user-actions-toggle,
  .ghost-button.compact-button
) {
  height: auto;
  overflow: visible;
  white-space: normal;
  text-overflow: clip;
  overflow-wrap: anywhere;
}

@media (min-width: 701px) {
  #mainView button,
  #mainView summary,
  #mainView select,
  #mainView textarea,
  #mainView input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]),
  #mainView [role="button"],
  #mainView [role="tab"] {
    min-height: 32px;
  }

  #mainView :is(select, textarea, input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"])),
  #mainView :is(
    summary,
    .nav-button,
    .playback-button,
    .random-cue-button,
    .actor-roles-button,
    .actor-wait-mode-button,
    .owner-scope-mode,
    .voice-tab,
    .voice-filter-toggle,
    .qwen-accent-summary,
    .admin-user-sort-button,
    .admin-user-actions-toggle,
    .ghost-button.compact-button,
    .secondary-button,
    #logoutButton
  ) {
    font-size: 14px;
  }

  #mainView :is(
    .about-icon-button,
    .owner-picker-close,
    .cast-picker-close,
    .self-tape-preview-icon-button,
    .self-tape-icon-button,
    .prompter-close-button
  ) {
    min-width: 32px;
    min-height: 32px;
  }

  #mainView :is(
    .actor-role-option,
    .mute-character,
    .owner-picker-option,
    .script-import-visibility-options label,
    .pmf-pilot-choice,
    .pmf-pilot-contact-choice,
    .pmf-pilot-admin-flag
  ) {
    min-height: 32px;
  }
}

@media (max-width: 700px) {
  #mainView .admin-user-sort-button {
    min-width: 40px;
  }

  .self-tape-panel:not(.is-fullscreen) .self-tape-preview-icon-button {
    width: 40px;
    min-width: 40px;
    height: 40px;
  }

  .self-tape-panel:not(.is-fullscreen) .self-tape-countdown-stepper {
    grid-template-columns: repeat(3, 40px);
    height: 42px;
  }

  .self-tape-panel:not(.is-fullscreen) .self-tape-countdown-stepper :is(button, input) {
    width: 40px;
    min-width: 40px;
    height: 40px;
    line-height: 40px;
  }

  .global-shell h1 {
    font-size: 24px;
  }

  #mainView :is(
    button,
    summary,
    select,
    textarea,
    input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]),
    a[href],
    [role="button"],
    [role="tab"]
  ),
  .public-beta-view :is(button, a[href], summary),
  .auth-dialog :is(button, input, select, textarea, summary) {
    min-height: 40px;
    font-size: 16px;
  }

  #mainView :is(
    .actor-role-option,
    .mute-character,
    .owner-picker-option,
    .script-import-visibility-options label,
    .pmf-pilot-choice,
    .pmf-pilot-contact-choice,
    .pmf-pilot-admin-flag
  ) {
    min-height: 40px;
  }

  #mainView .owner-scope-mode,
  #mainView .voice-owner-field .owner-scope-mode {
    min-height: 40px;
    height: auto;
  }

  :is(.auth-dialog-close, .pmf-pilot-dialog-close, .prompter-close-button) {
    font-size: 24px;
  }

  .voice-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    margin-right: 0;
    padding-right: 0;
    overflow: visible;
  }

  .voice-tab {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 340px) {
  .global-userbox {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .global-nav {
    grid-row: 3;
  }
}

@media (max-width: 900px), (hover: none) and (pointer: coarse) {
  #mainView :is(
    button,
    summary,
    select,
    textarea,
    input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]),
    a[href],
    [role="button"],
    [role="tab"]
  ),
  .auth-dialog :is(button, input, select, textarea, summary) {
    min-height: 40px;
    font-size: 16px;
  }

  #mainView :is(
    .actor-role-option,
    .mute-character,
    .owner-picker-option,
    .script-import-visibility-options label,
    .pmf-pilot-choice,
    .pmf-pilot-contact-choice,
    .pmf-pilot-admin-flag
  ) {
    min-height: 40px;
  }
}
