/* Midnight Studio: one token system for every workspace surface. */
@font-face {
  font-family: "Be Vietnam Pro";
  src: url("/fonts/BeVietnamPro-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: Bangers;
  src: url("/fonts/Bangers-Regular.ttf") format("truetype");
  font-display: swap;
}
@font-face {
  font-family: Anton;
  src: url("/fonts/Anton-Regular.ttf") format("truetype");
  font-display: swap;
}
@font-face {
  font-family: Coiny;
  src: url("/fonts/Coiny-Regular.ttf") format("truetype");
  font-display: swap;
}
@font-face {
  font-family: Manrope;
  src: url("./fonts/manrope-400.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Manrope;
  src: url("./fonts/manrope-500.ttf") format("truetype");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: Manrope;
  src: url("./fonts/manrope-600.ttf") format("truetype");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: Manrope;
  src: url("./fonts/manrope-700.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}
:root {
  color-scheme: dark;
  --bg: #101218;
  --surface: #191c25;
  --hover: #222632;
  --ink: #f1f2f7;
  --muted: #a0a6b8;
  --line: #2a2e3a;
  --control: #3b4151;
  --purple: #ad8cff;
  --purple-dark: #bea3ff;
  --lavender: #2d2446;
  --green: #73d9b0;
  --red: #ff9a9e;
  --amber: #edc16f;
  --font: Manrope, "Segoe UI", sans-serif;
}
* {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: #404657 transparent;
}
body {
  margin: 0;
  background: var(--bg);
  font: 14px/1.5 var(--font);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
a {
  color: inherit;
  text-decoration: none;
}
:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 3px;
}
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--purple);
  outline-offset: 2px;
}
input,
select,
textarea {
  min-width: 0;
  max-width: 100%;
  background: var(--bg);
  border: 1px solid var(--control);
  border-radius: 8px;
  padding: 10px 12px;
}
input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}
input[type="checkbox"] {
  appearance: none;
  width: 18px;
  height: 18px;
  min-width: 18px;
  border: 1px solid #737b91;
  border-radius: 5px;
  background: var(--bg);
  display: inline-grid;
  place-content: center;
  padding: 0;
  margin: 0;
  vertical-align: middle;
  cursor: pointer;
}
input[type="checkbox"]:checked {
  background: var(--purple);
  border-color: var(--purple);
}
input[type="checkbox"]:checked:after {
  content: "";
  width: 8px;
  height: 5px;
  border: solid #1d1233;
  border-width: 0 0 2px 2px;
  transform: rotate(-45deg) translateY(-1px);
}
input[type="range"] {
  appearance: none;
  width: 100%;
  height: 4px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: #414758;
  accent-color: var(--purple);
  cursor: pointer;
  margin: 7px 0;
}
input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  background: var(--purple);
  width: 15px;
  height: 15px;
  border-radius: 50%;
}
input[type="color"] {
  width: 100%;
  min-height: 36px;
  padding: 4px;
  cursor: pointer;
}
input[type="file"] {
  font-size: 12px;
}
input[type="file"]::file-selector-button {
  background: var(--hover);
  border: 0;
  border-radius: 5px;
  color: var(--ink);
  padding: 6px 10px;
  margin-right: 10px;
}
select {
  appearance: none;
  cursor: pointer;
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%23a0a6b8' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-position: right 10px center;
  background-repeat: no-repeat;
}
svg {
  width: 20px;
  height: 20px;
  display: block;
  flex-shrink: 0;
  stroke-width: 1.8;
}
button svg {
  width: 18px;
  height: 18px;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 32px;
  letter-spacing: -1.1px;
  line-height: 1.3;
  font-weight: 700;
}
h2 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.3px;
}
h3 {
  font-size: 15px;
  font-weight: 600;
}
small {
  font-size: 12px;
}
[hidden] {
  display: none !important;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.muted,
.small-text {
  color: var(--muted);
  line-height: 1.7;
}
.small-text {
  font-size: 12px;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition:
    background 0.15s,
    border-color 0.15s;
}
.button.primary {
  background: var(--purple);
  color: #1d1233;
}
.button.primary:hover {
  background: var(--purple-dark);
}
.button.secondary {
  background: var(--surface);
  border-color: var(--control);
}
.button.secondary:hover {
  background: var(--hover);
  border-color: #626a80;
}
.button.small {
  min-height: 36px;
  padding: 0 12px;
  font-size: 12px;
}
.button.full {
  width: 100%;
}
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 8px;
}
.icon-button:hover {
  background: var(--hover);
  color: var(--ink);
}
.icon-button svg {
  width: 18px;
  height: 18px;
}
.text-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  border: 0;
  background: none;
  color: #c3abff;
  font-size: 12px;
  font-weight: 600;
}
.text-button:hover {
  color: #dfd1ff;
}
.text-button svg {
  width: 16px;
  height: 16px;
}
.tag,
.soft-badge,
.job-label,
.connection-badge,
.member-role {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  line-height: 1.4;
  background: #292d39;
  color: #bec4d5;
  border-radius: 6px;
  padding: 5px 8px;
}
.soft-badge {
  padding: 8px 10px;
  white-space: nowrap;
}
.live-dot {
  width: 6px;
  height: 6px;
  background: var(--green);
  border-radius: 50%;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  min-width: 0;
}
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.panel-heading h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
}
.panel-heading h2 svg {
  width: 18px;
  height: 18px;
  color: var(--muted);
}
.notice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: #30271b;
  border: 1px solid #69502b;
  border-radius: 10px;
  color: var(--amber);
  padding: 14px 16px;
  margin: 20px 0;
  font-size: 13px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.notice.error {
  background: #352126;
  border-color: #724047;
  color: var(--red);
}
.notice.info {
  background: #1c293c;
  border-color: #344b6c;
  color: #a4c8ff;
}
.notice .button {
  align-self: center;
  flex-shrink: 0;
}
.empty-state {
  grid-column: 1/-1;
  padding: 64px 24px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 14px;
  text-align: center;
}
.empty-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  background: var(--lavender);
  color: #c3abff;
  border-radius: 14px;
  margin: 0 auto 20px;
}
.empty-icon svg {
  width: 24px;
  height: 24px;
}
.empty-state h3 {
  font-size: 18px;
}
.empty-state p {
  color: var(--muted);
  max-width: 440px;
  margin: 10px auto 20px;
  font-size: 14px;
  line-height: 1.7;
}
.empty-state p:last-child {
  margin-bottom: 0;
}
.option-note {
  display: flex;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
  margin: 12px 0 20px;
}
.option-note svg {
  width: 16px;
  height: 16px;
  margin-top: 3px;
}
.error-text {
  color: var(--red);
  font-size: 13px;
}
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #574773;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.spinner.dark {
  color: var(--purple);
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
details summary {
  cursor: pointer;
  list-style: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 0;
}
details summary::-webkit-details-marker {
  display: none;
}
details summary:after {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  margin-right: 3px;
  transition: transform 0.15s;
}
details[open] > summary:after {
  transform: rotate(225deg);
}
details[open] > summary {
  color: var(--ink);
}
.field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}
.field select {
  width: 100%;
  font-size: 14px;
}
/* Shell */
.shell {
  min-height: 100dvh;
  display: flex;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 232px;
  z-index: 40;
  background: #0c0e14;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 28px 16px 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  margin-bottom: 42px;
  font-size: 23px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: -1px;
}
.brand > img {
  width: 32px;
  height: 32px;
}
.brand-light {
  color: var(--muted);
  font-weight: 400;
}
.brand-text {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
.brand-tagline {
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.25;
}
.nav-label {
  color: #81889c;
  font-size: 12px;
  margin: 0 12px 12px;
}
.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 28px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 44px;
  padding: 11px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  transition: background 0.15s;
}
.nav-item svg {
  width: 19px;
  height: 19px;
}
.nav-item:hover {
  background: var(--surface);
  color: var(--ink);
}
.nav-item.active {
  background: var(--lavender);
  color: #c3abff;
}
.nav-count {
  margin-left: auto;
  background: #242836;
  color: #b8bfd0;
  border-radius: 5px;
  min-width: 22px;
  padding: 1px 5px;
  text-align: center;
  font-size: 12px;
}
.nav-item.active .nav-count {
  background: #403356;
  color: #d4c3ff;
}
.sidebar-bottom {
  margin-top: auto;
}
.help-link {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 12px;
  padding: 14px 12px;
}
.help-link svg {
  width: 18px;
  height: 18px;
}
.profile {
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding: 20px 8px;
}
.avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #352b49;
  color: #d4c3ff;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}
