/* LingoSend interface system */
:root {
  color-scheme: dark;
  --canvas: #0b0e11;
  --canvas-soft: #101419;
  --surface: #151a20;
  --surface-raised: #1b222a;
  --surface-hover: #222b34;
  --field: #10151a;
  --line: #2c353e;
  --line-strong: #46515c;
  --text: #f3f6f4;
  --soft: #c9d1cd;
  --muted: #909c97;
  --subtle: #66716d;
  --accent: #79d7aa;
  --accent-strong: #4fbc8b;
  --accent-ink: #07140f;
  --accent-soft: #14271f;
  --blue: #79a8f5;
  --blue-soft: #17233a;
  --warning: #e0b15a;
  --warning-soft: #2d2515;
  --danger: #ef7f78;
  --danger-soft: #301a1a;
  --success: #79d7aa;
  --success-soft: #14271f;
  --focus: #a9f0ce;
  --shadow: 0 24px 70px rgb(0 0 0 / 38%);
  --radius: 8px;
  --radius-small: 6px;
  --content: 1540px;
  --public-content: 1180px;
  --font: "SUIT Variable", SUIT, -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", "Hiragino Sans", "Yu Gothic UI", "Noto Sans JP", "Microsoft JhengHei UI", "PingFang TC", "Microsoft YaHei UI", "Noto Sans SC", "Noto Naskh Arabic", Tahoma, system-ui, sans-serif;
}

