:root {
  color-scheme: dark;
  --ink: #f8f4ff;
  --muted: #b9aacd;
  --panel: rgba(24, 18, 42, 0.78);
  --panel-strong: rgba(35, 24, 60, 0.92);
  --line: rgba(255, 255, 255, 0.14);
  --blue: #335fff;
  --electric-blue: #74d8ff;
  --electric-blue-strong: #9ee7ff;
  --pink: #ff5fad;
  --violet: #9f5cff;
  --gold: #e6bf5b;
  --green: #64f2d2;
  font-family:
    "IBM Plex Mono", "Recursive Mono", "Azeret Mono", "SFMono-Regular", "Roboto Mono", monospace;
}

@font-face {
  font-family: "TikTok Sans Semibold";
  src: url("assets/fonts/TikTok_Sans/static/TikTokSans-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: "Lato";
  src: url("assets/fonts/Lato/Lato-Bold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: "Crimson Text";
  src: url("assets/fonts/Crimson_Text/CrimsonText-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: "Merriweather";
  src: url("assets/fonts/Merriweather/static/Merriweather_24pt-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: block;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--gold);
  background:
    radial-gradient(circle at 16% 12%, rgba(255, 95, 173, 0.26), transparent 28rem),
    radial-gradient(circle at 78% 6%, rgba(51, 95, 255, 0.28), transparent 32rem),
    linear-gradient(145deg, #110b1d 0%, #211637 46%, #0f1733 100%);
}

button,
input {
  font: inherit;
}

.shell {
  width: min(1380px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0;
}

.workspace {
  min-height: calc(100vh - 56px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0;
}

.masthead-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex: 0 0 auto;
}

.account-menu-nav {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.account-menu-email {
  max-width: 220px;
  overflow: hidden;
  color: rgba(240, 236, 230, 0.72);
  font-size: 0.88rem;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-menu-button {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  align-content: center;
  gap: 3px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: var(--ink);
  background: rgba(107, 74, 173, 0.28);
  cursor: pointer;
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.account-menu-button[hidden] {
  display: none;
}

.account-menu-button:hover,
.account-menu-button:focus-visible {
  border-color: rgba(140, 104, 214, 0.48);
  background: rgba(122, 86, 196, 0.36);
  transform: translateY(-1px);
  outline: none;
}

.account-menu-button span {
  width: 17px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.brand-home-nav {
  position: relative;
  flex: 0 0 auto;
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 0 0 auto;
}

.brand-mark h1[hidden] {
  display: none;
}

.brand-menu {
  position: absolute;
  z-index: 10;
  top: calc(100% + 10px);
  left: 0;
  width: min(320px, calc(100vw - 32px));
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(19, 13, 34, 0.96);
  backdrop-filter: blur(18px);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
}

.brand-menu[hidden] {
  display: none;
}

.brand-menu.account-menu {
  top: calc(100% + 10px);
  left: 50%;
  right: auto;
  width: max-content;
  min-width: 126px;
  max-width: 180px;
  padding: 6px;
  transform: translateX(-82%);
}

.brand-menu.account-menu button {
  min-height: 38px;
  padding: 8px 12px;
  white-space: nowrap;
}

.brand-menu a {
  position: relative;
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
  transition:
    border-color 0.16s ease,
    background 0.16s ease,
    color 0.16s ease;
}

.brand-menu button {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--ink);
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    border-color 0.16s ease,
    background 0.16s ease,
    color 0.16s ease;
}

.brand-menu a:hover,
.brand-menu button:hover {
  border-color: rgba(100, 242, 210, 0.32);
  background: rgba(100, 242, 210, 0.1);
}

.home-menu a[aria-current="page"] {
  padding-left: 18px;
  border-color: transparent;
  background: rgba(255, 255, 255, 0.035);
  color: var(--ink);
}

.home-menu a[aria-current="page"]:hover {
  border-color: rgba(100, 242, 210, 0.32);
  background: rgba(100, 242, 210, 0.1);
}

.home-menu a[aria-current="page"]::before {
  content: "";
  position: absolute;
  inset: 10px auto 10px 6px;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(174, 125, 255, 0.88), rgba(119, 88, 219, 0.62));
}

.home-menu a span {
  font-weight: 560;
}

.home-menu a small {
  color: var(--muted);
  line-height: 1.35;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: flex-start;
  text-align: left;
  flex: 1 1 auto;
  min-width: 0;
}

.brand-home-button {
  min-height: 0;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  background: rgba(24, 18, 42, 0.6);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.32);
  transition:
    border-color 0.16s ease,
    transform 0.16s ease,
    background 0.16s ease;
}

.brand-home-button:hover {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

.brand-home-button:focus,
.brand-home-button:focus-visible {
  outline: none;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.32);
}

@keyframes brand-logo-press {
  0% { transform: translateY(0); }
  35% { transform: translateY(1px) scale(0.97); }
  100% { transform: translateY(0); }
}

.brand-home-button img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 9px;
}

.header-action {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.header-action:hover {
  transform: translateY(-1px);
}

.login-action-button {
  background: rgba(107, 74, 173, 0.28);
  border-color: rgba(140, 104, 214, 0.3);
  color: rgba(240, 236, 230, 0.92);
}

.login-action-button:hover {
  background: rgba(122, 86, 196, 0.34);
}

.signup-action-button {
  background: rgba(226, 240, 255, 0.9);
  color: #24183e;
  border-color: rgba(255, 255, 255, 0.65);
  box-shadow: 0 12px 32px rgba(181, 210, 255, 0.2);
}

.signup-action-button:hover {
  background: rgba(240, 247, 255, 0.96);
}

.subtle-action-button {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
  color: var(--ink);
}

.utility-help-panel {
  display: grid;
  gap: 10px;
  margin-top: 6px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.utility-help-panel[hidden],
.utility-menu-status[hidden] {
  display: none;
}

.utility-help-title,
.utility-help-footer,
.utility-menu-status {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.utility-help-title {
  color: var(--ink);
  font-weight: 600;
}

.utility-help-list {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
  line-height: 1.5;
}

.utility-menu-status {
  margin-top: 8px;
  padding: 0 2px;
}

.page-help[hidden],
.page-help-popover[hidden] {
  display: none;
}

.page-help-button {
  min-height: 0;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(100, 242, 210, 0.28);
  border-radius: 50%;
  color: var(--green);
  background: rgba(100, 242, 210, 0.08);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
}

.page-help-button:hover,
.page-help-button[aria-expanded="true"] {
  color: var(--ink);
  border-color: rgba(100, 242, 210, 0.46);
  background: rgba(100, 242, 210, 0.14);
}

.page-help-popover {
  position: absolute;
  z-index: 20;
  top: calc(100% + 10px);
  right: 0;
  width: min(330px, calc(100vw - 32px));
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(19, 13, 34, 0.97);
  backdrop-filter: blur(18px);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
}

.page-help-popover p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.page-help-popover p:first-child {
  color: var(--ink);
}

.page-help-popover ol {
  margin: 10px 0;
  padding-left: 1.25rem;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.page-help-popover li + li {
  margin-top: 4px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--green);
  font-size: 0.76rem;
  font-weight: 520;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 1.15rem;
  line-height: 1;
  font-weight: 560;
  max-width: 260px;
}

h2 {
  font-size: 1.15rem;
  font-weight: 560;
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
  gap: 16px;
  align-items: start;
}

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

.home-page,
.settings-page {
  display: grid;
  gap: 16px;
}

.home-page {
  padding-top: 18px;
  gap: 40px;
}

.home-intro {
  display: grid;
  gap: 8px;
  max-width: 900px;
  justify-items: center;
  margin: 0 auto;
  text-align: center;
}

.settings-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at top left, rgba(116, 216, 255, 0.18), transparent 28rem),
    radial-gradient(circle at 82% 20%, rgba(255, 95, 173, 0.16), transparent 22rem),
    linear-gradient(160deg, rgba(27, 18, 48, 0.96), rgba(18, 28, 56, 0.92));
}

.settings-hero::after {
  content: "";
  position: absolute;
  inset: auto -8% -34% auto;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(159, 92, 255, 0.2), transparent 70%);
  pointer-events: none;
}

.home-copy,
.section-copy {
  margin: 0;
  max-width: 760px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.home-copy {
  max-width: 900px;
  color: var(--ink);
  font-size: clamp(2.6rem, 7vw, 4.9rem);
  line-height: 0.95;
  font-weight: 700;
  letter-spacing: -0.05em;
  text-wrap: balance;
}

.home-subcopy {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.45;
}

.home-heading {
  margin-bottom: 0;
}

.tool-directory,
.settings-grid {
  display: grid;
  gap: 16px;
}

.tool-directory {
  justify-items: center;
  padding-top: 10px;
}

.video-spotlight {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(320px, 1.2fr);
  gap: 22px;
  width: min(100%, 760px);
  margin: 0 auto;
  align-items: center;
  padding: 28px 24px;
  background:
    radial-gradient(circle at top left, rgba(255, 95, 173, 0.14), transparent 18rem),
    radial-gradient(circle at top right, rgba(116, 216, 255, 0.12), transparent 18rem),
    rgba(24, 18, 42, 0.82);
}

.video-spotlight-copy {
  display: grid;
  gap: 14px;
}

.video-spotlight-kicker {
  margin: 0;
  color: var(--green);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.video-spotlight-copy h2 {
  margin: 0;
}

.video-spotlight-text {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.video-spotlight-embed {
  position: relative;
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(9, 8, 16, 0.52);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.video-spotlight-embed::before {
  content: "";
  display: block;
  padding-top: 56.25%;
}

.video-spotlight-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.tool-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 240px));
  justify-content: center;
  gap: 28px 24px;
  width: min(100%, 860px);
}

.tool-card,
.settings-card {
  position: relative;
  overflow: hidden;
}

.tool-card::before,
.settings-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, rgba(116, 216, 255, 0.75), rgba(255, 95, 173, 0.4), transparent);
}

.tool-card {
  display: grid;
  grid-template-rows: minmax(72px, auto) 1fr;
  gap: 18px;
  min-height: 260px;
  justify-items: center;
  text-align: center;
  cursor: pointer;
  background:
    radial-gradient(circle at top right, rgba(51, 95, 255, 0.12), transparent 13rem),
    rgba(24, 18, 42, 0.82);
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    background 0.16s ease,
    box-shadow 0.16s ease;
}

.tool-card:hover {
  transform: translateY(-2px);
  border-color: rgba(116, 216, 255, 0.34);
  background:
    radial-gradient(circle at top right, rgba(116, 216, 255, 0.18), transparent 13rem),
    radial-gradient(circle at top left, rgba(255, 95, 173, 0.12), transparent 16rem),
    rgba(29, 21, 50, 0.9);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.22);
}

.tool-card:focus,
.tool-card:focus-visible {
  outline: none;
  border-color: rgba(116, 216, 255, 0.4);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(116, 216, 255, 0.26);
}

.settings-label {
  margin: 0;
  color: var(--green);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tool-card h3,
.settings-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1.18rem;
  font-weight: 600;
}

.tool-card h3 {
  display: grid;
  align-items: center;
  min-height: 72px;
}

.tool-card p,
.account-status-block p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.ghost-action {
  min-height: 38px;
  width: fit-content;
  padding: 0 14px;
  border: 1px solid rgba(116, 216, 255, 0.3);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(116, 216, 255, 0.08);
  cursor: pointer;
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    background 0.16s ease;
}

.ghost-action:hover {
  transform: translateY(-1px);
  border-color: rgba(116, 216, 255, 0.48);
  background: rgba(116, 216, 255, 0.14);
}

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

.settings-card {
  display: grid;
  gap: 18px;
  align-content: start;
  min-height: 100%;
}

.settings-card.wide {
  grid-column: 1 / -1;
}

.login-page {
  display: grid;
  justify-items: center;
}

.login-shell {
  width: min(100%, 520px);
}

.login-card {
  width: 100%;
}

.profiles-card {
  border-color: rgba(230, 191, 91, 0.18);
  box-shadow: inset 0 0 0 1px rgba(230, 191, 91, 0.08);
}

.account-page {
  width: min(100%, 980px);
  margin: 0 auto;
}

.settings-card-wide {
  grid-column: 1 / -1;
}

.account-tier-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.account-current-card {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding: 16px 18px;
}

.account-current-card span {
  color: var(--muted);
}

.account-current-card strong {
  color: var(--gold);
}

.billing-toggle {
  display: inline-flex;
  gap: 6px;
  margin-bottom: 16px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(7, 6, 14, 0.28);
}

.billing-toggle-button {
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.billing-toggle-button.is-active {
  color: #24183e;
  background: rgba(226, 240, 255, 0.92);
}

.account-tier-card {
  position: relative;
  display: grid;
  align-content: start;
  gap: 20px;
  min-height: 330px;
  padding: 28px;
}

.account-tier-card.is-current-plan {
  border-color: rgba(226, 240, 255, 0.52);
  box-shadow:
    inset 0 0 0 1px rgba(226, 240, 255, 0.18),
    0 18px 80px rgba(28, 32, 96, 0.18);
}

.plan-current-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  color: #201538;
  background: rgba(226, 240, 255, 0.96);
  font-size: 0.82rem;
  font-weight: 700;
}

.upgrade-account-button {
  min-height: 44px;
  margin-top: 4px;
  border: 1px solid rgba(100, 242, 210, 0.4);
  border-radius: 999px;
  color: #0e1523;
  background: var(--green);
  font: inherit;
  cursor: pointer;
  box-shadow: 0 14px 36px rgba(100, 242, 210, 0.16);
}

.upgrade-account-button:hover {
  transform: translateY(-1px);
}

.premium-tier-card {
  border-color: rgba(100, 242, 210, 0.24);
  box-shadow:
    inset 0 0 0 1px rgba(100, 242, 210, 0.1),
    0 18px 80px rgba(100, 242, 210, 0.08);
}

.account-tier-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.account-tier-header h2 {
  margin: 0;
  color: var(--gold);
}

.account-tier-header span {
  color: var(--muted);
  font-weight: 650;
}

.premium-price-stack {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.premium-price-standard {
  color: rgba(240, 236, 230, 0.46);
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
}

.premium-price-live {
  color: var(--ink);
  font-weight: 750;
}

.premium-discount-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  color: #0d1e17;
  background: rgba(100, 242, 210, 0.94);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.account-tier-card ul {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.account-tier-card li {
  position: relative;
  padding-left: 22px;
  color: var(--ink);
  line-height: 1.45;
}

.account-tier-card li::before {
  content: "";
  position: absolute;
  top: 0.7em;
  left: 0;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--green);
  transform: translateY(-50%);
}

.account-plan-badge {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(230, 191, 91, 0.35);
  background: rgba(230, 191, 91, 0.12);
  color: var(--gold);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.settings-card-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
}

.settings-chip {
  align-self: start;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.78rem;
}

.settings-chip.accent {
  background: rgba(230, 191, 91, 0.14);
  color: var(--gold);
}

.settings-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.settings-stat-grid.single-column {
  grid-template-columns: 1fr;
}

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

.settings-stat {
  display: grid;
  gap: 5px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(7, 6, 14, 0.28);
}

.settings-stat span,
.profile-row span {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.settings-stat strong,
.profile-row strong {
  color: var(--ink);
  font-weight: 600;
}

.settings-stat.single-span {
  grid-column: 1 / -1;
}

.profile-list {
  display: grid;
  gap: 10px;
}

.profile-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(7, 6, 14, 0.28);
}

.profile-row > div {
  display: grid;
  gap: 4px;
}

.profile-row.muted {
  border-style: dashed;
}

.profile-row-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.settings-form {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.settings-form-group {
  display: grid;
  gap: 10px;
}

.settings-form-group h4 {
  margin: 0;
  color: var(--ink);
  font-size: 0.95rem;
}

.settings-input-row {
  display: grid;
  gap: 6px;
}

.settings-input-row span {
  color: var(--muted);
  font-size: 0.85rem;
}

.settings-input-row input,
.settings-input-row select {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(7, 6, 14, 0.32);
  color: var(--ink);
  font: inherit;
}

.settings-input-row input[readonly],
.settings-input-row input:disabled {
  color: rgba(240, 236, 230, 0.58);
  border-color: rgba(255, 255, 255, 0.06);
  background: rgba(7, 6, 14, 0.2);
  cursor: default;
  opacity: 1;
  pointer-events: none;
}

.settings-input-row input::placeholder {
  color: rgba(240, 236, 230, 0.35);
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.settings-actions.inline-actions {
  justify-content: flex-end;
}

.settings-note {
  min-height: 1.2em;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.account-detail-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.account-detail-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(7, 6, 14, 0.28);
}

.account-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.account-detail-label {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.account-detail-value {
  color: var(--ink);
  font-size: 1.02rem;
  font-weight: 600;
  word-break: break-word;
}

.account-inline-note {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.password-mask {
  letter-spacing: 0.08em;
}

.icon-edit-button {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(141, 198, 255, 0.4);
  background: rgba(11, 16, 42, 0.4);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 140ms ease, transform 140ms ease, background 140ms ease;
}

.icon-edit-button:hover,
.icon-edit-button:focus-visible {
  border-color: rgba(141, 198, 255, 0.9);
  background: rgba(20, 28, 60, 0.62);
  transform: translateY(-1px);
}

.icon-edit-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.icon-edit-button span {
  font-size: 0.95rem;
  line-height: 1;
}

.account-inline-editor {
  display: grid;
  gap: 10px;
}

.account-inline-editor[hidden] {
  display: none;
}

.subtle-action {
  opacity: 0.78;
}

.toggle-row.compact {
  margin-top: 2px;
}

.feature-gate-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
  color: var(--gold);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.premium-disabled {
  opacity: 0.56;
}

.ghost-action {
  background: rgba(255, 255, 255, 0.05);
}

.brand-menu-action.is-disabled,
.brand-menu-action:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.tool-save-profile {
  width: auto;
  margin-top: 0;
}

.icon-save-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(240, 236, 230, 0.7);
  cursor: pointer;
}

.icon-save-button:hover,
.icon-save-button:focus-visible {
  color: rgba(240, 236, 230, 0.95);
  outline: none;
}

.icon-save-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tool-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.captions-page {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(360px, 1.25fr) minmax(260px, 0.8fr);
  gap: 16px;
  align-items: start;
}

.captions-panel {
  display: grid;
  gap: 10px;
  min-width: 0;
  min-height: 430px;
  background: var(--panel-strong);
}

.captions-dropzone {
  min-height: 112px;
  padding-block: 14px;
}

.caption-tools {
  position: sticky;
  top: 18px;
  display: grid;
  min-width: 0;
}

.caption-preview-column {
  position: sticky;
  top: 18px;
  display: grid;
  min-width: 0;
}

.caption-preview-column .render-panel {
  grid-template-rows: auto auto;
  align-items: start;
  min-width: 0;
}

.caption-preview {
  position: relative;
  display: grid;
  gap: 10px;
  width: min(100%, var(--caption-preview-width, 520px));
  max-width: 100%;
  color: var(--muted);
  background: transparent;
  align-self: start;
  justify-self: center;
  margin-top: 0;
}

.caption-preview.is-vertical {
  width: min(100%, var(--caption-preview-width, 520px));
}

.caption-preview-frame {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 8px;
  background: #000;
  cursor: pointer;
}

.caption-preview-frame.is-timecode-visible .caption-preview-timecode {
  opacity: 1;
  transform: translate(-50%, 0);
}

.caption-preview-frame:focus,
.caption-preview-frame:focus-visible {
  outline: none;
  box-shadow: none;
}

.caption-preview video {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.caption-preview-canvas {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  pointer-events: none;
}

.caption-preview-timecode {
  position: absolute;
  left: 50%;
  bottom: 12px;
  z-index: 4;
  min-width: 0;
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--ink);
  background: rgba(8, 6, 16, 0.72);
  backdrop-filter: blur(10px);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  opacity: 0;
  transform: translate(-50%, 4px);
  transition:
    opacity 0.14s ease,
    transform 0.14s ease;
  pointer-events: none;
}

.access-gate-overlay[hidden] {
  display: none;
}

.access-gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(7, 6, 14, 0.52);
  backdrop-filter: blur(6px);
}

.access-gate-message {
  width: min(100%, 360px);
  padding: 16px 18px;
  border: 1px solid rgba(116, 216, 255, 0.32);
  border-radius: 14px;
  color: var(--ink);
  background:
    radial-gradient(circle at top right, rgba(116, 216, 255, 0.12), transparent 12rem),
    rgba(24, 18, 42, 0.94);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.3);
  text-align: center;
}

.caption-preview-controls {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.caption-preview-timeline {
  display: grid;
  gap: 4px;
  padding: 6px 8px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(12, 9, 22, 0.94), rgba(18, 13, 32, 0.94));
  cursor: default;
}

.caption-preview-timeline.is-edit-hover {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M8 5v14M16 5v14' stroke='%23f8f4ff' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M5 12h5M14 12h5' stroke='%23af88ff' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M7.5 9.5 5 12l2.5 2.5M16.5 9.5 19 12l-2.5 2.5' fill='none' stroke='%23af88ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") 12 12, col-resize;
}

.caption-preview-timeline:focus,
.caption-preview-timeline:focus-visible {
  outline: none;
  box-shadow: none;
}

.caption-preview-ruler {
  position: relative;
  height: 11px;
  overflow: hidden;
}

.caption-preview-ruler-tick {
  position: absolute;
  top: 1px;
  bottom: 1px;
  width: 1px;
  background: rgba(255, 255, 255, 0.18);
}

.caption-preview-ruler-tick span {
  position: absolute;
  top: -1px;
  left: 4px;
  color: rgba(248, 244, 255, 0.54);
  font-size: 0.52rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.caption-preview-ruler-tick.is-center span {
  left: 4px;
}

.caption-preview-ruler-tick.is-left span {
  left: 4px;
}

.caption-preview-ruler-tick.is-right span {
  left: auto;
  right: 4px;
}

.caption-preview-lane {
  position: relative;
  min-height: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  overflow: hidden;
}

.caption-preview-caption-lane {
  min-height: 38px;
}

.caption-preview-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--violet);
  box-shadow: 0 0 0 1px rgba(159, 92, 255, 0.16);
  pointer-events: none;
  z-index: 3;
}

.caption-preview-segment {
  position: absolute;
  top: 6px;
  bottom: 6px;
  min-width: 8px;
  border: 0;
  border-radius: 0;
  background: rgba(122, 105, 166, 0.66);
  box-shadow: inset 0 0 0 1px rgba(208, 198, 244, 0.18);
  color: var(--ink);
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  z-index: 2;
  overflow: hidden;
  transition:
    background 0.14s ease,
    box-shadow 0.14s ease;
}

.caption-preview-segment.is-touching-prev {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.caption-preview-segment.is-touching-next {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.caption-preview-segment.is-active {
  background: rgba(133, 114, 182, 0.74);
}

.caption-preview-segment.is-selected {
  box-shadow: inset 0 0 0 2px rgba(175, 136, 255, 0.72);
}

.caption-preview-segment-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 14px;
  border: 0;
  background: transparent;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M7 5v14M17 5v14' stroke='%23f8f4ff' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M4 12h6M14 12h6' stroke='%23af88ff' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M6.5 9.5 4 12l2.5 2.5M17.5 9.5 20 12l-2.5 2.5' fill='none' stroke='%23af88ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") 12 12, col-resize;
  padding: 0;
}

.caption-preview-segment-handle::after {
  content: none;
}

.caption-preview-segment-handle[data-boundary="start"] {
  left: 0;
}

.caption-preview-segment-handle[data-boundary="end"] {
  right: 0;
}

.caption-preview-cut-marker {
  position: absolute;
  bottom: 2px;
  width: 2px;
  height: 5px;
  margin-left: -1px;
  border-radius: 999px;
  background: rgba(100, 242, 210, 0.9);
  opacity: 0.82;
  z-index: 1;
  box-shadow: 0 0 8px rgba(100, 242, 210, 0.18);
  pointer-events: none;
}

.caption-preview-selected-boundary {
  position: absolute;
  top: 3px;
  bottom: 3px;
  width: 2px;
  margin-left: -1px;
  background: rgba(245, 236, 255, 0.92);
  box-shadow:
    0 0 0 1px rgba(159, 92, 255, 0.65),
    0 0 10px rgba(159, 92, 255, 0.24);
  pointer-events: none;
  z-index: 5;
}

.caption-preview-roll-handle {
  position: absolute;
  top: 4px;
  bottom: 4px;
  width: 14px;
  margin-left: -7px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M8 5v14M16 5v14' stroke='%23f8f4ff' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M5 12h5M14 12h5' stroke='%23af88ff' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M7.5 9.5 5 12l2.5 2.5M16.5 9.5 19 12l-2.5 2.5' fill='none' stroke='%23af88ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") 12 12, col-resize;
  z-index: 4;
}

.caption-preview-roll-handle::before,
.caption-preview-roll-handle::after {
  content: none;
}

.caption-preview:not(.has-video) .caption-preview-controls {
  display: none;
}

.caption-preview.has-video #captionPreviewStatus {
  display: none;
}

.caption-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.caption-actions .secondary {
  font-size: 0.84rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.caption-subsection {
  display: grid;
  gap: 6px;
}

.caption-export-panel {
  padding: 16px;
}

.caption-export-footer {
  display: flex;
  justify-content: flex-end;
  min-height: 30px;
  margin-top: 6px;
}

.small-cancel-button {
  min-width: 0;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.78rem;
}

.small-cancel-button[hidden] {
  display: none;
}

.caption-subsection-title {
  margin: 0;
  color: var(--gold);
  font-size: 0.96rem;
  font-weight: 560;
}

.caption-progress {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(7, 6, 14, 0.24);
}

.caption-progress[hidden] {
  display: none;
}

.modal-shell[hidden] {
  display: none;
}

.modal-shell {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 2, 8, 0.68);
  backdrop-filter: blur(8px);
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 720px);
  max-height: min(78vh, 720px);
  display: grid;
  gap: 14px;
  overflow: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-header h3 {
  margin: 0;
}

.modal-close-button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.04);
  font: inherit;
  cursor: pointer;
}

.modal-profile-list {
  display: grid;
  gap: 10px;
}

.caption-progress-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  font-size: 0.82rem;
}

.caption-progress-label {
  color: var(--ink);
}

.caption-progress-header output {
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.caption-progress progress {
  display: block;
  width: 100%;
  height: 10px;
}

.caption-diagnostics {
  min-height: 1.2em;
  margin: -10px 0 0;
  color: var(--gold);
  font-size: 0.76rem;
  line-height: 1.35;
}

.caption-editor {
  position: relative;
  display: grid;
  gap: 8px;
  width: 100%;
  min-width: 0;
  font-weight: 520;
}

.caption-editor-selection {
  position: absolute;
  left: 0;
  right: 0;
  top: 12px;
  height: 0;
  border-radius: 0;
  background: rgba(159, 92, 255, 0.14);
  box-shadow: inset 0 0 0 1px rgba(159, 92, 255, 0.28);
  opacity: 0;
  pointer-events: none;
  z-index: 3;
  transition: opacity 0.12s ease;
}

.caption-editor.has-selection .caption-editor-selection {
  opacity: 1;
}

.caption-editor textarea {
  position: relative;
  width: 100%;
  max-width: 100%;
  height: min(56vh, 680px);
  min-height: 360px;
  overflow: auto;
  resize: none;
  scrollbar-gutter: stable;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(7, 6, 14, 0.4);
  padding: 12px;
  font: inherit;
  line-height: 1.5;
  z-index: 2;
}

.caption-editor textarea:focus,
.caption-editor textarea:focus-visible {
  outline: none;
  box-shadow: none;
}

.caption-settings {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.caption-row {
  display: grid;
  gap: 12px;
  align-items: end;
  min-width: 0;
}

.caption-row-font {
  grid-template-columns: minmax(0, 1.55fr) minmax(112px, 0.5fr);
  gap: 12px;
}

.caption-row-position-size-paragraph {
  display: grid;
  grid-template-columns: minmax(64px, auto) minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.caption-row-paragraph-metrics {
  display: grid;
  grid-template-columns: minmax(120px, 0.95fr) minmax(0, 0.9fr);
  gap: 12px;
  align-items: start;
}

.caption-paragraph-control {
  display: grid;
  gap: 8px;
  font-weight: 520;
}

.caption-metric-stack {
  display: grid;
  gap: 10px;
  align-content: start;
  padding-top: 1px;
}

.caption-row-position-size-paragraph > * > span,
.caption-row-position-size-paragraph .control-label label {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
}

.caption-settings select {
  width: 100%;
  min-height: 42px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23f8f4ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right 16px center / 18px 18px no-repeat,
    rgba(7, 6, 14, 0.4);
  padding: 10px 44px 10px 10px;
  font: inherit;
  appearance: none;
}

.caption-select-control,
.caption-settings input[type="color"] {
  display: grid;
  gap: 8px;
  font-weight: 520;
  min-width: 0;
}

.caption-settings input[type="color"] {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(7, 6, 14, 0.4);
  padding: 6px;
}

.caption-select-control.compact select {
  min-width: 0;
  width: 100%;
}

.caption-color-control,
.caption-slider-control {
  display: grid;
  gap: 8px;
  font-weight: 520;
  min-width: 0;
}

.caption-slider-control input[type="range"] {
  width: 100%;
}

.caption-point-control {
  display: grid;
  gap: 6px;
  font-weight: 520;
  min-width: 0;
}

.caption-position-inline {
  display: flex;
  align-items: center;
  gap: 1px;
  flex-wrap: wrap;
}

.caption-position-comma {
  color: var(--gold);
}

.caption-position-value {
  display: inline-flex;
  align-items: center;
}

.caption-effect-row {
  grid-template-columns: minmax(104px, auto) 42px minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 4px;
}

.caption-effect-toggle {
  min-height: 42px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  font-weight: 520;
}

.caption-effect-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--pink);
}

.caption-color-control.compact {
  width: 42px;
  justify-self: start;
}

.caption-color-control.bare-color {
  align-items: center;
  justify-self: start;
  margin-left: -4px;
}

.caption-color-control.bare-color span {
  display: none;
}

.bare-slider-control {
  align-self: center;
  gap: 0;
}

.bare-slider-control input[type="range"] {
  align-self: center;
}

.caption-slider-control.compact {
  min-width: 0;
}

.caption-value-row.two-up {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.caption-value-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(7, 6, 14, 0.26);
  font-weight: 520;
}

.caption-value-control.compact {
  min-width: 132px;
}

.caption-plain-control {
  display: inline-grid;
  grid-template-columns: auto auto;
  align-items: center;
  justify-content: flex-start;
  column-gap: 6px;
  min-height: 32px;
  font-weight: 520;
  min-width: 0;
}

.caption-plain-control.compact {
  min-width: 146px;
}

.caption-box-row {
  grid-template-columns: 1fr;
  align-items: center;
  column-gap: 10px;
}

.caption-box-field {
  display: grid;
  gap: 8px;
  font-weight: 520;
  min-width: 0;
}

.caption-box-field-label {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
}

.caption-segmented-control {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-width: 0;
  width: 100%;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(7, 6, 14, 0.34);
}

.caption-segment {
  position: relative;
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
  transition:
    background 0.16s ease,
    color 0.16s ease,
    transform 0.16s ease;
}

.caption-segment.is-active {
  background: linear-gradient(135deg, rgba(255, 213, 122, 0.18), rgba(100, 242, 210, 0.16));
  box-shadow: inset 0 0 0 1px rgba(159, 92, 255, 0.22);
  color: var(--ink);
}

.caption-segment:hover {
  background: linear-gradient(135deg, rgba(255, 213, 122, 0.18), rgba(100, 242, 210, 0.16));
  color: var(--ink);
}

.paragraph-control {
  min-width: 0;
}

.caption-box-toggle {
  min-width: 0;
  width: 100%;
  padding: 3px;
}

.paragraph-segment {
  padding: 0 8px;
}

.paragraph-lines {
  display: grid;
  gap: 4px;
  width: 22px;
  margin: 0 auto;
}

.paragraph-lines span {
  display: block;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.paragraph-lines span:nth-child(1) { width: 100%; }
.paragraph-lines span:nth-child(2) { width: 78%; }
.paragraph-lines span:nth-child(3) { width: 92%; }

.paragraph-lines.left {
  justify-items: start;
}

.paragraph-lines.center {
  justify-items: center;
}

.paragraph-lines.right {
  justify-items: end;
}

.visually-hidden-slider {
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
  min-width: 1px;
  max-width: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
}

.inline-value-input {
  width: 3.6ch;
  min-height: 28px;
  color: var(--electric-blue);
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  font-size: 0.84rem;
  text-align: right;
  appearance: textfield;
  -moz-appearance: textfield;
  user-select: none;
}

.inline-value-input:focus,
.inline-value-input:focus-visible {
  outline: none;
  box-shadow: none;
  border-color: transparent;
}

.inline-value-input[readonly] {
  cursor: ew-resize;
}

.inline-value-link {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: color 0.16s ease, text-decoration-color 0.16s ease;
}

.inline-value-link[readonly]:hover {
  color: var(--electric-blue-strong);
  text-decoration-color: currentColor;
}

.inline-value-input:not([readonly]) {
  color: var(--green);
  width: 3.6ch;
  min-height: 32px;
  padding: 0;
  text-align: right;
  border-radius: 0;
  background: transparent;
  outline: none;
}

.caption-position-value .inline-value-input {
  width: 4.8ch;
}

.caption-position-value .inline-value-input:not([readonly]) {
  width: 4.8ch;
}

#captionPositionYValue {
  text-align: left;
}

#captionLengthValue {
  width: 6.6ch;
}

#captionLengthValue:not([readonly]) {
  width: 6.6ch;
}

.caption-value-row.two-up {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  align-items: center;
  column-gap: 16px;
}

.roundness-control {
  align-self: center;
}

.compact-size-control input[type="range"] {
  max-width: 154px;
}

.compact-size-control {
  margin-left: -4px;
}

.compact-size-control .control-label {
  justify-content: flex-start;
  gap: 6px;
}

.compact-size-control .inline-value-input {
  width: 3.6ch;
}

.compact-size-control .inline-value-input:not([readonly]) {
  width: 3.6ch;
}

.effect-value-input {
  width: 3.6ch;
  align-self: center;
  text-align: right;
  font-weight: 700;
  color: var(--electric-blue);
}

.effect-value-input.inline-value-link[readonly]:hover {
  color: var(--electric-blue-strong);
}

.text-box-detail-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  gap: 8px 16px;
}

