/* Industrial carbon: woven texture, editorial type, and precise rules. */
:root {
  color-scheme: dark;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 125%;
  font-weight: 400;
  line-height: 1.6;
  color: #edece7;
  background: #161715;
  --background: #161715;
  --surface: #1b1d1a;
  --surface-raised: #262923;
  --surface-hover: #2c3029;
  --border: #45493f;
  --border-soft: #33372f;
  --ink: #edece7;
  --muted: #babdb2;
  --accent: #d6ee8c;
  --accent-dark: #29321a;
  --danger: #ffb6bd;
  --radius: .15rem;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --carbon: linear-gradient(120deg, #ffffff03, #00000030), repeating-linear-gradient(135deg, #ffffff06 0 1px, transparent 1px 4px), repeating-linear-gradient(45deg, #00000055 0 2px, transparent 2px 6px);
  --image-background: repeating-conic-gradient(#292c28 0% 25%, #363a34 0% 50%) center / 1rem 1rem;
}

:root[data-text-size="large"] {
  font-size: 150%;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--background);
}

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

button, a, input, select, textarea, summary {
  -webkit-tap-highlight-color: transparent;
}

button, select, summary {
  cursor: pointer;
}

button {
  color: inherit;
}

[hidden] {
  display: none !important;
}

button:disabled, input:disabled, select:disabled {
  opacity: .6;
  cursor: not-allowed;
}

a {
  color: var(--accent);
}

::selection {
  background: var(--accent);
  color: #161715;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

/* Application frame and navigation. */
.skip-link {
  position: fixed;
  z-index: 1100;
  top: .6rem;
  left: .6rem;
  padding: .7rem 1rem;
  border-radius: .5rem;
  background: var(--accent);
  color: #101214;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.shell {
  display: grid;
  grid-template-columns: 12.6rem minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  flex-direction: column;
  gap: 0;
  overflow-y: auto;
  padding: 2rem 1.15rem 1.2rem;
  border-right: 1px solid var(--border-soft);
  background-color: #10120f;
  background-image: var(--carbon);
}

.brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 0 .35rem 1.8rem;
}

.brand-copy strong {
  display: block;
  font-size: 1.75rem;
  font-weight: 500;
  letter-spacing: -.065em;
  line-height: .98;
  white-space: nowrap;
}

.brand-copy strong span {
  display: block;
  color: var(--accent);
}

.brand-copy small {
  display: block;
  margin-top: .9rem;
  color: var(--muted);
  font-size: .8rem;
  line-height: 1.5;
}

.nav-label {
  margin: 1rem .35rem .8rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: .8rem;
  letter-spacing: -.04em;
}

.nav {
  display: grid;
}

.nav a {
  display: flex;
  min-height: 2.9rem;
  align-items: center;
  gap: .85rem;
  padding: .75rem .35rem;
  border-bottom: 1px solid #ffffff0d;
  color: #c8cbbf;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  transition: background .16s, color .16s, border-color .16s;
}

.nav a:hover {
  background: #ffffff04;
  color: #fff;
}

.nav a.active {
  background: #d6ee8c08;
  color: var(--accent);
}

.nav-index {
  font-family: var(--mono);
  font-size: .8rem;
  color: #a2a899;
}

.nav a.active .nav-index {
  color: var(--accent);
}

.side-foot {
  margin-top: auto;
  padding: 1rem .35rem 0;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: .8rem;
  line-height: 1.7;
}

.main {
  min-width: 0;
  background: linear-gradient(145deg, #20231e 0%, #171916 65%);
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  min-height: 4.5rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 3.2vw, 2.6rem);
  border-bottom: 1px solid var(--border-soft);
  background: #171a16;
}

.topbar .eyebrow {
  margin-bottom: .1rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: .8rem;
  letter-spacing: -.02em;
  text-transform: none;
}

.topbar h1 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: -.025em;
}

.reading-controls {
  display: flex;
  align-items: center;
  gap: .65rem;
  margin-left: auto;
}

.reading-controls > span {
  color: var(--muted);
  font-size: .8rem;
}

.text-size-options {
  display: flex;
  gap: .2rem;
  padding: .15rem;
  border: 1px solid var(--border);
  border-radius: .15rem;
  background: #10120f;
}

.text-size-options button {
  min-width: 2.3rem;
  min-height: 2.1rem;
  padding: .2rem .45rem;
  border: 0;
  border-radius: .1rem;
  background: transparent;
  color: #c8cbbf;
  font-weight: 500;
}

.text-size-options button[aria-pressed="true"] {
  background: var(--accent);
  color: #1a2012;
}

.text-size-options button:hover {
  color: var(--accent);
}

.content {
  width: min(100%, 78rem);
  min-height: 70vh;
  margin: 0 auto;
  padding: 2.2rem clamp(1rem, 3.2vw, 2.6rem) 3rem;
}

.content:focus {
  outline: none;
}

.menu-toggle {
  display: none;
  min-width: 2.5rem;
  min-height: 2.5rem;
  place-items: center;
  margin-left: auto;
  border: 1px solid var(--border);
  border-radius: .15rem;
  background: var(--surface-raised);
}

.menu-icon {
  width: 1.1rem;
  height: .85rem;
  background: linear-gradient(currentColor 0 0) top / 100% 2px no-repeat, linear-gradient(currentColor 0 0) center / 100% 2px no-repeat, linear-gradient(currentColor 0 0) bottom / 100% 2px no-repeat;
}

/* Page hierarchy and overview. */
.eyebrow {
  margin: 0 0 1.1rem;
  color: var(--accent);
  font-family: var(--mono);
  font-size: .8rem;
  font-weight: 400;
  letter-spacing: .025em;
  text-transform: uppercase;
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.4rem;
  margin-bottom: 1.7rem;
}

.hero h2 {
  max-width: 24ch;
  margin: 0 0 .85rem;
  font-size: clamp(2.4rem, 4.5vw, 3.6rem);
  font-weight: 400;
  letter-spacing: -.065em;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.hero p:not(.eyebrow) {
  max-width: 58ch;
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.65;
}

.hero > .change-action, .hero > .catalog-back {
  flex-shrink: 0;
}

.overview-hero {
  align-items: stretch;
  gap: 2rem;
  margin-bottom: 2rem;
}

.overview-hero > div:first-child {
  min-width: 0;
  flex: 1;
}

.overview-hero h2 {
  font-size: clamp(2.8rem, 5.2vw, 4.3rem);
  letter-spacing: -.075em;
  line-height: .98;
}

.overview-hero h2 span {
  display: block;
}

.overview-hero p:not(.eyebrow) {
  max-width: 37ch;
  margin-top: 1rem;
}

.overview-hero .change-action {
  margin-top: 1.2rem;
}

.carbon-study {
  position: relative;
  display: flex;
  width: 26%;
  min-width: 10rem;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.1rem;
  border-top: 2px solid var(--accent);
  background-color: #121510;
  background-image: var(--carbon);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 1.5rem), calc(100% - 1.5rem) 100%, 0 100%);
}

.study-label, .study-caption {
  font-family: var(--mono);
  font-size: .8rem;
  line-height: 1.5;
  color: var(--muted);
}

.study-label {
  padding-bottom: .8rem;
  border-bottom: 1px solid #ffffff22;
}

.study-number {
  align-self: center;
  margin: .4rem 0;
  color: var(--accent);
  font-size: clamp(5rem, 10vw, 8rem);
  font-weight: 400;
  letter-spacing: -.1em;
  line-height: 1;
  opacity: .85;
}

.study-caption {
  max-width: 19ch;
}

.pill, .channel-tag, .change-status {
  display: inline-flex;
  align-items: center;
  padding: .3rem .7rem;
  border: 1px solid var(--border);
  border-radius: .1rem;
  background: #ffffff04;
  color: var(--ink);
  font-size: .85rem;
  font-weight: 400;
}

.pill {
  flex-shrink: 0;
}

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

.card {
  min-width: 0;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.metric-card {
  padding: 1.1rem 0 1.2rem;
  border: 0;
  border-top: 1px solid #737b62;
  background: transparent;
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  color: #c8cbbf;
  font-size: 1rem;
}

.card strong.value {
  display: block;
  margin: .7rem 0 .25rem;
  font-size: 3.9rem;
  font-weight: 400;
  letter-spacing: -.065em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.metric-note {
  margin: .3rem 0 0;
  color: var(--muted);
  font-size: .8rem;
}

.section {
  margin-top: 2rem;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  margin-bottom: 1rem;
}

.section-head h2, .section-head h3 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 400;
  letter-spacing: -.04em;
  line-height: 1.3;
}

.section-head > span {
  color: var(--muted);
  font-size: .85rem;
}

.overview-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3rem;
  margin-top: 2.75rem;
}

.overview-columns > .section {
  min-width: 0;
  margin: 0;
  padding: 1.75rem 0 0;
  border-top: 1px solid var(--border);
}

.overview-columns .section-head {
  margin-bottom: 1.5rem;
}

.store-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 1.75rem;
  padding: 1.4rem 0;
}

.order-total-values {
  margin-top: 1.75rem;
}

.order-total-values .empty {
  padding: 1.75rem;
}

.activity {
  display: grid;
}

.row {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-soft);
}

.row:last-child {
  border-bottom: 0;
}

.row > div {
  min-width: 0;
}

.row b {
  font-size: 1.2rem;
  font-weight: 400;
  letter-spacing: -.03em;
}

