:root {
  --qlm-ink: #162033;
  --qlm-soft: #66758d;
  --qlm-line: #dfe5ef;
  --qlm-accent: #a1121f;
  --qlm-accent-soft: #f7dde0;
  --qlm-panel: #ffffff;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(161, 18, 31, 0.08), transparent 24%),
    linear-gradient(180deg, #fafbfd 0%, #eff4f9 100%);
  color: var(--qlm-ink);
}

a {
  color: inherit;
  text-decoration: none;
}

.hidden {
  display: none !important;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(16px);
  background: rgba(250, 251, 253, 0.9);
  border-bottom: 1px solid rgba(22, 32, 51, 0.08);
}

.topbar-inner {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  min-height: 4.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.brand,
.topnav {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.brand {
  font-weight: 700;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 0.9rem;
  background: var(--qlm-accent);
  color: white;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
}

.topnav a {
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  color: var(--qlm-soft);
}

.topnav a:hover {
  background: rgba(22, 32, 51, 0.06);
  color: var(--qlm-ink);
}

.app-shell {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.25rem 0 3rem;
}

.hero-card,
.form-card,
.tips-card,
.job-card {
  border-radius: 1.6rem;
  border: 1px solid rgba(22, 32, 51, 0.08);
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.06);
  background: rgba(255, 255, 255, 0.92);
}

.hero-card {
  padding: 1.5rem;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1rem;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: var(--qlm-accent-soft);
  color: var(--qlm-accent);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.85rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2rem;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  background: #eef2f7;
  color: #334155;
  font-size: 0.85rem;
  font-weight: 700;
}

.chip.fill {
  background: var(--qlm-accent-soft);
  color: var(--qlm-accent);
}

.hero-copy h1,
.section-head h2 {
  margin: 0;
  letter-spacing: -0.03em;
}

.hero-copy h1 {
  font-size: clamp(2rem, 3vw, 3.1rem);
}

.hero-copy p,
.tips-card p,
.helper-text,
.job-meta,
.job-subline {
  color: var(--qlm-soft);
}

.preview-card {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1rem;
  align-items: center;
  padding: 0.9rem;
}

.preview-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 1rem;
  object-fit: cover;
  background: #dbe4ef;
}

.panel-grid {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
  gap: 1rem;
}

.form-card,
.tips-card {
  padding: 1.25rem;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: center;
  margin-bottom: 1rem;
}

.stack {
  display: grid;
  gap: 1rem;
}

.field {
  display: grid;
  gap: 0.45rem;
}

.field > span {
  font-size: 0.9rem;
  color: var(--qlm-soft);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--qlm-line);
  border-radius: 1rem;
  padding: 0.9rem 1rem;
  background: var(--qlm-panel);
  font: inherit;
  color: var(--qlm-ink);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid rgba(161, 18, 31, 0.16);
  border-color: rgba(161, 18, 31, 0.35);
}

.textarea-field textarea {
  min-height: 9rem;
  resize: vertical;
}

.option-grid {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.form-actions {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.toggle {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  color: var(--qlm-soft);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 2.9rem;
  padding: 0.8rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(22, 32, 51, 0.1);
  background: white;
  color: var(--qlm-ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.button.fill {
  background: var(--qlm-accent);
  border-color: var(--qlm-accent);
  color: white;
}

.button.border {
  background: transparent;
}

.button.small {
  min-height: 2.3rem;
  padding: 0.55rem 0.8rem;
  font-size: 0.9rem;
}

.button.disabled {
  opacity: 0.45;
  pointer-events: none;
}

.chip-cloud {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.jobs-section {
  margin-top: 1.5rem;
}

.jobs-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.job-card {
  padding: 1rem;
  background: rgba(255, 255, 255, 0.86);
}

.job-card-head,
.job-actions,
.job-status-row {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.job-title {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
}

.job-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 1rem;
  object-fit: cover;
  background: #dbe4ef;
  margin: 0.9rem 0;
}

.job-meta {
  font-size: 0.9rem;
}

.job-progress {
  width: 100%;
  height: 0.65rem;
  appearance: none;
  margin: 0.7rem 0 0;
}

.job-progress::-webkit-progress-bar {
  background: #e7edf5;
  border-radius: 999px;
}

.job-progress::-webkit-progress-value {
  background: linear-gradient(90deg, #a1121f, #d14c57);
  border-radius: 999px;
}

.job-progress::-moz-progress-bar {
  background: linear-gradient(90deg, #a1121f, #d14c57);
  border-radius: 999px;
}

.status-chip {
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.status-queued { background: #eef2f7; color: #334155; }
.status-running { background: #fde7ea; color: #a1121f; }
.status-done { background: #dcf5e4; color: #166534; }
.status-error { background: #fee2e2; color: #b91c1c; }
.status-deleted { background: #eceff4; color: #64748b; }

@media (max-width: 880px) {
  .topbar-inner,
  .topnav,
  .hero-card,
  .panel-grid {
    grid-template-columns: 1fr;
  }

  .topbar-inner {
    padding: 0.75rem 0;
    align-items: flex-start;
  }
}
