:root {
  --bg: #f2ecdf;
  --panel: rgba(255, 255, 255, 0.9);
  --line: #d8cbb8;
  --text: #172028;
  --muted: #5d6770;
  --brand: #0f8a7b;
  --brand-dark: #175d98;
  --accent: #e8b357;
  --danger: #9e3f2f;
  --shadow: 0 18px 50px rgba(23, 32, 40, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(232, 179, 87, 0.28), transparent 24%),
    radial-gradient(circle at top right, rgba(23, 93, 152, 0.18), transparent 30%),
    linear-gradient(180deg, #f8f2e8 0%, #f1eadf 100%);
  color: var(--text);
  font: 16px/1.55 "Noto Sans", "Segoe UI", sans-serif;
}

a {
  color: var(--brand-dark);
}

code {
  background: rgba(23, 32, 40, 0.08);
  border-radius: 6px;
  padding: 0.1rem 0.35rem;
  font-family: "IBM Plex Mono", "Cascadia Code", monospace;
}

.shell-header,
.layout {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.shell-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  padding: 24px 0 10px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
  font-weight: 800;
}

.brand img {
  width: 42px;
  height: 42px;
}

.header-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.header-links a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 700;
}

.language-picker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid rgba(221, 209, 189, 0.9);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  font-weight: 700;
}

.language-picker select {
  width: auto;
  min-height: 0;
  padding: 0 18px 0 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 700;
}

.language-picker select:focus {
  outline: none;
}

.layout {
  padding: 18px 0 48px;
}

.hero-card,
.panel {
  background: var(--panel);
  border: 1px solid rgba(216, 203, 184, 0.9);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.hero-card {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 28px;
  padding: 28px;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--brand);
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0 0 12px;
  line-height: 1.1;
  font-family: "Noto Serif", Georgia, serif;
}

h1 {
  font-size: clamp(1rem, 2vw, 1.75rem);
}

h2 {
  font-size: clamp(1.05rem, 1.5vw, 1.35rem);
}

.lead,
.panel-heading p,
.status-text,
.status-detail,
.help-box li,
.tips li,
.hero-note li {
  color: var(--muted);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 24px;
  align-items: start;
}

.panel {
  padding: 24px;
}

.panel-heading {
  margin-bottom: 18px;
}

.panel-heading-status {
  margin-top: 26px;
}

.grid {
  display: grid;
  gap: 16px;
}

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

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.field span {
  font-weight: 700;
}

.field-inline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

input,
select,
button,
progress {
  font: inherit;
}

input,
select {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
}

input:focus,
select:focus {
  outline: 2px solid rgba(15, 138, 123, 0.18);
  border-color: var(--brand);
}

input:disabled,
select:disabled {
  background: rgba(92, 103, 112, 0.08);
  color: rgba(23, 32, 40, 0.45);
  border-color: rgba(216, 203, 184, 0.8);
  cursor: not-allowed;
}

input[type="file"] {
  padding: 10px 12px;
}

input[type="file"]::file-selector-button {
  margin-right: 14px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(23, 93, 152, 0.1), rgba(15, 138, 123, 0.12));
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

input[type="file"]::file-selector-button:hover {
  border-color: var(--brand);
}

.help-box,
.tips,
.hero-note,
.result-card {
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 250, 239, 0.78);
  border: 1px solid rgba(216, 203, 184, 0.9);
}

.help-box p,
.tips h3,
.hero-note h2 {
  margin-top: 0;
}

.help-box + .help-box,
.result-card + .tips {
  margin-top: 18px;
}

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

.actions-side {
  margin-top: 0;
  margin-bottom: 20px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border: none;
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
  font-weight: 700;
  transition: transform 120ms ease, box-shadow 120ms ease, opacity 120ms ease;
}

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

.button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  box-shadow: none;
}

.button-primary {
  background: linear-gradient(135deg, var(--brand-dark), var(--brand));
  color: #fff;
  box-shadow: var(--shadow);
}

.button-secondary {
  background: rgba(255, 255, 255, 0.84);
  color: var(--text);
  border: 1px solid var(--line);
}

.button-inline {
  white-space: nowrap;
}

.status-stack {
  display: grid;
  gap: 12px;
}

.status-badge {
  display: inline-flex;
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(15, 138, 123, 0.12);
  color: var(--brand);
  font-weight: 800;
}

.status-badge.is-error {
  background: rgba(158, 63, 47, 0.12);
  color: var(--danger);
}

progress {
  width: 100%;
  height: 14px;
  overflow: hidden;
  border: none;
  border-radius: 999px;
  background: rgba(216, 203, 184, 0.7);
}

progress::-webkit-progress-bar {
  background: rgba(216, 203, 184, 0.7);
  border-radius: 999px;
}

progress::-webkit-progress-value {
  background: linear-gradient(90deg, var(--brand), var(--accent));
  border-radius: 999px;
}

progress::-moz-progress-bar {
  background: linear-gradient(90deg, var(--brand), var(--accent));
  border-radius: 999px;
}

.status-text,
.status-detail {
  margin: 0;
}

.result-card {
  margin-top: 24px;
}

.result-card p {
  margin-top: 0;
  color: var(--muted);
}

.hidden {
  display: none;
}

ul {
  padding-left: 18px;
}

@media (max-width: 920px) {
  .hero-card,
  .workspace {
    grid-template-columns: 1fr;
  }
}

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

  .field-inline {
    grid-template-columns: 1fr;
  }

  .panel,
  .hero-card {
    padding: 20px;
    border-radius: 22px;
  }
}
