:root {
  color-scheme: light;
  --bg: #06111f;
  --bg-accent: #0f2940;
  --panel: rgba(255, 255, 255, 0.92);
  --line: rgba(15, 23, 42, 0.12);
  --text: #122033;
  --muted: #5d6a7b;
  --brand: #0078d4;
  --brand-dark: #005ea8;
  --success: #106c2e;
  --danger: #b42318;
  --shadow: 0 18px 60px rgba(3, 8, 20, 0.28);
  font-family: "Segoe UI", "PingFang SC", "Noto Sans SC", sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  background:
    radial-gradient(circle at top right, rgba(42, 157, 244, 0.28), transparent 34%),
    radial-gradient(circle at bottom left, rgba(18, 137, 86, 0.18), transparent 28%),
    linear-gradient(160deg, var(--bg), var(--bg-accent));
  color: var(--text);
}

button,
input,
textarea {
  font: inherit;
}

.shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px 32px;
}

.panel {
  width: min(100%, 560px);
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  padding: 24px;
}

.panel__head h1 {
  margin: 8px 0 10px;
  font-size: clamp(2rem, 8vw, 2.8rem);
  line-height: 1;
}

.eyebrow {
  margin: 0;
  color: var(--brand);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.subhead {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.form {
  margin-top: 24px;
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  font-weight: 600;
}

.field input,
.result textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--text);
}

.field input:focus,
.result textarea:focus {
  outline: 2px solid rgba(0, 120, 212, 0.18);
  border-color: rgba(0, 120, 212, 0.48);
}

.field--picker input {
  padding: 12px;
}

.picker-note,
.result__tip {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.4;
}

.selection,
.status,
.result {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(248, 250, 252, 0.92);
  padding: 16px;
}

.selection__meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}

.selection__meta span {
  color: var(--muted);
  font-size: 0.92rem;
}

.file-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.file-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 14px;
}

.file-list small {
  color: var(--muted);
}

.actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

button {
  border: 0;
  border-radius: 16px;
  padding: 14px 18px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 120ms ease, opacity 120ms ease, background 120ms ease;
}

button:hover {
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.6;
  cursor: wait;
  transform: none;
}

#upload-button {
  background: linear-gradient(135deg, var(--brand), #0094ff);
  color: white;
}

#upload-button:hover {
  background: linear-gradient(135deg, var(--brand-dark), #0078d4);
}

.button-secondary {
  background: rgba(15, 23, 42, 0.06);
  color: var(--text);
}

.status[data-state='success'] {
  color: var(--success);
  border-color: rgba(16, 108, 46, 0.2);
  background: rgba(235, 251, 240, 0.92);
}

.status[data-state='error'] {
  color: var(--danger);
  border-color: rgba(180, 35, 24, 0.2);
  background: rgba(254, 242, 242, 0.96);
}

.result {
  display: grid;
  gap: 12px;
}

.result__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.result textarea {
  min-height: 132px;
  resize: vertical;
}

@media (max-width: 640px) {
  .panel {
    padding: 20px;
    border-radius: 24px;
  }

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

  .result__head,
  .file-list li {
    flex-direction: column;
    align-items: flex-start;
  }
}

