:root {
  --black: #0b0b0d;
  --dark: #15161a;
  --card: #1d1f25;
  --line: rgba(255, 255, 255, 0.12);
  --white: #fff;
  --body: rgba(255, 255, 255, 0.76);
  --dim: rgba(255, 255, 255, 0.55);
  --red: #e03e30;
  --blue: #4d9fff;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "DM Sans", "Noto Sans JP", sans-serif;
  background:
    radial-gradient(circle at 85% -5%, rgba(224, 62, 48, 0.18), transparent 35%),
    radial-gradient(circle at 10% 0%, rgba(77, 159, 255, 0.12), transparent 30%),
    var(--black);
  color: var(--white);
  line-height: 1.6;
}

nav {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 62px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1.5rem;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 10, 10, 0.9);
  backdrop-filter: blur(16px);
}

.logo {
  color: var(--white);
  text-decoration: none;
  letter-spacing: 0.15em;
  font-family: "Bebas Neue", sans-serif;
  font-size: 1.5rem;
}

nav ul { list-style: none; display: flex; gap: 1.1rem; align-items: center; }
nav a { color: var(--body); text-decoration: none; font-size: 0.95rem; }
.nav-btn {
  background: linear-gradient(135deg, #ef4b3e, #d8392c);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  font-weight: 700;
}

.page { display: none; }
.page.active { display: block; }

.hero {
  min-height: calc(100vh - 62px);
  padding: 4rem 1.5rem 3rem;
  max-width: 980px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.3rem 0.9rem;
  color: var(--dim);
  font-size: 0.85rem;
  margin-bottom: 1.1rem;
}

.hero h1 {
  font-family: "Bebas Neue", sans-serif;
  font-size: clamp(2.8rem, 8vw, 6.4rem);
  line-height: 0.9;
  letter-spacing: 0.04em;
}
.hero h1 span { color: var(--red); }
.hero-desc { color: var(--body); max-width: 42ch; margin-top: 1rem; }
.hero-actions { margin-top: 1.8rem; display: flex; flex-wrap: wrap; gap: 0.9rem; }

.quick-points {
  margin-top: 2rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}
.qp-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.qp-card strong { font-size: 0.95rem; }
.qp-card span { font-size: 0.83rem; color: var(--dim); }

.btn-red, .btn-ghost {
  border: none;
  border-radius: 12px;
  padding: 1rem 1.5rem;
  cursor: pointer;
  font-weight: 700;
  font-family: inherit;
  font-size: 1.02rem;
  min-height: 52px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.btn-red {
  background: linear-gradient(135deg, #f14f41, #d8392c);
  color: #fff;
  box-shadow: 0 10px 26px rgba(224, 62, 48, 0.28);
}
.btn-red:hover { transform: translateY(-1px); }
.btn-ghost {
  background: rgba(255, 255, 255, 0.03);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
}
.btn-ghost:hover {
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-1px);
}
.full { width: 100%; }

.section {
  max-width: 980px;
  margin: 0 auto;
  padding: 2.6rem 1.5rem 4rem;
}
.section h2 { font-family: "Bebas Neue", sans-serif; font-size: 2.5rem; letter-spacing: 0.04em; }
.dark { background: var(--dark); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-desc { color: var(--dim); margin-top: 0.2rem; }
.section-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1rem;
}

.grid2 {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.015));
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 1.35rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}
.card h3 { margin-bottom: 0.7rem; }
.card li { margin-left: 1.2rem; color: var(--body); }

.talent-slider-rows {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.02);
  padding: 0.65rem 0;
  overflow: hidden;
}

.talent-slider-row {
  overflow: hidden;
}

.talent-slider-track {
  display: flex;
  gap: 0.9rem;
  width: max-content;
  padding: 0.35rem 1rem;
  animation: slideTalentsLeft 28s linear infinite;
}

.talent-slider-track--right {
  animation-name: slideTalentsRight;
}

.talent-slider-rows:hover .talent-slider-track {
  animation-play-state: paused;
}

.talent-card--clickable {
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.15s;
}

.talent-card--clickable:hover {
  border-color: rgba(77, 159, 255, 0.55);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.talent-card--clickable:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.talent-card {
  min-width: 250px;
  max-width: 250px;
  border-radius: 14px;
  padding: 1rem;
  background: #171920;
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.talent-top { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.55rem; }
.talent-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  background: linear-gradient(135deg, #f14f41, #4d9fff);
  flex-shrink: 0;
  overflow: hidden;
}
.talent-avatar-img-wrap {
  padding: 0;
  background: #1a1d24;
}
.talent-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.talent-avatar-preview {
  width: 72px;
  height: 72px;
  font-size: 1.8rem;
}
.avatar-picker {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.avatar-picker-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 12rem;
}
.field-hint {
  margin: 0.35rem 0 0;
  color: var(--dim);
  font-size: 0.82rem;
  line-height: 1.45;
}
.selected-talent-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}
.selected-talent-meta {
  margin: 0.2rem 0 0;
  color: var(--dim);
  font-size: 0.86rem;
}
.talent-name { font-weight: 700; }
.talent-meta { color: var(--dim); font-size: 0.83rem; }
.talent-bio { color: var(--body); font-size: 0.86rem; min-height: 2.8em; }
.talent-tags { margin-top: 0.7rem; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.talent-tag {
  font-size: 0.74rem;
  color: #d9e7ff;
  border: 1px solid rgba(77, 159, 255, 0.45);
  border-radius: 999px;
  padding: 0.18rem 0.55rem;
}

.talent-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
.talent-grid .talent-card { min-width: 0; max-width: none; }
.talent-cta {
  margin-top: 0.75rem;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  border-radius: 10px;
  padding: 0.6rem 0.7rem;
  font-weight: 700;
  cursor: pointer;
}
.talent-cta:hover { border-color: rgba(77, 159, 255, 0.7); }

@keyframes slideTalentsLeft {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@keyframes slideTalentsRight {
  from { transform: translateX(-50%); }
  to { transform: translateX(0); }
}

.talent-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.talent-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
}

.talent-modal-panel {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  max-height: min(88vh, 720px);
  overflow-y: auto;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #14161c;
  padding: 1.35rem 1.25rem 1.25rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.talent-modal-close {
  position: absolute;
  top: 0.65rem;
  right: 0.75rem;
  border: none;
  background: transparent;
  color: var(--dim);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.talent-modal-close:hover { color: var(--white); }

.talent-modal-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-right: 1.5rem;
}

.talent-modal-title {
  font-family: "Bebas Neue", sans-serif;
  font-size: 1.85rem;
  letter-spacing: 0.04em;
  margin: 0 0 0.2rem;
}

.talent-modal-bio {
  color: var(--body);
  margin-bottom: 0.85rem;
  white-space: pre-wrap;
}

.talent-modal-sample {
  margin: 0.75rem 0 1rem;
  font-size: 0.92rem;
}

.talent-modal-sample a {
  color: var(--blue);
  word-break: break-all;
}

.talent-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.form-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.1rem;
}
.form-subtitle {
  color: var(--dim);
  margin: 0 0 1rem;
  font-size: 0.95rem;
}
.back-btn {
  border: 1px solid rgba(77, 159, 255, 0.45);
  background: rgba(77, 159, 255, 0.08);
  color: var(--blue);
  border-radius: 10px;
  padding: 0.6rem 0.85rem;
  font-weight: 700;
  cursor: pointer;
}

.form-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.4rem;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.24);
}

.auth-gate-card h3 {
  margin-bottom: 0.5rem;
}

.auth-gate-actions {
  margin-top: 1rem;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.yt-logged-in-as {
  margin-bottom: 0.25rem;
  color: var(--muted, #9ca3af);
}

.yt-account-link-row {
  margin-bottom: 0.75rem;
}

.yt-draft-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin: 0.5rem 0 0.25rem;
}

.yt-draft-status {
  margin: 0;
  opacity: 0.85;
}

.yt-draft-modal-panel {
  max-width: 640px;
}

.yt-draft-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
  max-height: min(60vh, 480px);
  overflow-y: auto;
}

