:root {
  color-scheme: dark;
  --bg: #0a0b0c;
  --bg-1: #0f1012;
  --panel: #101114;
  --panel-2: #13151a;
  --panel-3: #171a1f;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #eef1f5;
  --muted: #8f95a0;
  --accent: #f0a55f;
  --accent-strong: #ffc27c;
  --good: #5ad39b;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  background: var(--bg);
  color: var(--text);
  letter-spacing: 0.01em;
  overflow: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.08), transparent 45%),
    radial-gradient(circle at 80% 10%, rgba(90, 211, 155, 0.08), transparent 45%),
    radial-gradient(circle at 30% 80%, rgba(240, 165, 95, 0.1), transparent 50%);
  opacity: 0.7;
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background-image: linear-gradient(transparent 95%, rgba(255, 255, 255, 0.02) 100%);
  background-size: 100% 4px;
  opacity: 0.2;
  pointer-events: none;
  z-index: 0;
}

.app-shell {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 16px;
  height: 100vh;
  padding: 16px;
}

.sidebar {
  width: 248px;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(19, 20, 23, 0.98), rgba(13, 14, 17, 0.98));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 14px 12px;
  gap: 18px;
  backdrop-filter: blur(10px);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 4px 0;
}

.logo {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--line);
  color: #f5f6f8;
}

.logo svg {
  width: 26px;
  height: 26px;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--muted);
  padding: 0 8px;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
  padding: 8px 10px;
  border-radius: 12px;
  border: 2px solid transparent;
  text-decoration: none;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
}

.nav-item:hover {
  color: #f0f0f0;
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--line);
}

