:root {
  color-scheme: dark;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #080f17;
  color: #ffffff;
  --bg: #080f17;
  --panel: #0f1820;
  --panel-raised: #1a2332;
  --field: #0f1820;
  --ink: #ffffff;
  --ink-soft: #b9c7d5;
  --line: #2a3340;
  --line-strong: #3f4c5b;
  --accent: #28d0ff;
  --accent-strong: #83e5ff;
  --action: #0076ff;
  --action-strong: #28d0ff;
  --accent-ink: #ffffff;
  --hover-ink: #080f17;
  --green: #73d8a7;
  --amber: #f0c45c;
  --red: #ff8177;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% -120px, rgba(40, 208, 255, 0.15), transparent 320px),
    var(--bg);
  color: var(--ink);
}

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

.shell {
  width: min(1500px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.admin-access {
  margin-bottom: 14px;
}

.admin-access summary {
  margin-bottom: 0;
  color: var(--ink);
  list-style-position: inside;
}

.admin-access[open] summary {
  margin-bottom: 14px;
}

.admin-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto auto;
  align-items: end;
  gap: 12px;
}

.advanced-panel {
  align-content: start;
}

.advanced-panel summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
  list-style: none;
}

.advanced-panel summary::-webkit-details-marker {
  display: none;
}

.advanced-panel summary::before {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--accent);
  content: "+";
  font-weight: 900;
}

.advanced-panel[open] summary::before {
  content: "-";
}

.advanced-body {
  display: grid;
  gap: 14px;
}

.checkline {
  display: flex;
  min-height: 40px;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}

.checkline input {
  width: auto;
}

.field-note {
  margin: -4px 0 2px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.45;
}

.dashboard-note {
  grid-column: 1 / -1;
  margin: 0;
}

.flow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.flow-step {
  display: inline-grid;
  min-height: 30px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(26, 35, 50, 0.82);
  color: var(--ink-soft);
  padding: 0 12px;
  font-size: 0.78rem;
  font-weight: 800;
}

.flow-ok {
  border-color: rgba(115, 216, 167, 0.5);
  color: var(--green);
}

.flow-warn {
  border-color: rgba(240, 196, 92, 0.5);
  color: var(--amber);
}

.flow-bad {
  border-color: rgba(255, 129, 119, 0.55);
  color: var(--red);
}

.webhook-issue-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  border: 1px solid rgba(255, 129, 119, 0.5);
  border-radius: 8px;
  background: rgba(64, 28, 34, 0.72);
  padding: 14px 16px;
}

.webhook-issue-panel .eyebrow {
  color: var(--red);
}

.webhook-issue-summary {
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.webhook-issue-panel button {
  flex: 0 0 auto;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  max-width: 760px;
  font-size: 2.25rem;
  line-height: 1;
  letter-spacing: 0;
  font-family: "Michroma", sans-serif;
  font-weight: 400;
}

h2 {
  font-size: 1.05rem;
  line-height: 1.2;
}

h3 {
  font-size: 0.92rem;
  line-height: 1.2;
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.customer-shell {
  width: min(760px, calc(100vw - 32px));
  max-width: 760px;
}

.customer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(280px, 0.72fr);
  gap: 16px;
  align-items: start;
}

.customer-grid-single {
  width: min(100%, 620px);
  max-width: 620px;
  grid-template-columns: minmax(0, 1fr);
  margin: 0 auto;
}

.panel,
.result {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.42);
}

.panel {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.panel-head,
.result {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.panel-head {
  align-items: center;
}

.helper-box {
  min-width: 0;
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-raised);
  padding: 12px;
}

.helper-copy {
  color: var(--ink-soft);
  font-size: 0.84rem;
  line-height: 1.45;
  overflow-wrap: break-word;
}

.step,
.badge {
  display: inline-grid;
  min-width: 32px;
  min-height: 32px;
  place-items: center;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 0.82rem;
  font-weight: 800;
}

.step {
  border: 1px solid rgba(40, 208, 255, 0.42);
  background: rgba(40, 208, 255, 0.12);
  color: var(--accent);
}

.badge {
  border: 1px solid var(--line);
  background: var(--panel-raised);
}

.badge-ok {
  color: var(--green);
}

.badge-bad {
  color: var(--red);
}

.badge-muted {
  color: var(--ink-soft);
}

label {
  display: grid;
  gap: 6px;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 700;
}

input,
select,
textarea {
  min-width: 0;
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--field);
  color: var(--ink);
  padding: 10px 11px;
  outline: none;
}