.yt-draft-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
}

.yt-draft-item--active {
  border-color: rgba(229, 57, 53, 0.55);
}

.yt-draft-item-title {
  margin: 0 0 0.25rem;
  font-weight: 600;
}

.yt-draft-item-meta {
  margin: 0;
  font-size: 0.85rem;
  opacity: 0.75;
}

.yt-draft-item-actions {
  display: flex;
  flex-shrink: 0;
  gap: 0.5rem;
}

.yt-draft-save-count {
  margin: 0.25rem 0 0.75rem;
  font-weight: 600;
}

.yt-draft-save-mode {
  margin-bottom: 1rem;
}

.yt-draft-save-mode .radio-row {
  margin-top: 0.35rem;
}

.yt-draft-replace-wrap {
  margin: 1rem 0;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(229, 57, 53, 0.35);
  border-radius: 10px;
  background: rgba(229, 57, 53, 0.06);
}

.yt-draft-replace-note {
  margin-top: 0;
}

.yt-draft-replace-list {
  max-height: min(40vh, 320px);
}

.yt-draft-replace-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  cursor: pointer;
}

.yt-draft-replace-item:has(input:checked) {
  border-color: rgba(229, 57, 53, 0.55);
  background: rgba(229, 57, 53, 0.08);
}

.yt-draft-replace-item input {
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.yt-draft-save-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.account-logout-card {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}

.account-favorite-talents {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.account-favorite-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
}

.account-favorite-main {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.account-favorite-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.account-favorite-name {
  font-weight: 600;
}

.account-favorite-meta {
  font-size: 0.85rem;
  opacity: 0.75;
}

.account-favorite-remove {
  flex-shrink: 0;
}

.talent-avatar--sm {
  width: 40px;
  height: 40px;
  font-size: 1.1rem;
}

.talent-avatar--sm.talent-avatar-img-wrap img,
.talent-avatar--sm.talent-avatar-img {
  width: 40px;
  height: 40px;
}

.talent-favorite-btn--active {
  border-color: rgba(229, 57, 53, 0.55);
  color: var(--accent, #e85d4c);
}

.cast-slot-favorites {
  margin: 0.75rem 0;
}

.cast-slot-favorites-label {
  margin: 0 0 0.45rem;
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0.9;
}

.cast-slot-favorites-empty {
  margin: 0.5rem 0 0.75rem;
}

.cast-slot-favorite-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.cast-favorite-chip {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: inherit;
  font: inherit;
  font-size: 0.85rem;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
}

.cast-favorite-chip:hover:not(:disabled) {
  border-color: rgba(229, 57, 53, 0.45);
  background: rgba(229, 57, 53, 0.12);
}

.cast-favorite-chip--offline,
.cast-favorite-chip:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.account-history-card {
  margin-top: 0.25rem;
}

.account-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.account-history-head h3 {
  margin: 0;
}

.account-case-history-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.85rem;
}

.account-case-card {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  overflow: hidden;
}

.account-case-card--open {
  border-color: rgba(229, 57, 53, 0.45);
}

.account-case-card-main {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.85rem;
  align-items: center;
  width: 100%;
  padding: 0.85rem 0.95rem;
  border: none;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.account-case-thumb {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  font-size: 1.35rem;
  flex-shrink: 0;
  overflow: hidden;
}

.account-case-thumb--video {
  color: var(--accent, #e85d4c);
}

.account-case-thumb--customer {
  font-weight: 700;
  font-size: 1.1rem;
}

.account-case-body {
  min-width: 0;
}

.account-case-title {
  margin: 0 0 0.2rem;
  font-weight: 700;
  line-height: 1.35;
}

.account-case-sub {
  margin: 0 0 0.45rem;
  font-size: 0.88rem;
  opacity: 0.78;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-case-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.account-case-status {
  font-size: 0.78rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.account-case-price {
  font-weight: 700;
  color: var(--accent, #e85d4c);
  font-size: 0.95rem;
}

.account-case-date {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  opacity: 0.65;
}

.account-case-chevron {
  font-size: 1.25rem;
  opacity: 0.45;
  transition: transform 0.15s ease;
}

.account-case-card--open .account-case-chevron {
  transform: rotate(90deg);
}

.account-case-detail {
  padding: 0 0.95rem 0.95rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.account-case-detail-section {
  margin-top: 0.85rem;
}

.account-case-detail-section h4 {
  margin: 0 0 0.45rem;
  font-size: 0.92rem;
}

.account-case-detail-dl {
  display: grid;
  gap: 0.45rem;
  margin: 0;
}

.account-case-detail-dl div {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 0.5rem;
  align-items: start;
}

.account-case-detail-dl dt {
  margin: 0;
  font-size: 0.82rem;
  opacity: 0.72;
}

.account-case-detail-dl dd {
  margin: 0;
  font-size: 0.9rem;
  word-break: break-word;
}

.account-case-detail-dl dd a {
  color: var(--accent, #e85d4c);
}

.account-case-income {
  font-weight: 700;
  color: var(--accent, #e85d4c);
}

.account-case-party-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.55rem;
}

.account-case-party-name {
  margin: 0 0 0.15rem;
  font-weight: 600;
}

.account-case-message-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-height: 220px;
  overflow-y: auto;
}

.account-case-message {
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.account-case-message p {
  margin: 0.25rem 0 0;
  white-space: pre-wrap;
}

.account-case-message-time {
  font-size: 0.78rem;
  opacity: 0.65;
  margin-left: 0.35rem;
}

.account-case-detail-empty {
  margin: 0;
}

.account-case-detail-actions {
  margin-top: 0.85rem;
}

.link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent, #e85d4c);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.link-btn:hover {
  opacity: 0.85;
}

.radio-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.35rem;
}

.radio-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  font-size: 0.95rem;
}

.channel-status-banner,
.channel-mismatch-banner {
  border-radius: 12px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
  font-size: 0.92rem;
}

.channel-status-banner {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.channel-mismatch-banner {
  background: rgba(232, 93, 76, 0.12);
  border: 1px solid rgba(232, 93, 76, 0.45);
}

.yt-test-bypass-card {
  border-radius: 12px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
  background: rgba(250, 204, 21, 0.1);
  border: 1px dashed rgba(250, 204, 21, 0.55);
}

.yt-test-bypass-label {
  margin: 0 0 0.5rem;
  font-size: 0.88rem;
}

.yt-test-bypass-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 500;
}

.account-channel-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.account-channel-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
}

.account-channel-list .channel-label {
  font-weight: 500;
}

.account-channel-list .channel-meta {
  font-size: 0.82rem;
  color: var(--muted, #9ca3af);
}

.login-session {
  margin-top: 1rem;
}
.login-session h3 {
  margin-bottom: 0.35rem;
}
.backend-config {
  margin-top: 1rem;
}
.backend-config h3 {
  margin-bottom: 0.35rem;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
  margin-bottom: 1rem;
}
.admin-stat-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.9rem;
  background: rgba(255, 255, 255, 0.03);
}
.admin-stat-card h3 {
  font-size: 0.88rem;
  color: var(--dim);
}
.admin-stat-value {
  font-family: "Bebas Neue", sans-serif;
  font-size: 2rem;
  letter-spacing: 0.04em;
  line-height: 1;
  margin-top: 0.4rem;
}
.admin-tools {
  margin-bottom: 1rem;
}
.admin-table-card {
  margin-bottom: 1rem;
}
.admin-table-wrap {
  overflow-x: auto;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}
.admin-table th,
.admin-table td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  text-align: left;
  padding: 0.65rem 0.45rem;
  font-size: 0.88rem;
  vertical-align: top;
}
.admin-table th {
  color: var(--dim);
  font-weight: 700;
}
.admin-empty {
  color: var(--dim);
}
.admin-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}
.admin-tab {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
  color: var(--body);
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
  font-weight: 700;
  cursor: pointer;
}
.admin-tab.active {
  border-color: rgba(77, 159, 255, 0.75);
  background: rgba(77, 159, 255, 0.18);
  color: #fff;
}
.admin-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}
.admin-panel-head h3 {
  margin: 0;
}
.admin-table-readable th {
  position: sticky;
  top: 0;
  background: #1b1e25;
  z-index: 1;
}
.admin-table-readable tbody tr:hover {
  background: rgba(77, 159, 255, 0.06);
}
.admin-cell-stack {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.admin-muted {
  color: var(--dim);
  font-size: 0.82rem;
}
.admin-nowrap {
  white-space: nowrap;
}
.admin-link {
  color: #9ec5ff;
  text-decoration: underline;
  word-break: break-all;
}
.admin-badge {
  display: inline-block;
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.badge-supabase {
  color: #d9ecff;
  border: 1px solid rgba(77, 159, 255, 0.55);
  background: rgba(77, 159, 255, 0.12);
}
.badge-local {
  color: #ffe9c7;
  border: 1px solid rgba(255, 193, 94, 0.45);
  background: rgba(255, 193, 94, 0.1);
}
.admin-avatar-col {
  width: 52px;
}
.admin-table-avatar {
  width: 40px;
  height: 40px;
  font-size: 1rem;
}
.status-timeline {
  margin-top: 0.7rem;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.5rem;
}
.status-pill {
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  font-size: 0.78rem;
  text-align: center;
  padding: 0.35rem 0.5rem;
  color: var(--dim);
}
.status-pill.done {
  color: #6ee7a8;
  border-color: rgba(110, 231, 168, 0.8);
  background: rgba(110, 231, 168, 0.12);
}
.chat-list, .delivery-list, .notice-list {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  padding: 0.65rem;
  max-height: 220px;
  overflow: auto;
  margin-bottom: 0.8rem;
}
.chat-item, .delivery-item, .notice-item {
  border-bottom: 1px dashed rgba(255, 255, 255, 0.12);
  padding: 0.45rem 0;
  font-size: 0.88rem;
}
.chat-item:last-child, .delivery-item:last-child, .notice-item:last-child {
  border-bottom: none;
}
.notice-item.unread {
  color: #d9e7ff;
}

.work-page .work-case-toolbar {
  border: 1px solid rgba(77, 159, 255, 0.45);
  background: linear-gradient(135deg, rgba(77, 159, 255, 0.14), rgba(255, 255, 255, 0.02));
}
.work-case-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
}
.work-case-select-field {
  flex: 1 1 280px;
  min-width: 0;
}
.work-request-select {
  font-size: 1rem;
  font-weight: 600;
}
.work-case-panel {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.work-case-header {
  border-color: rgba(110, 231, 168, 0.35);
  background: rgba(110, 231, 168, 0.06);
}
.work-case-header-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
}
.work-case-header-meta {
  display: grid;
  gap: 0.35rem;
  font-size: 0.88rem;
  color: var(--dim);
}
.work-case-header-meta a {
  color: #9fd4ff;
  word-break: break-all;
}
.work-case-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.55rem;
}
.work-case-badge {
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #d9e7ff;
}
.work-case-badge.is-active {
  color: #6ee7a8;
  border-color: rgba(110, 231, 168, 0.75);
  background: rgba(110, 231, 168, 0.12);
}

.work-case-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  margin: 12px 0 16px;
}

.work-case-card {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 0.95rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.work-case-card:hover,
.work-case-card.is-active {
  border-color: rgba(77, 159, 255, 0.45);
}

.work-case-card.is-active {
  background: rgba(77, 159, 255, 0.08);
}

.work-case-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 0.45rem;
}

.work-case-card-date {
  font-size: 0.78rem;
  color: var(--dim);
}

.work-case-card-video {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  line-height: 1.35;
  word-break: break-all;
}

.work-case-card-id,
.work-case-card-cast,
.work-case-card-deadline {
  margin: 0 0 0.25rem;
  font-size: 0.84rem;
  color: var(--dim);
}

.work-case-card-actions {
  margin-top: 0.65rem;
  flex-wrap: wrap;
}

.work-case-card-actions .btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.82rem;
}