.nav-item.is-active {
  color: #ffffff;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.02));
  border-color: var(--line-strong);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.nav-icon {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
}

.nav-label {
  flex: 1;
}

.tag {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: #d7dae0;
}

.tag.hot {
  color: #1a140d;
  background: linear-gradient(120deg, #f7c07b, #f0a55f);
  border-color: rgba(255, 193, 117, 0.6);
}

.tag.muted {
  color: #c5c8ce;
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}

.sidebar-card-label {
  color: var(--muted);
}

.sidebar-card-text {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
}

.status-pill {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
}

.status-pill.on {
  color: #0c1c14;
  background: linear-gradient(120deg, #7fe2b0, #5ad39b);
  border-color: rgba(90, 211, 155, 0.6);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 8px;
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.user-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(130deg, #5ad39b, #f0a55f);
  display: grid;
  place-items: center;
  font-weight: 600;
  color: #0b0b0c;
}

.user-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-email {
  font-size: 12px;
}

.user-tokens {
  font-size: 11px;
  color: var(--muted);
}

.workspace {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(18, 19, 22, 0.96), rgba(11, 12, 14, 0.96));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.workspace-top {
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.workspace-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.workspace-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 12px rgba(90, 211, 155, 0.8);
}

.workspace-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.workspace-tools {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.lang-toggle--sidebar {
  display: none;
  margin: 0 6px;
  justify-content: center;
}

.lang-option {
  color: inherit;
  text-decoration: none;
  font-weight: 600;
}

.lang-option:hover {
  color: #ffffff;
}

.lang-option.is-active {
  color: #ffffff;
}

.lang-sep {
  opacity: 0.5;
}

.workspace-body {
  flex: 1;
  overflow: hidden;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page {
  height: 100%;
  display: flex;
  flex-direction: column;
  animation: fadeUp 0.5s ease both;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.page-header h1 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  font-size: 18px;
}

.subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.page-body {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 20px;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.page-body.split .settings-panel::before,
.page-body.face-grid .result-panel::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--line);
}

.page-body.split .settings-panel::after,
.page-body.face-grid .result-panel::after {
  content: "";
  position: absolute;
  left: -19px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(13, 14, 16, 0.95);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.main-panel {
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(0, 0, 0, 0.35));
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 0;
  animation: fadeUp 0.6s ease both;
}

.hero {
  text-align: center;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.hero.has-image .hero-content {
  display: none;
}

.hero h2 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 22px;
  font-weight: 600;
}

.hero p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.hero-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

.hero-icon svg {
  width: 20px;
  height: 20px;
}

.hero-actions {
  display: flex;
  gap: 18px;
  margin-top: 16px;
}

.hero-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.hero-action-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  display: grid;
  place-items: center;
}

.hero-action-icon svg {
  width: 20px;
  height: 20px;
}

.prompt-box {
  margin-top: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.prompt-box textarea {
  width: 100%;
  min-height: 40px;
  background: transparent;
  border: none;
  color: var(--text);
  resize: none;
  font-family: "Manrope", sans-serif;
  font-size: 13px;
  outline: none;
}

.prompt-box textarea::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.prompt-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
}

.prompt-submit {
  height: 34px;
  padding: 0 12px;
  border-radius: 12px;
  font-size: 12px;
  white-space: nowrap;
}

.prompt-submit .btn-token {
  font-size: 11px;
}

.i2v-main.is-generated .hero-actions,
.i2v-main.is-generated .hero-subtitle {
  display: none;
}

.i2v-main {
  flex: 1;
  display: flex;
}

.i2v-main .page-body {
  flex: 1;
}

.i2v-main .main-panel {
  gap: 10px;
}

.i2v-main .prompt-box textarea {
  min-height: 40px;
}

.status-line {
  font-size: 11px;
  color: var(--muted);
  min-height: 16px;
}

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

.icon-btn {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
}

.icon-btn:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.08);
}

.primary-btn,
.ghost-btn {
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  font-size: 13px;
  padding: 9px 16px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s ease;
}

.primary-btn {
  background: #f1f2f3;
  color: #101113;
  border-color: rgba(255, 255, 255, 0.6);
}

.primary-btn:hover {
  background: #ffffff;
}

.primary-btn.disabled {
  background: #f1f2f3;
  color: #101113;
  border-color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
}

.ghost-btn {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.ghost-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.btn-token {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  padding-left: 8px;
  border-left: 1px solid rgba(0, 0, 0, 0.1);
}

.btn-token svg {
  width: 14px;
  height: 14px;
}

.muted {
  color: var(--muted);
}

.settings-panel,
.result-panel {
  position: relative;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(0, 0, 0, 0.35));
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  animation: fadeUp 0.6s ease both;
  animation-delay: 0.08s;
}

.panel-title {
  font-size: 14px;
  font-weight: 600;
}

.setting-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.setting-block input {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  color: var(--text);
  font-size: 12px;
  outline: none;
}

.setting-block input:focus {
  border-color: rgba(255, 255, 255, 0.25);
}

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

.setting-label {
  font-size: 12px;
  color: var(--muted);
}

.setting-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.setting-value {
  font-size: 12px;
  color: var(--text);
}

.select-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.select {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 12px;
}

.select-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 30px 8px 10px;
  background: rgba(255, 255, 255, 0.03);
  color: rgba(238, 241, 245, 0.92);
  font-size: 12px;
  outline: none;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.select-input option {
  color: rgba(238, 241, 245, 0.92);
  background: #0f1012;
}

.select-input:focus {
  border-color: rgba(255, 255, 255, 0.25);
}

.caret {
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  display: inline-block;
}

.warning {
  display: flex;
  gap: 10px;
  font-size: 11px;
  color: var(--accent-strong);
  border: 1px solid rgba(240, 165, 95, 0.4);
  background: rgba(240, 165, 95, 0.12);
  padding: 10px;
  border-radius: var(--radius-sm);
  line-height: 1.4;
}

.warning-icon {
  width: 18px;
  height: 18px;
}

.warning-icon svg {
  width: 18px;
  height: 18px;
}

.warning-link {
  color: #f8d4a6;
}

.range {
  width: 100%;
  accent-color: #ffffff;
}

.empty-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
}

.empty-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  color: var(--muted);
}

.empty-icon svg {
  width: 20px;
  height: 20px;
}

.empty-title {
  font-size: 13px;
  font-weight: 600;
}

.empty-text {
  font-size: 11px;
  color: var(--muted);
}

.face-grid {
  grid-template-columns: minmax(0, 1fr) 420px;
}

.face-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(0, 0, 0, 0.3));
  padding: 18px;
  animation: fadeUp 0.6s ease both;
}

.face-main > .primary-btn {
  margin-top: auto;
  width: 100%;
  justify-content: center;
}

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

.upload-card {
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.upload-card.compact {
  padding: 10px;
}

.upload-card.compact .upload-drop {
  min-height: 110px;
}

.upload-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}