.text-box-detail-row[hidden] {
  display: none;
}

.text-box-detail-control {
  min-width: fit-content;
  justify-self: start;
}

.text-box-detail-control.caption-plain-control {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.padding-detail-control.is-flashing {
  animation: padding-setting-flash 700ms ease-out;
}

@keyframes padding-setting-flash {
  0% {
    color: var(--ink);
    text-shadow: 0 0 0 rgba(116, 216, 255, 0);
  }
  35% {
    color: var(--electric-blue-strong);
    text-shadow: 0 0 16px rgba(116, 216, 255, 0.68);
  }
  100% {
    color: inherit;
    text-shadow: 0 0 0 rgba(116, 216, 255, 0);
  }
}

.inline-help-popover {
  position: absolute;
  z-index: 30;
  left: 0;
  top: calc(100% + 10px);
  width: min(260px, calc(100vw - 48px));
  max-width: 260px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(19, 13, 34, 0.97);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.34);
  font-size: 0.74rem;
  font-weight: 520;
  line-height: 1.45;
  white-space: normal;
  text-wrap: pretty;
}

.inline-help-popover[hidden] {
  display: none;
}

.text-box-color-control {
  align-self: center;
  margin-right: -4px;
}

.text-box-detail-control span {
  white-space: nowrap;
}

