:root {
  color-scheme: light;
  --bg: oklch(0.965 0.012 95);
  --panel: oklch(0.99 0.004 95);
  --panel-strong: oklch(0.973 0.008 95);
  --line: oklch(0.885 0.016 88);
  --line-strong: oklch(0.79 0.03 86);
  --text: oklch(0.25 0.02 92);
  --muted: oklch(0.48 0.018 90);
  --accent: oklch(0.66 0.13 75);
  --accent-soft: oklch(0.9 0.04 79);
  --green: oklch(0.62 0.13 150);
  --green-soft: oklch(0.91 0.03 150);
  --red: oklch(0.6 0.17 26);
  --red-soft: oklch(0.92 0.03 28);
  --amber: oklch(0.72 0.15 80);
  --amber-soft: oklch(0.93 0.03 83);
  --shadow: 0 18px 38px rgba(67, 48, 21, 0.08);
  --radius: 18px;
  --radius-sm: 12px;
  --content-width: 1420px;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  --sans: "Public Sans", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, rgba(215, 175, 81, 0.12), transparent 28%),
    radial-gradient(circle at left 20% bottom 10%, rgba(109, 169, 121, 0.09), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(246, 241, 233, 0.92));
  color: var(--text);
}

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

code,
pre,
.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.eyebrow {
  margin: 0 0 0.55rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.console-shell,
.auth-layout {
  width: min(calc(100% - 32px), var(--content-width));
  margin: 0 auto;
}

.auth-shell {
  display: grid;
  place-items: center;
  padding: 28px 0;
}

.auth-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr;
  gap: 20px;
  align-items: stretch;
}

.auth-panel,
.panel,
.summary-card,
.banner {
  border: 1px solid rgba(121, 93, 48, 0.12);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(250, 246, 239, 0.96));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.auth-panel {
  padding: 28px;
}

.auth-panel--hero {
  position: relative;
  overflow: hidden;
}

.auth-panel--hero::after {
  content: "";
  position: absolute;
  right: -50px;
  top: -80px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(213, 168, 62, 0.24), rgba(213, 168, 62, 0));
  pointer-events: none;
}

.auth-panel h1,
.topbar h1 {
  margin: 0;
  max-width: 12ch;
  font-size: clamp(2.1rem, 4.2vw, 4rem);
  line-height: 0.95;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.auth-copy,
.topbar-copy,
.panel-note,
.auth-panel p,
.summary-card p,
.runtime-list dd,
.empty-state {
  color: var(--muted);
  text-wrap: pretty;
}

.auth-grid {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.auth-grid article {
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  background: rgba(255, 251, 244, 0.72);
  border: 1px solid rgba(125, 95, 46, 0.1);
}

.auth-grid strong,
.summary-card strong {
  display: block;
  margin: 6px 0;
  font-size: 1.2rem;
}

.metric-label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.panel-heading h2 {
  margin: 0;
  font-size: 1.3rem;
  line-height: 1;
  letter-spacing: -0.03em;
}

.stack-form,
.settings-grid,
.inline-form {
  display: grid;
  gap: 14px;
}

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

.field,
.stack-form label {
  display: grid;
  gap: 8px;
}

.field span,
.stack-form span {
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.88);
  padding: 0.86rem 0.95rem;
  color: var(--text);
  transition-property: border-color, box-shadow, background-color;
  transition-duration: 160ms;
  transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible {
  outline: none;
  border-color: rgba(190, 140, 33, 0.65);
  box-shadow: 0 0 0 4px rgba(204, 156, 46, 0.12);
}

input:disabled {
  background: rgba(245, 238, 227, 0.92);
  color: var(--muted);
}

.field small {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  transition-property: transform, background-color, border-color, color, opacity;
  transition-duration: 160ms;
  transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
  touch-action: manipulation;
}

.button:active {
  transform: scale(0.97);
}

.button--primary {
  background: linear-gradient(180deg, rgba(211, 161, 45, 0.95), rgba(178, 125, 21, 0.98));
  color: white;
}

.button--secondary {
  background: rgba(223, 189, 118, 0.16);
  border-color: rgba(183, 140, 41, 0.2);
  color: var(--text);
}

.button--ghost {
  background: rgba(255, 255, 255, 0.7);
  border-color: rgba(125, 95, 46, 0.16);
  color: var(--text);
}

.button--danger {
  background: rgba(188, 74, 54, 0.08);
  border-color: rgba(188, 74, 54, 0.18);
  color: oklch(0.42 0.14 23);
}

.flash {
  margin: 0 0 16px;
  padding: 14px 16px;
  border-radius: 14px;
  font-weight: 600;
}

.flash--success {
  background: var(--green-soft);
  color: oklch(0.33 0.08 150);
}

.flash--error {
  background: var(--red-soft);
  color: oklch(0.4 0.12 24);
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  padding: 28px 0 18px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-chip,
.status-pill,
.inventory-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  font-size: 0.84rem;
  font-weight: 700;
}

.status-chip {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(125, 95, 46, 0.12);
}

.status-chip--ok,
.inventory-state--ok,
.status-pill--succeeded {
  color: oklch(0.35 0.09 150);
  background: var(--green-soft);
}

.status-chip--warn,
.status-pill--running,
.status-pill--queued {
  color: oklch(0.43 0.1 80);
  background: var(--amber-soft);
}

.status-pill--failed,
.inventory-state--miss {
  color: oklch(0.42 0.13 24);
  background: var(--red-soft);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
}

.banner {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 18px 20px;
  margin-bottom: 18px;
  background: linear-gradient(135deg, rgba(255, 246, 220, 0.98), rgba(246, 254, 243, 0.98));
}

.banner h2 {
  margin: 0;
  font-size: 1.15rem;
}

.key-display {
  display: grid;
  gap: 10px;
  justify-items: end;
}

.key-display code {
  display: inline-block;
  max-width: min(100%, 520px);
  overflow-wrap: anywhere;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
}

.summary-grid,
.main-grid,
.control-grid {
  display: grid;
  gap: 18px;
}

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

.summary-card,
.panel {
  padding: 20px;
}

.summary-card strong {
  font-size: clamp(1.7rem, 2vw, 2.4rem);
  letter-spacing: -0.04em;
}

.main-grid {
  grid-template-columns: minmax(0, 1.7fr) minmax(320px, 0.9fr);
  margin-top: 18px;
}

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

.bar-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
  min-height: 180px;
  align-items: end;
}

.bar-item {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.bar-track {
  position: relative;
  width: 100%;
  min-height: 140px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(239, 230, 207, 0.5), rgba(255, 255, 255, 0.85));
  border: 1px solid rgba(126, 96, 47, 0.08);
  overflow: hidden;
}

.bar-fill {
  position: absolute;
  inset: auto 0 0 0;
  min-height: 10px;
  background: linear-gradient(180deg, rgba(221, 176, 62, 0.92), rgba(170, 117, 24, 0.96));
  border-radius: 12px 12px 0 0;
}

.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(89, 67, 35, 0.08);
  vertical-align: top;
}