.info {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.upload-drop {
  flex: 1;
  min-height: 120px;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  color: var(--muted);
  padding: 10px;
  position: relative;
  overflow: hidden;
}

.upload-preview {
  position: absolute;
  inset: 6px;
  width: calc(100% - 12px);
  height: calc(100% - 12px);
  object-fit: contain;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 10px;
  z-index: 1;
  pointer-events: none;
}

.upload-drop.has-preview .upload-icon,
.upload-drop.has-preview .upload-text,
.upload-drop.has-preview .upload-subtext,
.upload-drop.has-preview .upload-meta {
  opacity: 0;
}

.upload-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
}

.upload-icon svg {
  width: 18px;
  height: 18px;
}

.upload-text {
  font-size: 12px;
}

.upload-subtext,
.upload-note {
  font-size: 11px;
  color: var(--muted);
}

.upload-meta {
  font-size: 11px;
  color: #cfd3da;
}

.file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

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

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field label {
  font-size: 12px;
  color: var(--muted);
}

.field input {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  color: var(--text);
  font-size: 12px;
  outline: none;
}

.field input:focus {
  border-color: rgba(255, 255, 255, 0.25);
}

.accordion {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  font-size: 12px;
}

.result-panel {
  min-height: 0;
}

.result-empty {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  color: var(--muted);
}

.result-preview {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  padding: 12px;
  display: grid;
  place-items: center;
  min-height: 260px;
  max-height: 440px;
}

.result-preview img {
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  border-radius: 12px;
}

.video-preview video {
  width: 100%;
  max-height: 400px;
  object-fit: contain;
  border-radius: 12px;
}

.page-body.history {
  grid-template-columns: minmax(0, 1fr);
}

.history-panel {
  min-height: 100%;
  align-self: stretch;
}

.history-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  align-content: start;
  grid-auto-rows: max-content;
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.history-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015));
  height: 64px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.history-card:hover {
  border-color: rgba(255, 255, 255, 0.16);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  transform: translateY(-1px);
}

.history-thumb {
  width: 64px;
  height: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  flex-shrink: 0;
}

.history-thumb.video {
  width: 96px;
  height: 100%;
  aspect-ratio: auto;
  object-fit: contain;
}

.history-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.history-prompt {
  font-size: 12px;
  color: rgba(238, 241, 245, 0.92);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.history-time {
  font-size: 11px;
  color: rgba(143, 149, 160, 0.9);
}

.history-empty {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  color: var(--muted);
  padding: 24px;
}

.auth-page {
  overflow: auto;
}

.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  position: relative;
  z-index: 1;
}

.landing-page {
  overflow: auto;
  font-family: "Manrope", "Space Grotesk", "Inter", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

.landing-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 36px;
  padding: 32px 32px 48px;
  position: relative;
  z-index: 1;
  max-width: 1120px;
  margin: 0 auto;
}

/* Auth/landing page background */
.landing-page::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(6, 7, 11, 0.99) 0%, rgba(6, 7, 11, 0.985) 35%, rgba(5, 6, 9, 0.99) 100%),
    radial-gradient(900px 520px at 18% 20%, rgba(94, 73, 255, 0.14), transparent 62%),
    radial-gradient(800px 460px at 82% 18%, rgba(90, 150, 255, 0.12), transparent 62%),
    radial-gradient(900px 520px at 50% 85%, rgba(168, 95, 255, 0.1), transparent 68%);
  pointer-events: none;
  z-index: 0;
  animation: none;
}
.landing-page::after {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(1000px 520px at 50% 38%, rgba(0, 0, 0, 0.2), transparent 64%),
    radial-gradient(1400px 900px at 50% 60%, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.95) 74%);
  pointer-events: none;
  z-index: 0;
  animation: none;
}

.landing-stars {
  display: none;
}

