:root {
  --bg: #ffffff;
  --bg-soft: #f6f6f6;
  --panel: #ffffff;
  --panel-strong: #ffffff;
  --line: #dde1e6;
  --text: #1a1a2e;
  --muted: #5a6070;
  --brand: #024594;
  --brand-dark: #024594;
  --accent: #6bb024;
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  color: var(--text);
  font-family: "Inter", sans-serif;
  background: var(--bg-soft);
}

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

.shell {
  max-width: 1600px;
  margin: 0 auto;
  padding: 140px 40px 80px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.85fr) minmax(300px, 0.85fr);
  gap: 24px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
  gap: 60px;
  margin-bottom: 32px;
  padding: 56px 56px 48px;
  box-shadow: none;
}

body.authenticated .shell {
  padding-top: 28px;
}

body.authenticated .hero {
  grid-template-columns: 1fr;
  gap: 18px;
  margin-bottom: 20px;
  padding: 20px 28px;
}

body.authenticated .hero-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

body.authenticated .hero-title {
  margin: 0;
  font-size: 1.65rem;
  line-height: 1.1;
}

body.authenticated .hero-text,
body.authenticated .hero-actions,
body.authenticated .hero-metrics,
body.authenticated .auth-eyebrow {
  display: none !important;
}

body.authenticated .auth-strip {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.hero h1 {
  margin: 0;
  font-size: clamp(3rem, 5.5vw, 5.2rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  font-weight: 600;
}

.hero-text {
  max-width: 36rem;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  line-height: 1.6;
}

.brand-mark {
  display: inline-flex;
  margin-bottom: 24px;
  align-items: center;
  text-decoration: none;
}

.brand-wordmark {
  color: var(--text);
  letter-spacing: -0.02em;
  white-space: nowrap;
  font-size: 1.5rem;
  font-weight: 700;
}

.brand-o {
  color: var(--brand);
}

.hero-actions {
  margin-top: 22px;
}

.auth-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.auth-eyebrow {
  margin-bottom: 8px;
}

.auth-summary {
  margin: 0;
  color: var(--muted);
}

.auth-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.google-login:empty {
  min-width: 220px;
  min-height: 40px;
}

.hidden {
  display: none !important;
}

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

.hero-metrics {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-content: start;
}

.metric {
  padding: 24px;
  border-radius: 4px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
}

.metric-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.editor-panel,
.rail-panel {
  padding: 32px;
}

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

.section-head h2,
.card-head h3 {
  margin: 0;
}

.status-text {
  margin: 0;
  padding: 10px 14px;
  border-radius: 4px;
  background: rgba(2, 69, 148, 0.08);
  color: var(--brand-dark);
  font-size: 0.86rem;
}

.status-text.error {
  background: rgba(192, 57, 43, 0.08);
  color: #c0392b;
}

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

.card {
  padding: 20px;
  border-radius: 4px;
  background: var(--panel-strong);
  border-top: 3px solid var(--brand);
  border-right: none;
  border-bottom: none;
  border-left: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.card-span-1 {
  grid-column: span 1;
}

.card-span-3 {
  grid-column: span 3;
}

.card-head {
  margin-bottom: 16px;
}

.card-head-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.card-head p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

label {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 0.88rem;
  font-weight: 600;
}

.fields {
  display: grid;
  gap: 14px;
}

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

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #ffffff;
  color: var(--text);
  padding: 13px 14px;
  transition: border-color 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(2, 69, 148, 0.1);
}

textarea {
  min-height: 140px;
  resize: vertical;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
  line-height: 1.55;
}

textarea.invalid {
  border-color: #c0392b;
  box-shadow: inset 0 0 0 1px rgba(192, 57, 43, 0.2);
}

.field-note {
  min-height: 1.2em;
  color: var(--brand-dark);
  font-size: 0.78rem;
}

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

.hotspot-layout {
  display: grid;
  grid-template-columns: minmax(320px, 1.1fr) minmax(0, 1fr);
  gap: 18px;
}

.hotspot-preview-panel {
  display: grid;
  gap: 12px;
}

#hotspot-preview {
  width: 100%;
  min-height: 420px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background:
    radial-gradient(circle at top, rgba(2, 69, 148, 0.06), transparent 48%),
    linear-gradient(180deg, #f8f8f8 0%, #f1f1f1 100%);
}

.preview-hotspot {
  width: 18px;
  height: 18px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(107, 176, 36, 0.18);
}

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

.upload-drop {
  padding: 18px;
  border-radius: 4px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
}

.maturity-card {
  display: grid;
  gap: 18px;
  padding: 20px 0 4px;
}

.maturity-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.maturity-label {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.maturity-score {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.maturity-message {
  max-width: 32rem;
  margin: 0;
  color: var(--muted);
  text-align: right;
}

.progress-track {
  width: 100%;
  height: 14px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #024594 0%, #6bb024 100%);
  transition: width .35s ease;
}

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

.maturity-item {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.92rem;
}

.maturity-item.done {
  color: var(--text);
  font-weight: 600;
}

.maturity-dot {
  width: 12px;
  height: 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  flex: 0 0 auto;
}

.maturity-item.done .maturity-dot {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(107, 176, 36, 0.12);
}

.stack-list {
  display: grid;
  gap: 16px;
}

.stack-item {
  padding: 18px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
}

.stack-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.stack-item-head-copy {
  display: grid;
  gap: 4px;
}

.stack-item-head-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.advanced-json {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.advanced-json summary {
  cursor: pointer;
  font-weight: 600;
}

.advanced-json-grid {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.file-picker {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.file-picker input {
  display: none;
}

.file-picker span,
button {
  border: 0;
  border-radius: 3px;
  padding: 12px 18px;
  color: #fff;
  cursor: pointer;
  transition: transform 140ms ease, opacity 140ms ease, background-color 0.2s ease;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  padding: 12px 18px;
  background: var(--brand);
  color: #fff;
  text-decoration: none;
  transition: all .2s ease;
}

.secondary-link {
  background: var(--accent);
}

.file-picker span,
button:not(.ghost):not(.secondary) {
  background: var(--brand);
}

button.secondary {
  background: var(--accent);
}

button.ghost {
  background: transparent;
  color: var(--brand);
  border: 1px solid var(--line);
}

button.danger {
  color: #c0392b;
  border-color: #c0392b;
}

button:hover,
.file-picker span:hover,
.button-link:hover {
  transform: translateY(-1px);
  opacity: 0.92;
}

.upload-meta {
  display: flex;
  align-items: end;
  gap: 12px;
}

.upload-meta label {
  flex: 1;
  margin: 0;
}

.asset-targets {
  display: grid;
  gap: 12px;
  align-content: start;
}

.hint {
  margin: 14px 0 0;
  color: var(--muted);
  font-family: "Trebuchet MS", sans-serif;
  font-size: 0.82rem;
}

.upload-progress {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: #fff;
}

.upload-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.upload-progress-head span {
  color: var(--muted);
  font-size: 0.88rem;
}

.upload-progress-head strong {
  font-size: 0.92rem;
}

.upload-progress-track {
  height: 10px;
}

.upload-progress-bar {
  transition: width 120ms linear;
}

.uploads-list,
.list {
  display: grid;
  gap: 12px;
}

.upload-card,
.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  padding: 16px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: #ffffff !important;
  color: var(--text) !important;
  text-align: left;
}

.list-item {
  flex-direction: column;
  align-items: start;
  cursor: pointer;
}

button.list-item {
  border-radius: 4px;
  transform: none !important;
  opacity: 1 !important;
}

button.list-item:hover {
  border-color: var(--brand);
}

.list-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.list-slug,
.badge,
.upload-path,
.upload-name,
.empty {
  font-family: "Inter", sans-serif;
}

.list-slug {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.list-progress {
  display: grid;
  gap: 6px;
  width: 100%;
  margin-top: 10px;
}

.mini-progress-track {
  width: 100%;
  height: 8px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 2px;
  overflow: hidden;
}

.mini-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #024594 0%, #6bb024 100%);
}

.mini-progress-label {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.badge {
  padding: 6px 10px;
  border-radius: 3px;
  background: rgba(2, 69, 148, 0.08);
  color: var(--brand-dark);
  font-size: 0.75rem;
}

.mini-link {
  color: var(--brand-dark);
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
}

.mini-link:hover {
  text-decoration: underline;
  color: var(--accent);
}

.upload-name {
  margin: 0 0 4px;
  font-size: 0.96rem;
  font-weight: 700;
}

.upload-path {
  color: var(--brand-dark);
  font-size: 0.84rem;
  word-break: break-all;
}

.tenant-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  width: fit-content;
  margin-top: 24px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
}

.tenant-label {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tenant-picker {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px;
}

.tenant-picker-copy {
  color: var(--muted);
  line-height: 1.6;
}

.tenant-options {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 24px;
}

.tenant-option {
  min-width: 180px;
  padding: 18px 24px;
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.tenant-option:hover {
  background: #035ab8;
}

.upload-actions {
  display: flex;
  gap: 10px;
}

.mini {
  padding: 9px 12px;
  font-size: 0.82rem;
}

.empty {
  margin: 0;
  color: var(--muted);
}

.actions {
  display: flex;
  gap: 12px;
}

@media (max-width: 1120px) {
  .workspace,
  .hero,
  .upload-grid,
  .hotspot-layout,
  .auth-strip,
  .fields-2,
  .fields-3 {
    grid-template-columns: 1fr;
  }

  .card-span-1,
  .card-span-3 {
    grid-column: span 3;
  }

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

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

@media (max-width: 760px) {
  .shell {
    padding: 96px 16px 48px;
  }

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

  .card-span-1,
  .card-span-3 {
    grid-column: span 1;
  }

  .actions,
  .upload-meta,
  .upload-card,
  .maturity-head,
  .stack-item-head {
    flex-direction: column;
    align-items: stretch;
  }

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

  .maturity-message {
    text-align: left;
  }
}