.row small {
  display: block;
  margin-top: .25rem;
  color: var(--muted);
  font-size: .85rem;
  line-height: 1.6;
}

.row .time {
  margin-left: auto;
  color: var(--muted);
  font-size: .85rem;
}

.store-count {
  margin-left: auto;
  flex-shrink: 0;
  text-align: right;
}

.store-count strong {
  font-size: 1.8rem;
  font-weight: 400;
  line-height: 1;
}

.store-count small {
  margin-top: 0;
}

.connection-state {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin-top: .3rem;
  color: var(--muted);
  font-size: .8rem;
}

.dot {
  width: .4rem;
  height: .4rem;
  flex-shrink: 0;
  border-radius: 50%;
  background: #d1a26c;
}

.dot.mint {
  background: var(--accent);
}

.revenue-value {
  margin: 1rem 0;
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: -.03em;
}

.revenue-value small {
  margin-right: .4rem;
  color: var(--muted);
  font-size: .85rem;
  font-weight: 500;
}

.empty {
  margin: 0;
  padding: 1.5rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: #ffffff02;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
  text-align: left;
}

.loading, .catalog-note, .settings-note {
  color: var(--muted);
  font-size: .95rem;
  line-height: 1.7;
}

.settings-note {
  max-width: 72ch;
  margin: 0 0 1.1rem;
}

.catalog-note {
  margin: .8rem 0 0;
}

/* Shared actions and marketplace filters. */
.change-review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-top: 1.1rem;
}

.change-action, .catalog-tab, .catalog-back {
  display: inline-flex;
  min-height: 2.65rem;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .55rem .95rem;
  border: 1px solid #626a55;
  border-radius: .15rem;
  background: #292f23;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.4;
  text-decoration: none;
  transition: background .15s, border-color .15s, box-shadow .15s;
}

.change-action:hover, .catalog-tab:hover, .catalog-back:hover {
  border-color: var(--accent);
  background: #343e29;
}

.change-action.approve {
  border-color: var(--accent);
  background: var(--accent);
  color: #202714;
}

.change-action.approve:hover {
  border-color: #e8ffab;
  background: #e8ffab;
}

.change-action.reject {
  border-color: #ffb6bd50;
  background: #2d2024;
  color: var(--danger);
}

.change-action.reject:hover {
  border-color: var(--danger);
  background: #41272e;
}

.sync-actions .change-action {
  font-size: .9rem;
}

.catalog-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-bottom: 1rem;
  padding: 0 0 .6rem;
  border-bottom: 1px solid var(--border);
}

.catalog-tab {
  min-height: 2.4rem;
  border-color: transparent;
  background: transparent;
  color: #bdc6cf;
}

.catalog-tab.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #202714;
}

/* Catalog, listing details, and editors. */
.catalog-list {
  display: grid;
  gap: .65rem;
}

.product-card-shell {
  position: relative;
  min-width: 0;
}

.product-card-shell .product-card {
  padding-right: 5rem;
}

.product-card-shell > .listing-actions {
  position: absolute;
  right: 1rem;
  top: 1rem;
}

.listing-actions {
  position: relative;
  flex-shrink: 0;
}

.listing-actions summary {
  display: grid;
  place-items: center;
  width: 2.8rem;
  height: 2.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}