.data-table th {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: left;
}

.data-table td:nth-child(1),
.data-table td:nth-child(3),
.data-table td:nth-child(4),
.data-table td:nth-child(5),
.data-table td:nth-child(6),
.data-table td:nth-child(7) {
  text-align: right;
}

.error-cell {
  max-width: 280px;
  color: var(--muted);
}

.runtime-list {
  display: grid;
  gap: 12px;
  margin: 0;
}

.runtime-list div {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 252, 247, 0.8);
  border: 1px solid rgba(126, 96, 47, 0.08);
}

.runtime-list dt {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.runtime-list dd {
  margin: 0;
}

.runtime-error {
  overflow-wrap: anywhere;
}

.inventory-block + .inventory-block {
  margin-top: 18px;
}

.inventory-block h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

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

.inventory-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 252, 247, 0.78);
  border: 1px solid rgba(126, 96, 47, 0.08);
}

.inventory-list code {
  display: block;
  margin-top: 4px;
  font-size: 0.82rem;
  color: var(--muted);
}

.inline-form {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  margin-bottom: 16px;
}

.action-row {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.code-block {
  margin: 0;
  padding: 16px;
  border-radius: 14px;
  background: oklch(0.205 0.02 85);
  color: oklch(0.93 0.02 96);
  overflow-x: auto;
  line-height: 1.55;
}

.empty-state {
  padding: 18px 6px;
}

@media (hover: hover) {
  .button--ghost:hover,
  .button--secondary:hover,
  .button--danger:hover {
    border-color: rgba(163, 123, 35, 0.28);
    background: rgba(255, 255, 255, 0.95);
  }

  .button--primary:hover {
    filter: brightness(1.02);
  }
}

@media (max-width: 1080px) {
  .auth-layout,
  .main-grid,
  .control-grid,
  .summary-grid {
    grid-template-columns: 1fr;
  }

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

  .topbar,
  .banner {
    flex-direction: column;
    align-items: stretch;
  }

  .key-display {
    justify-items: stretch;
  }
}

@media (max-width: 720px) {
  .console-shell,
  .auth-layout {
    width: min(calc(100% - 20px), var(--content-width));
  }

  .auth-panel,
  .panel,
  .summary-card,
  .banner {
    padding: 16px;
    border-radius: 16px;
  }

  .bar-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .data-table td:nth-child(1),
  .data-table td:nth-child(3),
  .data-table td:nth-child(4),
  .data-table td:nth-child(5),
  .data-table td:nth-child(6),
  .data-table td:nth-child(7) {
    text-align: left;
  }

  .action-row {
    flex-direction: column;
  }

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}


.public-shell {
  width: min(calc(100% - 32px), var(--content-width));
  margin: 0 auto;
  padding: 28px 0 36px;
}

.public-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 20px;
  align-items: stretch;
  margin-bottom: 20px;
}