.work-case-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 0.35rem;
}

.work-case-header-top .work-case-header-title {
  margin: 0;
  flex: 1;
  min-width: 0;
}

.work-deliverable-back-btn {
  margin-bottom: 12px;
}

.work-deliverable-notice {
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  background: rgba(245, 197, 66, 0.1);
  border: 1px solid rgba(245, 197, 66, 0.25);
}

.work-deliverable-readonly {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  max-height: 360px;
  overflow: auto;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.22);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.84rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  user-select: text;
}

.work-deliverable-transcript {
  max-height: 280px;
}

.work-assigned-voice-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 0.75rem;
}

.work-assigned-voice-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

@media (max-width: 640px) {
  .work-case-cards {
    grid-template-columns: 1fr;
  }
}

.work-action-row {
  flex-wrap: wrap;
  gap: 0.5rem;
}
.yt-record-workspace-row label {
  display: block;
  margin-bottom: 0.35rem;
}
.yt-record-workspace-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: stretch;
}
.yt-record-speaker-select,
.work-record-speaker-select {
  flex: 1 1 12rem;
  min-width: 10rem;
  max-width: 100%;
}
.yt-record-workspace-actions .btn-ghost {
  flex: 1 1 14rem;
}
.work-record-workspace-row {
  align-items: center;
}
.work-record-speaker-label {
  flex: 0 0 auto;
  font-size: 0.85rem;
  color: #c8d8f0;
  margin-right: 0.15rem;
}
.work-pending-hint {
  color: #ffe9c7;
  margin-top: 0.5rem;
}
.work-delivery-file-ready {
  color: #6ee7a8;
  margin-top: 0.35rem;
}

.talent-pricing {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.45rem 0 0.55rem;
}
.talent-price-tag {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(159, 212, 255, 0.35);
  color: #b8dcff;
  background: rgba(77, 159, 255, 0.1);
}
.talent-modal-pricing {
  margin-bottom: 0.65rem;
}
.quote-preview {
  border-color: rgba(110, 231, 168, 0.35);
  background: rgba(110, 231, 168, 0.06);
}
.quote-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  margin-bottom: 0.75rem;
}
.quote-table th,
.quote-table td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.4rem 0.35rem;
  text-align: left;
}
.quote-total {
  font-size: 1.05rem;
  margin: 0.35rem 0;
}
.quote-min {
  color: #ffe9c7;
  font-size: 0.78rem;
}
.work-retake-lock {
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 140, 120, 0.5);
  background: rgba(255, 100, 80, 0.12);
  color: #ffb4a8;
  font-size: 0.88rem;
  margin-bottom: 0.65rem;
}
.revision-list {
  border: 1px solid rgba(255, 140, 120, 0.35);
  border-radius: 10px;
  background: rgba(255, 120, 100, 0.06);
  padding: 0.65rem;
  max-height: 200px;
  overflow: auto;
  margin-bottom: 0.65rem;
}
.revision-item {
  border-bottom: 1px dashed rgba(255, 255, 255, 0.12);
  padding: 0.45rem 0;
  font-size: 0.88rem;
}
.revision-item:last-child {
  border-bottom: none;
}
.revision-item strong {
  color: #ffb4a8;
}
.chat-item.is-revision {
  border-left: 3px solid rgba(255, 140, 120, 0.8);
  padding-left: 0.5rem;
}
.delivery-item audio {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
}
.delivery-item-kind {
  font-size: 0.75rem;
  color: #9fd4ff;
  margin-right: 0.35rem;
}
nav a.nav-link-emphasis {
  color: #6ee7a8;
  border: 1px solid rgba(110, 231, 168, 0.55);
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
}