.listing-actions summary::-webkit-details-marker { display: none; }
.listing-actions summary:hover, .listing-actions[open] summary { border-color: var(--ink); }
.action-dots { display: flex; gap: 4px; }
.action-dots i { width: 4px; height: 4px; background: currentColor; border-radius: 50%; }
.listing-actions-menu {
  position: absolute;
  z-index: 20;
  right: 0;
  top: calc(100% + .5rem);
  width: min(21rem, calc(100vw - 2rem));
  max-height: min(36rem, var(--actions-available-height, calc(100dvh - 3rem)));
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: var(--border) var(--surface);
  padding: .6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--carbon), var(--surface);
  box-shadow: 0 18px 45px #0008;
}
.listing-actions-menu p { margin: .45rem .65rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; opacity: .65; }
.listing-actions-menu button,
.listing-actions-menu a { display: block; width: 100%; padding: .8rem; text-align: left; border: 0; border-radius: var(--radius); line-height: 1.5; background: transparent; color: var(--ink); font: inherit; cursor: pointer; text-decoration: none; }
.listing-actions-menu button:hover,
.listing-actions-menu a:hover { background: #8882; }
.listing-actions-menu :is(button, a) > span { display: block; font-size: .85rem; color: var(--muted); margin-top: .3rem; }
.listing-actions-menu .listing-action-delete { color: #ffa9a9; border-top: 1px solid var(--border); margin-top: .4rem; }
.delete-dialog { max-width: 44rem; }
.delete-destinations { border: 0; padding: 0; margin: 0; display: grid; gap: 1rem; }
.delete-destinations legend { font-size: 1.25rem; margin-bottom: 1rem; }
.delete-destination { display: flex; align-items: flex-start; gap: 1rem; padding: 1.25rem; border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; }
.delete-destination:has(input:checked) { border-color: #f48181; background: #f481810b; }
.clone-dialog .delete-destination input { width: 1.25rem; height: 1.25rem; padding: 0; margin-top: .25rem; accent-color: #f48181; flex-shrink: 0; }
.delete-destination strong { display: block; font-size: 1.15rem; }
.delete-destination small { display: block; margin-top: .5rem; font-size: 1rem; line-height: 1.6; color: var(--muted); }
.delete-confirm { border-color: #e86565; color: #ffb3b3; background: #b7363620; }
.publication-flag { display: inline-block; width: fit-content; padding: .45rem .7rem; margin: .4rem 0; border: 1px solid #f4818160; border-radius: .4rem; color: #ffb3b3; background: #b7363615; font-size: 1rem; line-height: 1.4; }
.publication-unconfirmed { color: #efdaaa; border-color: #efdaaa60; background: #efdaaa0b; }
.publication-shadow { color: #a4b18b; border-color: #a4b18b60; background: #a4b18b0d; border-style: dashed; }
.saved-drafts { margin: 2rem 0; padding: 1.5rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.saved-drafts header { margin-bottom: 1.5rem; }
.saved-drafts h3 { font-size: 1.6rem; }
.saved-draft-list { display: grid; gap: 1rem; }
.saved-draft { display: flex; gap: 1.5rem; align-items: center; justify-content: space-between; padding: 1.25rem; border: 1px solid var(--border); border-radius: var(--radius); }
.saved-draft > div { min-width: 0; }
.saved-draft h4 { margin: .5rem 0; font-size: 1.25rem; overflow-wrap: anywhere; }
.saved-draft p { margin: .5rem 0; font-size: 1rem; line-height: 1.6; overflow-wrap: anywhere; }
.saved-draft button { flex-shrink: 0; }
@media (max-width: 700px) { .saved-draft { flex-direction: column; align-items: stretch; } }
.clone-dialog {
  width: min(58rem, calc(100vw - 2rem));
  max-height: calc(100dvh - 3rem);
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--background);
  box-shadow: 0 30px 100px #000a;
  font-size: 1.05rem;
}
.clone-dialog::backdrop { background: #050709cc; backdrop-filter: blur(7px); }
.clone-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1.5rem; padding: 2rem; border-bottom: 1px solid var(--border); border-top: 3px solid var(--accent); background: var(--carbon), var(--surface); }
.clone-header h2 { font-size: clamp(1.8rem, 4vw, 2.5rem); font-weight: 400; letter-spacing: -.04em; line-height: 1.15; overflow-wrap: anywhere; margin: .5rem 0; }
.clone-header p { max-width: 42rem; line-height: 1.6; }
.dialog-close { display: grid; place-items: center; line-height: 1; flex-shrink: 0; width: 2.8rem; height: 2.8rem; border: 1px solid var(--border); border-radius: var(--radius); color: var(--ink); background: var(--background); font-size: 1.8rem; cursor: pointer; }
.clone-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 1.5rem 2rem 2rem; scrollbar-color: var(--border) var(--surface); }
.clone-body section { padding-top: 1.8rem; }
.clone-body h3 { font-size: 1.3rem; margin-bottom: 1.25rem; }
.clone-destination { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.clone-destination h3, .clone-note { grid-column: 1 / -1; }
.clone-destination label, .clone-dialog .edit-field { display: flex; flex-direction: column; gap: .65rem; line-height: 1.5; }
.clone-dialog input, .clone-dialog select, .clone-dialog textarea { width: 100%; box-sizing: border-box; padding: .85rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--background); color: var(--ink); font: inherit; }
.clone-dialog textarea { min-height: 8rem; resize: vertical; }
.clone-dialog .json-editor { min-height: 20rem; font-family: monospace; }
.clone-note { margin: .5rem 0; opacity: .75; line-height: 1.65; }
.clone-footer { position: static; display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; padding: 1.25rem 2rem; background: var(--carbon), var(--surface); border-top: 1px solid var(--border); }
.clone-footer > span { margin-right: auto; font-size: .9rem; opacity: .7; }
.clone-error { padding: 1rem; border: 1px solid #ff6a6a; background: #ff303015; color: #ffb3b3; border-radius: var(--radius); line-height: 1.6; }
@media (max-width: 650px) {
  .clone-header, .clone-body, .clone-footer { padding: 1.25rem; }
  .clone-destination { grid-template-columns: 1fr; }
  .clone-footer > span { width: 100%; }
}

.product-card {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  width: 100%;
  min-width: 0;
  align-items: center;
  gap: 1rem;
  padding: 1.15rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  transition: background .16s, border-color .16s;
}

.product-card-image {
  display: grid;
  width: 5.5rem;
  height: 5.5rem;
  overflow: hidden;
  place-items: center;
  background: var(--image-background);
  color: var(--muted);
}

.product-card-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-card-image .image-fallback {
  padding: .4rem;
  font-size: .8rem;
}

.product-card:hover {
  border-color: #8b9477;
  background: #292f24;
}

.product-card-copy {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: .4rem;
}

.product-card-copy strong {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -.015em;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.product-card-copy > span {
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.product-card-copy > .publication-flag {
  color: #ffb3b3;
  font-size: 1rem;
}

.product-card-copy > .publication-unconfirmed {
  color: #efdaaa;
}

/* Shadow listings live only in this database: dashed border and dimmed copy
   signal that nothing has been published to the storefront yet. */
.shadow-card {
  border-style: dashed;
  background: #20241c;
}

.shadow-card:hover {
  border-color: #6f7a5e;
  background: #242920;
}

.product-card-shadow .product-card-copy > span {
  color: #8a917d;
}

.channel-tag {
  text-transform: capitalize;
}

.channel-etsy {
  border-color: #ffbd9c45;
  color: #ffcfb6;
}

.channel-amazon {
  border-color: #efdaaa45;
  color: #efdaaa;
}

.channel-facebook {
  border-color: #adcafa45;
  color: #c5dafa;
}

.listing-detail, .automation-sections {
  display: grid;
  gap: 1rem;
}

.listing-section, .automation-section, .settings-provider, .listing-editor, .change-review-card {
  min-width: 0;
  padding: 1.35rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.listing-section h3, .automation-section h3 {
  margin: 0 0 1.1rem;
  font-size: 1.3rem;
  font-weight: 400;
  letter-spacing: -.04em;
}

.listing-fields, .change-review-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.3rem 1.7rem;
  margin: 0;
}

.listing-field, .change-review-fields > div {
  min-width: 0;
}

.listing-field dt, .change-field dt, .change-review-fields dt {
  margin-bottom: .35rem;
  color: var(--muted);
  font-size: .85rem;
  font-weight: 550;
}

.listing-field dd, .change-field dd, .change-review-fields dd {
  margin: 0;
  font-size: 1rem;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.listing-field pre, .change-field pre {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: inherit;
}

/* Product photography and an uncluttered merchandising summary. */
.product-navigation {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
}

.product-spread {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  align-items: start;
  gap: 2.5rem;
}

.product-gallery, .product-summary {
  min-width: 0;
}

.product-image-figure {
  margin: 0;
}

.product-image-stage {
  position: relative;
  display: grid;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  place-items: center;
  border: 1px solid var(--border);
  background: var(--image-background);
  color: var(--muted);
}

.product-image {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
}

.product-image-caption {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .5rem 1rem;
  margin-top: .9rem;
  color: var(--muted);
  font-size: .9rem;
}

.product-thumbnails {
  display: flex;
  gap: .7rem;
  overflow-x: auto;
  padding: .35rem .2rem .6rem;
  margin-top: 1rem;
}

.product-thumbnail {
  display: grid;
  width: 4rem;
  height: 4rem;
  flex-shrink: 0;
  overflow: hidden;
  place-items: center;
  padding: .2rem;
  border: 2px solid transparent;
  border-radius: .1rem;
  background: var(--image-background);
  color: var(--muted);
}

.product-thumbnail[aria-pressed="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px #10120f;
}

.product-thumbnail:hover {
  border-color: #9bad70;
}

.product-thumbnail img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.image-fallback {
  margin: 0;
  padding: 1rem;
  font-size: 1rem;
  line-height: 1.6;
  text-align: center;
}

.image-fallback small, .gallery-empty small {
  display: block;
  margin-top: .6rem;
  font-size: .9rem;
}

.product-thumbnail .image-fallback {
  padding: .15rem;
  font-size: .8rem;
}

.gallery-empty {
  padding: 2rem;
  border-color: var(--border);
  background-color: #141711;
  background-image: var(--carbon);
  color: var(--muted);
  text-align: center;
}

.gallery-empty p {
  margin: 0;
}

.product-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .75rem 1rem;
}

.product-title-row .channel-tag {
  flex-shrink: 0;
}

.product-summary h2 {
  flex: 1 1 16rem;
  min-width: 0;
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.65rem);
  font-weight: 400;
  letter-spacing: -.045em;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.product-identifier {
  margin: 1rem 0 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: .85rem;
  overflow-wrap: anywhere;
}

.product-price {
  margin: 1.5rem 0;
  font-size: 2.5rem;
  letter-spacing: -.05em;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.product-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  margin: 0;
  padding: 1.25rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.product-facts dd {
  font-size: 1.25rem;
}

.product-primary-actions {
  margin-top: 1.75rem;
}

.product-spread + .listing-detail {
  gap: 1.75rem;
  margin-top: 2.5rem;
}

.product-description {
  padding: 1.75rem;
}

.product-description p {
  max-width: 75ch;
  margin: 0;
  line-height: 1.85;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.product-platform-details summary {
  font-size: 1.3rem;
  letter-spacing: -.03em;
}

.product-platform-details .listing-fields {
  margin-top: 1.75rem;
}

.product-platform-details > [data-edit-platform] {
  margin-top: 1.75rem;
}

.product-workflow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 2rem;
  margin-top: 3rem;
  padding: 2rem;
  border: 1px solid var(--border);
  border-top: 2px solid var(--accent);
  background: var(--surface);
}

.product-workflow h3 {
  margin: 0 0 1rem;
  font-size: 1.6rem;
  font-weight: 400;
  letter-spacing: -.04em;
  line-height: 1.3;
}

.product-workflow p:not(.eyebrow) {
  margin: 0 0 1rem;
  line-height: 1.8;
}

.product-workflow p:last-child {
  margin-bottom: 0;
}

.product-workflow-actions {
  padding-top: 2.4rem;
}

.settings-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.3rem;
}

.settings-fields label {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr);
  gap: .55rem;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.settings-fields form label {
  grid-template-rows: minmax(3em, auto) auto auto;
}

.settings-fields input, .edit-field textarea, .edit-field select, .hook-field select {
  width: 100%;
  min-width: 0;
  min-height: 2.8rem;
  padding: .65rem .8rem;
  border: 1px solid #626a55;
  border-radius: .1rem;
  background: #121510;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
}

input::placeholder, textarea::placeholder {
  color: #b3baa7;
  opacity: 1;
}

.settings-fields input[readonly] {
  border-color: #738552;
  background: #202719;
  color: #e1edc8;
}

.settings-fields [data-saved-status], .edit-field small {
  color: var(--muted);
  font-size: .8rem;
  font-weight: 400;
}

.settings-fields form[data-configured="true"] [data-saved-status] {
  color: var(--accent);
}

.settings-fields form {
  min-width: 0;
  padding: 1.1rem 0;
  border-top: 1px solid var(--border-soft);
}

.settings-fields form .change-review-actions {
  gap: .45rem;
  margin-top: .8rem;
}

.settings-fields form .change-action {
  min-height: 2.5rem;
  padding: .5rem .75rem;
  font-size: .9rem;
}

.settings-credentials {
  margin-top: 0;
}

.settings-provider {
  margin-top: 2rem;
  padding: 1.2rem 0 0;
  border: 0;
  border-top: 1px solid #69715c;
  background: transparent;
}

.provider-heading {
  display: flex;
  align-items: center;
  gap: .8rem;
  margin-bottom: 1.1rem;
}

.provider-heading h3 {
  margin: 0;
  font-size: 1.7rem;
  font-weight: 400;
  letter-spacing: -.05em;
}

.provider-heading p {
  margin: .1rem 0 0;
  color: var(--muted);
  font-size: .8rem;
}

.edit-field textarea {
  min-height: 8rem;
  resize: vertical;
}

.edit-field .json-editor {
  min-height: 14rem;
  font-family: ui-monospace, monospace;
  font-size: .9rem;
}

/* Automation and order data. */
.hook-types-legend {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .8rem;
  margin-bottom: 1.3rem;
}

.hook-types-legend p {
  margin: 0;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #ffffff03;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.7;
}

.hook-types-legend strong {
  display: block;
  margin-bottom: .3rem;
  color: var(--ink);
  font-size: .95rem;
}

.hook-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(11rem, .5fr);
  align-items: center;
  gap: 1rem;
  padding: 1.2rem 0;
  border-top: 1px solid var(--border-soft);
}

.hook-field-copy {
  min-width: 0;
}

.hook-field-copy label {
  display: block;
  font-size: 1rem;
  font-weight: 550;
}

.hook-field-copy code {
  display: block;
  margin-top: .25rem;
  color: #c4d89c;
  font-size: .8rem;
  overflow-wrap: anywhere;
}

.hook-field-copy p {
  margin: .35rem 0 0;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.7;
}

.automation-storage-note {
  color: var(--muted);
  font-size: .9rem;
}

.change-queue, .automation-hook-settings {
  margin-top: 1.5rem;
}

.change-queue-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr));
  gap: 1rem;
}

.change-card {
  min-width: 0;
  padding: 1.2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.change-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .7rem;
}

.change-card-id {
  margin: 0 0 .5rem;
  font-size: 1.1rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.change-kind {
  color: var(--accent);
  font-size: .85rem;
}

.change-queued-at {
  display: block;
  color: var(--muted);
  font-size: .9rem;
}

.change-card .catalog-back {
  margin-top: 1rem;
}

.change-status.pending {
  border-color: #efdaaa66;
  color: #efdaaa;
}

.change-status.reviewed {
  border-color: #a9e8cd66;
  color: var(--accent);
}

.change-field-list {
  display: grid;
  gap: 1rem;
}

.change-field {
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--border-soft);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  background: #121510;
}

.change-field h3, .change-field h4 {
  margin: 0 0 .9rem;
  font-size: 1rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.change-field dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 0;
}

.change-field dl > div {
  min-width: 0;
}

.change-field-reason {
  grid-column: 1 / -1;
}

.change-field input, .change-field textarea, .change-field select {
  box-sizing: border-box;
  width: 100%;
  padding: .8rem;
  border: 1px solid var(--border-soft);
  border-radius: .5rem;
  background: #090c09;
  color: var(--ink);
  font: inherit;
  font-size: 1.05rem;
  line-height: 1.6;
}

.change-field textarea {
  resize: vertical;
  min-height: 9rem;
}

.change-field input:focus, .change-field textarea:focus, .change-field select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.review-money-editor {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.reviewed-changes {
  margin-top: 1rem;
}

.reviewed-changes summary {
  color: var(--accent);
}

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.table-scroll table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.table-scroll th, .table-scroll td {
  padding: .9rem 1rem;
  border-bottom: 1px solid var(--border-soft);
  font-size: .95rem;
}

.table-scroll th {
  background: #292f24;
  color: #c8cbbf;
  font-size: .85rem;
  font-weight: 500;
  white-space: nowrap;
}

.table-scroll tbody tr:last-child td {
  border-bottom: 0;
}

.table-scroll tbody tr:hover {
  background: #ffffff03;
}

/* Persistent errors arrive from the top; progress stays at bottom right. */
.alert-stack {
  position: fixed;
  z-index: 1000;
  top: 1rem;
  left: 50%;
  display: grid;
  width: min(42rem, calc(100vw - 2rem));
  max-height: calc(100dvh - 2rem);
  gap: .6rem;
  overflow-y: auto;
  padding: .3rem;
  transform: translateX(-50%);
  pointer-events: none;
}

.global-alert {
  display: flex;
  align-items: flex-start;
  gap: .8rem;
  padding: .9rem 1rem;
  border: 1px solid #ff727c88;
  border-left: 4px solid #ff7e87;
  border-radius: .7rem;
  background: linear-gradient(120deg, #412028, #261c22);
  color: #ffe9ec;
  box-shadow: 0 0 24px #ff526a22, 0 12px 36px #00000070;
  animation: alert-slide-in .3s ease-out both;
  pointer-events: auto;
}

.global-alert-message {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 1rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.global-alert-success {
  border-color: #a9e8cd88;
  border-left-color: var(--accent);
  background: linear-gradient(120deg, #1d3b2e, #1a2823);
  color: #e4fff0;
  box-shadow: 0 0 24px #87e3b922, 0 12px 36px #00000070;
}

.global-alert-close {
  display: grid;
  width: 2.3rem;
  height: 2.3rem;
  flex-shrink: 0;
  place-items: center;
  border: 1px solid #ffffff30;
  border-radius: .5rem;
  background: #ffffff07;
  color: inherit;
}

.global-alert-close:hover {
  background: #ffffff18;
}

.close-icon {
  position: relative;
  display: block;
  width: .9rem;
  height: .9rem;
}

.close-icon::before, .close-icon::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 2px;
  border-radius: 1rem;
  background: currentColor;
  content: "";
}

.close-icon::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.close-icon::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.progress-stack {
  position: fixed;
  z-index: 999;
  right: 1rem;
  bottom: 1rem;
  display: grid;
  width: min(25rem, calc(100vw - 2rem));
  pointer-events: none;
}

.global-progress {
  display: flex;
  min-height: 3.3rem;
  align-items: center;
  gap: .75rem;
  padding: .9rem 1rem;
  border: 1px solid #a9e8cd60;
  border-radius: .7rem;
  background: #1d2924;
  color: #e4fff0;
  box-shadow: 0 10px 30px #00000070;
  animation: progress-slide-in .3s ease-out both;
}

.global-progress-message {
  min-width: 0;
  font-size: 1rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.progress-spinner {
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
  border: 2px solid #a9e8cd30;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: progress-spin .8s linear infinite;
}

@keyframes alert-slide-in {
  from {
    opacity: 0;
    transform: translateY(-1.5rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes progress-slide-in {
  from {
    opacity: 0;
    transform: translateX(110%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes progress-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Reflow keeps large text usable on smaller screens and at browser zoom. */
@media (max-width: 1200px) {
  .overview-columns {
    grid-template-columns: 1fr;
  }
  .shell {
    grid-template-columns: 12rem minmax(0, 1fr);
  }
  .hook-types-legend {
    grid-template-columns: 1fr;
  }
  .carbon-study {
    display: none;
  }
  .product-spread {
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
  }
  .product-image-stage {
    aspect-ratio: 4 / 3;
  }
}

@media (max-width: 900px) {
  .shell {
    display: block;
  }
  .sidebar {
    position: relative;
    z-index: 2;
    height: auto;
    gap: 0;
    padding: .8rem 1rem;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .brand {
    padding: 0;
  }
  .brand-copy strong {
    font-size: 1.4rem;
  }
  .brand-copy small {
    margin-top: .3rem;
  }
  .menu-toggle {
    display: grid;
  }
  .nav-label, .nav, .side-foot {
    display: none;
  }
  .sidebar.open .nav-label {
    display: block;
    margin-top: 1.2rem;
  }
  .sidebar.open .nav {
    display: grid;
    margin-bottom: .5rem;
  }
  .sidebar.open .side-foot {
    display: block;
    margin-top: 1rem;
  }
  .topbar {
    min-height: 4.5rem;
  }
  .content {
    padding-top: 1.5rem;
  }
}

@media (max-width: 650px) {
  .hero {
    align-items: flex-start;
    flex-direction: column;
    gap: 1rem;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .metric-card .card-top {
    font-size: 1rem;
  }
  .card strong.value {
    font-size: 2.6rem;
  }
  .settings-fields, .listing-fields, .change-review-fields, .change-field dl {
    grid-template-columns: 1fr;
  }
  .hook-field {
    grid-template-columns: 1fr;
    gap: .7rem;
  }
  .automation-section, .listing-section, .listing-editor, .change-review-card {
    padding: 1rem;
  }
  .settings-provider {
    padding: 1.1rem 0 0;
  }
  .settings-fields form {
    padding: 1rem 0;
  }
  .settings-fields form label {
    grid-template-rows: auto auto auto;
  }
  .product-card {
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
  }
  .product-card-copy {
    grid-column: 1;
    grid-row: 2;
  }
  .product-card-image {
    grid-column: 1 / -1;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
  }
  .store-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem;
  }
  .store-row > button {
    grid-column: 1 / -1;
    justify-self: start;
  }
  .product-workflow {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
    padding: 1.25rem;
  }
  .product-workflow-actions {
    padding-top: 0;
  }
  .product-facts {
    grid-template-columns: minmax(0, 1fr);
  }
  .reading-controls > span {
    display: none;
  }
  .change-field-reason {
    grid-column: auto;
  }
  .section-head {
    flex-wrap: wrap;
  }
  .topbar {
    padding: .8rem 1rem;
  }
  .content {
    padding-right: 1rem;
    padding-left: 1rem;
  }
  .overview-columns > .section {
    padding: 1rem 0 0;
  }
  .overview-hero h2 {
    font-size: clamp(2.3rem, 9vw, 3.4rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* Catalog batch editing keeps the prompt and each listing outcome readable. */
.catalog-hero-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.catalog-actions {
  position: relative;
  z-index: 5;
}

.batch-dialog {
  width: min(48rem, calc(100vw - 2rem));
  max-height: calc(100dvh - 2rem);
  overflow: hidden;
  border-radius: var(--radius);
  border-color: var(--border);
  box-shadow: 0 32px 100px #000b;
}

.batch-dialog .clone-form {
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 2rem - 2px);
}

.batch-dialog .clone-header {
  flex-shrink: 0;
  padding: 1.6rem 2rem;
  background: var(--carbon), var(--surface);
  border-top: 3px solid var(--accent);
}

.batch-dialog .clone-header h2 {
  margin: .4rem 0 1rem;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 400;
  letter-spacing: -.05em;
  line-height: 1.1;
}

.batch-scope {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem .8rem;
  color: var(--muted);
  font-size: .9rem;
}

.batch-scope span:first-child {
  padding: .15rem .55rem;
  border: 1px solid var(--border);
  background: var(--background);
  color: var(--accent);
}

.batch-dialog .clone-body {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: var(--border) var(--surface);
}

.batch-dialog label {
  display: block;
  margin: 0 0 .8rem;
  font-size: 1.15rem;
  font-weight: 500;
}

.batch-dialog textarea {
  min-height: 9rem;
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  background: var(--background);
  font-size: 1.05rem;
  line-height: 1.65;
  transition: border-color .15s, box-shadow .15s;
}

.batch-dialog textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px #d6ee8c18;
}

.batch-dialog textarea::placeholder { color: #95998e; }
.batch-dialog textarea:disabled { opacity: .7; }

.batch-help {
  margin: .75rem 0 1.4rem;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.65;
}

.batch-modes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 1rem 0;
  border-block: 1px solid var(--border-soft);
}

.batch-modes > div {
  display: grid;
  align-content: start;
  gap: .3rem;
  padding: 0 .9rem;
  border-left: 1px solid var(--border-soft);
}

.batch-modes > div:first-child { padding-left: 0; border-left: 0; }
.batch-modes strong { font-size: .9rem; font-weight: 500; }
.batch-modes span { color: var(--muted); font-size: .8rem; line-height: 1.6; }

.batch-list-section > .eyebrow { margin: 0 0 .75rem; }
.batch-list-section > [data-summary] { margin: 0 0 1rem; line-height: 1.65; }

.batch-results {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--border-soft);
  counter-reset: batch-listing;
}

.batch-results li {
  position: relative;
  display: grid;
  gap: .4rem;
  padding: 1rem 0 1rem 2.6rem;
  border-bottom: 1px solid var(--border-soft);
  counter-increment: batch-listing;
}

.batch-results li::before {
  content: counter(batch-listing, decimal-leading-zero);
  position: absolute;
  top: 1.15rem;
  left: 0;
  color: var(--muted);
  font: .75rem var(--mono);
}

.batch-results strong {
  font-size: 1rem;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.batch-results span {
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.batch-results [data-outcome="error"] { color: var(--danger); }
.batch-results [data-outcome="success"] { color: var(--accent); }

.batch-dialog .clone-footer {
  position: static;
  flex-shrink: 0;
  gap: .7rem;
  padding: 1.2rem 2rem;
  background: var(--background);
}

.batch-footer-note {
  margin: 0 auto 0 0;
  color: var(--muted);
  font-size: .8rem;
  line-height: 1.5;
}

.batch-dialog .change-action { border-radius: var(--radius); }

@media (max-width: 650px) {
  .batch-dialog .clone-header,
  .batch-dialog .clone-body,
  .batch-dialog .clone-footer { padding: 1.2rem; }
  .batch-dialog .clone-body section { padding-top: 1.2rem; }
  .batch-modes { grid-template-columns: 1fr; gap: .8rem; }
  .batch-modes > div { padding: 0; border: 0; }
  .batch-footer-note { width: 100%; }
  .batch-dialog .clone-footer .change-action { flex: 1; }
}

/* Metrics: generous chart space and readable, exact observations. */
.metrics-page-heading,
.metrics-chart-heading,
.metrics-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.metrics-page-heading h2 { margin: 0; }
.metrics-page-heading p { margin-top: .35rem; }
.metrics-intro { max-width: 60rem; color: var(--muted); margin: 1.5rem 0 2rem; }
.metrics-controls { padding: 1rem 0 1.5rem; border-bottom: 1px solid var(--border); }
.metrics-platforms,
.metrics-ranges { display: flex; gap: .4rem; flex-wrap: wrap; }
.metrics-platforms button,
.metrics-ranges button {
  padding: .45rem .8rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
}
.metrics-platforms button:hover,
.metrics-ranges button:hover { color: var(--ink); background: var(--surface-raised); }
.metrics-platforms button[aria-pressed="true"],
.metrics-ranges button[aria-pressed="true"] { color: var(--accent); border-color: var(--border); background: var(--accent-dark); }
.metrics-toolbar-actions {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-left: auto;
}

.metrics-sync {
  min-height: 2.65rem;
  padding-inline: 1.25rem;
  border-color: var(--accent);
  background: var(--accent-dark);
  color: var(--accent);
}

.metrics-sync:hover:not(:disabled) {
  background: #343e29;
  box-shadow: inset 0 0 0 1px #d6ee8c25;
}

.metrics-filters {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.25rem 2rem;
  padding: 1.5rem 0;
}

.metrics-subject-label {
  display: grid;
  flex: 1 1 20rem;
  gap: .6rem;
  max-width: 42rem;
  margin: 0;
  color: var(--muted);
}

.metrics-range-filter {
  display: grid;
  gap: .6rem;
  margin-left: auto;
}

.metrics-filter-label {
  color: var(--muted);
}

.metrics-ranges {
  padding: .25rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--surface);
}

.metrics-platforms button,
.metrics-ranges button {
  min-height: 2.4rem;
}

.metrics-platforms button:focus-visible,
.metrics-ranges button:focus-visible,
.metrics-sync:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.metrics-subject-label select {
  width: 100%;
  padding: .8rem;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--radius);
}
.metrics-section-label { color: var(--muted); margin: 1.5rem 0 .9rem; }
.metrics-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); gap: .8rem; margin-bottom: 1.5rem; }
.metrics-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: .4rem;
  padding: 1.2rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--surface);
  min-width: 0;
  overflow-wrap: anywhere;
}
.metrics-card strong { font-size: clamp(1.5rem, 3vw, 2.4rem); line-height: 1.2; font-weight: 500; font-variant-numeric: tabular-nums; }
.metrics-card small { color: var(--muted); font-size: .75rem; }
.metrics-card:hover { border-color: var(--border); background: var(--surface-raised); }
.metrics-card[aria-pressed="true"] { border-color: var(--accent); background: linear-gradient(140deg, #d6ee8c09, transparent), var(--surface); }
.metrics-card[aria-pressed="true"] strong { color: var(--accent); }
.metrics-chart-card { padding: clamp(1rem, 3vw, 2rem); border: 1px solid var(--border); background: var(--carbon), var(--surface); }
.metrics-chart-heading h3 { margin: .25rem 0 0; font-size: 1.65rem; }
.metrics-chart-heading .eyebrow { margin: 0; }
.metrics-source,
.metrics-method { color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; }
.metrics-source { margin: 1rem 0 1.75rem; }
.metrics-method { margin: 1.5rem 0 0; max-width: 60rem; }
.metrics-chart-inspector { display: grid; gap: .3rem; min-height: 5rem; }
.metrics-chart-inspector strong { font-size: 2.1rem; font-weight: 500; color: var(--accent); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.metrics-chart-inspector span { color: var(--muted); font-size: .85rem; }
.metrics-chart { display: block; width: 100%; height: 290px; touch-action: pan-y; margin-top: .8rem; }
.metrics-chart-caption { display: flex; justify-content: space-between; gap: 1rem; color: var(--muted); font-family: var(--mono); font-size: .7rem; }
.metrics-chart-empty { padding: 3rem clamp(1rem, 4vw, 3rem); border: 1px dashed var(--border); margin: 1.5rem 0; background: var(--surface); }
.metrics-chart-empty strong { font-size: 1.5rem; display: block; }
.metrics-chart-empty p { color: var(--muted); max-width: 48rem; }
.metrics-history-table { margin-top: 1.5rem; border-top: 1px solid var(--border); }
.metrics-history-table summary { padding: 1.1rem 0; font-size: 1rem; }
.metrics-history-table summary span { color: var(--muted); margin-left: .75rem; font-size: .8rem; }
.metrics-table-scroll { overflow: auto; }
.metrics-history-table table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.metrics-history-table th,
.metrics-history-table td { padding: .8rem 1rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border-soft); }
.metrics-history-table th { color: var(--muted); font-weight: 400; white-space: nowrap; }
.metrics-history-table td small { display: block; color: var(--muted); }
.metrics-exact { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.metrics-warning { color: #e7bb79; border-left: 2px solid #e7bb79; padding-left: 1rem; }
.metrics-loading { padding: 2rem 0; color: var(--muted); }
.product-metrics > summary {
  font-size: 1.3rem;
  font-weight: 400;
  letter-spacing: -.04em;
}

.product-metrics > summary span {
  margin-left: .75rem;
  color: var(--muted);
  font-size: .85rem;
  letter-spacing: normal;
}

.product-metrics > summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: .4rem;
}

.product-metrics[open] > summary {
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-soft);
}

.product-metrics-body {
  padding-top: .75rem;
  min-width: 0;
}
@media (max-width: 650px) {
  .metrics-controls { gap: 1rem; }
  .metrics-filters { align-items: stretch; flex-direction: column; }
  .metrics-subject-label { flex-basis: auto; max-width: none; }
  .metrics-range-filter { margin-left: 0; }
  .metrics-ranges { width: fit-content; }
  .metrics-toolbar-actions { margin-left: 0; }
  .metrics-chart-caption { font-size: .6rem; }
  .metrics-chart-heading { align-items: flex-start; gap: .7rem; }
}

/* Common metrics aggregates shared counts for one product. */
.common-metrics-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding-top: 1.5rem;
}

.common-metrics-heading h3 {
  margin: .25rem 0;
  font-size: 1.65rem;
  font-weight: 400;
}

.common-metrics-heading p { color: var(--muted); }
.common-metrics-fields { margin: .5rem 0 1rem; }
.common-metrics-versions { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.5rem; }
.common-metrics-version { display: inline-flex; align-items: center; gap: .5rem; }
.common-metrics-version > button {
  border: 0;
  background: transparent;
  color: var(--muted);
  text-decoration: underline;
  font-size: .75rem;
}

.common-metrics-membership { margin-top: 2rem; }
.common-metrics-membership > summary { font-size: 1.1rem; }
.common-metrics-membership > summary span { color: var(--muted); margin-left: .75rem; font-size: .8rem; }
.common-metrics-membership-body { padding-top: 1rem; }
.common-metrics-basis { display: grid; gap: .5rem; color: var(--muted); font-size: .85rem; }
.common-metrics-basis select { padding: .6rem; border: 1px solid var(--border); background: var(--surface); color: var(--ink); }
.metrics-link-label { display: grid; gap: .5rem; margin: 1rem 0; color: var(--muted); }
.metrics-link-label select { min-width: 0; width: 100%; padding: .7rem; color: var(--ink); background: var(--surface); border: 1px solid var(--border); }
.metrics-links-dialog { border-radius: var(--radius); }
.metrics-links-dialog select { border-radius: var(--radius); }

.product-metrics .metrics-filters {
  justify-content: center;
}

.product-metrics .metrics-range-filter {
  margin-inline: auto;
  justify-items: center;
}


.metrics-plot {
  position: relative;
  margin-top: .8rem;
}

.metrics-plot .metrics-chart {
  margin-top: 0;
}

.metrics-chart-cursor {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 290px;
  pointer-events: none;
}

/* Queue controls follow catalog actions and retain readable spacing. */
.queue-header-actions, .queue-pagination {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.queue-pagination {
  justify-content: center;
  padding: 1.5rem 0;
}
.change-card-top .change-card-id { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.change-card-top .listing-actions { flex-shrink: 0; }
.queue-header-actions .listing-actions { position: relative; }
.queue-pagination button:disabled { opacity: .45; cursor: default; }
@media (max-width: 600px) {
  .queue-header-actions { gap: .5rem; }
  .queue-pagination { gap: .75rem; }
}

/* Actions belong to the current image in the product viewer. */
.product-image-controls {
  position: absolute;
  z-index: 2;
  top: .75rem;
  left: .75rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .55rem;
  width: calc(100% - 1.5rem);
}
.product-image-controls:empty { display: none; }
.product-image-actions {
  display: flex;
  max-width: 100%;
  flex-wrap: wrap;
  align-items: center;
  gap: .65rem;
}
.product-image-note {
  position: absolute;
  z-index: 1;
  bottom: .75rem;
  left: .75rem;
  right: .75rem;
  margin: 0;
  padding: .75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--carbon), rgb(27 29 26 / 70%);
  backdrop-filter: blur(6px);
  box-shadow: 0 .2rem .7rem #0004;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.6;
}
.product-image-note:hover {
  background: var(--carbon), var(--surface);
  color: var(--ink);
}
.product-image-note:empty { display: none; }

.metrics-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border-top: 1px solid var(--border-soft);
  color: var(--muted);
}
.metrics-pagination > div { display: flex; flex-wrap: wrap; gap: .6rem; }
.metrics-pagination button:disabled { opacity: .45; cursor: default; }

/* Listing editors share the catalog's carbon surfaces and square controls. */
.listing-editor-dialog {
  border-radius: var(--radius);
  background: var(--background);
}
.listing-editor-dialog .clone-header {
  border-top: 3px solid var(--accent);
  background: var(--carbon), var(--surface);
}
.listing-editor-dialog .clone-header h2 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 400;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.listing-editor-dialog .clone-header p:not(.eyebrow),
.listing-editor-dialog .clone-note {
  color: var(--muted);
  opacity: 1;
}
.listing-editor-dialog .dialog-close {
  border-radius: var(--radius);
  background: var(--background);
}
.listing-editor-dialog .clone-body {
  display: grid;
  gap: 1.5rem;
  padding-top: 1.5rem;
}
.listing-editor-dialog .clone-body section {
  min-width: 0;
  padding: 1.25rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--carbon), var(--surface);
}
.listing-editor-dialog .clone-body h3 { margin: 0 0 1.25rem; }
.listing-editor-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}
.listing-editor-fields .edit-field { min-width: 0; }
.listing-editor-field-wide { grid-column: 1 / -1; }
.listing-editor-dialog input, .listing-editor-dialog select, .listing-editor-dialog textarea {
  border-radius: var(--radius);
  background: var(--background);
  color: var(--ink);
  line-height: 1.6;
}
.listing-editor-dialog :is(input, select, textarea, button):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.listing-editor-dialog .clone-footer {
  gap: 1rem;
  background: var(--carbon), var(--surface);
}
@media (max-width: 650px) {
  .listing-editor-fields { grid-template-columns: 1fr; }
  .listing-editor-dialog .clone-body section { padding: 1rem; }
}
.image-publication {
  display: inline-block;
  font-size: .9rem;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  padding: .3rem .65rem;
  border-radius: var(--radius);
}
.image-publication.is-published {
  color: var(--accent);
  border-color: var(--border);
}
.image-publication.is-uncertain { color: var(--danger); }

/* CSS-drawn controls avoid font-dependent icon glyphs. */
.product-image-actions .viewer-icon-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.6rem;
  min-height: 2.6rem;
  padding: .65rem;
  background: var(--carbon), var(--surface);
  box-shadow: 0 .15rem .5rem #0005;
  text-decoration: none;
}
.viewer-icon {
  position: relative;
  display: block;
  flex: 0 0 1.1rem;
  width: 1.1rem;
  height: 1.1rem;
}
.viewer-icon::before, .viewer-icon::after, .viewer-icon i {
  position: absolute;
  display: block;
  content: "";
}
.viewer-icon-download::before {
  top: .02rem;
  left: .5rem;
  width: .1rem;
  height: .65rem;
  background: currentColor;
}
.viewer-icon-download i {
  top: .28rem;
  left: .33rem;
  width: .44rem;
  height: .44rem;
  border-right: .1rem solid currentColor;
  border-bottom: .1rem solid currentColor;
  transform: rotate(45deg);
}
.viewer-icon-download::after {
  right: 0;
  bottom: 0;
  left: 0;
  height: .3rem;
  border: .1rem solid currentColor;
  border-top: 0;
}
.viewer-icon-delete::before {
  top: .3rem;
  bottom: 0;
  left: .2rem;
  width: .7rem;
  border: .1rem solid currentColor;
  border-top: 0;
}
.viewer-icon-delete::after {
  top: .17rem;
  left: .08rem;
  width: .94rem;
  border-top: .1rem solid currentColor;
}
.viewer-icon-delete i {
  top: 0;
  left: .38rem;
  width: .34rem;
  height: .2rem;
  border: .09rem solid currentColor;
  border-bottom: 0;
}
.image-action-label {
  max-width: 0;
  margin-inline-start: 0;
  overflow: hidden;
  opacity: 0;
  white-space: nowrap;
  transition: max-width 180ms ease, margin-inline-start 180ms ease, opacity 150ms ease;
}
.viewer-icon-action:is(:hover, :focus-visible) .image-action-label {
  max-width: 8rem;
  margin-inline-start: .5rem;
  opacity: 1;
}
@media (hover: none) {
  .viewer-icon-action .image-action-label {
    max-width: 8rem;
    margin-inline-start: .5rem;
    opacity: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  .image-action-label { transition: none; }
}

/* Anchor disabled explanations to the overlay width, inside the image. */
.image-delete-control { display: inline-flex; }
.image-delete-control button:disabled { pointer-events: none; }
.image-delete-control:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.image-control-tooltip {
  position: absolute;
  z-index: 3;
  top: calc(100% + .5rem);
  left: 0;
  width: max-content;
  max-width: 100%;
  padding: .65rem .8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--carbon), var(--surface);
  box-shadow: 0 .2rem .7rem #0006;
  color: var(--ink);
  font-size: .9rem;
  line-height: 1.5;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
}
.image-delete-control:is(:hover, :focus-within) .image-control-tooltip {
  opacity: 1;
  visibility: visible;
}
.image-delete-control:focus-visible .image-action-label {
  max-width: 8rem;
  margin-inline-start: .5rem;
  opacity: 1;
}

/* Catalog selection and per-listing review queues share the carbon dialogs. */
.catalog-selection-dialog,
.catalog-queue-dialog,
.catalog-edit-dialog {
  width: min(52rem, calc(100vw - 2rem));
}
.catalog-actions .listing-actions-menu {
  max-height: min(38rem, 76dvh);
  overflow-y: auto;
}
.catalog-selection-search { display: grid; gap: .45rem; }
.catalog-selection-tools,
.catalog-selection-pages,
.catalog-queue-banner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .7rem;
}
.catalog-selection-tools { margin: 1rem 0; }
.catalog-selection-tools .pill { margin-left: auto; }
.catalog-selection-list { border-top: 1px solid var(--border); }
.catalog-selection-row {
  display: flex;
  align-items: flex-start;
  gap: .9rem;
  padding: 1rem .5rem;
  border-bottom: 1px solid var(--border-soft);
  cursor: pointer;
}
.catalog-selection-row:hover { background: var(--surface-hover); }
.catalog-selection-row:has(input:checked) { background: var(--accent-dark); }
.catalog-selection-row > input { flex: 0 0 auto; width: 1.2rem; height: 1.2rem; margin-top: .3rem; accent-color: var(--accent); }
.catalog-selection-row > span { display: grid; gap: .2rem; min-width: 0; overflow-wrap: anywhere; }
.catalog-selection-row strong { font-size: 1rem; font-weight: 600; }
.catalog-selection-row small { color: var(--muted); }
.catalog-selection-row.is-unavailable { cursor: default; }
.catalog-selection-reason { font-style: italic; }
.catalog-selection-pages { justify-content: space-between; padding-top: 1rem; }
.catalog-selection-pages span { color: var(--muted); font-size: .85rem; }
.catalog-queue-banner { justify-content: space-between; padding: .9rem 1.2rem; border-bottom: 1px solid var(--border); background: var(--accent-dark); font-size: .85rem; }
.catalog-queue-current { margin: 1rem 0; padding: 1rem; border: 1px solid var(--border); background: var(--carbon), var(--surface-raised); overflow-wrap: anywhere; }
.catalog-queue-dialog .batch-results { max-height: 45dvh; overflow-y: auto; }
.catalog-edit-dialog .hero { padding: 0 0 1.2rem; }
.catalog-edit-dialog .listing-editor { margin: 0; }
.catalog-link-list { display: grid; gap: .8rem; }
@media (max-width: 640px) {
  .catalog-selection-tools .pill { margin-left: 0; }
  .catalog-selection-pages { justify-content: center; }
  .catalog-queue-banner { align-items: flex-start; flex-direction: column; }
}
.catalog-selection-dialog .clone-form,
.catalog-queue-dialog .clone-form { display: flex; flex-direction: column; max-height: calc(100dvh - 3rem); }
.catalog-selection-dialog .clone-body,
.catalog-queue-dialog .clone-body { overflow-y: auto; min-height: 0; }
.catalog-selection-dialog .clone-header,
.catalog-selection-dialog .clone-footer,
.catalog-queue-dialog .clone-header,
.catalog-queue-dialog .clone-footer { flex-shrink: 0; }

.image-transfer-dialog { width: min(58rem, calc(100vw - 2rem)); }
.image-transfer-dialog .clone-form { display: flex; flex-direction: column; max-height: calc(100dvh - 3rem); }
.image-transfer-dialog .clone-body { overflow-y: auto; min-height: 0; }
.image-transfer-dialog .clone-header,
.image-transfer-dialog .clone-footer { flex-shrink: 0; }
.image-transfer-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: .7rem; margin: 1rem 0; }
.image-transfer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: 1rem; }
.image-transfer-asset { position: relative; display: flex; flex-direction: column; gap: .65rem; padding: .75rem; border: 1px solid var(--border); border-radius: .65rem; background: var(--carbon), var(--surface-raised); cursor: pointer; }
.image-transfer-asset:has(input:checked) { border-color: var(--accent); background-color: var(--accent-dark); }
.image-transfer-asset:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.image-transfer-asset input { position: absolute; top: 1rem; left: 1rem; width: 1.3rem; height: 1.3rem; accent-color: var(--accent); z-index: 1; }
.image-transfer-asset img { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: .35rem; background: repeating-conic-gradient(#25282c 0% 25%, #191b1e 0% 50%) 0 / 18px 18px; }
.image-transfer-asset strong { display: block; font-size: .9rem; overflow-wrap: anywhere; }
.image-transfer-asset small { display: block; color: var(--muted); margin-top: .25rem; }

/* Facebook sends use the same readable carbon cards as catalog review. */
.facebook-publish-dialog { width: min(62rem, calc(100vw - 2rem)); }
.facebook-queue-item,
.facebook-batch-history {
  padding: 1.1rem 1.25rem;
  margin: .85rem 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--carbon), var(--surface-raised);
}
.facebook-queue-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.facebook-queue-heading .catalog-selection-row { flex: 1; border: 0; padding: .25rem 0 .75rem; }
.facebook-queue-item details,
.facebook-batch-history details { padding-top: .7rem; border-top: 1px solid var(--border-soft); }
.facebook-queue-item summary,
.facebook-batch-history summary { cursor: pointer; font-size: 1rem; color: var(--muted); }
.facebook-field-preview { list-style: none; padding: 0; }
.facebook-field-preview li { display: grid; gap: .4rem; margin-top: 1rem; overflow-wrap: anywhere; }
.facebook-field-preview li span { white-space: pre-wrap; max-height: 14rem; overflow: auto; }
.facebook-batch-section { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.facebook-batch-history li { margin: 1rem 0; overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .facebook-queue-heading { flex-wrap: wrap; }
  .facebook-queue-item, .facebook-batch-history { padding: .9rem; }
}
.facebook-batch-history pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .9rem; }

/* File Store shares the catalog's carbon surfaces and generous reading size. */
.file-store { display: grid; gap: 1.4rem; }
.file-store-header { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; border-bottom: 1px solid var(--border); padding: .5rem 0 1.5rem; }
.file-store-header h2 { margin: 0; font-size: clamp(2rem, 4vw, 3.5rem); letter-spacing: -.055em; line-height: 1.15; }
.file-store-header h2 span { color: var(--accent); }
.file-store-header p { margin: .5rem 0 0; color: var(--muted); }
.file-store-summary { display: grid; text-align: right; white-space: nowrap; }
.file-store-summary strong { color: var(--accent); font: 2.5rem var(--mono); }
.file-store-summary span { color: var(--muted); }
.file-store-toolbar { display: flex; align-items: flex-end; gap: .7rem; }
.file-store-toolbar label { display: grid; gap: .4rem; flex: 1; color: var(--muted); }
.file-store-toolbar input { width: 100%; min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .65rem .8rem; color: var(--ink); }
.file-store-intro { margin: 0; color: var(--muted); max-width: 65ch; }
.file-store-results { display: grid; gap: 1rem; }
.file-store-results[aria-busy="true"] { opacity: .65; }
.file-store-card { display: grid; grid-template-columns: minmax(8rem, 12rem) minmax(0, 1fr); border: 1px solid var(--border); background: var(--carbon), var(--surface); }
.file-store-preview { display: grid; place-items: center; min-height: 12rem; background: var(--image-background); border-right: 1px solid var(--border-soft); color: var(--muted); overflow: hidden; }
.file-store-preview img { display: block; width: 100%; height: 100%; max-height: 23rem; object-fit: contain; }
.file-store-details { min-width: 0; padding: 1.1rem 1.3rem; }
.file-store-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.file-store-heading h2 { font-size: 1.15rem; margin: 0; overflow-wrap: anywhere; }
.file-store-id { font: .72rem/1.7 var(--mono); color: var(--muted); overflow-wrap: anywhere; margin: .5rem 0; }
.file-store-meta { color: var(--muted); font-size: .85rem; margin: .5rem 0 1rem; }
.file-store-details h3 { font-size: .85rem; font-weight: 500; margin: 0 0 .5rem; color: var(--muted); }
.file-store-details h3 span { color: var(--accent); margin-left: .4rem; }
.file-store-channel { color: var(--accent); font: .7rem/1.5 var(--mono); text-transform: uppercase; white-space: nowrap; }
.file-store-links { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; max-height: 15rem; overflow-y: auto; }
.file-store-links li { display: grid; grid-template-columns: 5rem minmax(0, 1fr); gap: .6rem; padding: .6rem 0; border-top: 1px solid var(--border-soft); }
.file-store-links li > span { overflow-wrap: anywhere; }
.file-store-links small { display: block; color: var(--muted); font: .7rem/1.6 var(--mono); margin-top: .3rem; }
.file-store-unlinked { margin: 0; color: var(--muted); }
.file-store-card-footer { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1rem; }
.file-store-card-footer a { text-decoration: none; }
.file-store-protection, .file-store-warning { margin: .75rem 0 0; font-size: .8rem; color: var(--muted); }
.file-store-warning { color: var(--danger); }
.file-store-pagination { display: flex; align-items: center; justify-content: center; gap: 1rem; }
.file-store-pagination span { color: var(--muted); }
.file-store-empty { padding: 2rem; border: 1px dashed var(--border); text-align: center; color: var(--muted); }
.file-store-confirm { display: flex; gap: .8rem; align-items: baseline; padding: 1rem; border: 1px solid var(--border); background: var(--surface-raised); }
.file-store-confirm input { width: 1rem; height: 1rem; accent-color: var(--accent); flex-shrink: 0; }
@media (max-width: 750px) {
  .file-store-header { align-items: flex-start; }
  .file-store-summary strong { font-size: 1.8rem; }
  .file-store-toolbar { flex-wrap: wrap; }
  .file-store-toolbar label { flex-basis: 100%; }
  .file-store-card { grid-template-columns: 1fr; }
  .file-store-preview { border-right: 0; border-bottom: 1px solid var(--border-soft); max-height: 14rem; }
  .file-store-preview img { height: 14rem; }
  .file-store-heading { flex-wrap: wrap; gap: .3rem; }
  .file-store-details { padding: 1rem; }
}

/* Structured marketplace attributes: readable labels, restrained carbon cards. */
.listing-field-structured { grid-column: 1 / -1; }
.listing-field-structured > dt { margin-bottom: .8rem; }
.attribute-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin: 0; border: 1px solid var(--border); background: var(--carbon), var(--surface); }
.attribute-row { padding: 1rem 1.2rem; min-width: 0; border-bottom: 1px solid var(--border-soft); }
.attribute-row-wide { grid-column: 1 / -1; }
.attribute-row dt { color: var(--muted); font-size: .8rem; letter-spacing: .025em; margin-bottom: .45rem; }
.attribute-row dd { margin: 0; overflow-wrap: anywhere; }
.attribute-row .attribute-grid { margin-top: .4rem; background: var(--surface-raised); }
.attribute-text { white-space: pre-wrap; }
.attribute-link { display: inline-block; max-width: 100%; text-decoration-color: var(--border); text-underline-offset: .2em; font-size: .9rem; overflow-wrap: anywhere; }
.attribute-link:hover { text-decoration-color: var(--accent); }
.attribute-list { list-style: none; display: grid; gap: .6rem; padding: 0; margin: 0; }
.attribute-list > li { padding: .65rem .8rem; background: #0000001a; border-left: 2px solid var(--border); min-width: 0; }
.attribute-empty { color: var(--muted); }
.attribute-boolean { color: var(--accent); }
.attribute-long-text summary { color: var(--ink); font-size: 1rem; font-weight: 400; line-height: 1.7; }
.attribute-long-text summary span { display: block; color: var(--accent); font-size: .8rem; margin-top: .4rem; }
.attribute-long-text[open] summary { color: var(--muted); }
.attribute-long-text[open] summary span { display: none; }
.attribute-long-text p { white-space: pre-wrap; margin: 1rem 0 0; padding-top: 1rem; border-top: 1px solid var(--border-soft); }
.attribute-overflow { max-height: 24rem; overflow: auto; }
@media (max-width: 750px) {
  .attribute-grid { grid-template-columns: 1fr; }
  .attribute-row { padding: .9rem; }
}

.image-transfer-asset-disabled { cursor: not-allowed; border-color: var(--border-soft); background: var(--surface); }
.image-transfer-asset-disabled img { filter: grayscale(1); opacity: .4; }
.image-transfer-asset-disabled > span { color: var(--muted); }
.image-transfer-asset-disabled .image-transfer-existing { padding-top: .35rem; font-weight: 600; color: var(--muted); }

/* Shared interaction behavior builds on the base action/dialog surfaces above. */
.listing-actions > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.listing-actions[open] { z-index: 30; }
.actions-open-above > .listing-actions-menu { top: auto; bottom: calc(100% + .5rem); }
.actions-align-start > .listing-actions-menu { right: auto; left: 0; }
.listing-actions-menu :is(button, a):focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--surface-hover); }
.listing-actions-menu button:disabled:hover { background: transparent; cursor: not-allowed; }
.clone-dialog > .clone-form { display: flex; flex-direction: column; max-height: calc(100dvh - 3rem - 2px); }
.clone-dialog .clone-header, .clone-dialog .clone-footer { flex-shrink: 0; }
.clone-dialog .dialog-close:hover:not(:disabled) { background: var(--surface-hover); border-color: var(--ink); }
.clone-dialog :is(input[type="checkbox"], input[type="radio"]) { width: 1.2rem; height: 1.2rem; padding: 0; flex-shrink: 0; accent-color: var(--accent); }
.clone-dialog.delete-dialog :is(input[type="checkbox"], input[type="radio"]) { accent-color: var(--danger); }
.clone-dialog :is(button, a, input, select, textarea):focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.clone-dialog > .clone-body { max-height: calc(100dvh - 3rem - 2px); }
.global-alert-info { border-color: var(--border); border-left-color: var(--accent); background: var(--carbon), var(--surface); color: var(--ink); box-shadow: 0 12px 36px #0008; }

/* Checkout extends the shared industrial carbon theme; no storefront browsing. */
.checkout-header,
.checkout-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .75rem 1.5rem;
  padding: 1rem max(1.25rem, calc((100vw - 64rem) / 2));
  border-bottom: 1px solid var(--border-soft);
  color: var(--muted);
}

.checkout-header > span:first-child {
  color: var(--ink);
  font-weight: 600;
  letter-spacing: .18em;
}

.checkout-shell {
  width: min(64rem, calc(100% - 2.5rem));
  margin: 2.5rem auto 4rem;
}

.checkout-intro {
  max-width: 42rem;
  margin-bottom: 2rem;
}

.checkout-intro h1 {
  margin: .4rem 0 .75rem;
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 400;
  line-height: 1.15;
}

.checkout-intro > p:last-child {
  color: var(--muted);
}

.checkout-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(15rem, 21rem);
  align-items: start;
  gap: 1.5rem;
}

.checkout-items-card,
.checkout-summary,
.checkout-state {
  min-width: 0;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--carbon), var(--surface);
}

.checkout-section-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: .5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-soft);
}

.checkout-section-heading h2,
.checkout-summary h2,
.checkout-state h2 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 400;
}

.checkout-section-heading span,
.checkout-line-copy p,
.checkout-policy,
.checkout-state p {
  color: var(--muted);
}

.checkout-line {
  display: grid;
  grid-template-columns: 5rem minmax(0, 1fr) auto;
  align-items: start;
  gap: 1rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border-soft);
}

.checkout-line:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.checkout-image {
  display: grid;
  place-items: center;
  width: 5rem;
  height: 6rem;
  background: var(--image-background);
  border: 1px solid var(--border-soft);
}

.checkout-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.checkout-image span {
  color: var(--muted);
  font-size: .85rem;
  text-align: center;
}

.checkout-line-copy h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.checkout-line-copy p {
  margin: .5rem 0 .75rem;
}

.checkout-line-total {
  white-space: nowrap;
}

.checkout-quantity {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
}

.checkout-quantity button {
  width: 2.65rem;
  min-height: 2.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--background);
}