.landing-icons {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.landing-icons span {
  position: absolute;
  top: var(--top);
  left: var(--left);
  width: var(--size);
  height: var(--size);
  opacity: var(--opacity);
  background-repeat: no-repeat;
  background-size: contain;
  transform-origin: center;
  filter: drop-shadow(0 0 10px rgba(146, 115, 255, 0.35));
  animation-duration: var(--duration);
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  animation-delay: var(--delay);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 22 22' fill='none'%3E%3Cpath d='M11 2.2l1.9 4.4 4.4 1.9-4.4 1.9-1.9 4.4-1.9-4.4-4.4-1.9 4.4-1.9L11 2.2z' fill='%23b794ff' fill-opacity='0.95'/%3E%3Cpath d='M11 5.4l1.1 2.6 2.6 1.1-2.6 1.1-1.1 2.6-1.1-2.6-2.6-1.1 2.6-1.1L11 5.4z' fill='%23e6ddff' fill-opacity='0.95'/%3E%3C/svg%3E");
}

.landing-icons span:nth-child(1) { --left: 8%; --top: 22%; --size: 24px; --duration: 5.5s; --delay: -1s; --opacity: 0.75; animation-name: iconTwinkle; }
.landing-icons span:nth-child(2) { --left: 18%; --top: 58%; --size: 22px; --duration: 6.5s; --delay: -4s; --opacity: 0.6; animation-name: iconFloat; }
.landing-icons span:nth-child(3) { --left: 28%; --top: 32%; --size: 20px; --duration: 5s; --delay: -2s; --opacity: 0.65; animation-name: iconTwinkle; }
.landing-icons span:nth-child(4) { --left: 40%; --top: 18%; --size: 26px; --duration: 7s; --delay: -6s; --opacity: 0.8; animation-name: iconFloat; }
.landing-icons span:nth-child(5) { --left: 52%; --top: 72%; --size: 22px; --duration: 5.8s; --delay: -3s; --opacity: 0.7; animation-name: iconTwinkle; }
.landing-icons span:nth-child(6) { --left: 64%; --top: 26%; --size: 21px; --duration: 6.8s; --delay: -7s; --opacity: 0.65; animation-name: iconFloat; }
.landing-icons span:nth-child(7) { --left: 74%; --top: 52%; --size: 24px; --duration: 5.6s; --delay: -5s; --opacity: 0.75; animation-name: iconTwinkle; }
.landing-icons span:nth-child(8) { --left: 86%; --top: 30%; --size: 22px; --duration: 7.2s; --delay: -8s; --opacity: 0.68; animation-name: iconFloat; }
.landing-icons span:nth-child(9) { --left: 92%; --top: 64%; --size: 20px; --duration: 6s; --delay: -6s; --opacity: 0.6; animation-name: iconTwinkle; }
.landing-icons span:nth-child(10) { --left: 10%; --top: 78%; --size: 18px; --duration: 6.4s; --delay: -2s; --opacity: 0.58; animation-name: iconFloat; }
.landing-icons span:nth-child(11) { --left: 24%; --top: 14%; --size: 21px; --duration: 5.2s; --delay: -5s; --opacity: 0.7; animation-name: iconTwinkle; }
.landing-icons span:nth-child(12) { --left: 46%; --top: 42%; --size: 19px; --duration: 7.6s; --delay: -3s; --opacity: 0.62; animation-name: iconFloat; }
.landing-icons span:nth-child(13) { --left: 58%; --top: 10%; --size: 23px; --duration: 5.9s; --delay: -7s; --opacity: 0.74; animation-name: iconTwinkle; }
.landing-icons span:nth-child(14) { --left: 80%; --top: 74%; --size: 18px; --duration: 6.9s; --delay: -4s; --opacity: 0.55; animation-name: iconFloat; }

.landing-stars span {
  position: absolute;
  top: var(--top);
  left: var(--left);
  width: var(--size);
  height: var(--size);
  background: radial-gradient(circle, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.5) 60%, rgba(255, 255, 255, 0) 70%);
  clip-path: polygon(
    50% 0%,
    58% 32%,
    100% 50%,
    58% 68%,
    50% 100%,
    42% 68%,
    0% 50%,
    42% 32%
  );
  opacity: var(--opacity);
  filter: blur(var(--blur));
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
  animation-duration: var(--duration);
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  animation-delay: var(--delay);
}