.verify-box {
  border: 1px solid rgba(77, 159, 255, 0.35);
  background: rgba(77, 159, 255, 0.08);
  border-radius: 14px;
  padding: 1rem;
  margin-bottom: 1rem;
}
.verify-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
}
.verify-head h3 {
  font-size: 1rem;
}
.verify-badge {
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  border: 1px solid rgba(255, 139, 139, 0.6);
  color: #ff8b8b;
}
.verify-badge.done {
  border-color: rgba(110, 231, 168, 0.8);
  color: #6ee7a8;
}
.verify-note {
  color: var(--body);
  font-size: 0.88rem;
  margin: 0.45rem 0 0.7rem;
}
.verify-steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem;
}
.verify-step-btn {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.03);
  color: #fff;
  cursor: pointer;
  text-align: left;
  font-weight: 600;
  padding: 0.72rem 0.85rem;
}
.verify-step-btn.done {
  border-color: rgba(110, 231, 168, 0.7);
  background: rgba(110, 231, 168, 0.12);
}

.admin-identity-col {
  max-width: 11rem;
  font-size: 0.86rem;
  line-height: 1.35;
  color: var(--body);
}

.cast-mode-box {
  margin: 1rem 0 0.6rem;
  border: 1px solid rgba(77, 159, 255, 0.35);
  background: rgba(77, 159, 255, 0.06);
  border-radius: 14px;
  padding: 1rem;
}
.cast-mode-title {
  font-size: 1rem;
  margin-bottom: 0.7rem;
}
.cast-mode-radios {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
}
.cast-radio {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  font-weight: 700;
}
.cast-subtitle {
  color: var(--dim);
  font-weight: 700;
  margin-bottom: 0.6rem;
  font-size: 0.92rem;
}
.cast-box {
  margin-top: 0.2rem;
}
.selected-talent-card {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.02);
  border-radius: 12px;
  padding: 0.85rem;
}
.selected-talent-name {
  font-weight: 900;
  font-size: 1.02rem;
  margin-bottom: 0.1rem;
}

.talent-filter {
  margin-bottom: 1rem;
  border: 1px solid rgba(77, 159, 255, 0.35);
  background: rgba(77, 159, 255, 0.06);
  border-radius: 14px;
  padding: 1rem;
}
.filter-title {
  font-weight: 900;
  margin-bottom: 0.7rem;
}
.talent-filter input, .talent-filter select {
  width: 100%;
}

.field { margin-bottom: 0.9rem; }
.field label { display: block; font-size: 0.92rem; color: var(--body); margin-bottom: 0.4rem; font-weight: 600; }
.field input, .field textarea, .field select {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: #111319;
  color: #fff;
  padding: 0.88rem 0.92rem;
  font-family: inherit;
  font-size: 0.98rem;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: rgba(77, 159, 255, 0.8);
  box-shadow: 0 0 0 4px rgba(77, 159, 255, 0.16);
}
.field textarea { min-height: 94px; resize: vertical; }

/* 依頼フォーム: 生成台本（編集可）— 通常の textarea の約4倍の高さ */
/* 依頼フォーム: 生成台本（編集可）— 通常の textarea の約4倍の高さ + 赤字オーバーレイ */
.yt-script-stack {
  position: relative;
  display: grid;
  grid-template: 1fr / 1fr;
  min-height: 376px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  background: var(--sa-editor, rgba(0, 0, 0, 0.2));
  overflow: hidden;
}

.yt-script-stack:focus-within {
  border-color: rgba(77, 159, 255, 0.55);
  box-shadow:
    0 0 0 1px rgba(77, 159, 255, 0.45),
    0 0 0 4px rgba(77, 159, 255, 0.12);
}

.yt-script-mirror,
.yt-script-stack .yt-script-field,
.yt-script-stack #ytScript {
  grid-area: 1 / 1;
  width: 100%;
  min-height: 376px;
  margin: 0;
  padding: 0.75rem 0.85rem;
  border: none;
  border-radius: 0;
  background: transparent;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.88rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  box-sizing: border-box;
}

.yt-script-mirror {
  z-index: 0;
  overflow: auto;
  pointer-events: none;
  color: #e8e8e8;
  -webkit-text-fill-color: #e8e8e8;
  scrollbar-width: none;
}

.yt-script-mirror::-webkit-scrollbar {
  display: none;
}

.yt-script-stack .yt-script-field,
.yt-script-stack #ytScript {
  position: relative;
  z-index: 1;
  display: block;
  resize: vertical;
  overflow: auto;
  color: #e8e8e8;
  caret-color: #f5f5f5;
  -webkit-text-fill-color: #e8e8e8;
}

.yt-script-stack--overlay .yt-script-field,
.yt-script-stack--overlay #ytScript {
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.yt-script-stack--overlay .yt-script-field::selection,
.yt-script-stack--overlay #ytScript::selection {
  background: rgba(77, 159, 255, 0.35);
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.field textarea.yt-script-field,
#ytScript {
  min-height: 376px;
}

.yt-script-adlib-hint {
  margin: 0.45rem 0 0;
  font-size: 0.82rem;
  color: var(--dim);
}

.wavrick-adlib-highlight {
  color: #ff5a5a;
  font-weight: 700;
  background: rgba(255, 70, 70, 0.12);
  border-radius: 3px;
  padding: 0 0.12em;
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }

.ai-status {
  border: 1px solid rgba(77, 159, 255, 0.4);
  border-radius: 10px;
  padding: 0.8rem;
  margin-bottom: 0.8rem;
  background: rgba(77, 159, 255, 0.08);
}
.ai-status p {
  margin: 0.2rem 0;
  color: var(--dim);
  font-size: 0.88rem;
}
.ai-status p.ai-step-active {
  color: var(--white);
  font-weight: 600;
}

.pipeline-wizard .section-desc {
  margin-bottom: 0.75rem;
}

/* —— 文字起こし・話者割り当て（プロ用ダーク UI） —— */
.speaker-assign-workspace {
  --sa-bg: #1e1e1e;
  --sa-panel: #2d2d2d;
  --sa-editor: #121212;
  --sa-text: #e0e0e0;
  --sa-muted: rgba(224, 224, 224, 0.62);
  --sa-border: rgba(255, 255, 255, 0.08);
  --sa-radius: 12px;
  --sa-shadow: 0 8px 28px rgba(0, 0, 0, 0.42);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 0.35rem;
  padding: 1rem;
  border-radius: 14px;
  background: var(--sa-bg);
  border: 1px solid var(--sa-border);
}

.speaker-assign-panel {
  background: var(--sa-panel);
  border: 1px solid var(--sa-border);
  border-radius: var(--sa-radius);
  box-shadow: var(--sa-shadow);
}

.speaker-assign-panel--head {
  padding: 1rem 1.15rem 0.9rem;
}

.speaker-assign-step-label {
  display: block;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--sa-text);
  margin-bottom: 0.45rem;
}

.speaker-assign-workspace .speaker-assign-intro {
  margin: 0;
  color: var(--sa-muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.speaker-assign-panel--editor {
  padding: 0.65rem;
}

.speaker-assign-panel--controls {
  padding: 1rem 1.1rem 1.1rem;
}

.speaker-assign-panel-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sa-muted);
  margin-bottom: 0.65rem;
}

.speaker-assign-panel--preview {
  padding: 0.95rem 1.1rem 1.05rem;
}

.speaker-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: stretch;
}

.speaker-picker--toolbar {
  flex: 1;
  min-width: 0;
  width: 100%;
  gap: 0.65rem;
}

.speaker-chip {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--sa-border);
  border-radius: 10px;
  padding: 1.35rem 0.85rem 0.9rem;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.14s ease,
    background 0.18s ease;
  line-height: 1.25;
  min-height: 3.4rem;
  min-width: 0;
  flex: 1 1 7.5rem;
  font-family: inherit;
  background: #252525;
  color: var(--sa-text);
  text-align: center;
}

.speaker-chip::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--speaker-accent, rgba(255, 255, 255, 0.35));
  border-radius: 10px 10px 0 0;
}

.speaker-chip-color-dot {
  display: block;
  width: 1.1rem;
  height: 1.1rem;
  margin: 0 auto 0.35rem;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  flex-shrink: 0;
}

.speaker-chip-label {
  display: block;
}

#ytSpeakerPicker .speaker-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.4rem 0.75rem 0.95rem !important;
  font-size: 0.94rem !important;
  font-weight: 700 !important;
  min-height: 3.55rem !important;
  min-width: 0 !important;
  border-width: 1px !important;
  line-height: 1.25 !important;
}

