:root {
  --bg: #0b0e1a;
  --bg-2: #10162d;
  --surface: rgba(19, 24, 45, 0.72);
  --surface-strong: rgba(28, 34, 63, 0.9);
  --glass: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.12);
  --text: #e6e9f4;
  --muted: #a0abc0;
  --primary: #6cf6ff;
  --primary-2: #5b8bff;
  --accent: #ffb86c;
  --danger: #ff6b6b;
  --shadow: 0 30px 60px rgba(4, 8, 21, 0.55);
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --transition: 180ms ease;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
}

.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: radial-gradient(circle at top left, rgba(91, 139, 255, 0.2), transparent 50%),
    radial-gradient(circle at 20% 80%, rgba(108, 246, 255, 0.18), transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255, 184, 108, 0.14), transparent 50%),
    linear-gradient(135deg, #0b0e1a 0%, #10162d 60%, #0e1326 100%);
}

.bg .grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.4;
}

.orb {
  position: absolute;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  filter: blur(30px);
  opacity: 0.6;
  animation: float 12s ease-in-out infinite;
}

.orb-1 {
  top: -80px;
  left: 6%;
  background: radial-gradient(circle, rgba(108, 246, 255, 0.45), transparent 70%);
}

.orb-2 {
  bottom: -120px;
  right: 12%;
  background: radial-gradient(circle, rgba(91, 139, 255, 0.45), transparent 70%);
  animation-delay: -4s;
}

.orb-3 {
  top: 20%;
  right: -120px;
  background: radial-gradient(circle, rgba(255, 184, 108, 0.35), transparent 70%);
  animation-delay: -8s;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(26px);
  }
}

.app {
  max-width: 1240px;
  margin: 0 auto;
  padding: 32px 24px 60px;
}

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

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

.logo {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  font-weight: 700;
  font-size: 20px;
  color: #0b0e1a;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 12px 20px rgba(91, 139, 255, 0.35);
}

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

.subtitle {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-chip {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pill {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(108, 246, 255, 0.12);
  border: 1px solid rgba(108, 246, 255, 0.3);
  font-size: 12px;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.content {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.page {
  display: none;
}

.page.active {
  display: block;
  animation: fadeIn 0.5s ease;
}

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

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 28px;
}

.hero-copy h1 {
  font-size: 36px;
  margin: 0 0 12px;
}

.hero-copy p {
  margin: 0 0 20px;
  color: var(--muted);
  line-height: 1.6;
}

.meta-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.meta-chip {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  font-size: 12px;
  letter-spacing: 0.02em;
}

.hero-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.upload {
  border: 1px dashed rgba(108, 246, 255, 0.4);
  border-radius: var(--radius-md);
  padding: 28px;
  text-align: center;
  background: rgba(12, 16, 33, 0.7);
  cursor: pointer;
  transition: transform var(--transition), border-color var(--transition);
}

.upload:hover {
  transform: translateY(-2px);
  border-color: rgba(108, 246, 255, 0.7);
}

.upload.drag {
  border-color: rgba(108, 246, 255, 0.9);
  box-shadow: 0 0 20px rgba(108, 246, 255, 0.25);
}

.upload input {
  display: none;
}

.upload-title {
  font-weight: 600;
  font-size: 18px;
}

.upload-sub {
  color: var(--muted);
  font-size: 13px;
  margin-top: 6px;
}

.upload-info {
  font-size: 13px;
  color: var(--muted);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

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

.inline-field {
  gap: 10px;
}

.inline-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text);
}

label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

select,
input[type="text"] {
  padding: 10px 12px;
  background: rgba(12, 16, 33, 0.9);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  outline: none;
}

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

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

button {
  font-family: inherit;
  border: none;
  cursor: pointer;
  padding: 10px 16px;
  border-radius: 12px;
  transition: transform var(--transition), box-shadow var(--transition),
    background var(--transition);
}

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

.primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #0b0e1a;
  font-weight: 600;
  box-shadow: 0 12px 24px rgba(91, 139, 255, 0.3);
}

.primary.alt {
  background: linear-gradient(135deg, var(--accent), #ff7b7b);
  box-shadow: 0 12px 24px rgba(255, 184, 108, 0.25);
}

.ghost {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid var(--border);
}

.grid-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 24px;
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.panel-section {
  background: var(--surface-strong);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 18px;
}

.panel-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 12px;
}

.progress-ring {
  position: relative;
  width: 120px;
  margin: 0 auto 12px;
}

.progress-ring svg {
  width: 120px;
  height: 120px;
  transform: rotate(-90deg);
}

.ring-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 10;
}

.ring-progress {
  fill: none;
  stroke: var(--primary);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 327;
  stroke-dashoffset: 327;
  transition: stroke-dashoffset 200ms ease;
}

.ring-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 600;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.stat-value {
  font-size: 18px;
  font-weight: 600;
}

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

.session-meta {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 10px;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  margin-top: 10px;
}

.switch {
  position: relative;
  width: 42px;
  height: 22px;
}

.switch input {
  display: none;
}

.slider {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  transition: background var(--transition);
}

.slider::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  transition: transform var(--transition);
}

.switch input:checked + .slider {
  background: rgba(108, 246, 255, 0.4);
}

.switch input:checked + .slider::after {
  transform: translateX(18px);
}

.hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}

.workbench {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sentence-card {
  min-height: 320px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.sentence-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
}

.sentence-text {
  font-size: 22px;
  line-height: 1.6;
  min-height: 140px;
}

.chip {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sentence-controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.shortcut-row {
  font-size: 12px;
  color: var(--muted);
}

.shortcut-row span {
  font-family: var(--mono);
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 6px;
  margin: 0 4px;
}

.list-card {
  padding: 0;
}

.list-header {
  display: flex;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.queue {
  max-height: 280px;
  overflow-y: auto;
  padding: 10px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.queue-item {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  font-size: 13px;
  line-height: 1.4;
  cursor: pointer;
  transition: transform var(--transition);
}

.queue-item:hover {
  transform: translateX(4px);
}

.queue-item.active {
  border-color: rgba(108, 246, 255, 0.5);
  box-shadow: inset 0 0 0 1px rgba(108, 246, 255, 0.2);
}

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

  .grid-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .sentence-text {
    font-size: 18px;
  }

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