.landing-stars span:nth-child(1) { --left: 6%; --top: 18%; --size: 10px; --duration: 6s; --delay: -1s; --opacity: 0.6; --blur: 0px; animation-name: starTwinkle; }
.landing-stars span:nth-child(2) { --left: 14%; --top: 42%; --size: 12px; --duration: 7.5s; --delay: -3s; --opacity: 0.7; --blur: 0.3px; animation-name: starBob; }
.landing-stars span:nth-child(3) { --left: 22%; --top: 12%; --size: 9px; --duration: 5s; --delay: -2s; --opacity: 0.5; --blur: 0px; animation-name: starTwinkle; }
.landing-stars span:nth-child(4) { --left: 30%; --top: 30%; --size: 13px; --duration: 8.5s; --delay: -4s; --opacity: 0.8; --blur: 0.4px; animation-name: starBob; }
.landing-stars span:nth-child(5) { --left: 38%; --top: 60%; --size: 10px; --duration: 7s; --delay: -5s; --opacity: 0.6; --blur: 0.2px; animation-name: starTwinkle; }
.landing-stars span:nth-child(6) { --left: 46%; --top: 22%; --size: 12px; --duration: 9.5s; --delay: -6s; --opacity: 0.85; --blur: 0.5px; animation-name: starBob; }
.landing-stars span:nth-child(7) { --left: 54%; --top: 48%; --size: 9px; --duration: 6s; --delay: -2s; --opacity: 0.55; --blur: 0px; animation-name: starTwinkle; }
.landing-stars span:nth-child(8) { --left: 62%; --top: 15%; --size: 13px; --duration: 8.8s; --delay: -7s; --opacity: 0.75; --blur: 0.4px; animation-name: starBob; }
.landing-stars span:nth-child(9) { --left: 70%; --top: 68%; --size: 10px; --duration: 7.2s; --delay: -1s; --opacity: 0.7; --blur: 0.3px; animation-name: starTwinkle; }
.landing-stars span:nth-child(10) { --left: 78%; --top: 36%; --size: 12px; --duration: 10.5s; --delay: -8s; --opacity: 0.85; --blur: 0.5px; animation-name: starBob; }
.landing-stars span:nth-child(11) { --left: 86%; --top: 20%; --size: 9px; --duration: 5.5s; --delay: -4s; --opacity: 0.6; --blur: 0px; animation-name: starTwinkle; }
.landing-stars span:nth-child(12) { --left: 94%; --top: 54%; --size: 13px; --duration: 11.5s; --delay: -3s; --opacity: 0.9; --blur: 0.6px; animation-name: starBob; }

@keyframes landingGlow {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(-2%, -1%, 0) scale(1.05); }
  100% { transform: translate3d(0, 0, 0) scale(1); }
}

@keyframes landingDim {
  0% { opacity: 0.55; }
  50% { opacity: 0.9; }
  100% { opacity: 0.55; }
}

@keyframes starTwinkle {
  0% { opacity: 0.2; transform: scale(0.6); }
  50% { opacity: 1; transform: scale(1); }
  100% { opacity: 0.3; transform: scale(0.7); }
}

@keyframes starBob {
  0% { opacity: 0.55; transform: translateY(0) scale(0.9); }
  50% { opacity: 1; transform: translateY(-8px) scale(1); }
  100% { opacity: 0.7; transform: translateY(0) scale(0.95); }
}

@keyframes iconTwinkle {
  0% { opacity: 0.25; transform: scale(0.7) rotate(0deg); }
  50% { opacity: 0.95; transform: scale(1.05) rotate(10deg); }
  100% { opacity: 0.35; transform: scale(0.78) rotate(-8deg); }
}

@keyframes iconFloat {
  0% { opacity: 0.4; transform: translateY(0) scale(0.88) rotate(0deg); }
  50% { opacity: 0.95; transform: translateY(-12px) scale(1.05) rotate(8deg); }
  100% { opacity: 0.55; transform: translateY(0) scale(0.9) rotate(-8deg); }
}

@keyframes expandIn {
  0% { opacity: 0; transform: translateY(24px) scale(0.96); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.landing-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: -18px;
}

.landing-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  font-size: 18px;
}

.landing-logo {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #f5f6f8;
}

.landing-title {
  letter-spacing: 0.02em;
}

.landing-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  color: #ffffff;
  margin-left: auto;
  transform: translateX(68px);
}

.landing-nav a {
  color: inherit;
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 12px;
  border: 1px solid transparent;
  margin-left: 0;
  background: rgba(255, 255, 255, 0.02);
  transition: all 0.2s ease;
}

.landing-nav a:hover {
  color: #ffffff;
  border-color: transparent;
  background: rgba(255, 255, 255, 0.06);
}

.landing-nav .lang-toggle {
  font-size: 11px;
  letter-spacing: 0.1em;
  padding: 0;
  border: 0;
  background: transparent;
  gap: 6px;
}
.landing-nav .lang-toggle a {
  border: 0;
  background: transparent;
  padding: 0 6px;
  margin-left: 0;
  border-radius: 0;
}
.landing-nav .lang-toggle a:hover {
  border: 0;
  background: transparent;
  color: #ffffff;
}

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