.text-box-detail-control .inline-value-input {
  width: 3.6ch;
}

.text-box-detail-control .inline-value-input:not([readonly]) {
  width: 3.6ch;
}

.text-box-detail-row.is-disabled {
  opacity: 0.45;
}

.text-box-detail-row.is-disabled .inline-value-input,
.text-box-detail-row.is-disabled .caption-plain-control {
  cursor: default;
}

.text-box-detail-row.is-disabled .inline-value-link {
  text-decoration-color: rgba(255, 255, 255, 0.15);
}

.text-box-detail-row.is-disabled .inline-value-input[disabled] {
  color: var(--muted);
}

.text-box-detail-row.is-disabled label {
  pointer-events: none;
}

.inline-value-input::-webkit-outer-spin-button,
.inline-value-input::-webkit-inner-spin-button {
  margin: 0;
  appearance: none;
}

.panel,
.render-panel {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(18px);
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25);
}

.panel {
  padding: 18px;
}

.source-panel {
  grid-column: 1;
  min-height: 430px;
}

.right-rail {
  grid-column: 2;
  position: sticky;
  top: 18px;
  display: grid;
  gap: 14px;
  align-content: start;
}

.output-location {
  margin: -6px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.rail-audio {
  display: grid;
  gap: 8px;
}

.rail-audio p {
  margin: 0;
}

.music-panel {
  margin-bottom: 14px;
}

.render-panel {
  grid-column: auto;
  display: grid;
  gap: 14px;
  align-items: center;
  padding: 18px;
  background: var(--panel-strong);
}

.right-rail > .generate {
  order: 3;
}

.right-rail > .output-location {
  order: 4;
  margin-top: -8px;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}

.settings-menu {
  border: 1px solid var(--line);
  background: rgba(24, 18, 42, 0.66);
  backdrop-filter: blur(18px);
  border-radius: 8px;
  box-shadow: 0 18px 58px rgba(0, 0, 0, 0.2);
}

.settings-menu summary {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 16px;
  cursor: pointer;
  list-style: none;
  transition:
    background 0.16s ease,
    color 0.16s ease;
}

.settings-menu summary::-webkit-details-marker {
  display: none;
}

.settings-menu summary::after {
  content: "+";
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--green);
  font-size: 1.2rem;
  font-weight: 560;
}