* { box-sizing: border-box; letter-spacing: 0; }
html { min-width: 320px; background: var(--canvas); font-size: 16px; scroll-behavior: smooth; }
body {
  min-width: 320px;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  background: var(--canvas);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
body::before, body::after, .public-home-page::before, .public-home-page::after { display: none; content: none; }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button, a, input, select, textarea, [tabindex] { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
[hidden] { display: none !important; }
a { color: var(--accent); }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3, strong { color: var(--text); }
h1 { font-size: 52px; font-weight: 720; line-height: 1.08; }
h2 { font-size: 20px; font-weight: 700; line-height: 1.3; }
h3 { font-size: 16px; font-weight: 700; line-height: 1.4; }

button, .button, a.primary, a.secondary, a.ghost {
  min-height: 44px;
  border-radius: var(--radius-small);
  font-weight: 650;
}
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }
.primary, button.primary, a.primary {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: none;
}
.primary:hover:not(:disabled), button.primary:hover:not(:disabled), a.primary:hover {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
  color: var(--accent-ink);
  transform: none;
}
.secondary, button.secondary, a.secondary {
  border: 1px solid var(--line-strong);
  background: var(--surface-raised);
  color: var(--text);
  box-shadow: none;
}
.secondary:hover:not(:disabled), button.secondary:hover:not(:disabled), a.secondary:hover {
  border-color: var(--muted);
  background: var(--surface-hover);
  transform: none;
}
.ghost, button.ghost, a.ghost {
  border: 1px solid transparent;
  background: transparent;
  color: var(--soft);
  box-shadow: none;
}
.ghost:hover:not(:disabled), button.ghost:hover:not(:disabled), a.ghost:hover {
  border-color: var(--line);
  background: var(--surface-raised);
  color: var(--text);
  transform: none;
}
input, select, textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-small);
  background: var(--field);
  color: var(--text);
  box-shadow: none;
}
input, select { padding: 0 13px; }
textarea { padding: 12px 13px; line-height: 1.5; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--subtle); opacity: 1; }
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input:focus, select:focus, textarea:focus { border-color: var(--focus); background: #12191e; box-shadow: none; }
label > span, .field-title { display: block; margin-bottom: 7px; color: var(--soft); font-size: 14px; font-weight: 650; }
small, .helper-note, .oauth-help, .form-message { color: var(--muted); font-size: 13px; line-height: 1.55; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { border: 3px solid transparent; border-radius: 999px; background: #58655f; background-clip: padding-box; }

.brand-mark {
  display: inline-grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius-small);
  background: url("/assets/icons/icon-192.png?v=20260901-ls-mark-1") center / cover no-repeat;
  color: transparent;
  font-size: 0;
  box-shadow: none;
}
.brand-mark.small { width: 38px; height: 38px; flex: 0 0 38px; border-radius: var(--radius-small); }
.brand-mark.titlebar-mark { width: 18px; height: 18px; flex: 0 0 18px; border-radius: 5px; }
.eyebrow { margin: 0 0 10px; color: var(--accent); font-size: 12px; font-weight: 760; text-transform: uppercase; }
.step, .step-number {
  display: inline-grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: var(--surface-raised);
  color: var(--muted);
  font-size: 13px;
  font-weight: 720;
}
.section { min-width: 0; min-height: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: none; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.section-heading > div:first-child { display: flex; min-width: 0; align-items: flex-start; gap: 12px; }
.section-heading h2, .section-heading p { margin: 0; }
.section-heading p { margin-top: 5px; color: var(--muted); font-size: 13px; line-height: 1.5; }

/* Authentication */
.auth-view {
  position: relative;
  display: grid;
  min-height: 100dvh;
  padding: 28px;
  isolation: isolate;
  place-items: center end;
  background: #080b0e;
}
.auth-view::before {
  position: absolute;
  inset: 0 42% 0 0;
  z-index: -2;
  display: block;
  background: #101419 url("/assets/images/lingosend-login-relay.webp") center / cover no-repeat;
  content: "";
}
.auth-view::after {
  position: absolute;
  inset: 0 42% 0 0;
  z-index: -1;
  display: block;
  background: rgb(4 7 9 / 42%);
  content: "";
}
.auth-shell {
  position: relative;
  width: min(100%, 520px);
  max-height: calc(100dvh - 56px);
  margin-right: max(0px, calc((42vw - 520px) / 2));
  padding: 34px 38px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #11161b;
  box-shadow: var(--shadow);
}
.auth-shell > .brand-mark { margin-bottom: 24px; }
.auth-shell h1 { margin-bottom: 12px; font-size: 32px; }
.auth-copy { margin-bottom: 20px; color: var(--soft); font-size: 15px; line-height: 1.7; }
.auth-purpose { display: grid; gap: 6px; margin: 0 0 24px; padding: 14px 0 14px 16px; border: 0; border-left: 2px solid var(--accent); border-radius: 0; background: transparent; color: var(--muted); font-size: 13px; }
.auth-purpose strong { font-size: 14px; }
.auth-purpose a { width: fit-content; color: var(--accent); }
.auth-language-picker { position: absolute; top: 18px; right: 20px; width: 138px; margin: 0; }
.auth-language-picker select, .app-language-picker select, .public-language-picker select { min-height: 40px; font-size: 13px; }
.auth-tabs, .provider-tabs, .segmented, .lyrics-input-tabs { display: grid; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: var(--radius-small); background: var(--field); }
.auth-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0 0 20px; }
.auth-tabs button, .provider-tabs button, .segmented button, .lyrics-input-tabs button { min-height: 40px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); font-size: 13px; }
.auth-tabs button.active, .provider-tabs button.active, .segmented button.active, .lyrics-input-tabs button.active { background: var(--surface-hover); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.auth-form { display: grid; gap: 15px; }
.auth-form button[type="submit"] { width: 100%; min-height: 50px; }
.form-message { min-height: 1.4em; margin: 12px 0 0; }
.legal-links { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.legal-links a { color: var(--muted); font-size: 12px; }

/* Product shell */
.app { width: min(calc(100% - 24px), var(--content)); min-height: calc(100dvh - 24px); margin: 12px auto; padding: 0; overflow: visible; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.window-titlebar { display: none; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: minmax(230px, auto) minmax(220px, 1fr) auto;
  min-height: 66px;
  align-items: center;
  gap: 18px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius) var(--radius) 0 0;
  background: rgb(18 23 28 / 96%);
  backdrop-filter: blur(14px);
}
.brand { display: flex; min-width: 0; align-items: center; gap: 11px; }
.brand > div { min-width: 0; }
.brand strong, .brand span { display: block; }
.brand strong { overflow: hidden; font-size: 16px; font-weight: 720; text-overflow: ellipsis; white-space: nowrap; }
.brand > div > span { color: var(--muted); font-size: 12px; }
.status-pills { display: flex; min-width: 0; align-items: center; justify-content: center; gap: 8px; }
.status-pills > span { display: inline-flex; min-height: 30px; align-items: center; gap: 7px; padding: 4px 10px; border: 1px solid #315f4b; border-radius: 999px; background: var(--success-soft); color: var(--success); font-size: 12px; font-weight: 650; white-space: nowrap; }
.status-pills > span.is-off { border-color: #65502a; background: var(--warning-soft); color: var(--warning); }
.status-pills i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.mobile-menu-button { display: none; }
.top-actions { display: flex; align-items: center; justify-content: flex-end; gap: 3px; }
.top-actions > span { max-width: 124px; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.top-actions button, .top-actions a { display: inline-flex; min-height: 40px; align-items: center; padding: 0 10px; font-size: 12px; text-decoration: none; }
.app-language-picker { width: 116px; margin: 0; }
.notice { min-height: 44px; margin: 0; padding: 11px 16px; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--radius) var(--radius); background: #111a18; color: var(--soft); font-size: 13px; font-weight: 600; }

.workspace-layout { display: grid; grid-template-columns: 238px minmax(0, 1fr); min-height: calc(100dvh - 170px); margin-top: 12px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.workflow-nav { display: flex; min-width: 0; padding: 14px 10px; border-right: 1px solid var(--line); background: #11161b; flex-direction: column; gap: 4px; }
.workflow-nav-item { position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr); min-height: 62px; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid transparent; border-radius: var(--radius-small); background: transparent; color: var(--muted); text-align: left; }
.workflow-nav-item:hover { background: var(--surface-raised); color: var(--soft); }
.workflow-nav-item.active { border-color: #39634f; background: var(--accent-soft); color: var(--text); }
.workflow-nav-item.is-recommended:not(.active)::after { position: absolute; top: 10px; right: 9px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); content: ""; }
.workflow-nav-item.is-complete .workflow-index { border-color: #315f4b; color: var(--accent); }
.workflow-index { display: grid; width: 30px; height: 30px; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--subtle); font-size: 11px; font-weight: 740; }
.workflow-nav-item > span:last-child, .workflow-nav-item strong, .workflow-nav-item small { display: block; min-width: 0; }
.workflow-nav-item strong { overflow: hidden; color: inherit; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.workflow-nav-item small { margin-top: 2px; overflow: hidden; color: var(--subtle); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.workspace { display: block; width: 100%; min-width: 0; height: auto; max-height: none; margin: 0; padding: 22px; background: var(--canvas-soft); }
.workspace > .section { display: none; width: min(100%, 1060px); min-height: 100%; margin: 0 auto; padding: 24px; overflow: visible; }
.workspace > .section.is-viewing { display: block; animation: panel-enter .16s ease-out; }
@keyframes panel-enter { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.step-panel.is-current .step { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.step-panel.is-complete .step { border-color: #315f4b; background: var(--success-soft); color: var(--success); }
.settings-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; }
.save-state { display: inline-flex; min-height: 30px; align-items: center; padding: 3px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.save-state.saved, .save-state.is-saved { border-color: #315f4b; background: var(--success-soft); color: var(--success); }
.save-button { min-height: 38px; padding: 0 12px; font-size: 12px; }
.provider-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 18px; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.settings-grid > div:last-child { grid-column: 1 / -1; }
.input-action { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.input-action button { min-width: 92px; }
.source-language-segmented { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.helper-note, .oauth-help { display: block; margin: 14px 0 0; }
.channel-list { display: grid; gap: 8px; }
.channel-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 62px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-small); background: var(--field); }
.channel-item.active, .channel-item.is-active { border-color: #39634f; background: var(--success-soft); }
.channel-item img { width: 40px; height: 40px; border-radius: 50%; }
.channel-item strong, .channel-item small { display: block; overflow-wrap: anywhere; }
.channel-actions { display: flex; gap: 5px; }
.channel-actions button { min-width: 42px; min-height: 40px; padding: 0 9px; font-size: 12px; }
.language-toolbar { display: grid; grid-template-columns: minmax(220px, 1fr) repeat(5, auto); gap: 7px; margin-bottom: 14px; }
.language-toolbar input, .language-toolbar button { min-height: 40px; font-size: 12px; }
.language-toolbar button { padding: 0 12px; }
.language-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-content: start; gap: 7px; max-height: calc(100dvh - 340px); min-height: 240px; padding-right: 4px; overflow-y: auto; }
.language-option { display: flex; min-width: 0; min-height: 44px; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-small); background: var(--field); cursor: pointer; }
.language-option:hover { border-color: var(--line-strong); background: var(--surface-raised); }
.language-option:has(input:checked) { border-color: #39634f; background: var(--accent-soft); }
.language-option input { width: 19px; min-width: 19px; height: 19px; min-height: 19px; margin: 0; accent-color: var(--accent-strong); }
.language-option span { min-width: 0; margin: 0; overflow: hidden; color: var(--soft); font-size: 13px; font-weight: 560; text-overflow: ellipsis; white-space: nowrap; }
.switch { display: inline-flex; min-height: 44px; align-items: center; gap: 8px; color: var(--soft); font-size: 13px; cursor: pointer; }
.switch input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.switch > span:first-of-type { position: relative; display: block; width: 40px; height: 22px; flex: 0 0 40px; margin: 0; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--field); }
.switch > span:first-of-type::after { position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); content: ""; transition: transform .16s ease; }
.switch input:checked + span:first-of-type { border-color: var(--accent); background: var(--accent); }
.switch input:checked + span:first-of-type::after { background: var(--accent-ink); transform: translateX(18px); }
.switch:has(input:focus-visible) > span:first-of-type { outline: 3px solid var(--focus); outline-offset: 3px; }
.video-paste-button, .run-button { width: 100%; margin-top: 8px; }
.run-dock { width: 100%; margin-top: 10px; }
.run-button { min-height: 54px; font-size: 15px; }
.progress-area { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.progress-area > div:first-child { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.progress-track { height: 8px; overflow: hidden; border-radius: 999px; background: var(--field); }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.result-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.result-heading strong { font-size: 14px; }
.result-heading span { color: var(--muted); font-size: 12px; text-align: right; }
.result { min-height: 110px; margin-top: 9px; padding: 14px; overflow-wrap: anywhere; border: 1px solid var(--line); border-radius: var(--radius-small); background: var(--field); color: var(--soft); font-size: 13px; }
.result .empty, .job-list .empty, .channel-list .empty { margin: 0; color: var(--muted); }
.job-list { display: grid; gap: 8px; }
.job-item { padding: 13px 14px; border: 1px solid var(--line); border-radius: var(--radius-small); background: var(--field); }
.job-item strong, .job-item small { display: block; }
.job-item p { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.app-legal-links { display: flex; min-height: 50px; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 20px; margin: 0; }
.app-legal-links a { display: inline-flex; min-height: 44px; align-items: center; color: var(--muted); font-size: 12px; }

/* Administration */
.admin-workspace { margin-top: 12px; padding-bottom: 24px; }
.admin-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 24px 4px 18px; border-bottom: 1px solid var(--line); }
.admin-header h1 { margin-bottom: 6px; font-size: 28px; }
.admin-header p { margin: 0; color: var(--muted); }
.metric-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; margin: 16px 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--line); }
.metric { min-height: 94px; padding: 16px; border: 0; border-radius: 0; background: var(--surface); }
.metric strong { display: block; margin-bottom: 8px; font-size: 24px; line-height: 1; }
.metric span { color: var(--muted); font-size: 12px; }
.admin-workspace > .section { margin-top: 12px; padding: 20px; }
.admin-operations-section, .admin-billing-section { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; padding: 0 !important; overflow: hidden; }
.admin-operation-panel { min-width: 0; padding: 20px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: transparent; }
.admin-operation-panel:nth-child(2n) { border-right: 0; }
.admin-notice-form, .maintenance-form, .admin-billing-plan-form, .admin-billing-grant-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.admin-notice-form label:has(textarea), .maintenance-form label, .admin-billing-plan-form .billing-description, .admin-notice-form button, .maintenance-form button, .maintenance-form small { grid-column: 1 / -1; }
.admin-notice-list, .billing-plan-list, .billing-order-list { display: grid; gap: 8px; margin-top: 16px; }
.admin-notice-item, .billing-plan-item, .admin-billing-order, .billing-history-item { padding: 13px; border: 1px solid var(--line); border-radius: var(--radius-small); background: var(--field); }
.admin-billing-order { border-left: 3px solid var(--warning); }
.admin-billing-order-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.admin-charts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.admin-chart-card { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-small); background: var(--field); }
.admin-chart-svg-wrap, .admin-chart-svg { min-height: 190px; }
.admin-chart-svg { width: 100%; height: 190px; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-small); }
.table-wrap table { width: 100%; min-width: 880px; border-collapse: collapse; background: var(--field); }
.table-wrap th, .table-wrap td { padding: 11px 12px; border-bottom: 1px solid var(--line); color: var(--soft); font-size: 12px; text-align: left; vertical-align: top; }
.table-wrap th { position: sticky; top: 0; z-index: 1; background: var(--surface-raised); color: var(--text); font-weight: 650; }

/* Dialogs and feedback */
.modal-open { overflow: hidden; }
.billing-modal, .notice-board-modal, .job-result-modal, .open-chat-modal, .maintenance-modal, .completion-modal { position: fixed; inset: 0; z-index: 100; display: grid; padding: 20px; overflow-y: auto; place-items: center; background: rgb(3 5 7 / 80%); backdrop-filter: blur(7px); }
.billing-modal-content, .notice-board-card, .job-result-card, .open-chat-card, .maintenance-card, .completion-card { width: min(100%, 760px); max-height: calc(100dvh - 40px); padding: 24px; overflow-y: auto; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.billing-customer-plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.billing-customer-plan, .billing-card, .billing-current-access, .billing-referral-panel, .billing-payment-step { padding: 15px; border: 1px solid var(--line); border-radius: var(--radius-small); background: var(--field); }
.billing-customer-plan.recommended, .billing-customer-plan.is-recommended { border-color: var(--accent); }
.billing-recommended-badge { display: inline-flex; margin-bottom: 8px; padding: 3px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 700; }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 200; width: min(420px, calc(100% - 40px)); padding: 14px 16px; border: 1px solid var(--line-strong); border-radius: var(--radius-small); background: var(--surface-raised); color: var(--text); box-shadow: var(--shadow); font-size: 13px; }
.toast:empty, .toast:not(.show) { pointer-events: none; opacity: 0; }
.toast.error { border-color: #8c413c; background: var(--danger-soft); color: #ffc0bc; }
.toast.success { border-color: #315f4b; background: var(--success-soft); color: var(--success); }

/* Public home */
.public-home-page, .legal-page { background: var(--canvas); }
.public-home-shell { width: 100%; margin: 0; padding: 0; }
.public-home-nav { position: sticky; top: 0; z-index: 50; display: block; min-height: 72px; margin: 0; border-bottom: 1px solid var(--line); background: rgb(11 14 17 / 95%); backdrop-filter: blur(16px); }
.public-nav-inner { display: grid; grid-template-columns: auto 1fr auto; width: min(calc(100% - 40px), var(--public-content)); min-height: 72px; align-items: center; gap: 30px; margin: 0 auto; }
.public-brand { display: inline-flex; align-items: center; gap: 11px; color: var(--text); font-weight: 720; text-decoration: none; }
.public-nav-inner > nav { display: flex; align-items: center; justify-content: center; gap: 24px; }
.public-nav-inner > nav a, .public-footer a, .public-text-actions a { color: var(--muted); font-size: 13px; text-decoration: none; }
.public-nav-inner > nav a:hover, .public-footer a:hover, .public-text-actions a:hover { color: var(--text); text-decoration: none; }
.public-nav-actions { display: flex; align-items: center; gap: 8px; }
.public-language-picker { width: 132px; margin: 0; }
.public-nav-cta { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; padding: 0 14px; border: 1px solid var(--accent); border-radius: var(--radius-small); background: var(--accent); color: var(--accent-ink); font-size: 13px; font-weight: 700; text-decoration: none; }
.public-hero { position: relative; display: grid; width: 100%; max-width: none; height: 70dvh; min-height: 600px; max-height: 760px; align-items: end; overflow: hidden; isolation: isolate; margin: 0; padding: 0; border-bottom: 1px solid var(--line); background: #090d10; }
.public-hero-media { position: absolute; inset: 0; z-index: -2; }
.public-hero-media img { width: 100%; height: 100%; object-fit: cover; object-position: center top; filter: saturate(.82) contrast(1.04); }
.public-hero::after { position: absolute; inset: 0; z-index: -1; display: block; background: rgb(5 8 10 / 58%); content: ""; }
.public-hero-inner { width: min(calc(100% - 40px), var(--public-content)); margin: 0 auto; padding: 64px 0 68px; }
.public-hero h1 { max-width: 980px; margin-bottom: 20px; color: var(--text); font-size: 50px; line-height: 1.1; word-break: keep-all; text-shadow: 0 2px 20px rgb(0 0 0 / 78%); }
.public-hero-copy { max-width: 720px; margin-bottom: 0; color: #e4e9e6; font-size: 17px; line-height: 1.75; text-shadow: 0 1px 14px rgb(0 0 0 / 82%); }
.public-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 28px; }
.public-cta { display: inline-flex; min-height: 48px; align-items: center; justify-content: center; padding: 0 20px; text-decoration: none; }
.public-actions .secondary.is-outlined { border-color: rgb(255 255 255 / 42%); background: rgb(10 14 17 / 72%); color: var(--text); }
.public-home-content { width: min(calc(100% - 40px), var(--public-content)); margin: 0 auto; }
.public-proof { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.public-proof span { min-width: 0; padding: 18px 22px; border-right: 1px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 650; text-align: center; }
.public-proof span:last-child { border-right: 0; }
.public-section { display: grid; grid-template-columns: minmax(220px, .72fr) minmax(0, 1.28fr); gap: 70px; max-width: none; margin: 0; padding: 76px 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; box-shadow: none; }
.public-section-heading h2 { max-width: 330px; margin-bottom: 0; font-size: 28px; word-break: keep-all; }
.public-section > p, .public-section > div:last-child > p, .public-section li { color: var(--soft); font-size: 15px; line-height: 1.8; }
.public-note { margin: 20px 0 0; padding: 14px 0 14px 16px; border-left: 2px solid var(--line-strong); color: var(--muted) !important; font-size: 12px !important; line-height: 1.65 !important; }
.public-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin: 0; border-bottom: 1px solid var(--line); }
.public-grid article { min-width: 0; padding: 42px 28px 42px 0; border: 0; border-right: 1px solid var(--line); border-radius: 0; background: transparent; }
.public-grid article + article { padding-left: 28px; }
.public-grid article:last-child { border-right: 0; }
.public-grid h3 { margin: 16px 0 8px; font-size: 17px; }
.public-grid p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.public-data ul { display: grid; gap: 12px; margin: 0; padding-left: 22px; }
.public-text-actions { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 20px; }
.public-text-actions a { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }
.public-footer { display: flex; min-height: 92px; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; color: var(--muted); font-size: 12px; }
.public-footer span { display: flex; flex-wrap: wrap; gap: 8px 18px; }

/* Guide, policy, and support */
.legal-shell { width: min(calc(100% - 40px), 920px); margin: 0 auto; padding: 28px 0 56px; }
.legal-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 58px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.legal-back { display: inline-flex; min-height: 44px; align-items: center; color: var(--soft); text-decoration: none; }
.legal-shell > h1 { max-width: 760px; margin-bottom: 14px; font-size: 42px; }
.legal-updated { color: var(--muted); }
.legal-shell > section, .guide-section { margin: 0; padding: 34px 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; box-shadow: none; }
.legal-shell section h2, .guide-section h2 { margin-bottom: 14px; font-size: 20px; }
.legal-shell section h3, .guide-section h3 { margin: 26px 0 8px; color: var(--text); font-size: 16px; font-weight: 700; }
.legal-shell section p, .legal-shell section li, .guide-list li { color: var(--soft); line-height: 1.8; }
.guide-callout { margin: 30px 0 0; padding: 18px 0 18px 18px !important; border-bottom: 0 !important; border-left: 2px solid var(--accent) !important; color: var(--soft); }
.guide-list { display: grid; gap: 12px; padding-left: 24px; }
.guide-note { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-small); background: var(--field); color: var(--soft); }

/* Lyrics workspace */
.lyrics-page { background: var(--canvas); color: var(--text); }
.lyrics-topbar { position: sticky; top: 0; z-index: 30; display: flex; min-height: 66px; align-items: center; justify-content: space-between; gap: 16px; padding: 10px max(20px, calc((100vw - 1460px) / 2)); border-bottom: 1px solid var(--line); background: rgb(18 23 28 / 96%); backdrop-filter: blur(14px); }
.lyrics-brand { display: inline-flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; }
.lyrics-brand strong, .lyrics-brand small { display: block; }
.lyrics-brand small { color: var(--muted); font-size: 12px; }
.lyrics-shell { width: min(calc(100% - 32px), 1460px); margin: 0 auto; padding: 28px 0 50px; }
.lyrics-intro { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 330px); align-items: end; gap: 28px; padding: 8px 0 22px; border-bottom: 1px solid var(--line); }
.lyrics-intro h1 { max-width: 820px; margin-bottom: 8px; font-size: 30px; line-height: 1.25; }
.lyrics-intro p:not(.eyebrow) { margin: 0; color: var(--soft); font-size: 14px; }
.lyrics-capability { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-small); background: var(--field); color: var(--muted); font-size: 12px; }
.lyrics-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(330px, .72fr); align-items: start; gap: 14px; margin-top: 18px; }
.lyrics-workspace, .lyrics-history { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: none; }
.lyrics-section { margin: 0; padding: 22px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; box-shadow: none; }
.lyrics-section:last-child { border-bottom: 0; }
.lyrics-section-head, .history-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.lyrics-section-head > div, .history-head > div { min-width: 0; flex: 1; }
.lyrics-section-head h2, .lyrics-section-head p, .history-head h2, .history-head p { margin: 0; }
.lyrics-section-head p { margin-top: 4px; color: var(--muted); font-size: 13px; }
.lyrics-input-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); width: min(100%, 360px); margin-bottom: 18px; }
.lyrics-picker-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.lyrics-picker { display: grid; min-height: 144px; align-content: center; gap: 7px; padding: 18px; border: 1px dashed var(--line-strong); border-radius: var(--radius-small); background: var(--field); cursor: pointer; }
.lyrics-picker:hover { border-color: var(--accent); background: var(--accent-soft); }
.lyrics-picker input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.lyrics-picker:has(input:focus-visible), .language-option:has(input:focus-visible) { border-color: var(--focus); outline: 3px solid var(--focus); outline-offset: 2px; }
.picker-button { width: fit-content; margin-top: 5px; color: var(--accent); font-size: 13px; font-weight: 650; }
.pairing-note, .paste-help, #outputModeHelp { margin: 12px 0 0; color: var(--muted); font-size: 12px; }
.separate-pickers { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.separate-pickers summary { display: inline-flex; min-height: 44px; align-items: center; color: var(--soft); cursor: pointer; font-size: 13px; font-weight: 650; }
.paste-mode, .lyrics-output-mode, .suno-helper, .batch-toolbar, .batch-empty, .lyrics-toggle { padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-small); background: var(--field); }
.paste-mode { display: grid; gap: 14px; }
.paste-actions, .suno-helper, .batch-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.suno-helper, .batch-toolbar, .batch-empty { margin-top: 12px; }
.batch-empty { text-align: center; }
.batch-queue, .lyrics-jobs { display: grid; gap: 8px; margin-top: 10px; }
.lyrics-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.lyrics-toggle { display: flex; align-items: flex-start; gap: 12px; margin-top: 12px; }
.lyrics-toggle input { width: 20px; min-width: 20px; height: 20px; min-height: 20px; accent-color: var(--accent-strong); }
.lyrics-start { width: 100%; min-height: 54px; }
.lyrics-status { margin-top: 12px; color: var(--muted); font-size: 13px; }
.lyrics-history { position: sticky; top: 82px; max-height: calc(100dvh - 100px); padding: 20px; overflow: hidden; }
.lyrics-jobs { max-height: calc(100dvh - 220px); overflow-y: auto; }
.lyrics-job, .batch-item { padding: 13px; overflow-wrap: anywhere; border: 1px solid var(--line); border-radius: var(--radius-small); background: var(--field); }

@media (max-width: 1240px) {
  .topbar { grid-template-columns: minmax(210px, auto) 1fr; }
  .status-pills { justify-content: flex-end; }
  .top-actions { grid-column: 1 / -1; padding-top: 8px; border-top: 1px solid var(--line); }
  .workspace-layout { min-height: calc(100dvh - 220px); }
  .language-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  h1 { font-size: 44px; }
  .auth-view { place-items: center; }
  .auth-view::before, .auth-view::after { inset: 0; }
  .auth-view::after { background: rgb(4 7 9 / 76%); }
  .auth-shell { margin-right: 0; }
  .workspace-layout { grid-template-columns: 190px minmax(0, 1fr); }
  .workflow-nav-item { grid-template-columns: 30px minmax(0, 1fr); padding: 8px; }
  .settings-grid { grid-template-columns: 1fr; }
  .settings-grid > div:last-child { grid-column: auto; }
  .source-language-segmented { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .source-language-segmented button:last-child { grid-column: 1 / -1; }
  .language-toolbar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .language-toolbar input { grid-column: 1 / -1; }
  .public-nav-inner { gap: 16px; }
  .public-nav-inner > nav { gap: 14px; }
  .public-nav-cta { display: none; }
  .public-hero h1 { font-size: 44px; }
  .public-section { grid-template-columns: 1fr; gap: 22px; }
  .lyrics-layout { grid-template-columns: 1fr; }
  .lyrics-history { position: static; max-height: none; }
  .lyrics-jobs { max-height: 520px; }
  .admin-charts, .billing-customer-plans { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  h1 { font-size: 36px; }
  body { font-size: 16px; }
  .auth-view { padding: 10px; }
  .auth-shell { width: 100%; max-height: none; padding: 24px 18px; box-shadow: none; }
  .auth-language-picker { position: static; width: 100%; margin-bottom: 22px; }
  .app { width: 100%; min-height: 100dvh; margin: 0; padding-bottom: calc(78px + env(safe-area-inset-bottom)); }
  .topbar { position: sticky; display: grid; grid-template-areas: "brand menu" "pills pills" "actions actions"; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 10px; padding: 9px 11px; border-right: 0; border-left: 0; border-radius: 0; }
  .brand { grid-area: brand; }
  .mobile-menu-button { display: inline-flex; grid-area: menu; min-height: 44px; align-items: center; gap: 7px; justify-self: end; }
  .status-pills { grid-area: pills; flex-wrap: wrap; justify-content: flex-start; }
  .top-actions { display: none; grid-area: actions; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; padding-top: 10px; border-top: 1px solid var(--line); }
  .top-actions.is-open { display: grid; }
  .top-actions > span { grid-column: 1 / -1; max-width: none; }
  .top-actions button, .top-actions a, .app-language-picker { width: 100%; justify-content: center; }
  .notice { border-right: 0; border-left: 0; border-radius: 0; }
  .workspace-layout { display: block; min-height: 0; margin-top: 8px; border-right: 0; border-left: 0; border-radius: 0; }
  .workflow-nav { display: flex; padding: 8px 10px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); flex-direction: row; scroll-snap-type: x proximity; }
  .workflow-nav-item { width: 154px; min-width: 154px; min-height: 54px; grid-template-columns: 28px minmax(0, 1fr); scroll-snap-align: start; }
  .workflow-index { width: 26px; height: 26px; }
  .workspace { padding: 10px; }
  .workspace > .section { padding: 17px; }
  .section-heading { flex-wrap: wrap; gap: 12px; }
  .section-heading h2 { overflow-wrap: anywhere; }
  .settings-actions { width: 100%; justify-content: space-between; }
  .save-button { min-height: 44px; }
  .source-language-segmented, .language-list { grid-template-columns: 1fr; }
  .source-language-segmented button:last-child { grid-column: auto; }
  .language-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .language-list { max-height: none; }
  .run-dock { position: fixed; right: 0; bottom: 0; left: 0; z-index: 50; margin: 0; padding: 10px 10px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgb(11 14 17 / 98%); box-shadow: 0 -12px 30px rgb(0 0 0 / 34%); }
  .run-dock .run-button { margin: 0; }
  .result-heading { align-items: flex-start; flex-direction: column; }
  .result-heading span { text-align: left; }
  .admin-workspace { margin: 10px; }
  .admin-header { align-items: stretch; flex-direction: column; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-operations-section, .admin-billing-section, .admin-notice-form, .maintenance-form, .admin-billing-plan-form, .admin-billing-grant-form { grid-template-columns: 1fr; }
  .admin-operation-panel { border-right: 0; }
  .admin-notice-form > *, .maintenance-form > *, .admin-billing-plan-form > *, .admin-billing-grant-form > * { grid-column: auto !important; }
  .public-nav-inner, .public-home-content, .public-hero-inner, .legal-shell { width: min(calc(100% - 28px), var(--public-content)); }
  .public-home-nav, .public-nav-inner { min-height: 64px; }
  .public-nav-inner { grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 8px 0; }
  .public-brand > span:last-child { max-width: none; overflow: visible; white-space: nowrap; }
  .public-nav-inner > nav { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; gap: 18px; overflow-x: auto; }
  .public-nav-inner > nav a { flex: 0 0 auto; min-height: 34px; }
  .public-nav-actions { align-self: start; }
  .public-language-picker { width: 118px; }
  .public-hero { height: calc(100dvh - 150px); min-height: 500px; max-height: 650px; }
  .public-hero-inner { padding: 38px 0 42px; }
  .public-hero h1 { font-size: 36px; line-height: 1.15; }
  .public-hero-copy { font-size: 15px; }
  .public-actions { align-items: stretch; flex-direction: column; }
  .public-cta { width: 100%; }
  .public-proof { grid-template-columns: 1fr; }
  .public-proof span { border-right: 0; border-bottom: 1px solid var(--line); }
  .public-proof span:last-child { border-bottom: 0; }
  .public-section { gap: 18px; padding: 48px 0; }
  .public-section-heading h2 { font-size: 24px; }
  .public-grid { grid-template-columns: 1fr; }
  .public-grid article, .public-grid article + article { padding: 28px 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .public-grid article:last-child { border-bottom: 0; }
  .public-footer { align-items: flex-start; flex-direction: column; }
  .legal-toolbar { align-items: center; flex-flow: row wrap; margin-bottom: 42px; }
  .legal-toolbar .legal-back { min-width: 0; min-height: 44px; flex: 1 1 auto; margin: 0; }
  .legal-toolbar .public-language-picker { flex: 0 0 118px; margin-left: auto; }
  .legal-shell > h1 { font-size: 34px; }
  .lyrics-topbar { padding: 10px 14px; }
  .lyrics-shell { width: min(calc(100% - 20px), 1460px); padding-top: 18px; }
  .lyrics-intro { grid-template-columns: 1fr; align-items: start; }
  .lyrics-intro h1 { font-size: 26px; }
  .lyrics-section, .lyrics-history { padding: 16px; }
  .lyrics-picker-grid, .lyrics-options { grid-template-columns: 1fr; }
  .paste-actions, .suno-helper, .batch-toolbar { align-items: stretch; flex-direction: column; }
  .lyrics-back { max-width: 140px; text-align: center; }
  .billing-modal-content, .notice-board-card, .job-result-card, .open-chat-card, .maintenance-card, .completion-card { padding: 18px; }
  .toast { right: 12px; bottom: calc(84px + env(safe-area-inset-bottom)); width: min(420px, calc(100% - 24px)); }
}

@media (max-width: 430px) {
  .top-actions { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: 1fr; }
  .public-nav-inner, .public-home-content, .public-hero-inner, .legal-shell { width: min(calc(100% - 20px), var(--public-content)); }
  .public-brand > span:last-child { max-width: none; }
  .public-hero h1 { font-size: 32px; }
  .lyrics-brand small { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