input[type="checkbox"] {
  accent-color: var(--accent);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(40, 208, 255, 0.18);
}

.product-library {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-raised);
  padding: 12px;
}

.product-library-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.product-library-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px 12px;
}

/* Same squash-instead-of-scroll bug as .support-list — see the note there. */
.product-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow: auto;
}

.product-list > * { flex: 0 0 auto; }

.activation-dashboard {
  grid-column: 1 / -1;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: end;
}

.activation-dashboard .panel-head,
.activation-dashboard .actions,
.activation-dashboard #dashboardSummary,
.activation-dashboard .license-dashboard-wrap {
  grid-column: 1 / -1;
}

.activation-dashboard .dashboard-field {
  grid-column: span 3;
}

.activation-dashboard .dashboard-field-wide {
  grid-column: span 3;
}

.activation-dashboard .dashboard-field-narrow {
  grid-column: span 2;
}

.activation-dashboard .actions {
  justify-content: flex-start;
}

.activation-dashboard .actions button {
  flex: 0 1 180px;
}

.activation-dashboard #dashboardSummary {
  justify-self: stretch;
  min-height: 34px;
  text-align: center;
}

.license-dashboard-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-raised);
}

.license-dashboard {
  width: 100%;
  /*
   * Columns 5 (Customer) and 6 (Shop/order) take whatever the fixed-width columns
   * leave behind, so this must grow whenever a fixed width does — otherwise widening
   * one column silently squeezes the auto ones. The wrapper scrolls horizontally.
   */
  min-width: 1440px;
  border-collapse: collapse;
  table-layout: fixed;
}

.license-dashboard th,
.license-dashboard td {
  text-align: left;
  vertical-align: top;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  font-size: 0.8rem;
  line-height: 1.3;
}

.license-dashboard th:nth-child(1),
.license-dashboard td:nth-child(1) {
  width: 170px;
}

.license-dashboard th:nth-child(2),
.license-dashboard td:nth-child(2) {
  width: 210px;
}

.license-dashboard th:nth-child(3),
.license-dashboard td:nth-child(3) {
  width: 230px;
}

.license-dashboard th:nth-child(4),
.license-dashboard td:nth-child(4) {
  width: 200px;
}

.license-dashboard th:nth-child(7),
.license-dashboard td:nth-child(7) {
  width: 112px;
}

.license-dashboard th:nth-child(8),
.license-dashboard td:nth-child(8) {
  width: 140px;
}

.license-dashboard th {
  position: sticky;
  top: 0;
  z-index: 1;
  white-space: nowrap;
  background: var(--line);
  color: var(--ink-soft);
  font-weight: 800;
}

.license-dashboard tbody tr:last-child td {
  border-bottom: 0;
}

.license-dashboard tbody tr:hover td {
  background: var(--panel);
}

.license-dashboard .license-key,
.license-dashboard .core-id,
.license-dashboard .activation-id {
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 0.74rem;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.license-dashboard .license-status,
.license-dashboard .license-issued {
  white-space: nowrap;
}

/*
 * Product IDs are long dotted identifiers with no spaces (coreforge.crestron.nvx.licence).
 * With table-layout: fixed, `white-space: nowrap` made them overflow the cell and paint
 * over the Customer column instead of wrapping. Let them wrap at any character.
 */
.license-dashboard .license-product {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.license-dashboard .license-customer,
.license-dashboard .license-order {
  overflow-wrap: anywhere;
  word-break: normal;
}

.license-dashboard .badge {
  white-space: nowrap;
}

.product-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 4px 12px;
  width: 100%;
  height: auto;
  min-height: 64px;
  border-color: var(--line);
  background: var(--field);
  padding: 10px 11px;
  text-align: left;
}

.product-row:hover {
  background: var(--panel);
  color: var(--ink);
}

.product-row-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(40, 208, 255, 0.18);
}