.settings-menu[open] summary::after {
  content: "-";
}

.settings-menu[open] summary {
  background: rgba(255, 213, 122, 0.12);
  color: var(--gold);
}

.settings-menu summary span {
  font-weight: 560;
}

.settings-menu summary small {
  margin-left: auto;
  color: var(--muted);
}

.settings-drawer {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  padding: 0 16px 16px;
}

.settings-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 12px;
  margin-bottom: -8px;
}

.settings-toolbar-actions {
  justify-content: flex-end;
}

.settings-toolbar[hidden] {
  display: none;
}

.settings-load-control {
  display: grid;
  gap: 8px;
  width: min(100%, 440px);
  color: var(--gold);
  font-size: 0.94rem;
  font-weight: 560;
}

.settings-load-control select {
  width: 100%;
  min-height: 42px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23f8f4ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right 16px center / 18px 18px no-repeat,
    rgba(7, 6, 14, 0.4);
  padding: 10px 44px 10px 10px;
  font: inherit;
  appearance: none;
}

.settings-toolbar-note {
  margin-top: -6px;
}

.tool-settings-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.icon-action-button {
  position: relative;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(240, 236, 230, 0.78);
  cursor: pointer;
}

.icon-action-button svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-action-button:hover,
.icon-action-button:focus-visible {
  color: rgba(255, 255, 255, 0.98);
  outline: none;
}