.public-hero__copy {
  position: relative;
  overflow: hidden;
  padding: clamp(24px, 4vw, 44px);
  border: 1px solid rgba(121, 93, 48, 0.12);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at right 12% top 10%, rgba(222, 174, 58, 0.22), transparent 26%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(249, 242, 230, 0.94));
  box-shadow: var(--shadow);
}

.public-hero h1 {
  margin: 0;
  max-width: 13ch;
  font-size: clamp(2.6rem, 7vw, 6.4rem);
  line-height: 0.92;
  letter-spacing: -0.07em;
  text-wrap: balance;
}

.hero-copy {
  max-width: 740px;
  color: var(--muted);
  font-size: clamp(1rem, 1.4vw, 1.2rem);
  line-height: 1.75;
  text-wrap: pretty;
}

.hero-actions,
.download-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 18px;
}

.hero-guide {
  display: grid;
  align-content: center;
}

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

.step-list li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 12px;
  padding: 14px;
  border: 1px solid rgba(126, 96, 47, 0.08);
  border-radius: 14px;
  background: rgba(255, 252, 247, 0.78);
}

.step-list strong {
  color: oklch(0.43 0.1 80);
}

.step-list span {
  color: var(--muted);
}

.public-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.72fr);
  gap: 18px;
  align-items: start;
}

.uploader-card,
.result-column {
  display: grid;
  gap: 18px;
}

.drop-zone {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: clamp(22px, 4vw, 42px);
  border: 2px dashed rgba(178, 125, 21, 0.34);
  border-radius: 22px;
  background: rgba(255, 252, 246, 0.7);
  text-align: center;
  cursor: pointer;
  transition: border-color 160ms cubic-bezier(0.2, 0, 0, 1), background-color 160ms cubic-bezier(0.2, 0, 0, 1), transform 160ms cubic-bezier(0.2, 0, 0, 1);
}

.drop-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.drop-zone__icon {
  font-size: 2.6rem;
}

.drop-zone small,
.helper-text,
.progress-note {
  color: var(--muted);
  line-height: 1.55;
}

.drop-zone--active {
  border-color: rgba(178, 125, 21, 0.72);
  background: rgba(255, 245, 220, 0.9);
  transform: translateY(-1px);
}

.option-section {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.option-section h3 {
  margin: 0;
  font-size: 1rem;
}

.option-grid {
  display: grid;
  gap: 10px;
}

.option-grid--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.option-card {
  display: grid;
  gap: 7px;
  padding: 14px;
  border: 1px solid rgba(126, 96, 47, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.68);
  cursor: pointer;
}

.option-card input {
  width: auto;
}

.option-card span {
  font-weight: 800;
}

.option-card small {
  color: var(--muted);
  line-height: 1.35;
}

.submit-button {
  width: 100%;
  margin-top: 18px;
}

.submit-button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.progress-note {
  margin: 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 252, 247, 0.78);
}

.progress-note[data-tone="success"] {
  color: oklch(0.35 0.09 150);
  background: var(--green-soft);
}

.progress-note[data-tone="error"] {
  color: oklch(0.42 0.13 24);
  background: var(--red-soft);
}

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

.preview-frame {
  display: grid;
  gap: 10px;
  margin: 0;
}

.preview-frame img,
.placeholder {
  width: 100%;
  min-height: 220px;
  max-height: 420px;
  object-fit: contain;
  border: 1px solid rgba(126, 96, 47, 0.1);
  border-radius: 16px;
  background:
    linear-gradient(45deg, rgba(126, 96, 47, 0.05) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(126, 96, 47, 0.05) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(126, 96, 47, 0.05) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(126, 96, 47, 0.05) 75%);
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
}

.placeholder {
  display: grid;
  place-items: center;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.preview-frame figcaption,
.job-meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.limit-list {
  display: grid;
  gap: 10px;
  padding-left: 1.2rem;
  color: var(--muted);
  line-height: 1.6;
}

.limit-list a {
  color: oklch(0.43 0.1 80);
  font-weight: 700;
}

@media (hover: hover) {
  .drop-zone:hover,
  .option-card:hover {
    border-color: rgba(178, 125, 21, 0.4);
    background: rgba(255, 255, 255, 0.92);
  }
}

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

@media (max-width: 720px) {
  .public-shell {
    width: min(calc(100% - 20px), var(--content-width));
    padding-top: 12px;
  }

  .option-grid--three,
  .preview-grid {
    grid-template-columns: 1fr;
  }

  .public-hero h1 {
    font-size: clamp(2.4rem, 17vw, 4.2rem);
  }
}