.product-row-id,
.product-row-name,
.product-row-meta {
  min-width: 0;
  overflow-wrap: anywhere;
}

.product-row-id {
  color: var(--accent-strong);
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 0.78rem;
}

.product-row-name {
  color: var(--ink);
  font-size: 0.84rem;
}

.product-row-meta {
  grid-column: 1 / -1;
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.product-row-archived {
  border-color: rgba(240, 196, 92, 0.42);
}

.product-row-archived .product-row-meta {
  color: var(--amber);
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 6px;
  color: var(--ink-soft);
  padding: 12px;
  font-size: 0.84rem;
  line-height: 1.4;
}

.support-feed {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-raised);
  padding: 12px;
}

/*
 * Flex column, not grid. As a grid with a definite max-height this divided that height
 * between its rows: six ~116px rows were squashed to 40px each and their content
 * clipped instead of scrolling. `align-content: start` was not enough — grid track
 * sizing still compressed them. Flex with an explicit `flex: 0 0 auto` on the children
 * cannot shrink them, so every row keeps its natural height and the container scrolls.
 */
.support-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow: auto;
}

.support-list > * { flex: 0 0 auto; }

.support-item {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--field);
  padding: 10px 11px;
}

/* A stale checkout: created long ago, never completed. Amber, not red — it is a
   question to answer ("abandoned or lost webhook?"), not a confirmed failure. */
.support-item.support-item-warn {
  border-color: var(--amber);
}

.support-item.support-item-warn > strong {
  color: var(--amber);
}

.support-item strong,
.support-item span,
.support-item small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.support-item strong {
  color: var(--accent-strong);
  font-size: 0.82rem;
}

.support-item span {
  color: var(--ink);
  font-size: 0.84rem;
  line-height: 1.4;
}

.support-item small {
  color: var(--ink-soft);
  font-size: 0.76rem;
  line-height: 1.35;
}

textarea {
  min-height: 156px;
  resize: vertical;
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.45;
}

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

.actions button {
  flex: 1 1 150px;
}

button {
  min-width: 0;
  max-width: 100%;
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  padding: 0 14px;
  cursor: pointer;
  font-weight: 800;
  line-height: 1.2;
}

button:hover {
  border-color: var(--accent);
  color: var(--hover-ink);
  background: var(--accent);
}

button:disabled {
  cursor: wait;
  opacity: 0.7;
}

button.primary {
  border-color: var(--action);
  background: var(--action);
  color: var(--accent-ink);
}

button.primary:hover {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--hover-ink);
}

button.danger {
  border-color: rgba(255, 129, 119, 0.55);
  color: var(--red);
}

button.danger:hover {
  border-color: var(--red);
  background: var(--red);
  color: var(--hover-ink);
}

.wide {
  width: 100%;
}

.result {
  align-items: start;
  margin-top: 16px;
  padding: 18px;
}

.result-summary {
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.activation-message {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-raised);
  color: var(--ink-soft);
  padding: 11px 12px;
  font-size: 0.9rem;
  line-height: 1.45;
}

.activation-message-ok {
  border-color: rgba(115, 216, 167, 0.45);
  color: var(--green);
}

.activation-message-bad {
  border-color: rgba(255, 129, 119, 0.5);
  color: var(--red);
}

.key-result {
  display: grid;
  gap: 14px;
}

.result details {
  width: min(720px, 100%);
}

.result summary {
  margin-bottom: 8px;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 800;
}