.icon-action-button::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  padding: 6px 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(10, 7, 18, 0.96);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.28);
  font-size: 0.78rem;
  line-height: 1.1;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.icon-action-button:hover::after,
.icon-action-button:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.settings-section {
  display: grid;
  align-content: start;
  gap: 16px;
  min-width: 0;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.dropzone {
  min-height: 132px;
  border: 1px dashed rgba(255, 255, 255, 0.34);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 7px;
  padding: 18px;
  border-radius: 8px;
  cursor: pointer;
  background: rgba(10, 7, 18, 0.24);
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    transform 0.2s ease;
}

.dropzone:hover {
  border-color: var(--pink);
  background: rgba(255, 95, 173, 0.09);
  transform: translateY(-1px);
}

.dropzone input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.drop-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: #0b1024;
  background: linear-gradient(135deg, var(--green), var(--pink));
  font-size: 2rem;
  font-weight: 560;
}

.drop-title {
  font-size: 1.12rem;
  font-weight: 560;
}

.drop-copy,
.muted {
  color: var(--muted);
}

.drop-copy {
  text-align: center;
  max-width: 420px;
  line-height: 1.45;
}

.captions-dropzone .drop-copy {
  max-width: 100%;
  font-size: 0.82rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.photo-strip {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.trash-drop {
  display: none;
  place-items: center;
  min-height: 62px;
  margin-top: 14px;
  border: 1px dashed rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(7, 6, 14, 0.24);
  transition:
    border-color 0.16s ease,
    background 0.16s ease,
    color 0.16s ease;
}

.trash-drop.is-visible {
  display: grid;
}

.trash-drop.is-drag-over {
  border-color: var(--pink);
  color: var(--pink);
  background: rgba(255, 95, 173, 0.12);
}

.trash-drop svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.photo-card {
  position: relative;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(7, 6, 14, 0.34);
  cursor: grab;
  overflow: hidden;
  transition:
    border-color 0.16s ease,
    opacity 0.16s ease,
    transform 0.16s ease;
}

.photo-card:active {
  cursor: grabbing;
}

.photo-card.is-dragging {
  opacity: 0.48;
  transform: scale(0.96);
}

.photo-card.is-drop-target {
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(100, 242, 210, 0.24);
}

.thumb {
  aspect-ratio: 1;
  width: 100%;
  display: block;
  object-fit: cover;
}

.photo-order {
  position: absolute;
  top: 7px;
  left: 7px;
  display: grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  padding: 0 7px;
  border-radius: 999px;
  color: #080612;
  background: linear-gradient(135deg, var(--gold), var(--green));
  font-size: 0.78rem;
  font-weight: 560;
}

.photo-name {
  display: block;
  min-height: 34px;
  padding: 7px 8px 8px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.control {
  display: grid;
  gap: 10px;
}

.control-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-weight: 520;
}

output {
  color: var(--gold);
}

input[type="range"] {
  accent-color: var(--pink);
  width: 100%;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(7, 6, 14, 0.24);
}

.toggle-row span {
  display: grid;
  gap: 3px;
}

.toggle-row small {
  color: var(--muted);
  line-height: 1.35;
}

.toggle-row input {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  accent-color: var(--pink);
}

.loop-controls {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(7, 6, 14, 0.24);
}

.loop-controls[hidden] {
  display: none;
}

.loop-duration {
  margin: 0;
  color: var(--gold);
  font-size: 0.82rem;
}

.transition-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.transition-group legend {
  padding: 0 8px;
  color: var(--muted);
  font-weight: 520;
}

.transition-group label {
  display: flex;
  gap: 8px;
  align-items: center;
}

input[type="radio"] {
  accent-color: var(--pink);
}

.file-row {
  display: grid;
  gap: 8px;
  font-weight: 520;
}

.file-row input[type="file"],
.file-row input[type="text"] {
  width: 100%;
  min-height: 42px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(7, 6, 14, 0.4);
  padding: 10px;
}

.file-row input[type="file"]::file-selector-button {
  margin-right: 14px;
}

.directory-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  font-weight: 560;
}

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

.secondary {
  padding: 0 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.09);
}

