:root {
  --bg: #eef1f4;
  --panel: #ffffff;
  --ink: #14212f;
  --muted: #617080;
  --line: #cfd7df;
  --line-strong: #aeb8c4;
  --brand: #00766f;
  --brand-dark: #064f4a;
  --dark: #0e1721;
  --good: #0f8a5f;
  --bad: #b42318;
  --warn: #f7b500;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 248px;
  padding: 18px 14px;
  background: var(--dark);
  color: #fff;
  border-right: 1px solid #000;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  margin-bottom: 14px;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 4px;
  background: var(--brand);
  font-weight: 900;
}

.brand strong {
  display: block;
  font-size: 15px;
}

.brand span:last-child {
  display: block;
  color: #9fb0c0;
  font-size: 12px;
  margin-top: 2px;
}

nav {
  display: grid;
  gap: 2px;
}

nav a {
  color: #dce4ec;
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 700;
}

nav a:hover {
  background: rgba(255, 255, 255, 0.1);
}

main {
  margin-left: 248px;
  padding: 22px;
  max-width: 1500px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 26px;
}

h2 {
  font-size: 19px;
}

h3 {
  font-size: 16px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.flow-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border: 1px solid var(--line-strong);
  background: #fff;
  margin-bottom: 14px;
}

.flow-step {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 6px 10px;
  padding: 14px;
  border-right: 1px solid var(--line);
  min-height: 82px;
}

.flow-step:last-child {
  border-right: 0;
}

.flow-step span {
  grid-row: span 2;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  background: #dfe6ed;
  border-radius: 50%;
  font-weight: 900;
}

.flow-step.active span {
  background: var(--brand);
  color: white;
}

.flow-step small {
  color: var(--muted);
}

.status-grid {
  display: grid;
  grid-template-columns: 260px 190px 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.status-box,
.panel,
.sub-panel {
  background: var(--panel);
  border: 1px solid var(--line-strong);
}

.status-box {
  padding: 12px;
}

.status-box strong {
  display: flex;
  align-items: center;
  min-height: 38px;
  color: var(--brand-dark);
}

.panel {
  margin-bottom: 14px;
  padding: 18px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}

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

.sub-panel {
  padding: 14px;
}

.sub-panel h3 {
  margin-bottom: 12px;
}

label {
  display: block;
  color: #314253;
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 6px;
}

input,
select {
  width: 100%;
  height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  padding: 0 10px;
  color: var(--ink);
  background: #fff;
  font: inherit;
}

input[readonly] {
  background: #f5f7f9;
}

button,
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid var(--brand-dark);
  border-radius: 3px;
  padding: 0 14px;
  background: var(--brand);
  color: white;
  cursor: pointer;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

button:hover,
.button-link:hover {
  background: var(--brand-dark);
}

.secondary-button {
  background: #233142;
  border-color: #15202d;
}

.secondary-button:hover {
  background: #15202d;
}

.icon-button {
  width: 42px;
  padding: 0;
  font-size: 20px;
}

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

.toolbar-form {
  display: grid;
  grid-template-columns: 1.4fr 170px 140px auto auto;
  gap: 10px;
  align-items: end;
}

.stack-form {
  display: grid;
  gap: 10px;
}

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

.action-row {
  display: flex;
  gap: 10px;
  align-items: end;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 3px;
  padding: 0 10px;
  background: #e4f4f2;
  border: 1px solid #b7ddd8;
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 900;
}

.selected-line {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
  padding: 10px 12px;
  background: #f5f7f9;
  border: 1px solid var(--line);
}

.tokens,
.product-grid,
.diagnostics {
  display: grid;
  gap: 10px;
}

.tokens {
  margin-bottom: 14px;
}

.token-card {
  display: grid;
  gap: 4px;
  width: 100%;
  min-height: auto;
  border: 1px solid var(--line-strong);
  border-left: 4px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  text-align: left;
  padding: 10px;
}

.token-card.selected {
  border-left-color: var(--brand);
  background: #f0faf8;
}

.token-card span,
.token-card small,
.hint,
.empty {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.product-grid {
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  margin-top: 12px;
}

.product-card {
  border: 1px solid var(--line-strong);
  background: #fff;
  padding: 10px;
}

.product-card img,
.image-placeholder {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border: 1px solid var(--line);
  margin-bottom: 10px;
}

.image-placeholder {
  display: grid;
  place-items: center;
  background: #f3f5f7;
  color: var(--muted);
}

.product-card h3 {
  font-size: 14px;
  min-height: 42px;
}

.product-card p {
  margin: 6px 0;
  color: var(--muted);
  font-size: 13px;
  word-break: break-all;
}

.diagnostic {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--bad);
  background: #fff;
}

.diagnostic.ok {
  border-left-color: var(--good);
}

.diagnostic strong {
  font-size: 14px;
}

.diagnostic span {
  color: var(--muted);
  font-size: 13px;
}

pre {
  min-height: 220px;
  max-height: 520px;
  overflow: auto;
  margin: 14px 0 0;
  padding: 14px;
  background: #0f1720;
  color: #dbeafe;
  border-radius: 3px;
  line-height: 1.5;
}

@media (max-width: 1100px) {
  .flow-strip,
  .status-grid,
  .split,
  .publish-form,
  .toolbar-form {
    grid-template-columns: 1fr;
  }

  .flow-step {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 820px) {
  .sidebar {
    position: static;
    width: auto;
  }

  main {
    margin-left: 0;
    padding: 14px;
  }
}