pre {
  width: 100%;
  max-height: 280px;
  margin: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #050a0f;
  color: #e4eef8;
  padding: 14px;
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.topbar-sub {
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.tab {
  min-height: auto;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--ink-soft);
  padding: 11px 14px;
  font-size: 0.9rem;
  font-weight: 800;
}

.tab:hover {
  background: transparent;
  color: var(--ink);
  border-color: transparent;
  border-bottom-color: var(--line-strong);
}

.tab[aria-selected="true"] {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

.tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.tab-panel {
  display: block;
}

.tab-intro {
  margin: 0 0 16px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 0;
  background: var(--panel);
  color: var(--ink-soft);
  padding: 12px 14px;
  font-size: 0.9rem;
  line-height: 1.55;
}

.tab-intro-label {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 800;
}

.tab-intro-warn {
  border-left-color: var(--amber);
}

.tab-intro-warn .tab-intro-label {
  color: var(--amber);
}

.tab-intro-optional {
  border-left-color: var(--line-strong);
}

.overview-lead {
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.6;
}

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

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

.overview-step {
  display: grid;
  gap: 6px;
  height: auto;
  min-height: 0;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-raised);
  padding: 14px;
  text-align: left;
  color: var(--ink);
}

.overview-step:hover {
  border-color: var(--accent);
  background: var(--panel-raised);
  color: var(--ink);
}

.overview-step-num {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.overview-step-title {
  color: var(--ink);
  font-size: 0.98rem;
  font-weight: 800;
}

.overview-step-muted .overview-step-title {
  font-size: 0.92rem;
}

.overview-step-copy {
  color: var(--ink-soft);
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.45;
}

.overview-optional-label {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.glossary {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-raised);
  padding: 14px;
}

.glossary dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.glossary-row {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 12px;
}

.glossary dt {
  color: var(--accent-strong);
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 0.8rem;
}

.glossary dd {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.85rem;
  line-height: 1.45;
}

.glossary code {
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
}

.button-link {
  display: inline-grid;
  place-items: center;
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 0 14px;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.button-link:hover {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--hover-ink);
}

.actions .button-link {
  flex: 1 1 150px;
}

@media (max-width: 820px) {
  h1 {
    font-size: 1.55rem;
    line-height: 1.12;
  }

  .shell {
    width: min(100%, calc(100vw - 32px));
    padding: 28px 0 40px;
  }

  .customer-shell {
    width: min(760px, calc(100vw - 32px));
  }

  .topbar,
  .webhook-issue-panel,
  .result {
    align-items: stretch;
    flex-direction: column;
  }

  .webhook-issue-panel button {
    width: 100%;
  }

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


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

  .tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .tab {
    flex: 0 0 auto;
  }

  .overview-steps,
  .overview-steps-optional {
    grid-template-columns: 1fr;
  }

  .glossary-row {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .activation-dashboard {
    grid-template-columns: 1fr;
  }

  .activation-dashboard .dashboard-field,
  .activation-dashboard .dashboard-field-wide,
  .activation-dashboard .dashboard-field-narrow {
    grid-column: 1 / -1;
  }

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

  .customer-grid-single {
    width: min(100%, calc(100vw - 64px));
  }

  .panel {
    padding: 16px;
  }

  .actions {
    flex-direction: column;
  }

  .actions button {
    width: 100%;
    flex-basis: auto;
  }

  button {
    font-size: 0.94rem;
  }
}

@media (max-width: 520px) {
  .product-library-head {
    align-items: stretch;
    flex-direction: column;
  }

  .product-library-tools {
    justify-content: flex-start;
  }
}

/* ---------- store catalogue ---------- */

.catalogue-row {
  width: 100%;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.catalogue-row:hover { border-color: var(--accent); }

.catalogue-row.is-selected {
  border-color: var(--accent);
  background: var(--panel-raised, var(--field));
}

.catalogue-meta {
  font-size: 0.76rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.store-step {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px 16px 16px;
  margin: 0 0 16px;
  display: grid;
  gap: 12px;
  grid-column: 1 / -1;
}

.store-step legend {
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0 6px;
}

.store-step .step-number {
  color: var(--accent);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-right: 8px;
}

.store-step textarea {
  width: 100%;
  resize: vertical;
  font: inherit;
}

.media-heading {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 8px;
}

/*
 * A media row is built in public/catalogue.js as:
 *   img.media-thumb? / .media-meta (strong kind + a link) / input (alt) / .media-actions
 * A grid keeps the thumbnail fixed and lets the kind/link sit beside it, the description
 * span the full width, and the actions align on their own row — instead of the old flat
 * flex jumble of eight siblings.
 */
.media-row {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 8px 14px;
  align-items: center;
}

.media-meta { display: grid; gap: 4px; min-width: 0; }

.media-row .media-meta strong {
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.media-row .media-meta a {
  font-size: 0.74rem;
  overflow-wrap: anywhere;
  min-width: 0;
}

/* The description spans the full row under the thumbnail. */
.media-row > input {
  grid-column: 1 / -1;
  font-size: 0.85rem;
}

.media-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.media-actions button {
  flex: 0 0 auto;
  padding: 6px 12px;
  font-size: 0.76rem;
}

.media-actions button:disabled { opacity: 0.4; cursor: not-allowed; }

/* Square icons: a square thumb shows the cover without the zoom-crop the cards used to
   suffer from. Video uses the same box; 16:9 content letterboxes inside it. */
.media-thumb {
  grid-row: 1 / span 2;
  width: 96px;
  height: 96px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0a0d12;
}

.media-add {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.media-add input { flex: 1 1 190px; min-width: 0; }
.media-add select { flex: 0 0 auto; }

/* ---------- upload progress ---------- */

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

.upload-progress-track {
  height: 8px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}

.upload-progress-bar {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
  transition: width 0.2s ease;
}

.upload-progress-label {
  font-size: 0.76rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.link-button {
  background: none;
  border: 0;
  padding: 0;
  color: var(--muted);
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
  text-decoration: underline;
  justify-self: end;
}

.link-button:hover { color: var(--accent); }
/* Store product editor */
.store-step[hidden], .store-editor[hidden] { display: none; }
.store-step-nav { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0 20px; }
.store-step-nav button { font-size: .8rem; padding: 8px 10px; background: transparent; color: inherit; border: 1px solid #344052; }
.store-step-nav button[aria-current="step"] { color: #080d12; background: #28d0ff; }
.rich-toolbar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.rich-toolbar button { font-size: .8rem; padding: 6px 10px; }
.rich-editor { min-height: 230px; border: 1px solid #344052; border-radius: 8px; padding: 14px; background: #111820; line-height: 1.6; font-weight: 400; overflow-wrap: anywhere; }
.rich-editor:focus { outline: 2px solid #28d0ff; }
/*
 * `.catalogue-row` is a `.support-item`, which is display:grid — so the previous
 * `float: left` on the thumbnail did nothing (floats do not apply to grid items) and
 * the image took its own grid cell, pushing the name and meta underneath it.
 * Place it explicitly in column 1 spanning every text row instead. The optional
 * thumbnail is fine: with no image, column 1 collapses to zero width.
 */
/* Product rows carry a thumbnail plus three lines, so the shared 280px list height
   only showed about three of them. Give the picker room for the whole catalogue. */
#catalogueList { max-height: min(60vh, 620px); }

.catalogue-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2px 12px;
  align-items: center;
  padding: 12px;
}

.catalogue-row > strong { line-height: 1.3; }

.catalogue-row > .catalogue-thumb {
  grid-column: 1;
  grid-row: 1 / -1;
  align-self: center;
}

.catalogue-row > strong,
.catalogue-row > .catalogue-meta { grid-column: 2; }

.catalogue-thumb {
  width: 62px;
  height: 48px;
  object-fit: contain;
  background: #0a0d12;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.media-row .catalogue-meta { overflow-wrap: anywhere; width: 100%; }
.store-editor .actions { position: sticky; bottom: 0; z-index: 2; background: #111820; padding: 12px 0; border-top: 1px solid #344052; }
.store-editor .actions a { color: #28d0ff; padding: 8px; }
.store-catalogue { align-self: start; }
@media (max-width: 700px) { .store-step-nav button { flex: 1 0 25%; } .store-editor .actions { position: static; } }


/* Shared fix: --muted was referenced (link-button, field-note, upload label) but never defined. */
:root { --muted: var(--ink-soft); }