.generate {
  padding: 0 22px;
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--violet) 52%, var(--pink));
  box-shadow: 0 14px 36px rgba(159, 92, 255, 0.28);
  width: 100%;
}

.render-actions {
  display: flex;
  gap: 10px;
  justify-content: stretch;
  flex-wrap: wrap;
}

.render-actions button {
  width: 100%;
}

#statusText {
  margin: 8px 0 0;
  color: var(--muted);
}

.live-preview {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(5, 3, 10, 0.62);
}

.live-preview.is-vertical {
  aspect-ratio: 9 / 16;
  max-height: 520px;
  width: min(100%, 300px);
  justify-self: center;
}

.preview-status {
  z-index: 1;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
  padding: 14px;
}

.live-preview.has-video .preview-status {
  display: none;
}

.live-preview video {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border: 0;
  border-radius: 0;
}

progress {
  grid-column: 1 / -1;
  display: none;
  width: 100%;
  height: 12px;
  accent-color: var(--pink);
}

progress.is-visible {
  display: block;
}

video {
  display: none;
  width: 100%;
  max-height: 520px;
  border-radius: 8px;
  background: #05030a;
  border: 1px solid var(--line);
}

@media (max-width: 820px) {
  .grid,
  .captions-page,
  .settings-grid,
  .account-tier-grid,
  .tool-card-grid,
  .video-spotlight {
    grid-template-columns: 1fr;
  }

  .masthead {
    align-items: flex-start;
    flex-direction: column;
  }

  .masthead-actions,
  .brand {
    width: 100%;
  }

  .masthead-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .source-panel,
  .right-rail,
  .caption-preview-column,
  .caption-tools {
    grid-column: 1;
  }

  .caption-actions {
    grid-template-columns: 1fr;
  }

  .caption-row-font,
  .caption-row-paragraph-metrics,
  .caption-row-position-size-paragraph,
  .caption-effect-row,
  .caption-box-row,
  .caption-value-row.two-up {
    grid-template-columns: 1fr;
  }

  .settings-card.wide {
    grid-column: auto;
  }

  .settings-stat-grid {
    grid-template-columns: 1fr;
  }

  .account-inline-forms {
    grid-template-columns: 1fr;
  }

  .caption-select-control.compact select {
    width: 100%;
  }

  .caption-segmented-control {
    min-width: 0;
  }

  .right-rail,
  .caption-preview-column,
  .caption-tools {
    position: static;
  }

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

  .settings-menu summary {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    padding: 12px 16px;
  }

  .settings-menu summary small {
    margin-left: 0;
  }

  .render-panel {
    display: grid;
  }
}

@media (max-width: 520px) {
  .shell {
    width: min(100% - 20px, 1180px);
    padding: 10px 0;
  }

  .brand {
    align-items: flex-start;
    flex-direction: column;
  }

  .brand-home-nav,
  .brand-mark {
    width: 100%;
  }

  .header-action {
    width: 100%;
  }

  .brand-logo-button {
    width: 48px;
    height: 48px;
    border-radius: 9px;
  }

  .settings-card-header,
  .profile-row {
    flex-direction: column;
    align-items: start;
  }

  .tool-panel-header {
    flex-direction: column;
    align-items: start;
  }

  .transition-group {
    grid-template-columns: 1fr;
  }

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