.landing-signin {
  padding: 8px 14px;
  font-size: 13px;
}

.landing-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  padding-top: 22px;
}

.landing-page .landing-hero,
.landing-page .auth-card,
.landing-page .landing-foot {
  animation: expandIn 1.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.landing-page .landing-hero {
  animation-delay: 0.05s;
}

.landing-page .landing-hero h1 {
  animation: expandIn 1.8s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: 0.12s;
}

.landing-page .landing-hero p {
  animation: expandIn 1.8s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: 0.2s;
}

.landing-page .auth-card {
  animation-delay: 0.28s;
}

.landing-page .landing-foot {
  animation-delay: 0.36s;
}

.landing-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 560px;
  padding-top: 70px;
}

.landing-badge {
  font-size: 13px;
  letter-spacing: 0.06em;
  color: #c9a9ff;
  border: 1px solid rgba(124, 92, 255, 0.55);
  padding: 9px 20px 9px 38px;
  border-radius: 999px;
  background: rgba(88, 62, 168, 0.22);
  min-width: 150px;
  display: inline-flex;
  justify-content: center;
  margin-top: 2px;
  position: relative;
}

.landing-badge::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 50%;
  width: 14px;
  height: 14px;
  transform: translateY(-50%);
  background-repeat: no-repeat;
  background-size: contain;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14' fill='none'%3E%3Cpath d='M7 1l1.1 2.6 2.6 1.1-2.6 1.1L7 8.4l-1.1-2.6-2.6-1.1 2.6-1.1L7 1z' fill='%23c9a9ff'/%3E%3Cpath d='M10.6 8.4l.7 1.6 1.6.7-1.6.7-.7 1.6-.7-1.6-1.6-.7 1.6-.7.7-1.6z' fill='%23e8dcff'/%3E%3C/svg%3E");
}

.landing-hero h1 {
  margin: 6px 0 0;
  font-family: "Space Grotesk", "Manrope", "Inter", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 48px;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.02em;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-shadow: 0 36px 177px rgba(120, 92, 255, 0.32), 0 0 240px rgba(120, 92, 255, 0.5), 0 0 455px rgba(120, 92, 255, 0.24), 0 0 658px rgba(120, 92, 255, 0.12), -114px 0 228px rgba(120, 92, 255, 0.2), 114px 0 228px rgba(120, 92, 255, 0.2);
}

.landing-hero h1 span:first-child {
  text-shadow: 0 43px 215px rgba(120, 92, 255, 0.34), 0 0 291px rgba(120, 92, 255, 0.58), 0 0 531px rgba(120, 92, 255, 0.26), 0 0 759px rgba(120, 92, 255, 0.14), -139px 0 278px rgba(120, 92, 255, 0.22), 139px 0 278px rgba(120, 92, 255, 0.22);
}

.landing-hero h1 span {
  text-shadow: 0 43px 215px rgba(120, 92, 255, 0.34), 0 0 291px rgba(120, 92, 255, 0.58), 0 0 531px rgba(120, 92, 255, 0.26), 0 0 759px rgba(120, 92, 255, 0.14), -139px 0 278px rgba(120, 92, 255, 0.22), 139px 0 278px rgba(120, 92, 255, 0.22);
}

.landing-hero p {
  margin: 0;
  font-size: 18px;
  color: rgba(238, 241, 245, 0.7);
  line-height: 1.6;
  white-space: pre-line;
}

.landing-accent {
  color: #b38bff;
  text-shadow: 0 43px 215px rgba(120, 92, 255, 0.34), 0 0 291px rgba(120, 92, 255, 0.58), 0 0 531px rgba(120, 92, 255, 0.26), 0 0 759px rgba(120, 92, 255, 0.14), -139px 0 278px rgba(120, 92, 255, 0.22), 139px 0 278px rgba(120, 92, 255, 0.22);
}

.landing-card {
  width: min(520px, 92vw);
}

.landing-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
}

