:root {
  --ink: #111827;
  --muted: #667085;
  --line: #e6eaf0;
  --panel: #f7f9fc;
  --blue: #1677ff;
  --blue-dark: #075ccf;
  --blue-soft: #eaf3ff;
  --green: #16a36a;
  --danger: #d92d20;
  --shadow: 0 24px 70px rgb(16 24 40 / 8%);
  font-family:
    Inter, Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  color: var(--ink);
  background: #fff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  flex-direction: column;
  border-right: 1px solid var(--line);
  padding: 28px 20px;
  background: #fbfcfe;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.04em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 15px;
  color: #fff;
  background: var(--ink);
  font-size: 23px;
}

nav {
  display: grid;
  gap: 8px;
  margin-top: 50px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: 14px 16px;
  color: var(--muted);
  background: transparent;
  text-align: left;
}

.nav-item.active {
  color: var(--ink);
  background: #eef1f5;
  font-weight: 700;
}

.nav-icon {
  width: 24px;
  color: currentColor;
  font-size: 22px;
  text-align: center;
}

.sidebar-bottom {
  margin-top: auto;
}

.sidebar-bottom p {
  margin: 12px 4px 0;
  color: #98a2b3;
  font-size: 12px;
  line-height: 1.55;
}

.auth-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 12px;
  color: var(--muted);
  background: #fff;
  font-size: 13px;
  font-weight: 650;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f79009;
  box-shadow: 0 0 0 4px rgb(247 144 9 / 12%);
}

.auth-badge.connected .status-dot {
  background: var(--green);
  box-shadow: 0 0 0 4px rgb(22 163 106 / 12%);
}

main {
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 66px 48px 34px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.11em;
}

h1 {
  margin: 0;
  font-size: clamp(38px, 5vw, 68px);
  line-height: 1.08;
  letter-spacing: -0.055em;
}

.language-route {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 12px 18px;
  white-space: nowrap;
}

.route-arrow {
  color: var(--blue);
}

.workspace {
  max-width: 1180px;
  margin: 0 auto;
  padding: 16px 48px 34px;
}

.upload-panel,
.job-panel {
  min-height: 450px;
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 48px;
  background:
    radial-gradient(circle at 50% 0%, rgb(22 119 255 / 7%), transparent 37%),
    #fff;
  box-shadow: var(--shadow);
}

.upload-panel {
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  transition:
    border-color 160ms ease,
    transform 160ms ease;
}

.upload-panel.dragging {
  border-color: var(--blue);
  transform: translateY(-2px);
}

.upload-visual {
  position: relative;
  width: 98px;
  height: 90px;
  margin-bottom: 20px;
}

.paper {
  position: absolute;
  display: grid;
  width: 66px;
  height: 78px;
  place-items: center;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 14px 26px rgb(16 24 40 / 10%);
  font-size: 14px;
  font-weight: 850;
}

.paper-back {
  left: 8px;
  top: 3px;
  transform: rotate(-9deg);
}

.paper-front {
  right: 7px;
  top: 8px;
  color: var(--blue);
  transform: rotate(7deg);
}

h2 {
  margin: 0;
  font-size: 27px;
  letter-spacing: -0.035em;
}

.upload-panel > div:nth-child(2) p {
  margin: 10px 0 24px;
  color: var(--muted);
}

.primary-button,
.secondary-button {
  border-radius: 13px;
  padding: 14px 26px;
  font-weight: 750;
}

.primary-button {
  border: 0;
  color: #fff;
  background: var(--blue);
  box-shadow: 0 9px 22px rgb(22 119 255 / 24%);
}

.primary-button:hover {
  background: var(--blue-dark);
}

.drop-hint {
  margin: 13px 0 28px;
  color: #98a2b3;
  font-size: 13px;
}

.language-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 22px;
}

.language-picker > span {
  margin-right: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.language-picker label input {
  position: absolute;
  opacity: 0;
}

.language-picker label span {
  display: block;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 14px;
  color: var(--muted);
  background: #fff;
  font-size: 13px;
  font-weight: 700;
}

.language-picker input:checked + span {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--blue-soft);
}

.hidden {
  display: none !important;
}

.job-panel {
  min-height: 480px;
}

.job-heading {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
}

.file-icon {
  display: grid;
  width: 62px;
  height: 70px;
  place-items: center;
  border: 1px solid #cfe2ff;
  border-radius: 13px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 12px;
  font-weight: 850;
}

.job-heading h2 {
  overflow: hidden;
  max-width: 700px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-heading p:last-child {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 14px;
}

#progressNumber {
  color: var(--blue);
  font-size: 34px;
  letter-spacing: -0.04em;
}

.progress-track {
  overflow: hidden;
  height: 9px;
  margin: 34px 0 24px;
  border-radius: 999px;
  background: #edf1f6;
}

.progress-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), #71cbff);
  transition: width 400ms ease;
}

.stage-card {
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid #d9e9ff;
  border-radius: 17px;
  padding: 20px;
  background: #f7fbff;
}

.stage-card p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid #cce1ff;
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 900ms linear infinite;
}

.spinner.done {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border: 0;
  color: #fff;
  background: var(--green);
  animation: none;
}

.spinner.done::after {
  content: "✓";
}

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

.result-list {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.result-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 16px 18px;
  background: #fff;
}

.result-card strong {
  display: block;
  margin-bottom: 4px;
}

.result-card span {
  color: var(--muted);
  font-size: 13px;
}

.result-card a {
  border-radius: 11px;
  padding: 10px 15px;
  color: #fff;
  background: var(--ink);
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}

.log-details {
  margin-top: 20px;
  color: var(--muted);
  font-size: 13px;
}

.log-details summary {
  cursor: pointer;
}

.log-details pre {
  overflow: auto;
  max-height: 170px;
  border-radius: 12px;
  padding: 14px;
  color: #d0d5dd;
  background: #101828;
  font: 11px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap;
}

.secondary-button {
  margin-top: 18px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: #fff;
}

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 26px 48px 70px;
}

.features article {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.features article > span {
  color: var(--blue);
  font-size: 12px;
  font-weight: 850;
}

.features h3 {
  margin: 11px 0 8px;
  font-size: 17px;
}

.features p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

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

  .sidebar {
    position: static;
    display: grid;
    height: auto;
    grid-template-columns: 1fr auto;
    align-items: center;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 16px 20px;
  }

  .sidebar nav,
  .sidebar-bottom p {
    display: none;
  }

  .sidebar-bottom {
    margin: 0;
  }

  .topbar {
    padding-top: 44px;
  }

  .language-route {
    display: none;
  }
}

@media (max-width: 640px) {
  .topbar,
  .workspace,
  .features {
    padding-right: 20px;
    padding-left: 20px;
  }

  h1 {
    font-size: 40px;
  }

  .upload-panel,
  .job-panel {
    min-height: 430px;
    border-radius: 22px;
    padding: 28px 20px;
  }

  .job-heading {
    grid-template-columns: auto 1fr;
  }

  #progressNumber {
    grid-column: 1 / -1;
  }

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

  .language-picker {
    flex-wrap: wrap;
    justify-content: center;
  }
}