.profile .nav-text {
  min-width: 0;
}
.profile strong {
  display: block;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 130px;
}
.profile small {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-top: 2px;
}
.profile .icon-button {
  margin-left: auto;
}
.workspace {
  width: calc(100% - 232px);
  margin-left: 232px;
  min-width: 0;
}
.topbar {
  height: 72px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 40px;
}
.breadcrumb,
.top-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}
.workspace-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}
.server-state {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.server-state i {
  width: 6px;
  height: 6px;
  background: var(--green);
  border-radius: 50%;
}
.mobile-menu {
  display: none;
}
.avatar-small {
  width: 30px;
  height: 30px;
}
main {
  padding: 32px 40px;
  max-width: 1720px;
  margin: 0 auto;
  outline: none;
}
.view {
  min-width: 0;
}
.page-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 28px 0 18px;
}
.section-heading p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}
.section-heading p:empty {
  display: none;
}
.results-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.view-switch {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.view-switch button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 28px;
  border: 0;
  border-radius: 5px;
  background: none;
  color: var(--muted);
}
.view-switch button.active {
  color: #c3abff;
  background: var(--lavender);
}
.view-switch svg {
  width: 16px;
  height: 16px;
}
/* Discover: every platform, one search, optional filters. */
.search-panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
.source-picker {
  padding: 18px 18px 0;
}
.platform-tabs {
  display: flex;
  gap: 8px;
  overflow: auto;
  padding-bottom: 14px;
  scrollbar-width: thin;
}
.platform-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  flex: 1 0 auto;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition:
    background 0.15s,
    border-color 0.15s;
}
.platform-tab:hover {
  background: var(--hover);
  color: var(--ink);
}
.platform-tab.active {
  background: var(--lavender);
  border-color: #8e70cc;
  color: var(--ink);
}
.platform-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  background: transparent;
  overflow: hidden;
}
.platform-glyph svg {
  width: 100%;
  height: 100%;
  stroke: none;
}
.platform-tab .platform-glyph {
  width: 22px;
  height: 22px;
}
.search-main {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-top: 1px solid var(--line);
}
.search-symbol {
  color: var(--muted);
  flex-shrink: 0;
}
.search-main input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  height: 44px;
  padding: 8px 0;
  font-size: 14px;
}
.search-main input:focus {
  outline: 0;
}
.search-main:focus-within {
  border-top-color: #65517e;
}
.search-main kbd {
  font: 12px var(--font);
  color: var(--muted);
  border: 1px solid var(--control);
  border-radius: 4px;
  padding: 2px 6px;
}
.search-main .button {
  min-height: 42px;
}
.search-main .button > svg:last-child {
  display: none;
}
.search-filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1.1fr)) minmax(0, 1.3fr) repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px 18px 16px;
  border-top: 1px solid var(--line);
}
.search-filters > label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}
.search-filters input,
.search-filters select,
.search-filters .select-trigger {
  width: 100%;
  min-width: 0;
  height: 36px;
  min-height: 36px;
  font-size: 13px;
}
.duration-range {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  grid-column: 1 / -1;
}
.duration-range label {
  display: grid;
  gap: 8px;
  max-width: 180px;
  color: var(--muted);
  font-size: 12px;
}
.duration-range > span {
  flex-basis: 100%;
  color: var(--muted);
  font-size: 12px;
}
.suggestions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
  color: var(--muted);
  font-size: 12px;
}
.suggestions > span {
  margin-right: 4px;
}
.suggestions button {
  border: 0;
  background: var(--surface);
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 12px;
  color: var(--muted);
}
.suggestions button:hover {
  background: var(--lavender);
  color: #d4c3ff;
}
.suggestions button span {
  margin-left: 8px;
}
.discover-empty {
  padding: 56px 24px;
  background: transparent;
}
/* Video collections */
.video-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}
.video-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  min-width: 0;
  transition: border-color 0.15s;
}
.video-card:hover {
  border-color: #50586e;
}
.video-card.selected {
  border-color: var(--purple);
}
.video-thumbnail {
  aspect-ratio: 16/9;
  position: relative;
  background: #242936;
  overflow: hidden;
}
.video-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.missing-thumb {
  position: absolute;
  left: calc(50% - 20px);
  top: calc(50% - 20px);
  width: 40px;
  height: 40px;
  color: var(--muted);
}
.video-duration {
  position: absolute;
  right: 10px;
  bottom: 10px;
  border-radius: 4px;
  background: #080a0edb;
  color: white;
  font-size: 12px;
  padding: 3px 6px;
}
.video-select,
.asset-check {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 2;
}
.asset-check {
  line-height: 0;
}
.video-overlay-button {
  display: grid;
  place-items: center;
  position: absolute;
  inset: 0;
  background: #06080d25;
  color: white;
  border: 0;
}
.video-overlay-button > svg {
  width: 36px;
  height: 36px;
  padding: 10px;
  background: #101218bd;
  border-radius: 50%;
  fill: currentColor;
  stroke-width: 0;
}
.video-overlay-button:hover {
  background: #06080d50;
}
.video-info {
  padding: 16px;
}
.video-platform {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
  min-width: 0;
}
.video-platform > span:last-child {
  margin-left: auto;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.video-platform .platform-glyph {
  width: 17px;
  height: 17px;
}
.video-info h3 {
  font-size: 14px;
  line-height: 1.6;
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  min-height: 45px;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.video-author {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  margin: 10px 0 14px;
  min-height: 20px;
}
.video-author > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.video-author .icon-button {
  height: 24px;
  width: 24px;
}
.video-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.video-actions .button {
  flex: 1;
}
.video-actions .icon-button {
  width: 32px;
  height: 36px;
}
.video-actions svg {
  width: 16px;
  height: 16px;
}
.video-grid.list-mode {
  grid-template-columns: 1fr;
}
.list-mode .video-card {
  display: flex;
}
.list-mode .video-thumbnail {
  width: 220px;
  flex-shrink: 0;
}
.list-mode .video-info {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0 20px;
}
.list-mode .video-platform,
.list-mode .video-author,
.list-mode h3 {
  grid-column: 1;
}
.list-mode .video-actions {
  grid-column: 2;
  grid-row: 1/4;
  border: 0;
  min-width: 180px;
}
.list-mode h3 {
  min-height: 0;
}
.list-mode .video-author {
  margin-bottom: 0;
}
.skeleton-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
  animation: pulse 1.3s ease-in-out infinite;
}
.skeleton-thumb {
  aspect-ratio: 16/9;
  background: #272b37;
}
.skeleton-copy {
  padding: 18px;
}
.skeleton-copy i {
  display: block;
  height: 10px;
  border-radius: 3px;
  background: #303541;
  margin-bottom: 12px;
}
.skeleton-copy i:last-child {
  width: 55%;
}
@keyframes pulse {
  50% {
    opacity: 0.5;
  }
}
.library-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.segmented {
  display: flex;
  gap: 3px;
  background: var(--surface);
  padding: 4px;
  border-radius: 9px;
}
.segmented button {
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--muted);
  padding: 9px 14px;
  font-size: 13px;
}
.segmented button.active {
  background: var(--lavender);
  color: #d4c3ff;
}
.compact-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--control);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--muted);
}
.compact-search svg {
  width: 17px;
  height: 17px;
}
.compact-search input {
  width: 190px;
  border: 0;
  background: none;
  padding: 11px 0;
  font-size: 13px;
}
.compact-search:focus-within {
  outline: 2px solid var(--purple);
  outline-offset: 2px;
}
.compact-search input:focus {
  outline: 0;
}
.batch-bar {
  position: sticky;
  top: 12px;
  z-index: 5;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  background: #262136;
  border: 1px solid #594476;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 20px;
}
.batch-bar strong {
  font-size: 13px;
}
.batch-bar small {
  color: var(--muted);
  flex-basis: 100%;
  font-size: 12px;
}
/* Studio A: video / transcript / voice. Advanced controls do not interrupt creation. */
.studio-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 280px;
  gap: 20px;
  align-items: start;
}
.studio-layout > .panel,
.studio-options .panel {
  padding: 18px;
}
.studio-options {
  min-width: 0;
}
.source-panel .panel-heading,
.script-panel .panel-heading {
  margin-bottom: 16px;
}
.heading-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.source-panel .panel-heading {
  flex-wrap: wrap;
}
.video-stage {
  position: relative;
  background: #080a0e;
  line-height: 0;
  border-radius: 10px;
  overflow: hidden;
}
.video-stage video {
  width: 100%;
  display: block;
  object-fit: contain;
  height: clamp(200px, calc(100dvh - 390px), 490px);
}
.mask-box {
  position: absolute;
  border: 2px dashed #ff777e;
  background: #ff777e20;
  border-radius: 4px;
  pointer-events: none;
}
.source-info {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
}
.source-info h3 {
  font-size: 14px;
  line-height: 1.6;
}
.source-info p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}
.source-info > .tag {
  display: none;
}
.output-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-top: 1px solid var(--line);
  margin-top: 16px;
  padding-top: 16px;
}
.script-source {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: end;
  gap: 10px;
  margin-bottom: 12px;
}
.script-source label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}
.script-source select,
.script-source .select-trigger {
  width: 100%;
  min-height: 36px;
  height: 36px;
  font-size: 13px;
}
.script-arrow {
  color: var(--muted);
  padding-bottom: 8px;
}
.script-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.script-toolbar .button {
  flex: 1;
}
.script-toolbar .button:first-child {
  flex: 2;
}
.script-panel > textarea {
  width: 100%;
  height: clamp(240px, calc(100dvh - 410px), 490px);
  resize: vertical;
  padding: 14px;
  font-size: 14px;
  line-height: 1.8;
}
.script-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 12px;
  font-size: 12px;
  color: var(--muted);
}
.line-review {
  height: clamp(240px, calc(100dvh - 410px), 490px);
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.line-summary {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 6px;
}
.line-summary b {
  color: var(--amber);
}
.line-row {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 8px;
  align-items: start;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}
.line-row.warn {
  border-color: #69502b;
}
.line-row.bad {
  border-color: #724047;
}
.line-time {
  display: flex;
  flex-direction: column;
  border: 0;
  background: none;
  color: #c3abff;
  font-size: 12px;
  text-align: left;
  padding: 3px 0;
}
.line-time small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}
.line-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.line-body textarea {
  width: 100%;
  min-height: 65px;
  resize: vertical;
  font-size: 14px;
  line-height: 1.6;
  padding: 8px;
}
.line-source {
  color: var(--muted);
  font-size: 12px;
}
.cps {
  grid-column: 2;
  justify-self: end;
  font-size: 12px;
  border-radius: 5px;
  background: #17352c;
  color: var(--green);
  padding: 2px 6px;
}
.cps.warn {
  background: #3b301e;
  color: var(--amber);
}
.cps.bad {
  background: #3e252d;
  color: var(--red);
}
.voice-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
  max-height: 280px;
  overflow: auto;
}
.voice-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--control);
  border-radius: 9px;
  cursor: pointer;
  background: var(--bg);
}
.voice-option.active {
  border-color: #9a78df;
  background: var(--lavender);
}
.voice-avatar {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border-radius: 50%;
  background: #39334e;
  color: #d4c3ff;
  font-size: 12px;
}
.voice-detail {
  flex: 1;
  min-width: 0;
}
.voice-detail b {
  display: block;
  font-size: 13px;
  font-weight: 600;
}
.voice-detail small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}
.voice-radio {
  display: none;
}
.voice-sample {
  display: grid;
  place-items: center;
  background: none;
  border: 0;
  color: #c3abff;
  width: 28px;
  height: 28px;
  padding: 0;
}
.voice-sample svg {
  width: 16px;
  height: 16px;
}
.range-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.range-label > span {
  color: #c3abff;
}
.range-label input {
  flex-basis: 100%;
}
.subtitle-option {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  margin: 22px 0;
  cursor: pointer;
}
.advanced-settings {
  border-top: 1px solid var(--line);
  margin-top: 8px;
}
.advanced-body {
  padding-bottom: 4px;
}
.advanced-body > .range-label:first-child {
  margin-top: 8px;
}
.advanced-body > .select-control {
  width: 100%;
  margin-top: 8px;
}
.subtitle-style {
  border-top: 1px solid var(--line);
  margin-top: 20px;
}
.sub-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 10px;
}
.sub-grid label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}
.sub-grid .sub-check {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sub-grid .select-control {
  width: 100%;
}
.sub-preview {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  width: 150px;
  aspect-ratio: 9/16;
  margin: 0 auto 16px;
  border-radius: 10px;
  background: #242b39;
  padding: 0 8px;
  overflow: hidden;
}
.sub-preview span {
  text-align: center;
  line-height: 1.25;
  max-width: 100%;
}
.studio-action {
  position: sticky;
  bottom: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  background: var(--bg);
  border-top: 1px solid var(--line);
  margin-top: 24px;
}
.studio-action > span {
  font-size: 12px;
  color: var(--muted);
}
.studio-action .button {
  min-height: 44px;
  padding: 0 22px;
}
.studio-job-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  margin-top: 16px;
}
.studio-job-card strong {
  font-size: 13px;
}
.studio-job-card p {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
  margin: 8px 0;
}
.asset-chooser {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.asset-choice {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  text-align: left;
}
.asset-choice:hover {
  border-color: var(--purple);
}
.asset-choice img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 6px;
}
.asset-choice strong {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.6;
  margin: 8px 4px 4px;
}
/* Follow and automation forms */
.follow-form {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}
.follow-form input[type="url"] {
  flex: 1 1 260px;
}
.follow-form label {
  display: grid;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}