.landing-foot-action {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  padding: 0;
  cursor: pointer;
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

.landing-foot-action:hover,
.landing-foot-action:focus-visible {
  color: #ffffff;
  text-shadow: 0 0 12px rgba(148, 93, 255, 0.6);
}

.landing-foot-action.is-active {
  color: #d8c9ff;
  text-shadow: 0 0 16px rgba(148, 93, 255, 0.8);
}

.landing-page .primary-btn,
.landing-page .ghost-btn {
  font-size: 14px;
}

.landing-page .auth-field {
  font-size: 14px;
  gap: 0;
}

.landing-page .auth-input {
  font-size: 15px;
}

.landing-page .auth-message {
  font-size: 13px;
}

.landing-page .oauth-btn {
  font-size: 14px;
}

.landing-page .auth-sep {
  font-size: 12px;
}

.landing-foot-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #5ad39b;
  box-shadow: 0 0 10px rgba(90, 211, 155, 0.8);
}

.landing-foot-dot.alt {
  background: #7aa7ff;
  box-shadow: 0 0 10px rgba(122, 167, 255, 0.7);
}

.landing-foot-sep {
  width: 1px;
  height: 12px;
  background: rgba(255, 255, 255, 0.1);
}

.landing-footer {
  width: 100%;
  margin-top: 64px;
  padding: 120px 12px 48px;
  color: rgba(255, 255, 255, 0.6);
  position: relative;
}

.landing-footer::before {
  content: "";
  position: absolute;
  top: 72px;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.landing-footer-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px;
}

.landing-footer-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.landing-footer-title {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 6px;
}

.landing-footer-link {
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  font-size: 12px;
  padding: 2px 0;
  transition: color 0.2s ease;
}

.landing-footer-link:hover {
  color: #ffffff;
}

.landing-footer-text {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.6;
  margin-bottom: 6px;
}

.landing-footer-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.landing-footer-input {
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.04);
  padding: 0 12px;
  color: #ffffff;
  font-size: 12px;
  outline: none;
}

.landing-footer-input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.landing-footer-submit {
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #f6f6fb;
  color: #0b0b10;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.landing-footer-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.2);
}

.landing-footer-follow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}

.landing-footer-follow-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
}

.landing-footer-social {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: grid;
  place-items: center;
  color: #ffffff;
  text-decoration: none;
  font-size: 12px;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.landing-footer-social:hover {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.08);
}

.landing-footer-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 88px 0 22px;
}

.landing-footer-bottom {
  text-align: center;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
}

.auth-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.auth-stack .auth-message {
  width: min(520px, 92vw);
}

.auth-card {
  width: min(460px, 92vw);
  background: rgba(10, 10, 14, 0.6);
  border: 1px solid rgba(146, 110, 255, 0.28);
  border-radius: 20px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  position: relative;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-brand-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #8b5cf6;
  box-shadow: 0 0 16px rgba(139, 92, 246, 0.9);
}

.auth-title {
  font-family: "Space Grotesk", sans-serif;
  font-size: 18px;
  font-weight: 600;
}

.auth-subtitle {
  font-size: 13px;
  color: var(--muted);
}

.oauth-btn {
  width: 100%;
  border: 1px solid rgba(168, 120, 255, 0.7);
  border-radius: 12px;
  background: transparent;
  color: rgba(248, 248, 252, 0.98);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.oauth-btn:hover {
  background: rgba(139, 92, 246, 0.22);
  border-color: rgba(168, 120, 255, 0.95);
}

.oauth-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.45);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  color: #ffffff;
}

.auth-sep {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
  letter-spacing: 0.16em;
}