.checkout-quantity button:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--surface-hover);
}

.checkout-summary dl {
  margin: 1.5rem 0;
}

.checkout-summary dl > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: .75rem 0;
}

.checkout-summary dd {
  margin: 0;
}

.checkout-total {
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 1.3rem;
}

.checkout-total dd {
  color: var(--accent);
}

.checkout-policy {
  margin: 1rem 0;
  line-height: 1.65;
}

.checkout-pay {
  width: 100%;
  margin: .5rem 0;
  white-space: normal;
}

.checkout-status {
  margin-bottom: 0;
  color: var(--accent);
}

.checkout-footer {
  justify-content: center;
  border-top: 1px solid var(--border-soft);
  border-bottom: 0;
}

@media (max-width: 950px) {
  .checkout-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 580px) {
  .checkout-shell {
    width: calc(100% - 1.5rem);
    margin-top: 1.5rem;
  }

  .checkout-items-card,
  .checkout-summary,
  .checkout-state {
    padding: 1rem;
  }

  .checkout-line {
    grid-template-columns: 4rem minmax(0, 1fr);
  }

  .checkout-image {
    width: 4rem;
    height: 5rem;
  }

  .checkout-line-total {
    grid-column: 2;
  }
}

/* The screen receipt shares the carbon theme; print uses an ink-saving sheet. */
.receipt-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.receipt-heading .eyebrow { margin-top: 0; }
.receipt-paid { color: var(--accent); }
.receipt-test { padding: 1rem; border: 1px solid var(--accent); }
.receipt-details { margin: 2rem 0; }
.receipt-details > div { margin: 1rem 0; }
.receipt-details dt { color: var(--muted); }
.receipt-details dd { margin: .25rem 0 0; }
.receipt-reference { font-family: var(--mono); overflow-wrap: anywhere; }
.receipt-lines { width: 100%; }
.receipt-lines th, .receipt-lines td { padding: 1rem .75rem; vertical-align: top; }
.receipt-lines th:first-child, .receipt-lines td:first-child { padding-left: 0; }
.receipt-lines td:first-child { min-width: 12rem; overflow-wrap: anywhere; }
.receipt-totals { margin: 1.5rem 0 1.5rem auto; max-width: 23rem; }
.receipt-totals > div { display: flex; justify-content: space-between; gap: 1rem; padding: .75rem 0; }
.receipt-totals dd { margin: 0; }
.receipt-totals > div:last-child { font-size: 1.3rem; border-top: 1px solid var(--border); }
.receipt-footer { padding-top: 1.5rem; border-top: 1px solid var(--border); }
.receipt-footer p { max-width: 42rem; }
.receipt-footer button { margin-top: 1rem; }