.speaker-color-popover {
  position: fixed;
  z-index: 9999;
  min-width: 12.5rem;
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--sa-border, #444);
  background: #2a2a2a;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
}

.speaker-color-popover.hidden {
  display: none;
}

.speaker-color-popover-title {
  margin: 0 0 0.55rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--sa-text, #eee);
}

.speaker-color-popover-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.55rem;
}

.speaker-color-swatch {
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.75);
  background: var(--swatch-color, #888);
  cursor: pointer;
  padding: 0;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.speaker-color-swatch:hover {
  transform: scale(1.08);
}

.speaker-color-swatch.is-selected {
  box-shadow:
    0 0 0 2px #fff,
    0 0 0 4px var(--swatch-color, #888);
}

.speaker-color-popover-custom {
  width: 100%;
  font-size: 0.78rem;
  padding: 0.35rem 0.5rem;
}

.speaker-chip:hover {
  border-color: color-mix(in srgb, var(--speaker-accent) 55%, transparent);
  background: #2a2a2a;
  transform: translateY(-1px);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--speaker-accent) 35%, transparent),
    0 10px 22px rgba(0, 0, 0, 0.35),
    inset 0 0 24px color-mix(in srgb, var(--speaker-accent) 12%, transparent);
}

.speaker-highlight.speaker-1 { --speaker-accent: #e03e30; }
.speaker-highlight.speaker-2 { --speaker-accent: #4d9fff; }
.speaker-highlight.speaker-3 { --speaker-accent: #6ee7a8; }
.speaker-highlight.speaker-4 { --speaker-accent: #f5c542; }
.speaker-highlight.speaker-5 { --speaker-accent: #c77dff; }
.speaker-highlight.speaker-6 { --speaker-accent: #ff8b8b; }

.speaker-chip.active {
  transform: translateY(-2px);
  border-color: var(--speaker-accent);
  background: #303030;
  box-shadow:
    0 0 0 1px var(--speaker-accent),
    0 0 28px color-mix(in srgb, var(--speaker-accent) 42%, transparent),
    0 12px 26px rgba(0, 0, 0, 0.45);
}

.speaker-chip.speaker-1,
.speaker-chip.speaker-2,
.speaker-chip.speaker-3,
.speaker-chip.speaker-4,
.speaker-chip.speaker-5,
.speaker-chip.speaker-6 {
  background: #252525;
  color: var(--sa-text);
}

.transcript-assign-stack {
  position: relative;
  display: grid;
  grid-template: 1fr / 1fr;
  min-height: 200px;
  max-height: 360px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  background: var(--sa-editor);
  overflow: hidden;
}

.transcript-assign-stack:focus-within {
  border-color: rgba(77, 159, 255, 0.55);
  box-shadow:
    0 0 0 1px rgba(77, 159, 255, 0.45),
    0 0 0 4px rgba(77, 159, 255, 0.12);
}

.transcript-assign-stack:focus-within .transcript-assign-input {
  border: none;
  box-shadow: none;
  outline: none;
}

.transcript-assign-stack.transcript-assign--click-mode:focus-within {
  border-color: rgba(110, 231, 168, 0.55);
  box-shadow:
    0 0 0 1px rgba(110, 231, 168, 0.45),
    0 0 0 4px rgba(110, 231, 168, 0.12);
}

/* 背面ミラー（話者色）+ 前面 textarea（操作）。同一 grid セルで位置を一致 */
.transcript-assign-mirror,
.transcript-assign-stack .transcript-assign-input,
#ytTranscriptAssign.transcript-assign-input {
  grid-area: 1 / 1;
  width: 100%;
  min-height: 200px;
  max-height: 360px;
  margin: 0;
  padding: 2.35rem 2.75rem 1.15rem 1.25rem;
  border: none;
  border-radius: 0;
  background: transparent;
  font-size: 1rem;
  line-height: 1.75;
  letter-spacing: 0;
  tab-size: 2;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Hiragino Sans", "Noto Sans JP", monospace;
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
  box-sizing: border-box;
}

.transcript-assign-mirror {
  z-index: 0;
  overflow: auto;
  pointer-events: none;
  color: #e8e8e8;
  -webkit-text-fill-color: #e8e8e8;
  scrollbar-width: none;
}

.transcript-assign-mirror::-webkit-scrollbar {
  display: none;
}

.transcript-assign-stack:not(.transcript-assign-stack--overlay) .transcript-assign-mirror {
  visibility: hidden;
}

.transcript-assign-stack .transcript-assign-input,
#ytTranscriptAssign.transcript-assign-input {
  z-index: 1;
  display: block;
  resize: none;
  overflow: auto;
  color: #e8e8e8;
  caret-color: #f5f5f5;
  -webkit-text-fill-color: #e8e8e8;
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}

.transcript-assign-stack--overlay .transcript-assign-input {
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.transcript-assign-stack--overlay .transcript-assign-input::selection {
  background: rgba(77, 159, 255, 0.35);
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.transcript-assign-stack--overlay .transcript-assign-input::placeholder {
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.transcript-assign-mirror .speaker-highlight {
  padding: 0;
  margin: 0;
  border-radius: 2px;
}

.transcript-assign-input::placeholder {
  color: rgba(255, 255, 255, 0.35);
  -webkit-text-fill-color: rgba(255, 255, 255, 0.35);
}

.transcript-assign-input:focus {
  outline: none;
}

.transcript-assign-stack.transcript-assign--click-mode .transcript-assign-input {
  cursor: crosshair;
}

.speaker-highlight.speaker-assign-preview-focus {
  outline: 2px solid rgba(255, 255, 255, 0.55);
  outline-offset: 1px;
}

.speaker-highlight {
  border-radius: 4px;
  padding: 0.1rem 0.04rem;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.speaker-highlight[class*="speaker-"] {
  background: color-mix(in srgb, var(--speaker-accent, #888) 30%, transparent);
  color: color-mix(in srgb, var(--speaker-accent, #888) 68%, white);
}

.transcript-assign.assign-flash {
  border-color: rgba(110, 231, 168, 0.65);
  box-shadow:
    0 0 0 1px rgba(110, 231, 168, 0.5),
    0 0 24px rgba(110, 231, 168, 0.2);
  transition: box-shadow 0.35s ease, border-color 0.35s ease;
}

.speaker-assign-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1rem;
}

.yt-transcript-edit-actions {
  margin-top: 0.75rem;
}

.speaker-assign-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.speaker-assign-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.65rem 1.1rem;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition:
    transform 0.14s ease,
    box-shadow 0.14s ease,
    border-color 0.14s ease,
    background 0.14s ease;
  color: var(--sa-text);
}

.speaker-assign-btn:hover {
  transform: translateY(-1px);
}

.speaker-assign-btn:active {
  transform: translateY(0);
}

.speaker-assign-btn--secondary {
  background: linear-gradient(180deg, #3a3a3a 0%, #2a2a2a 100%);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
}

.speaker-assign-btn--secondary:hover {
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.34);
}

.speaker-assign-btn--primary {
  background: linear-gradient(180deg, #4a7fd4 0%, #3568b8 100%);
  border-color: rgba(120, 170, 255, 0.35);
  box-shadow: 0 4px 16px rgba(53, 104, 184, 0.45);
}

.speaker-assign-btn--primary:hover {
  border-color: rgba(160, 200, 255, 0.5);
  box-shadow: 0 6px 22px rgba(53, 104, 184, 0.55);
}

.speaker-assign-btn--primary.is-on {
  background: linear-gradient(180deg, #3ecf8e 0%, #2aa86c 100%);
  border-color: rgba(130, 240, 190, 0.45);
  box-shadow:
    0 0 0 1px rgba(110, 231, 168, 0.55),
    0 6px 22px rgba(42, 168, 108, 0.45);
}

.speaker-assign-btn-icon {
  flex-shrink: 0;
  opacity: 0.92;
}

.speaker-assign-btn-label {
  line-height: 1.3;
}

.speaker-assign-toolbar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.7rem;
  width: 100%;
  padding-top: 0.15rem;
  border-top: 1px solid var(--sa-border);
}

.speaker-assign-toolbar-label {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--sa-muted);
  text-transform: uppercase;
}

.speaker-assign-names {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding-top: 0.15rem;
  border-top: 1px solid var(--sa-border);
}

.speaker-assign-names-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
  gap: 0.55rem;
}

.speaker-assign-name-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.speaker-assign-name-chip {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--sa-muted);
}

.speaker-assign-name-chip::before {
  content: "";
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 2px;
  margin-right: 0.35rem;
  vertical-align: middle;
  background: var(--speaker-accent, #888);
}

.speaker-assign-name-chip.speaker-1 { --speaker-accent: #e03e30; }
.speaker-assign-name-chip.speaker-2 { --speaker-accent: #4d9fff; }
.speaker-assign-name-chip.speaker-3 { --speaker-accent: #6ee7a8; }
.speaker-assign-name-chip.speaker-4 { --speaker-accent: #f5c542; }
.speaker-assign-name-chip.speaker-5 { --speaker-accent: #c77dff; }
.speaker-assign-name-chip.speaker-6 { --speaker-accent: #ff8b8b; }

.speaker-assign-name-input {
  width: 100%;
  padding: 0.5rem 0.6rem;
  border-radius: 8px;
  border: 1px solid var(--sa-border);
  background: #252525;
  color: var(--sa-text);
  font-size: 0.88rem;
  font-family: inherit;
}

.speaker-assign-name-input:focus {
  outline: none;
  border-color: rgba(77, 159, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(77, 159, 255, 0.12);
}

.cast-slot-suggestion {
  font-size: 0.82rem;
  color: var(--dim);
  margin: 0 0 0.55rem;
  line-height: 1.45;
}

.cast-slot-suggestion-btn {
  margin-left: 0.35rem;
  padding: 0.2rem 0.55rem;
  font-size: 0.78rem;
  vertical-align: baseline;
}

.speaker-assign-status-hint {
  margin: 0;
  padding: 0 0.15rem;
  color: var(--sa-muted);
  font-size: 0.84rem;
}

.speaker-assign-summary {
  margin-top: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.speaker-summary-row {
  display: block;
  width: 100%;
  margin: 0;
  font-size: 0.86rem;
  color: var(--sa-muted);
  line-height: 1.5;
  border-left: none;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  background: #252525;
  border: 1px solid var(--sa-border);
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  transition:
    border-color 0.16s ease,
    background 0.16s ease,
    box-shadow 0.16s ease;
}

.speaker-summary-row:hover {
  background: #2e2e2e;
  border-color: rgba(255, 255, 255, 0.16);
}

.speaker-summary-row.is-preview-active {
  background: #333;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.speaker-summary-row strong {
  color: var(--sa-text);
  font-weight: 700;
}

.speaker-summary-row[class*="speaker-"] {
  border-left: 3px solid var(--speaker-accent, #888);
  box-shadow: inset 3px 0 0 color-mix(in srgb, var(--speaker-accent, #888) 15%, transparent);
}

.speaker-assign-toolbar-hint {
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--dim);
}

.speaker-remove-panel {
  margin-top: 0.85rem;
  padding: 1rem 1.05rem;
  border: 1px solid rgba(255, 183, 77, 0.35);
  border-radius: 12px;
  background: rgba(255, 183, 77, 0.06);
}

.speaker-remove-title {
  margin: 0 0 0.45rem;
  font-size: 1rem;
}

.speaker-remove-choices {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.55rem;
  margin: 0.75rem 0;
}

.speaker-remove-choice {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
}

.speaker-remove-choice::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--speaker-accent, #888);
  flex-shrink: 0;
}

.speaker-remove-choice:has(input:checked) {
  border-color: var(--speaker-accent, #888);
  background: color-mix(in srgb, var(--speaker-accent, #888) 12%, transparent);
}

.speaker-remove-actions {
  margin-top: 0.35rem;
}

@media (max-width: 640px) {
  .speaker-assign-workspace {
    padding: 0.75rem;
  }

  .speaker-assign-btn-row {
    flex-direction: column;
  }

  .speaker-assign-btn {
    width: 100%;
  }

  #ytSpeakerPicker .speaker-chip {
    flex: 1 1 calc(50% - 0.35rem) !important;
  }
}

.cast-slots {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.cast-slot-card {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 0.85rem;
  background: rgba(255, 255, 255, 0.02);
}

.cast-slot-card h4 {
  margin-bottom: 0.5rem;
  font-size: 0.98rem;
}

.cast-slot-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  margin-bottom: 0.6rem;
  font-size: 0.9rem;
}

.cast-slot-modes label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
}

.recruitment-slot-row {
  grid-template-columns: 72px 1fr auto auto;
}

.recruitment-slot-row--clickable {
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.recruitment-slot-row--clickable:hover,
.recruitment-slot-row--clickable:focus-visible {
  border-color: rgba(255, 77, 77, 0.4);
  background: rgba(255, 77, 77, 0.06);
  outline: none;
}

.recruitment-slot-row--closed {
  opacity: 0.72;
}

.recruitment-slot-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.recruitment-slot-mode {
  font-size: 0.78rem;
  color: var(--dim);
}

.recruitment-slot-metrics {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.82rem;
  color: var(--muted, #9ca3af);
  white-space: nowrap;
}

.recruitment-slot-closed-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(156, 163, 175, 0.18);
  color: #d1d5db;
  border: 1px solid rgba(156, 163, 175, 0.35);
}

.recruitment-script-preview {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  max-height: 320px;
  overflow: auto;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.25);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.84rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.recruitments-speaker-detail .recruitment-detail-actions {
  margin-top: 0.5rem;
}

@media (max-width: 640px) {
  .recruitment-slot-row {
    grid-template-columns: 56px 1fr;
    grid-template-rows: auto auto;
  }
  .recruitment-slot-metrics,
  .recruitment-slot-row .cast-acceptance-status {
    grid-column: 2;
  }
}

.recruitments-toolbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.recruitments-count {
  margin: 0;
  color: var(--dim);
  font-size: 0.92rem;
}

.recruitments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 12px;
}

.recruitment-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem 1.05rem;
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.recruitment-card:hover,
.recruitment-card:focus-visible {
  border-color: rgba(255, 77, 77, 0.45);
  transform: translateY(-1px);
  outline: none;
}

.recruitment-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 0.45rem;
}

.recruitment-card-title {
  margin: 0;
  font-size: 1.05rem;
}

.recruitment-card-badge {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(255, 77, 77, 0.15);
  color: #ffb4b4;
}

.recruitment-card-video {
  margin: 0 0 0.55rem;
  color: var(--dim);
  font-size: 0.88rem;
  word-break: break-all;
}

.recruitment-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  margin-bottom: 0.75rem;
  color: var(--muted, #9ca3af);
  font-size: 0.82rem;
}

.recruitment-card-detail-btn {
  width: 100%;
}

.recruitments-back-btn {
  margin-bottom: 0.75rem;
}

.recruitment-detail-title {
  margin: 0 0 0.75rem;
}

.recruitment-detail-meta {
  margin-bottom: 1rem;
}

.recruitment-detail-actions {
  margin-top: 1rem;
}

.recruitments-empty p {
  margin: 0;
  color: var(--dim);
}

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

.cast-acceptance-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 12px 0;
}

.cast-acceptance-row {
  display: grid;
  grid-template-columns: 72px 1fr auto auto;
  gap: 8px 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.cast-acceptance-speaker {
  font-weight: 600;
  font-size: 0.9rem;
}

.cast-acceptance-status {
  font-size: 0.85rem;
  color: var(--muted, #9ca3af);
  white-space: nowrap;
}

.cast-applicants {
  grid-column: 1 / -1;
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.cast-applicant-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
}

.cast-slot-recruit-note {
  margin: 0.35rem 0 0.5rem;
}

.btn-sm {
  font-size: 0.8rem;
  padding: 4px 10px;
}

.cast-slot-talent-name {
  font-weight: 700;
  margin-bottom: 0.45rem;
  font-size: 0.92rem;
}
.cast-slot-profile {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  background: rgba(255, 255, 255, 0.025);
  margin-bottom: 0.55rem;
}
.cast-slot-profile .talent-top { margin-bottom: 0.35rem; }
.cast-slot-profile .talent-pricing { margin: 0.3rem 0 0.15rem; }
.cast-slot-profile .talent-tags { margin-top: 0.35rem; }
.cast-slot-profile--offline {
  opacity: 0.55;
  border-color: rgba(255, 183, 77, 0.3);
}

.message { min-height: 1.4em; margin-top: 0.55rem; color: var(--dim); font-size: 0.9rem; }
.message.ok { color: #6ee7a8; }
.message.err { color: #ff8b8b; }
.hidden { display: none; }

.editor-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.editor-panel-head > label {
  margin: 0;
  flex: 1;
  min-width: 0;
}

.editor-expand-btn {
  flex-shrink: 0;
  border: 1px solid var(--sa-border, #444);
  border-radius: 8px;
  background: #2a2a2a;
  color: var(--sa-text, #eee);
  font-size: 1.05rem;
  line-height: 1;
  padding: 0.35rem 0.55rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.editor-expand-btn:hover {
  border-color: rgba(77, 159, 255, 0.65);
  background: #333;
}

.editor-surface {
  position: relative;
  min-width: 0;
}

.editor-expand-btn--overlay {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  z-index: 12;
  opacity: 0.92;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  pointer-events: auto;
}

.transcript-assign-stack .editor-expand-btn--overlay,
.yt-script-stack .editor-expand-btn--overlay {
  grid-area: 1 / 1;
  justify-self: end;
  align-self: start;
  margin: 0.45rem 0.45rem 0 0;
}

.editor-expand-btn--overlay:hover {
  opacity: 1;
}

.yt-script-stack .yt-script-mirror,
.yt-script-stack .yt-script-field,
.yt-script-stack #ytScript {
  padding-top: 2.35rem;
  padding-right: 2.75rem;
}

.editor-workspace-shell .editor-workspace-layout {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.editor-workspace-main {
  min-width: 0;
}

.editor-workspace-sidebar {
  min-width: 0;
}

.editor-fullscreen-layer {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  background: #0f0f0f;
  padding: 0.75rem 1rem 1rem;
  box-sizing: border-box;
  overflow: hidden;
}

.editor-fullscreen-layer.hidden,
.editor-fullscreen-layer[hidden] {
  display: none !important;
}

.editor-fullscreen-layer-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.editor-workspace-shell.is-fullscreen {
  position: relative;
  inset: auto;
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  background: transparent;
  padding: 0;
  z-index: auto;
}

.editor-workspace-shell.is-fullscreen .editor-fullscreen-bar {
  display: flex;
}

.editor-workspace-shell.is-fullscreen .editor-workspace-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 1fr);
  gap: 1rem;
  overflow: hidden;
}

.editor-workspace-shell.is-fullscreen.editor-workspace-shell--script .editor-workspace-layout {
  grid-template-columns: minmax(0, 1fr);
}

.editor-workspace-shell.is-fullscreen .editor-workspace-main {
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.editor-workspace-shell.is-fullscreen .editor-surface {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.editor-workspace-shell.is-fullscreen .speaker-assign-panel--editor {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0.65rem;
}

.editor-workspace-shell.is-fullscreen .transcript-assign-stack,
.editor-workspace-shell.is-fullscreen .yt-script-stack {
  flex: 1;
  min-height: 0;
  max-height: none !important;
  height: 100%;
}

.editor-workspace-shell.is-fullscreen .transcript-assign-mirror,
.editor-workspace-shell.is-fullscreen .transcript-assign-stack .transcript-assign-input,
.editor-workspace-shell.is-fullscreen #ytTranscriptAssign,
.editor-workspace-shell.is-fullscreen .yt-script-mirror,
.editor-workspace-shell.is-fullscreen .yt-script-stack .yt-script-field,
.editor-workspace-shell.is-fullscreen #ytScript {
  min-height: 0 !important;
  max-height: none !important;
  height: 100% !important;
  resize: none;
}

.editor-workspace-shell.is-fullscreen .editor-workspace-sidebar {
  min-height: 0;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  border-left: 1px solid var(--sa-border, #3a3a3a);
  padding-left: 0.85rem;
  box-sizing: border-box;
  position: sticky;
  top: 0;
  align-self: stretch;
}

.editor-workspace-shell.is-fullscreen .speaker-assign-btn-row {
  flex-direction: column;
  align-items: stretch;
}

.editor-workspace-shell.is-fullscreen .speaker-assign-btn {
  width: 100%;
  justify-content: flex-start;
}

.editor-workspace-shell.is-fullscreen .speaker-picker--toolbar {
  flex-direction: column;
}

.editor-workspace-shell.is-fullscreen .speaker-chip {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
}

.editor-workspace-shell.is-fullscreen .speaker-assign-names-grid {
  grid-template-columns: 1fr;
}

.editor-workspace-shell.is-fullscreen .speaker-assign-panel--controls {
  border: none;
  box-shadow: none;
  background: transparent;
  padding: 0.25rem 0 0.5rem;
}

.editor-workspace-shell.is-fullscreen .speaker-assign-status-hint--fullscreen {
  margin: 0 0 0.75rem;
  font-size: 0.82rem;
}

.editor-workspace-shell.is-fullscreen .yt-script-adlib-hint {
  flex-shrink: 0;
  margin-top: 0.5rem;
}

body.editor-fullscreen-open--transcript .speaker-assign-panel--preview {
  visibility: hidden;
  pointer-events: none;
}

.editor-fullscreen-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
  flex-shrink: 0;
}

.editor-workspace-shell.is-fullscreen .editor-fullscreen-bar {
  display: flex;
}

.editor-fullscreen-bar-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--sa-text, #eee);
}

.editor-fullscreen-close {
  border: 1px solid var(--sa-border, #444);
  border-radius: 8px;
  background: #2a2a2a;
  color: var(--sa-text, #eee);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.4rem 0.75rem;
  cursor: pointer;
}

.editor-fullscreen-close:hover {
  border-color: rgba(77, 159, 255, 0.65);
}

.speaker-count-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  margin: 0 0 0.85rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--sa-border, #3a3a3a);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
}

.speaker-count-row label {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 700;
}

.speaker-count-row select {
  min-width: 6.5rem;
}

body.editor-fullscreen-open {
  overflow: hidden;
}
.btn-red:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

footer {
  border-top: 1px solid var(--line);
  padding: 1rem 1.5rem 1.6rem;
  color: var(--dim);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.86rem;
}

/* ── Talent Stats Badges (card compact) ── */
.talent-stat-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.5rem;
}
.talent-stat-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  line-height: 1.4;
  white-space: nowrap;
}
.talent-stat-speed {
  background: linear-gradient(135deg, rgba(255, 193, 7, 0.18), rgba(255, 152, 0, 0.14));
  border: 1px solid rgba(255, 193, 7, 0.45);
  color: #ffd54f;
}
.talent-stat-response {
  background: linear-gradient(135deg, rgba(77, 159, 255, 0.16), rgba(100, 180, 255, 0.12));
  border: 1px solid rgba(77, 159, 255, 0.45);
  color: #90caf9;
}
.talent-stat-clean {
  background: rgba(110, 231, 168, 0.1);
  border: 1px solid rgba(110, 231, 168, 0.4);
  color: #6ee7a8;
}
.talent-stat-danger {
  background: rgba(255, 82, 82, 0.12);
  border: 1px solid rgba(255, 82, 82, 0.45);
  color: #ff8b8b;
}

/* ── Talent Stats Panel (modal / mypage detail) ── */
.talent-stats-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  background: rgba(255, 255, 255, 0.025);
  margin: 0.85rem 0;
}
.talent-stats-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--white);
  margin: 0 0 0.15rem;
  letter-spacing: 0.02em;
}
.talent-stats-orders {
  font-size: 0.8rem;
  color: var(--dim);
  margin: 0 0 0.7rem;
}
.talent-stats-empty {
  font-size: 0.85rem;
  color: var(--dim);
  margin: 0;
}

/* Speed badge highlight */
.talent-stats-highlight {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  margin-bottom: 0.75rem;
}
.talent-stats-highlight--speed {
  background: linear-gradient(135deg, rgba(255, 193, 7, 0.12), rgba(255, 152, 0, 0.08));
  border: 1px solid rgba(255, 193, 7, 0.32);
}
.talent-stats-highlight--response {
  background: linear-gradient(135deg, rgba(77, 159, 255, 0.1), rgba(100, 180, 255, 0.06));
  border: 1px solid rgba(77, 159, 255, 0.3);
}
.talent-stats-highlight--response .talent-stats-highlight-text {
  color: #90caf9;
}
.talent-stats-highlight--response .talent-stats-highlight-rate {
  color: rgba(144, 202, 249, 0.85);
}
.talent-stats-highlight-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}
.talent-stats-highlight-text {
  font-size: 0.84rem;
  font-weight: 600;
  color: #ffd54f;
  flex: 1;
}
.talent-stats-highlight-rate {
  font-size: 0.82rem;
  font-weight: 700;
  color: rgba(255, 213, 79, 0.85);
  flex-shrink: 0;
}

/* Stat rows */
.talent-stat-row {
  display: grid;
  grid-template-columns: 1fr auto 80px;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.talent-stat-row:last-child {
  border-bottom: none;
}
.talent-stat-label {
  font-size: 0.82rem;
  color: var(--body);
}
.talent-stat-value {
  font-size: 0.82rem;
  font-weight: 700;
  text-align: right;
  min-width: 3em;
}
.talent-stat-row--clean .talent-stat-value { color: #6ee7a8; }
.talent-stat-row--neutral .talent-stat-value { color: var(--body); }
.talent-stat-row--warn .talent-stat-value { color: #ffb74d; }
.talent-stat-row--danger .talent-stat-value { color: #ff5252; }

/* Mini progress bar */
.talent-stat-bar {
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.talent-stat-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.4s ease;
}
.talent-stat-bar-fill--clean { background: #6ee7a8; }
.talent-stat-bar-fill--neutral { background: var(--blue); }
.talent-stat-bar-fill--warn { background: #ffb74d; }
.talent-stat-bar-fill--danger { background: #ff5252; }

/* ── Star rating ── */
.talent-rating {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  line-height: 1;
}
.talent-rating--sm {
  margin-top: 0.15rem;
}
.talent-rating--sm .talent-rating-stars { font-size: 0.78rem; }
.talent-rating--sm .talent-rating-score { font-size: 0.72rem; }
.talent-rating--sm .talent-rating-count { font-size: 0.68rem; }
.talent-rating--md {
  margin-top: 0.2rem;
}
.talent-rating--md .talent-rating-stars { font-size: 0.95rem; }
.talent-rating--md .talent-rating-score { font-size: 0.85rem; }
.talent-rating--md .talent-rating-count { font-size: 0.78rem; }
.talent-rating-stars {
  display: inline-flex;
  gap: 0;
  letter-spacing: -0.5px;
}
.star { display: inline-block; }
.star--full { color: #ffc107; }
.star--half {
  color: #ffc107;
  position: relative;
  overflow: hidden;
}
.star--half::after {
  content: "★";
  position: absolute;
  left: 50%;
  top: 0;
  width: 50%;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.18);
  direction: rtl;
}
.star--empty { color: rgba(255, 255, 255, 0.18); }
.talent-rating-score {
  font-weight: 700;
  color: #ffc107;
}
.talent-rating-count {
  color: var(--dim);
}
.talent-stats-rating-row {
  margin-bottom: 0.65rem;
}

/* Voice mypage stats card */
.voice-mypage-stats {
  margin-top: 0.5rem;
}

/* ── Nav voice status indicator ── */
.nav-voice-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  line-height: 1.3;
  white-space: nowrap;
  cursor: default;
}
.nav-voice-status--active {
  background: rgba(110, 231, 168, 0.12);
  border: 1px solid rgba(110, 231, 168, 0.4);
  color: #6ee7a8;
}
.nav-voice-status--offline {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--dim);
}
.nav-voice-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.nav-voice-status--active .nav-voice-status-dot { background: #6ee7a8; box-shadow: 0 0 6px rgba(110, 231, 168, 0.5); }
.nav-voice-status--offline .nav-voice-status-dot { background: rgba(255, 255, 255, 0.35); }

/* ── Toggle switch (iOS style) ── */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 26px;
  transition: background 0.25s;
}
.toggle-slider::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.25s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.toggle-switch input:checked + .toggle-slider {
  background: linear-gradient(135deg, #34d399, #6ee7a8);
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(22px);
}
.toggle-switch input:focus-visible + .toggle-slider {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* ── Voice active toggle card (mypage) ── */
.voice-active-toggle-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  background: rgba(255, 255, 255, 0.025);
  margin: 0.85rem 0;
}
.voice-active-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.voice-active-toggle-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.voice-active-toggle-label {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--white);
}
.voice-active-status-text {
  font-size: 0.78rem;
  font-weight: 600;
}
.voice-active-status-text--on {
  color: #6ee7a8;
}
.voice-active-status-text--off {
  color: var(--dim);
}
.voice-active-toggle-desc {
  margin-top: 0.65rem;
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--dim);
}

/* ── Talent card offline badge (top-right) ── */
.talent-card {
  position: relative;
}
.talent-card-offline-badge {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--dim);
  letter-spacing: 0.02em;
  z-index: 1;
}
.talent-cta--disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--dim);
}
.talent-cta--disabled:hover {
  transform: none;
  border-color: rgba(255, 255, 255, 0.12);
}

/* ── Filter online-only toggle ── */
.filter-online-toggle {
  margin-top: 0.45rem;
}
.filter-online-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.88rem;
  color: var(--body);
  cursor: pointer;
  user-select: none;
}
.filter-online-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #6ee7a8;
  cursor: pointer;
}

.talent-offline-notice {
  margin-top: 0.45rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #ffb74d;
  padding: 0.3rem 0.55rem;
  border-radius: 8px;
  background: rgba(255, 183, 77, 0.1);
  border: 1px solid rgba(255, 183, 77, 0.3);
}

/* ── Cast slot: offline suggestion ── */
.cast-slot-suggestion--offline {
  color: var(--dim);
  opacity: 0.7;
}
.cast-slot-suggestion--offline .btn-ghost {
  display: none;
}

.cast-slot-suggestion--offline .btn-ghost {
  display: none;
}

.field-checkbox {
  margin-top: 0.75rem;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--body);
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  margin-top: 0.2rem;
  width: 16px;
  height: 16px;
  accent-color: var(--red);
  flex-shrink: 0;
}

.checkbox-label a {
  color: var(--red);
  text-decoration: underline;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
}

.site-footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
}

.site-footer-links a {
  color: var(--dim);
  text-decoration: none;
}

.site-footer-links a:hover {
  color: var(--body);
  text-decoration: underline;
}

.site-footer-mvp {
  color: var(--dim);
  font-size: 0.85rem;
}

.site-deploy-tag {
  margin-left: 0.5rem;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--dim);
  letter-spacing: 0.02em;
  vertical-align: middle;
}

@media (max-width: 760px) {
  nav ul { display: none; }
  .grid2, .field-row, .quick-points { grid-template-columns: 1fr; }
  .talent-grid { grid-template-columns: 1fr; }
  .admin-stats { grid-template-columns: 1fr 1fr; }
  .status-timeline { grid-template-columns: 1fr 1fr; }
  .form-header { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  footer { flex-direction: column; }
  .section-head { align-items: flex-start; flex-direction: column; }
  .btn-red, .btn-ghost { width: 100%; }
  .talent-stat-row { grid-template-columns: 1fr auto 60px; gap: 0.4rem; }
}
