:root {
  --bg: #f2efe7;
  --bg-strong: #e8dfcc;
  --panel: rgba(255, 251, 244, 0.9);
  --panel-border: rgba(107, 78, 39, 0.16);
  --text: #2d2418;
  --muted: #6f614d;
  --accent: #8a431d;
  --accent-strong: #6c2f10;
  --accent-soft: rgba(138, 67, 29, 0.12);
  --success: #1d6d45;
  --warning: #9b6a1f;
  --danger: #8a2f2f;
  --shadow: 0 18px 40px rgba(83, 54, 23, 0.12);
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --font-body: "Segoe UI", "PingFang SC", "Noto Sans SC", sans-serif;
  --font-display: "Georgia", "Times New Roman", serif;
  --font-mono: "Consolas", "SFMono-Regular", monospace;
}

* {
  box-sizing: border-box;
}

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

body {
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.8), transparent 32%),
    linear-gradient(160deg, #f7f1e7 0%, #ede4d4 52%, #ddd0bb 100%);
  color: var(--text);
  font-family: var(--font-body);
}

code,
pre,
select,
input,
button {
  font-family: var(--font-mono);
}

.shell {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 64px;
}

.hero {
  padding: 18px 0 30px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 6vw, 4.4rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.hero-copy {
  max-width: 720px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.7;
}

.panel {
  margin-top: 18px;
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

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

.field-wide {
  grid-column: 1 / -1;
}

.field label {
  font-size: 0.94rem;
  font-weight: 700;
}

input[type="file"],
input[type="text"],
select {
  width: 100%;
  min-height: 48px;
  padding: 13px 14px;
  border: 1px solid rgba(69, 49, 24, 0.16);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.75);
  color: var(--text);
  font-size: 1rem;
  line-height: 1.25;
}

input[type="text"],
select {
  height: 48px;
}

select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 42px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 19px) 50%,
    calc(100% - 13px) 50%;
  background-repeat: no-repeat;
  background-size: 6px 6px;
}

input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 8px 12px;
  border: 0;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  cursor: pointer;
}

input:focus,
select:focus,
button:focus,
a:focus {
  outline: 2px solid rgba(138, 67, 29, 0.28);
  outline-offset: 2px;
}

.checkbox-row {
  justify-content: flex-end;
}

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(69, 49, 24, 0.1);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.62);
  font-size: 0.95rem;
}

.checkbox input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.hint,
.muted {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.primary,
.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 700;
}

.primary {
  border: 0;
  background: linear-gradient(135deg, var(--accent), #b55d28);
  color: #fff9f4;
  cursor: pointer;
}

.primary:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.secondary {
  border: 1px solid rgba(69, 49, 24, 0.14);
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
}

.is-hidden {
  display: none;
}

.panel-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.panel h2 {
  margin: 0 0 6px;
  font-size: 1.15rem;
}

.engine-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.engine-card,
.placeholder {
  padding: 16px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.85), rgba(240, 231, 216, 0.92));
  border: 1px solid rgba(69, 49, 24, 0.1);
}

.engine-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1rem;
}

.engine-card span {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
  word-break: break-word;
}

.summary {
  overflow-x: auto;
  margin: 0;
  padding: 18px;
  border-radius: var(--radius-md);
  background: #221d17;
  color: #f6efe4;
  font-size: 0.9rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.notes {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.7;
}

@media (max-width: 820px) {
  .shell {
    width: min(100% - 20px, 1100px);
    padding-top: 28px;
  }

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

  .action-bar,
  .panel-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .checkbox-row {
    justify-content: flex-start;
  }
}
