:root {
  --gold: #dc9a1d;
  --gold-soft: #ddc39a;
  --chrome-bg: #1a2735;
  --chrome-bg-alt: #213142;
  --chrome-fg: #f5eedb;
  --chrome-muted: rgba(245, 238, 219, 0.74);
  --page-bg: #48525d;
  --line: rgba(220, 154, 29, 0.24);
  --line-strong: rgba(220, 154, 29, 0.52);
  --disabled-bg: rgba(245, 238, 219, 0.08);
  --disabled-fg: rgba(245, 238, 219, 0.36);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  color: var(--chrome-fg);
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top, rgba(220, 154, 29, 0.18), transparent 32%),
    linear-gradient(180deg, #56626e 0%, var(--page-bg) 36%, #3c4650 100%);
}

.app-shell {
  min-height: 100vh;
}

#top-brand-bar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  padding: 14px 28px;
  background: linear-gradient(180deg, rgba(26, 39, 53, 0.98), rgba(26, 39, 53, 0.94));
  border-bottom: 2px solid var(--gold);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.brand-mark {
  display: flex;
  align-items: center;
  min-height: 50px;
  color: var(--chrome-fg);
  text-decoration: none;
}

.brand-mark-text {
  display: block;
  max-width: 240px;
  color: inherit;
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.2;
  text-transform: uppercase;
}

.brand-kicker,
.panel-eyebrow {
  margin: 0;
  color: var(--gold-soft);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.brand-paid-message {
  margin: 0;
  min-width: 0;
  max-height: calc(1.45em * 2);
  overflow: hidden;
  padding: 0 8px;
  color: rgba(245, 238, 219, 0.92);
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: 0.9rem;
  line-height: 1.45;
  text-align: center;
  text-wrap: balance;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.brand-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px 14px;
}

.brand-nav a {
  color: var(--chrome-fg);
  text-decoration: none;
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.brand-nav a:hover,
.brand-mark:hover {
  color: var(--gold-soft);
}

.brand-nav a:hover {
  background-color: rgba(220, 154, 29, 0.14);
  border-color: rgba(220, 154, 29, 0.55);
}

.brand-nav .brand-contact-link {
  font-size: 0.66rem;
  letter-spacing: 0.01em;
  text-transform: none;
}

.tool-heading h2,
.status-main h2,
.preview-card__header h2 {
  margin: 0;
  color: var(--gold-soft);
  font-family: "Libre Baskerville", Georgia, serif;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.workspace {
  max-width: 1500px;
  margin: 0 auto;
  padding: 20px;
  display: grid;
  grid-template-columns: minmax(320px, 390px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.panel {
  background: linear-gradient(180deg, rgba(26, 39, 53, 0.96), rgba(17, 26, 36, 0.98));
  border: 1px solid var(--line-strong);
}

.sidebar {
  position: sticky;
  top: 20px;
  padding: 18px;
}

.tool-heading {
  padding-bottom: 14px;
}

.tool-heading h2 {
  font-size: 1.15rem;
  line-height: 1.2;
}

.control-group {
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.control-group h3 {
  margin: 0 0 12px;
  color: var(--gold-soft);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.sidebar-note {
  margin: 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--chrome-muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.file-drop {
  display: grid;
  gap: 6px;
  padding: 18px 16px;
  border: 1px dashed var(--line-strong);
  background: rgba(245, 238, 219, 0.03);
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.file-drop:hover,
.file-drop.is-dragging {
  background: rgba(220, 154, 29, 0.08);
  border-color: rgba(220, 154, 29, 0.72);
}

.file-drop__title {
  color: var(--chrome-fg);
  font-size: 1rem;
  font-weight: 700;
}

.file-drop__subtitle,
.file-drop__meta,
.preview-meta,
.status-meta,
output {
  color: var(--chrome-muted);
}

.file-drop__meta {
  font-size: 0.88rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.button {
  appearance: none;
  width: 100%;
  padding: 0.78rem 1rem;
  border: 1px solid var(--gold);
  border-radius: 0;
  background: rgba(245, 238, 219, 0.03);
  color: var(--chrome-fg);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.button:hover:not(:disabled) {
  background: rgba(220, 154, 29, 0.14);
}

.button:disabled {
  border-color: rgba(245, 238, 219, 0.14);
  background: var(--disabled-bg);
  color: var(--disabled-fg);
  cursor: not-allowed;
}

.button--ghost {
  border-color: var(--line-strong);
  background: transparent;
}

.button--small {
  width: auto;
  white-space: nowrap;
}

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

.field + .field {
  margin-top: 12px;
}

.field__top,
.field--inline {
  display: grid;
  gap: 10px;
}

.field__top {
  grid-template-columns: 1fr auto;
  align-items: center;
  color: var(--chrome-fg);
  font-weight: 500;
}

.field__label {
  color: var(--chrome-fg);
  font-weight: 500;
}

input[type="range"] {
  width: 100%;
  margin: 0;
  accent-color: var(--gold-soft);
  cursor: pointer;
}

.text-input {
  width: 100%;
  min-width: 0;
  padding: 0.78rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(245, 238, 219, 0.04);
  color: var(--chrome-fg);
  font: inherit;
}

.seed-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.stage {
  display: grid;
  gap: 18px;
}

.status-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.75fr);
  gap: 18px;
  align-items: center;
  padding: 16px 18px;
}

.status-main h2,
.preview-card__header h2 {
  font-size: 1rem;
  line-height: 1.2;
}

.status-meta {
  display: grid;
  gap: 6px;
  text-align: right;
  line-height: 1.5;
  font-size: 0.92rem;
}

.status-meta p,
.preview-meta {
  margin: 0;
}

.preview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.preview-card {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 620px;
}

.preview-card__header {
  display: grid;
  gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.preview-stage {
  padding: 18px;
}

.preview-stage canvas {
  width: 100%;
  height: min(68vh, 720px);
  display: block;
  border: 1px solid var(--line);
  background-image:
    linear-gradient(45deg, rgba(245, 238, 219, 0.06) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(245, 238, 219, 0.06) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(245, 238, 219, 0.06) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(245, 238, 219, 0.06) 75%);
  background-size: 24px 24px;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
  background-color: rgba(245, 238, 219, 0.03);
}

@media (max-width: 1100px) {
  #top-brand-bar {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 12px;
  }

  .brand-nav {
    justify-content: center;
  }
}

@media (max-width: 1180px) {
  .workspace,
  .preview-grid,
  .status-bar {
    grid-template-columns: 1fr;
  }

  .status-meta {
    text-align: left;
  }

  .sidebar {
    position: static;
  }
}

@media (max-width: 760px) {
  #top-brand-bar,
  .workspace {
    padding-left: 14px;
    padding-right: 14px;
  }

  #top-brand-bar {
    gap: 10px;
  }

  .sidebar,
  .status-bar,
  .preview-card__header,
  .preview-stage {
    padding-left: 14px;
    padding-right: 14px;
  }

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

  .preview-card {
    min-height: 0;
  }

  .preview-stage canvas {
    height: min(56vh, 440px);
  }
}