.auth-sep-line {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.auth-sep-text {
  text-transform: uppercase;
}

.auth-tabs {
  display: flex;
  gap: 6px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-tab {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-tab.is-active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.12);
}

.auth-message {
  border-radius: 10px;
  border: 1px solid rgba(240, 165, 95, 0.5);
  background: rgba(240, 165, 95, 0.12);
  color: var(--accent);
  font-size: 12px;
  padding: 10px 12px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.auth-input {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 13px 16px;
  color: var(--text);
  font-size: 14px;
  outline: none;
}

.auth-input:focus {
  border-color: rgba(148, 93, 255, 0.6);
}

.auth-code-row {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-code-input {
  width: 100%;
  padding-right: 118px;
}

.auth-code-action {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: 1px solid rgba(168, 120, 255, 0.7);
  border-radius: 10px;
  background: transparent;
  color: rgba(248, 248, 252, 0.98);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-code-action:hover {
  background: rgba(139, 92, 246, 0.22);
  border-color: rgba(168, 120, 255, 0.95);
}

.auth-submit {
  width: 100%;
  justify-content: center;
}

.btn-gradient {
  background: linear-gradient(90deg, #6b13ff, #a855f7);
  border-color: transparent;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-gradient:hover {
  background: linear-gradient(90deg, #7b20ff, #b267ff);
}

.btn-arrow {
  font-size: 14px;
}

body.modal-open {
  overflow: hidden;
}

.history-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(7, 10, 16, 0.7);
  backdrop-filter: blur(6px);
  z-index: 40;
}

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

.history-modal-card {
  width: min(960px, 92vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(12, 14, 20, 0.95);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

.history-modal-close {
  align-self: flex-end;
}

.history-modal-media {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  overflow: hidden;
}

.history-modal-media img,
.history-modal-media video {
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
}

.history-modal-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.history-modal-prompt {
  font-size: 13px;
  color: rgba(238, 241, 245, 0.95);
}

.history-modal-time {
  font-size: 12px;
  color: rgba(143, 149, 160, 0.9);
}

.account-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(7, 10, 16, 0.7);
  backdrop-filter: blur(6px);
  z-index: 40;
}

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

.account-modal-card {
  width: min(680px, 92vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(12, 14, 20, 0.95);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  overflow: auto;
}

.account-modal-close {
  align-self: flex-end;
}

.account-modal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.account-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.account-avatar {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: linear-gradient(130deg, #5ad39b, #f0a55f);
  display: grid;
  place-items: center;
  font-weight: 600;
  color: #0b0b0c;
}

.account-user-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.account-email {
  font-size: 14px;
  color: rgba(238, 241, 245, 0.95);
}

.account-subtitle {
  font-size: 12px;
  color: var(--muted);
}

.account-tokens {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: rgba(238, 241, 245, 0.9);
}

.account-token-label {
  color: var(--muted);
}

.account-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.account-panel-title {
  font-size: 16px;
  font-weight: 600;
}

.account-panel-text {
  font-size: 12px;
  color: var(--muted);
}

.account-panel-action {
  margin-top: 6px;
  width: 100%;
  justify-content: center;
}

.account-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.account-section-title {
  font-size: 14px;
  font-weight: 600;
}

.account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.account-row:last-child {
  border-bottom: none;
}

.account-row-label {
  font-size: 13px;
  color: rgba(238, 241, 245, 0.9);
}

.account-row-action {
  padding: 6px 12px;
  font-size: 12px;
}

.hero-preview {
  margin-top: 16px;
  width: min(520px, 100%);
  position: relative;
  max-height: 320px;
  overflow: hidden;
}

.hero-preview-loading {
  display: none;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
}

.hero-preview.is-loading .hero-preview-loading {
  display: inline-flex;
}

.hero-preview.is-loading img {
  display: none;
}

.hero-preview.has-image img {
  display: block;
}

.download-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.6);
  color: var(--text);
  display: grid;
  place-items: center;
  transition: all 0.2s ease;
  z-index: 2;
}

.download-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
}

.download-btn:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.1);
}

.loader {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: rgba(255, 255, 255, 0.8);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.result-title {
  font-size: 13px;
  color: var(--text);
}

.result-text {
  font-size: 11px;
  color: var(--muted);
  max-width: 240px;
}

.section-divider {
  height: 1px;
  background: var(--line);
  margin: 4px 0;
}

.helper {
  font-size: 11px;
  color: var(--muted);
}

.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  font-size: 11px;
  color: var(--text);
}

.bottom-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

@media (max-width: 1200px) {
  .app-shell {
    flex-direction: column;
    height: auto;
  }

  body {
    overflow: auto;
  }

  .sidebar {
    width: 100%;
  }

  .workspace {
    min-height: 80vh;
  }
}

@media (max-width: 960px) {
  .lang-toggle--top {
    display: none;
  }

  .lang-toggle--sidebar {
    display: flex;
  }

  .landing-topbar {
    flex-wrap: wrap;
    justify-content: center;
    padding-left: 0;
  }

  .landing-nav {
    display: none;
  }

  .landing-hero h1 {
    font-size: 32px;
  }

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

  .page-body,
  .face-grid {
    grid-template-columns: 1fr;
  }

  .settings-panel::before,
  .settings-panel::after,
  .result-panel::before,
  .result-panel::after {
    display: none;
  }

  .hero-actions {
    flex-direction: column;
  }

  .upload-grid,
  .field-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .landing-footer {
    padding: 40px 6px 28px;
  }

  .landing-footer-grid {
    grid-template-columns: 1fr;
  }
}