@media print {
  @page { margin: 16mm; }
  html, body.checkout-page { background: white !important; color: black !important; font-size: 11pt; }
  .checkout-header, .checkout-intro, .checkout-footer, .receipt-footer button,
  #alert-stack, #progress-stack, [data-order] { display: none !important; }
  .checkout-shell { width: 100%; margin: 0; }
  .checkout-receipt { padding: 0; border: 0; background: white !important; }
  .checkout-receipt * { color: black !important; box-shadow: none !important; text-shadow: none !important; }
  .checkout-receipt .table-scroll { overflow: visible; }
  .receipt-lines { table-layout: fixed; font-size: 10pt; }
  .receipt-lines th:first-child { width: 50%; }
  .receipt-lines td:first-child { min-width: 0; }
  .receipt-lines tr, .receipt-totals, .receipt-heading { break-inside: avoid; }
  .receipt-lines th, .receipt-lines td { border-bottom: 1px solid #bbb; }
}

.checkout-delivery { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.checkout-address-form { display: grid; gap: 1rem; margin-top: 1.5rem; }
.checkout-address-form label { display: grid; gap: .5rem; min-width: 0; }
.checkout-address-form label > span { display: inline; color: var(--muted); }
.checkout-address-form input { width: 100%; min-width: 0; min-height: 2.65rem; font: inherit; border: 1px solid var(--border); border-radius: var(--radius); background: var(--background); color: var(--ink); padding: .6rem .75rem; }
.checkout-address-form input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.checkout-address-form input[name="postcode"] { text-transform: uppercase; }
.checkout-address-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(8rem, .6fr); gap: 1rem; }
@media (max-width: 580px) { .checkout-address-row { grid-template-columns: 1fr; } }