.follow-form label.sub-check {
  display: flex;
  align-items: center;
  min-height: 42px;
  font-size: 13px;
}
.follow-form input:not([type="checkbox"]):not([type="range"]),
.follow-form select {
  min-height: 42px;
}
.follow-form input[type="number"] {
  max-width: 120px;
}
.follow-form > input:not([type="url"]) {
  flex: 1 1 180px;
}
.form-advanced {
  flex-basis: 100%;
  order: 2;
  border-top: 1px solid var(--line);
}
.form-advanced summary {
  justify-content: flex-start;
}
.form-options {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
  padding: 8px 0;
}
.form-options > input {
  flex: 1 1 260px;
}
.form-options label {
  flex: 1 1 140px;
}
.form-options label .select-control {
  width: 100%;
}
.form-options label input {
  width: 100%;
}
#view-automation > .panel {
  margin-bottom: 24px;
}
#view-automation > .panel > .muted {
  margin-bottom: 20px;
  font-size: 13px;
}
.brand-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
}
/* Queue and shared management rows */
.job-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.job-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.job-kind {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--lavender);
  color: #c3abff;
}
.job-content {
  flex: 1;
  min-width: 0;
}
.job-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.job-top h3 {
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.job-content > p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
  margin-top: 8px;
  overflow-wrap: anywhere;
}
.job-label {
  flex-shrink: 0;
}
.job-label.done {
  background: #17352c;
  color: var(--green);
}
.job-label.failed {
  background: #3e252d;
  color: var(--red);
}
.job-label.cancelled {
  background: #292d39;
  color: var(--muted);
}
.job-progress {
  height: 4px;
  border-radius: 4px;
  background: #343849;
  margin: 14px 0 8px;
  overflow: hidden;
}
.job-progress > span {
  display: block;
  height: 100%;
  background: var(--purple);
  border-radius: 4px;
  transition: width 0.3s;
}
.job-bottom {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}
.job-actions {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 12px;
}
.job-time {
  color: var(--muted);
  font-size: 12px;
  margin-left: auto;
}
.job-error {
  color: var(--red) !important;
  background: #352126;
  padding: 12px;
  border-radius: 8px;
}
.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}
.admin-grid .muted {
  font-size: 13px;
}
.tool-row,
.member-row,
.candidate-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}
.tool-row:last-child,
.member-row:last-child,
.candidate-row:last-child {
  border: 0;
}
.tool-ready {
  color: var(--green);
}
.tool-missing {
  color: var(--amber);
}
.member-row strong {
  font-size: 14px;
  color: var(--ink);
}
.member-row small {
  display: block;
  margin-top: 5px;
  font-size: 12px;
}
.candidate-row > span {
  font-size: 12px;
}
/* Dialogs and feedback */
dialog {
  border: 1px solid var(--control);
  border-radius: 16px;
  width: min(600px, calc(100% - 32px));
  padding: 0;
  box-shadow: 0 24px 80px #0008;
  color: var(--ink);
  background: var(--surface);
  max-height: 92dvh;
  animation: dialog-in 0.15s ease-out;
}
dialog::backdrop {
  background: #06080dbb;
  backdrop-filter: blur(4px);
}
@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.modal-header h2 {
  font-size: 18px;
}
.modal-body {
  padding: 24px;
  max-height: 75dvh;
  overflow: auto;
}
.modal-body p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
  margin-bottom: 16px;
}
.modal-body label,
.login-card label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 18px;
}
.modal-body input:not([type="checkbox"]):not([type="range"]),
.modal-body select,
.modal-body textarea,
.login-card input {
  display: block;
  width: 100%;
  margin-top: 8px;
}
.modal-body textarea {
  min-height: 130px;
  resize: vertical;
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 12px;
}
.modal-body video {
  width: 100%;
  max-height: 60dvh;
  background: #080a0e;
  border-radius: 8px;
}
.help-step {
  display: flex;
  gap: 14px;
  margin-bottom: 20px;
}
.help-step > b {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--lavender);
  color: #c3abff;
  flex-shrink: 0;
}
.help-step h3 {
  margin-bottom: 6px;
}
.wizard .small-text {
  margin-bottom: 14px;
}
.wz-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 16px;
}
.wz-progress i {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--line);
  overflow: hidden;
}
.wz-progress b {
  display: block;
  height: 100%;
  background: #7c5cff;
}
.wz-step[hidden] {
  display: none;
}
.wz-step h3 {
  font-size: 17px;
}
.wz-hint {
  min-height: 20px;
  margin: 12px 0 0;
  color: #f5c451 !important;
}
.wz-safe {
  border: 1px solid rgba(74, 222, 128, 0.35);
  background: rgba(74, 222, 128, 0.06);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
}
.wz-body {
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
}
.wz-body .wz-cta {
  display: flex;
  width: 100%;
  min-height: 48px;
  margin: 4px 0 18px;
  font-size: 14px;
  box-shadow: 0 10px 24px -12px rgb(124 92 255 / 0.7);
}
.wz-body .wz-cta svg {
  width: 18px;
  height: 18px;
}
.wz-body > p {
  margin-bottom: 14px;
}
#wzSave {
  margin-bottom: 4px;
}
.wizard .modal-footer {
  padding-top: 20px;
  margin-bottom: 24px;
}
.wz-body ol {
  padding-left: 20px;
  margin-bottom: 12px;
}
.wz-body li {
  margin-bottom: 6px;
}
.wz-body a:not(.button) {
  color: #c3abff;
}
.wz-confirm {
  display: flex !important;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--surface);
}
.wz-note,
.wz-checks .wait {
  font-size: 12px;
  color: var(--muted);
}
.wz-checks {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 13px;
}
.wz-checks li {
  margin-bottom: 6px;
}
.wz-checks .ok,
.wz-result.ok {
  color: #4ade80;
}
.wz-checks .bad,
.wz-result.bad {
  color: #ff7a7a;
}
.wz-result.warn {
  color: #f5c451;
}
.wz-result {
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.7;
}
.toasts {
  position: fixed;
  right: 24px;
  top: 84px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
  width: 380px;
  max-width: calc(100vw - 32px);
}
.toast {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid var(--control);
  background: #262238;
  color: var(--ink);
  border-radius: 10px;
  padding: 16px;
  font-size: 13px;
  line-height: 1.7;
  box-shadow: 0 10px 30px #0005;
  animation: dialog-in 0.15s;
}
.toast > svg {
  width: 18px;
  height: 18px;
  color: var(--green);
  margin-top: 2px;
}
.toast.error {
  background: #38232b;
  border-color: #71434e;
}
.toast.error > svg {
  color: var(--red);
}
.toast-message {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.toast .icon-button {
  width: 24px;
  height: 24px;
}
.toast .text-button {
  padding-top: 8px;
}
.toast.has-action {
  border-color: #8e70cc;
}
.toast-action {
  margin-top: 12px;
  width: 100%;
}
.login-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 24px;
  background: var(--bg);
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
}
.login-card {
  width: 410px;
  max-width: 100%;
  min-width: 0;
  padding: 36px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
}
.login-card h1 {
  font-size: 28px;
  margin: 24px 0 10px;
}
.login-card > p {
  color: var(--muted);
  margin-bottom: 28px;
}
.login-card .error-text {
  color: var(--red);
  margin-bottom: 16px;
}
.login-wordmark {
  position: fixed;
  bottom: 20px;
  color: var(--muted);
  font-size: 12px;
}
.login-wordmark > span {
  margin-left: 8px;
}
/* Custom select, progressively enhanced over the existing form control. */
.select-control {
  position: relative;
  display: inline-flex;
  min-width: 0;
  max-width: 100%;
  vertical-align: middle;
}
.select-control > select {
  position: absolute;
  width: 1px !important;
  height: 1px !important;
  clip-path: inset(50%);
  opacity: 0;
  pointer-events: none;
}
.select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  min-width: 0;
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--control);
  border-radius: 8px;
  background: var(--bg);
  font-size: 13px;
  text-align: left;
}
.select-trigger > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.select-trigger > svg {
  width: 14px;
  height: 14px;
  color: var(--muted);
}
.select-trigger[aria-expanded="true"] {
  border-color: var(--purple);
}
.select-menu {
  position: fixed;
  margin: 0;
  padding: 5px;
  max-height: 280px;
  overflow: auto;
  border: 1px solid var(--control);
  border-radius: 10px;
  background: #222632;
  box-shadow: 0 12px 30px #0007;
  z-index: 2000;
  animation: dialog-in 0.12s ease-out;
  min-width: 140px;
}
.select-option {
  padding: 9px 10px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  line-height: 1.5;
}
.select-option:hover,
.select-option.focused {
  background: #343044;
}
.select-option[aria-selected="true"] {
  color: #d4c3ff;
  background: var(--lavender);
}
.select-option[aria-disabled="true"] {
  opacity: 0.4;
  cursor: not-allowed;
}
.platform-glyph img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.search-main input::-webkit-search-cancel-button {
  appearance: none;
}
.query-field {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.search-main .clear-search {
  width: 32px;
  height: 32px;
}
@media (max-width: 600px) {
  .query-field {
    flex-basis: calc(100% - 32px);
  }
}
.topbar {
  background: var(--surface);
}
.button.secondary:hover {
  border-color: var(--control);
}
.select-trigger {
  min-height: 42px;
}
.select-menu:popover-open {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.select-option {
  flex-shrink: 0;
}
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 0;
  background-color: #343044;
}
.button.primary:focus-visible {
  background: #d3bdff;
}
.button.secondary:focus-visible,
.nav-item:focus-visible,
.platform-tab:focus-visible,
.icon-button:focus-visible,
.text-button:focus-visible {
  background: #343044;
}
.voice-option:focus-visible {
  outline: 0;
  background: #3c3151;
}
.suggestions button {
  min-height: 32px;
}
.platform-tabs.can-next {
  mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent);
}
.platform-tabs.can-prev {
  mask-image: linear-gradient(to right, transparent, #000 24px);
}
.platform-tabs.can-prev.can-next {
  mask-image: linear-gradient(
    to right,
    transparent,
    #000 24px,
    #000 calc(100% - 32px),
    transparent
  );
}
#brandForm > label {
  min-width: 0;
}
#brandForm input[type="file"] {
  width: 100%;
}
.file-picker-label {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--control);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  cursor: pointer;
}
.file-picker-label small {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 160px;
}
.file-picker:focus-within .file-picker-label {
  background: #343044;
}
#brandForm .file-picker input {
  width: 1px;
  min-height: 1px;
}
.source-info h3 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
@media (max-width: 600px) {
  #searchResults .video-author > span:last-child {
    display: none;
  }
}
.empty-library {
  display: flex;
  width: max-content;
  margin: 14px auto 0;
}
@media (max-width: 600px) {
  #brandForm > label {
    flex-basis: 100%;
  }
  #brandForm > .button {
    flex-basis: 100%;
  }
}
/* Responsive */
@media (min-width: 1700px) {
  .video-grid:not(.list-mode) {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (max-width: 1250px) {
  .studio-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .studio-options {
    grid-column: 1/-1;
  }
  .studio-options .voice-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 24px;
  }
  .voice-panel > .panel-heading {
    grid-column: 1/-1;
  }
  .voice-panel > .field,
  .voice-panel > .voice-list {
    grid-column: 1;
  }
  .voice-panel > .range-label,
  .voice-panel > .subtitle-option,
  .voice-panel > .advanced-settings {
    grid-column: 2;
  }
  .voice-panel > .range-label {
    grid-row: 2;
    align-self: center;
    margin-top: 0;
  }
  .voice-panel > .subtitle-option {
    grid-row: 3;
    align-self: start;
  }
  .voice-panel > .advanced-settings {
    grid-row: 4;
  }
  .voice-panel > .voice-list {
    grid-row: 3/5;
  }
}
@media (max-width: 1100px) {
  .sidebar {
    width: 208px;
    padding-left: 12px;
    padding-right: 12px;
  }
  .workspace {
    width: calc(100% - 208px);
    margin-left: 208px;
  }
  .nav-item {
    font-size: 12px;
    gap: 9px;
    padding: 11px 10px;
  }
  .brand {
    font-size: 21px;
  }
  .topbar {
    padding: 0 28px;
  }
  main {
    padding: 28px;
  }
  .video-grid {
    gap: 18px;
  }
  .platform-tab {
    padding: 8px 10px;
  }
  .video-platform > span:last-child {
    max-width: 105px;
  }
}
@media (max-width: 800px) {
  .sidebar {
    display: none;
    width: 248px;
    padding: 24px 16px 0;
    box-shadow: 16px 0 50px #0009;
  }
  .shell.nav-open .sidebar {
    display: flex;
  }
  .nav-scrim {
    display: none;
    position: fixed;
    inset: 0;
    border: 0;
    background: #05070bc9;
    z-index: 35;
  }
  .shell.nav-open .nav-scrim {
    display: block;
  }
  .sidebar-close {
    position: absolute;
    right: 12px;
    top: 23px;
  }
  .sidebar .brand {
    padding-right: 25px;
  }
  .workspace {
    width: 100%;
    margin-left: 0;
  }
  .mobile-menu {
    display: inline-flex;
  }
  .topbar {
    height: 64px;
    padding: 0 16px;
  }
  .top-actions {
    gap: 10px;
  }
  .top-actions > [data-action="help"] {
    display: none;
  }
  .breadcrumb {
    gap: 10px;
  }
  .server-state {
    font-size: 12px;
  }
  .server-state i {
    display: none;
  }
  main {
    padding: 24px 16px;
  }
  .page-intro {
    margin-bottom: 24px;
  }
  .page-intro h1 {
    font-size: 28px;
  }
  .page-intro .button {
    font-size: 12px;
    padding: 0 12px;
    min-height: 40px;
  }
  .video-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }
  .studio-layout {
    gap: 16px;
  }
  .studio-options .voice-panel {
    gap: 0 18px;
  }
  .admin-grid {
    grid-template-columns: 1fr;
  }
  .notice {
    flex-wrap: wrap;
  }
  .notice > span {
    flex: 1;
    min-width: 200px;
  }
  .section-heading {
    margin-top: 24px;
  }
  .section-heading h2 {
    font-size: 16px;
  }
  .platform-tab {
    flex: 0 0 auto;
    min-width: 118px;
  }
  .search-main {
    gap: 10px;
  }
  .search-main kbd {
    display: none;
  }
}
@media (min-width: 801px) {
  .nav-scrim,
  .sidebar-close {
    display: none;
  }
}
@media (min-width: 601px) and (max-width: 1100px) {
  .search-filters {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  .search-filters > label {
    grid-column: span 2;
  }
  .search-filters > label:nth-of-type(n + 4) {
    grid-column: span 3;
  }
}
@media (max-width: 600px) {
  h1 {
    font-size: 28px;
  }
  .page-intro {
    gap: 12px;
  }
  .page-intro h1 {
    font-size: 26px;
  }
  .page-intro .button svg {
    display: none;
  }
  .source-picker {
    padding: 14px 14px 0;
  }
  .platform-tab {
    min-width: 115px;
    min-height: 46px;
  }
  .search-main {
    padding: 14px;
    flex-wrap: wrap;
    gap: 10px;
  }
  .search-main input {
    flex: 1 1 calc(100% - 36px);
  }
  .search-main > .search-symbol {
    width: 19px;
    height: 19px;
  }
  .search-main #searchButton {
    flex: 1;
    order: 2;
  }
  .search-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 14px;
    gap: 12px;
  }
  .search-filters > .filter-sort {
    grid-column: 1 / -1;
  }
  .duration-range label {
    flex: 1;
    min-width: 0;
  }
  .suggestions {
    gap: 6px;
  }
  .suggestions > span {
    display: none;
  }
  .suggestions button {
    font-size: 12px;
    padding: 6px 8px;
  }
  .suggestions button span {
    display: none;
  }
  .section-heading {
    flex-wrap: wrap;
    gap: 12px;
  }
  .section-heading > div:first-child {
    flex: 1;
    min-width: 120px;
  }
  .results-actions {
    gap: 6px;
  }
  .results-actions > .button {
    font-size: 12px;
    padding: 0 9px;
  }
  .results-actions > .button > svg,
  .results-actions .view-switch {
    display: none;
  }
  .video-info {
    padding: 12px;
  }
  .video-info h3 {
    font-size: 13px;
    min-height: 42px;
  }
  .video-platform {
    flex-wrap: wrap;
    gap: 5px;
  }
  .video-platform > span:last-child {
    max-width: none;
  }
  .video-platform .platform-name {
    display: none;
  }
  .video-author {
    margin: 8px 0 12px;
  }
  .video-actions {
    gap: 4px;
    padding-top: 12px;
  }
  .video-actions .button {
    font-size: 12px;
    padding: 0 8px;
    gap: 5px;
  }
  .video-actions .button > svg {
    display: none;
  }
  .video-actions .icon-button {
    width: 25px;
  }
  .video-duration {
    right: 7px;
    bottom: 7px;
  }
  .video-grid {
    gap: 14px 10px;
  }
  .video-grid.list-mode .video-card {
    display: block;
  }
  .list-mode .video-thumbnail {
    width: 100%;
    aspect-ratio: 16/9;
  }
  .list-mode .video-info {
    display: block;
  }
  .list-mode .video-actions {
    border-top: 1px solid var(--line);
    min-width: 0;
  }
  .library-toolbar {
    flex-wrap: wrap;
    gap: 14px;
  }
  .compact-search {
    width: 100%;
  }
  .compact-search input {
    width: 100%;
  }
  .segmented button {
    font-size: 13px;
    padding: 8px 12px;
  }
  .discover-empty,
  .empty-state {
    padding: 44px 20px;
  }
  .empty-state h3 {
    font-size: 17px;
  }
  .empty-state p {
    font-size: 13px;
  }
  .studio-layout {
    display: flex;
    flex-direction: column;
  }
  .studio-layout > * {
    width: 100%;
  }
  .studio-layout > .panel {
    padding: 16px;
  }
  .studio-options .voice-panel {
    display: block;
    padding: 16px;
  }
  .voice-panel > .field {
    margin-top: 12px;
  }
  .voice-panel > .range-label {
    margin-top: 20px;
  }
  .voice-list {
    max-height: 230px;
  }
  .video-stage video {
    height: clamp(230px, calc(100dvh - 410px), 380px);
  }
  .script-panel > textarea,
  .line-review {
    height: 320px;
  }
  .studio-action {
    padding: 12px 0;
    gap: 12px;
  }
  .studio-action > span {
    font-size: 12px;
    max-width: 70px;
  }
  .studio-action .button {
    padding: 0 14px;
    font-size: 13px;
  }
  .source-info h3 {
    font-size: 14px;
  }
  .follow-form {
    gap: 14px;
  }
  .follow-form > input[type="url"] {
    flex-basis: 100%;
  }
  .follow-form > label {
    flex: 1 1 120px;
  }
  .follow-form > .button {
    flex: 1;
    min-width: 130px;
  }
  .follow-form > label.sub-check {
    flex-basis: 100%;
  }
  .form-options {
    gap: 14px;
  }
  .form-options > label {
    flex: 1 1 130px;
  }
  .panel {
    padding: 16px;
  }
  .panel-heading h2 {
    font-size: 15px;
  }
  .job-card {
    padding: 16px;
    gap: 12px;
  }
  .job-kind {
    width: 32px;
    height: 32px;
  }
  .job-kind svg {
    width: 17px;
    height: 17px;
  }
  .job-top {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 8px;
  }
  .job-top h3 {
    white-space: normal;
    font-size: 13px;
  }
  .job-time {
    margin-left: 0;
  }
  .job-actions {
    gap: 10px;
  }
  .modal-header {
    padding: 16px;
  }
  .modal-header h2 {
    font-size: 17px;
  }
  .modal-body {
    padding: 18px;
  }
  .toasts {
    right: 16px;
    top: 76px;
  }
  .login-card {
    padding: 28px;
  }
  .asset-choice strong {
    font-size: 12px;
  }
  .batch-bar {
    position: static;
    gap: 8px;
    padding: 12px;
  }
  .batch-bar .button {
    font-size: 12px;
  }
  .admin-grid {
    gap: 16px;
  }
  .member-row {
    flex-wrap: wrap;
  }
  .page-intro > .soft-badge {
    white-space: normal;
    max-width: 130px;
  }
  .server-state {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    white-space: nowrap;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
/* Declutter pass: one chrome (sidebar) on desktop, calmer hierarchy, tactile controls. */
@media (min-width: 801px) {
  .topbar {
    height: 52px;
    padding: 0 40px;
    border-bottom: 0;
    background: transparent;
    justify-content: flex-end;
  }
  .topbar .breadcrumb {
    display: none;
  }
  main {
    padding-top: 40px;
  }
}
.brand {
  margin-bottom: 32px;
}
.sidebar .server-state {
  padding: 0 12px 8px;
}
.help-link {
  padding-top: 8px;
}
h1,
h2,
h3 {
  text-wrap: balance;
}
p {
  text-wrap: pretty;
}
.nav-count,
.video-duration,
.script-footer,
.range-label span,
.section-heading p {
  font-variant-numeric: tabular-nums;
}
.button,
.nav-item,
.platform-tab,
.icon-button {
  transition:
    background 0.15s,
    border-color 0.15s,
    transform 0.12s;
}
.button:active:not(:disabled),
.nav-item:active,
.platform-tab:active {
  transform: scale(0.98);
}
.video-card {
  transition:
    border-color 0.15s,
    box-shadow 0.2s;
}
.video-card:hover {
  box-shadow: 0 18px 36px -24px #05030f;
}
.search-panel {
  box-shadow: 0 24px 48px -36px #05030f;
}
.login-switch {
  margin: 20px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.login-switch .text-button {
  display: inline;
  padding: 0 2px;
  min-height: 0;
}
.studio-stepper {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 12px;
}
.studio-stepper > span {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--surface);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.studio-stepper b {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--hover);
  font-size: 11px;
}
.studio-stepper > .done {
  color: var(--green);
}
.studio-stepper > .done b {
  background: #1c3a31;
}
.studio-stepper > .current {
  background: var(--lavender);
  color: #c3abff;
}
.studio-stepper > .current b {
  background: var(--purple);
  color: #1d1233;
}
.batch-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}
@media (max-width: 800px) {
  .studio-stepper > span {
    flex: none;
  }
  .studio-stepper {
    overflow-x: auto;
  }
  .script-source {
    grid-template-columns: minmax(0, 1fr);
  }
  .script-arrow {
    display: none;
  }
}
/* Discover: linked sources first, unlinked ones in their own section. */
.discover-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.discover-top:has(.source-add[hidden]) {
  grid-template-columns: minmax(0, 1fr);
}
.source-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.source-heading h2,
.source-add-head h2 {
  font-size: 15px;
  letter-spacing: -0.2px;
}
.source-heading small,
.source-add-head p {
  color: var(--muted);
  font-size: 12px;
}
.platform-tabs {
  gap: 20px;
}
.platform-group {
  display: grid;
  gap: 8px;
  flex: none;
  align-content: start;
}
.platform-group-label {
  font-size: 12px;
  color: var(--muted);
}
.platform-group.linked .platform-group-label {
  color: var(--green);
}
.platform-group-items {
  display: flex;
  gap: 8px;
}
.platform-group-items .platform-tab {
  flex: 0 0 auto;
  min-width: 0;
}
.platform-tab.linked {
  border-color: #34413f;
}
.platform-tab.linked.active {
  border-color: #8e70cc;
}
.source-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6b7388;
  flex: none;
}
.source-dot.s-valid {
  background: var(--green);
}
.source-dot.s-unverified,
.source-dot.s-blocked {
  background: var(--amber);
}
.source-dot.s-expired,
.source-dot.s-error {
  background: var(--red);
}
.source-add {
  border-radius: 14px;
  background: var(--surface);
  padding: 18px;
  box-shadow: 0 24px 48px -36px #05030f;
}
.source-add-head {
  margin-bottom: 14px;
}
.source-add-head p {
  margin-top: 4px;
  text-wrap: pretty;
}
.source-add-list {
  display: grid;
  gap: 10px;
  max-height: 460px;
  overflow: auto;
}
.source-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 12px;
  background: var(--bg);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.045);
  transition:
    background 0.2s,
    box-shadow 0.2s;
}
.source-card:hover {
  background: #141720;
  box-shadow: inset 0 0 0 1px var(--line);
}
.source-card.required {
  background:
    linear-gradient(180deg, rgb(237 193 111 / 0.08), transparent 72%), var(--bg);
  box-shadow: inset 0 0 0 1px rgb(237 193 111 / 0.24);
}
.source-card.required:hover {
  box-shadow: inset 0 0 0 1px rgb(237 193 111 / 0.4);
}
.source-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.source-card .platform-glyph {
  width: 34px;
  height: 34px;
  padding: 6px;
  border-radius: 9px;
  background: var(--surface);
}
.source-card h3 {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.1px;
}
.source-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgb(255 255 255 / 0.05);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
}
.source-tag::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.7;
}
.source-card.required .source-tag {
  background: rgb(237 193 111 / 0.14);
  color: var(--amber);
}
.source-card.required .source-tag::before {
  opacity: 1;
}
.source-card p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-wrap: pretty;
}
.source-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 8px;
}
.source-actions .button,
.source-actions .text-button {
  justify-content: center;
  min-height: 36px;
  padding: 0 10px;
  white-space: nowrap;
}
.source-actions .text-button {
  border: 1px solid var(--control);
  border-radius: 8px;
  color: var(--muted);
  transition:
    background 0.15s,
    border-color 0.15s,
    color 0.15s,
    transform 0.12s;
}
.source-actions .text-button:hover {
  background: var(--hover);
  border-color: #626a80;
  color: var(--ink);
}
.source-actions .text-button:active {
  transform: scale(0.98);
}
.source-note {
  color: var(--muted);
  font-size: 12px;
}
.discover-row {
  display: flex;
  gap: 16px;
  align-items: stretch;
  margin-top: 16px;
}
.source-add {
  flex: 1;
  min-width: 0;
  padding: 14px 16px;
}
.source-add-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
}
.source-add-head p {
  display: none;
}
.source-add .source-add-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(236px, 1fr));
  gap: 12px;
  max-height: none;
  overflow: visible;
}
.source-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 60px;
  padding: 12px;
  border-radius: 12px;
  background: var(--bg);
  box-shadow: inset 0 0 0 1px var(--line);
}
.source-chip .platform-glyph {
  flex: none;
  width: 28px;
  height: 28px;
  padding: 0;
  background: none;
}
.source-chip-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
}
.source-chip button {
  flex: none;
  height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
}
.source-chip-connect {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--purple);
  color: #1d1233;
}
.source-chip-connect:hover {
  background: var(--purple-dark);
}
.source-chip-connect svg {
  width: 14px;
  height: 14px;
}
.source-chip-login {
  background: none;
  color: #c3abff;
}
.source-add .source-more {
  margin-top: 10px;
  padding-top: 10px;
}
.dropzone {
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 220px;
  padding: 16px;
  border: 2px dashed var(--control);
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  text-align: center;
  transition:
    border-color 0.15s,
    background 0.15s,
    color 0.15s;
}
.dropzone svg {
  width: 24px;
  height: 24px;
}
.dropzone strong {
  color: var(--ink);
  font-size: 14px;
}
.dropzone small {
  font-size: 12px;
  line-height: 1.5;
}
.dropzone:hover,
.dropzone.over {
  border-color: var(--purple);
  background: rgb(167 139 250 / 0.08);
  color: #c3abff;
}
@media (max-width: 800px) {
  .discover-row {
    flex-direction: column;
  }
  .dropzone {
    width: 100%;
  }
}
.source-more {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.source-more > summary {
  padding: 0;
}
.source-more-label {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.source-more-label strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}
.source-more-label small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
}
.source-more > summary:hover .source-more-label small {
  color: var(--ink);
}
.source-more > .source-add-list {
  margin-top: 12px;
  max-height: 340px;
}
.toggle-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--control);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  transition:
    background 0.15s,
    border-color 0.15s,
    color 0.15s,
    transform 0.12s;
}
.toggle-chip svg {
  width: 16px;
  height: 16px;
}
.toggle-chip::after {
  content: "";
  width: 26px;
  height: 14px;
  border-radius: 7px;
  background: #3b4151
    radial-gradient(circle at 7px 7px, #a0a6b8 0 5px, transparent 5.5px) no-repeat;
  transition:
    background-color 0.15s,
    background-position 0.15s;
}
.toggle-chip:hover {
  background: var(--hover);
  color: var(--ink);
}
.toggle-chip:active {
  transform: scale(0.98);
}
.toggle-chip[aria-pressed="true"] {
  background: var(--lavender);
  border-color: #8e70cc;
  color: #d4c3ff;
}
.toggle-chip[aria-pressed="true"]::after {
  background: #8e70cc
    radial-gradient(circle at 19px 7px, #f1ebff 0 5px, transparent 5.5px) no-repeat;
}

/* Thư viện câu mở đầu (hook) */
.hook-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 8px;
}
.hook-chip {
  flex: none;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
.hook-chip.active {
  background: var(--lavender);
  border-color: var(--purple);
  color: #c3abff;
}
.hook-hint {
  color: var(--muted);
  margin: 4px 0 12px;
}
.hook-list {
  display: grid;
  gap: 10px;
}
.hook-card {
  display: grid;
  gap: 6px;
  text-align: left;
  min-height: 44px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
.hook-card:hover,
.hook-card:focus-visible {
  background: var(--hover);
  border-color: var(--purple);
}
.hook-card .tag {
  justify-self: start;
}
.hook-card small {
  color: var(--muted);
}
.hook-credit {
  color: var(--muted);
  font-size: 12px;
  margin-top: 16px;
}
.hook-credit a {
  color: var(--purple-dark);
}
.hook-edit {
  display: grid;
  gap: 6px;
}
.hook-edit textarea {
  width: 100%;
  font: inherit;
  font-size: 16px;
  padding: 10px 12px;
  color: var(--ink);
  background: #080a0e;
  border: 1px solid var(--line);
  border-radius: 8px;
  resize: vertical;
}
.hook-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.hook-actions .button {
  flex: 1;
  min-height: 44px;
}

.hook-clip-option {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 10px 0;
}
.hook-clip-option > div {
  flex: 1;
  min-width: 140px;
  display: grid;
}
.hook-clip-option span {
  color: var(--muted);
  font-size: 12px;
}
.hook-clip-option .button,
.hook-clip-option .text-button {
  min-height: 44px;
}
.clip-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.clip-card {
  display: grid;
  gap: 6px;
  align-content: start;
  text-align: left;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
.clip-card.selected,
.clip-card:hover,
.clip-card:focus-visible {
  border-color: var(--purple);
  background: var(--hover);
}
.clip-card img {
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  border-radius: 6px;
  background: #080a0e;
}
.clip-card .tag {
  justify-self: start;
}
.clip-preview {
  display: grid;
  justify-items: center;
  margin-bottom: 10px;
}
.clip-preview video {
  width: min(100%, 260px);
  max-height: 55dvh;
  border-radius: 8px;
  background: #080a0e;
}
@media (min-width: 720px) {
  .clip-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (min-width: 720px) {
  .hook-chips {
    flex-wrap: wrap;
    overflow-x: visible;
  }
}

/* Nút trong cửa sổ xem trước clip luôn thấy trọn, không phải cuộn */
.clip-preview ~ .hook-actions {
  position: sticky;
  bottom: 0;
  padding: 10px 0;
  background: var(--bg);
  z-index: 1;
}
.clip-preview video {
  max-height: 42dvh;
}
/* Cắt theo ý và khung dọc */
.clip-note {
  margin: 2px 0 6px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.clip-note.highlight {
  color: var(--green);
  font-weight: 600;
}
.autoclip-form {
  display: grid;
  gap: 14px;
}
.autoclip-form label {
  display: grid;
  gap: 6px;
}
.autoclip-form select,
.autoclip-form input {
  min-height: 44px;
  font-size: 16px;
}
.autoclip-form .modal-footer .button {
  min-height: 44px;
}
@media (max-width: 800px) {
  .library-toolbar .segmented {
    overflow-x: auto;
  }
  .library-toolbar .segmented button {
    flex: none;
    white-space: nowrap;
  }
  .batch-actions .button {
    min-height: 44px;
  }
}

/* Video tin nhắn chat */
.chat-layout{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);gap:20px;align-items:start}
.chat-step{display:flex;align-items:center;gap:10px;font-size:1rem;margin:22px 0 12px}
.chat-step:first-child{margin-top:0}
.chat-step b{display:inline-grid;place-items:center;width:26px;height:26px;border-radius:50%;background:var(--accent,#6c5ce7);color:#fff;font-size:.8rem}
.chat-looks{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.chat-look{display:flex;flex-direction:column;gap:4px;align-items:flex-start;padding:12px;border:2px solid var(--line);border-radius:12px;background:var(--surface);color:inherit;text-align:left;cursor:pointer;min-height:44px}
.chat-look i{display:block;width:100%;height:34px;border-radius:8px}
.chat-look-zalo i{background:linear-gradient(90deg,#0068ff 0 100%) top/100% 10px no-repeat,#eaf0f7}
.chat-look-messenger i{background:linear-gradient(90deg,#fff,#0084ff);border:1px solid #d6d9e0}
.chat-look-instagram i{background:linear-gradient(90deg,#000,#584ce8)}
.chat-look small{color:var(--muted,#8a90a2);font-size:.75rem}
.chat-look.active{border-color:#6c8cff;box-shadow:0 0 0 2px rgba(108,140,255,.35)}
.chat-add{display:grid;grid-template-columns:150px minmax(0,1fr) auto;gap:8px}
.chat-add input,.chat-paste textarea,.chat-options input,.chat-options select{width:100%;min-height:44px;box-sizing:border-box}
.chat-add .button{min-height:44px}
.chat-chips{display:flex;flex-wrap:wrap;gap:6px;margin:8px 0}
.chat-chip{min-height:36px;padding:4px 12px;border-radius:999px;border:1px solid var(--line);background:transparent;color:inherit;cursor:pointer}
.chat-paste{margin:8px 0}.chat-paste summary{cursor:pointer;padding:8px 0}
.chat-listhead{display:flex;align-items:center;gap:14px;margin:14px 0 6px}.chat-listhead b{flex:1}
.chat-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px;max-height:340px;overflow:auto}
.chat-list li{display:grid;grid-template-columns:90px minmax(0,1fr) 36px;gap:8px;align-items:center;padding:6px 10px;border-radius:10px;background:rgba(255,255,255,.04)}
.chat-list li.mine{background:rgba(80,120,255,.14)}
.chat-who{font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chat-text{overflow-wrap:anywhere}
.chat-list li.chat-empty{display:block;color:var(--muted,#8a90a2)}
.chat-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.chat-options label{display:flex;flex-direction:column;gap:6px;font-size:.85rem}
.chat-make{margin-top:12px}.chat-make .button{min-height:48px;min-width:160px}
.chat-job{margin-top:12px}.chat-error{color:#ff7a7a}
.chat-result{display:grid;grid-template-columns:150px minmax(0,1fr);gap:14px;margin-bottom:14px}
.chat-result video{width:100%;aspect-ratio:9/16;background:#000;border-radius:12px;object-fit:contain}
.chat-result h3{font-size:.95rem;margin:0 0 6px}
@media (max-width:800px){
  .chat-layout{grid-template-columns:minmax(0,1fr)}
  .chat-looks{grid-template-columns:minmax(0,1fr)}
  .chat-look{flex-direction:row;align-items:center;gap:10px}.chat-look i{width:46px;flex:none}
  .chat-add{grid-template-columns:minmax(0,1fr)}
  .chat-add .button{width:100%}
  .chat-options{grid-template-columns:minmax(0,1fr)}
  .chat-list li{grid-template-columns:70px minmax(0,1fr) 44px}
  .chat-list li .icon-button{min-width:44px;min-height:44px}
  .chat-make .button{width:100%}
  .chat-result{grid-template-columns:110px minmax(0,1fr)}
}

/* Chat: vùng chạm tối thiểu 44px */
#view-chat #chatSample,#view-chat #chatClear,#view-chat #chatImport,#view-chat .chat-paste summary{min-height:44px;display:inline-flex;align-items:center}
#view-chat .chat-chip{min-height:44px}
.top-actions {
  position: relative;
  display: flex;
  align-items: center;
}
.bell-button {
  position: relative;
}
.bell-button i {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}
.note-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 900;
  width: 360px;
  max-width: calc(100vw - 32px);
  max-height: 70vh;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--control);
  border-radius: 12px;
  box-shadow: 0 18px 40px #000a;
}
.note-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
}
.note-panel ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.note-panel li {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.6;
}
.note-panel li svg {
  width: 18px;
  height: 18px;
  flex: none;
  margin-top: 3px;
  color: var(--green);
}
.note-panel li.error svg {
  color: var(--red);
}
.note-panel li p {
  margin: 0;
  overflow-wrap: anywhere;
}
.note-panel li small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}
.note-empty {
  padding: 20px 16px;
  color: var(--muted);
  font-size: 13px;
}
.landing {
  position: fixed;
  inset: 0;
  z-index: 100;
  overflow: auto;
  padding: 0 24px 48px;
  background: var(--bg);
}
.landing[hidden] {
  display: none;
}
.login-back {
  position: fixed;
  top: 20px;
  left: 24px;
}
.tour-hole {
  position: fixed;
  z-index: 1200;
  border-radius: 10px;
  box-shadow:
    0 0 0 9999px rgb(5 3 15 / 0.66),
    0 0 0 2px #a78bfa;
  pointer-events: none;
  transition: all 0.2s;
}
.tour-card {
  position: fixed;
  z-index: 1201;
  padding: 18px;
  border: 1px solid var(--control);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 20px 48px #000a;
}
.tour-card small {
  color: var(--muted);
  font-size: 12px;
}
.tour-card h3 {
  margin: 6px 0;
  font-size: 16px;
}
.tour-card p {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}
.tour-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.wz-shot {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

/* KQ-20261202-022: logo đầy đủ (biểu tượng + tên) ở thanh bên */
.brand-lockup { width: 159px; height: auto; max-width: 100%; display: block; }
