:root {
  color-scheme: dark;
  --bg: #07090c;
  --bg-soft: #0d1116;
  --panel: rgba(17, 20, 26, 0.88);
  --panel-strong: rgba(20, 24, 31, 0.96);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.13);
  --ink: #edf2f6;
  --muted: #98a1ab;
  --faint: #6e7781;
  --accent: #2ed6c4;
  --accent-strong: #14b8a6;
  --danger: #f87171;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top, rgba(46, 214, 196, 0.12), transparent 26rem),
    linear-gradient(180deg, #06080b 0%, #090d12 42%, #07090c 100%);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.4), transparent 70%);
}

.app-shell {
  width: min(1200px, calc(100% - 24px));
  margin: 0 auto;
  padding: 28px 0 24px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 0 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
}

.brand-mark {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.02);
  color: var(--accent);
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.eyebrow {
  margin: 1px 0 6px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 1.55rem;
  line-height: 1.12;
  letter-spacing: 0;
}

.description {
  max-width: 720px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.5;
}

.status-pill {
  flex: 0 0 auto;
  padding: 10px 14px;
  border: 1px solid rgba(46, 214, 196, 0.25);
  border-radius: 999px;
  background: rgba(16, 19, 25, 0.9);
  color: #dffaf6;
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
  gap: 16px;
}

.panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 700;
}

.meta-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
  white-space: nowrap;
}

.divider {
  color: var(--faint);
}

textarea {
  display: block;
  width: 100%;
  min-height: 540px;
  resize: none;
  overflow: hidden;
  border: 0;
  outline: 0;
  padding: 22px 20px 18px;
  background: transparent;
  color: var(--ink);
  font: 1rem/1.8 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

textarea::placeholder {
  color: rgba(152, 161, 171, 0.45);
}

.results {
  min-height: 540px;
  padding: 10px;
}

.results.empty {
  display: grid;
  place-items: center;
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.result-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 92px;
  gap: 12px;
  align-items: start;
  padding: 12px 12px 13px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.result-row:last-child {
  border-bottom: 0;
}

.line-number {
  color: var(--faint);
  font: 0.86rem/1.7 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.translated-text {
  min-height: 1.6em;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.7;
}

.row-status {
  justify-self: end;
  max-width: 100%;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  text-align: center;
}

.row-status.loading {
  background: rgba(46, 214, 196, 0.1);
  color: #7ff0e3;
}

.row-status.done {
  background: rgba(34, 197, 94, 0.12);
  color: #86efac;
}

.row-status.error {
  background: rgba(248, 113, 113, 0.12);
  color: #fca5a5;
}

.row-status.pending {
  background: rgba(251, 191, 36, 0.12);
  color: #fcd34d;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

button {
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 150ms ease,
    border-color 150ms ease,
    background 150ms ease;
}

button:hover {
  border-color: rgba(46, 214, 196, 0.5);
  background: rgba(255, 255, 255, 0.065);
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.56;
  transform: none;
}

.primary-button {
  background: linear-gradient(180deg, rgba(46, 214, 196, 0.18), rgba(20, 184, 166, 0.08));
  border-color: rgba(46, 214, 196, 0.28);
  color: #dffaf6;
}

.primary-button:hover {
  background: linear-gradient(180deg, rgba(46, 214, 196, 0.24), rgba(20, 184, 166, 0.1));
}

.icon-button {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 0.84rem;
}

.message {
  min-height: 24px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.message.error {
  color: var(--danger);
}

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

  textarea,
  .results {
    min-height: 420px;
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: min(100% - 16px, 1200px);
    padding-top: 14px;
  }

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

  .brand-mark {
    width: 48px;
    height: 48px;
    border-radius: 14px;
  }

  h1 {
    font-size: 1.32rem;
  }

  .panel-header {
    min-height: 52px;
    padding: 0 14px;
  }

  textarea {
    min-height: 340px;
    padding: 18px 14px 16px;
  }

  .results {
    min-height: 300px;
  }

  .result-row {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .row-status {
    grid-column: 2;
    justify-self: start;
  }

  .controls button {
    flex: 1 1 100%;
  }
}
