/*
  Atelier presentation for the technical inventory configuration screens.

  Scoped to `.inventory-setup` (the body class of the configuration layout) so
  the stock, catalog, recipe, access and transfer screens keep their existing
  layout. Colors, type and spacing reuse the shared floral/Prewind tokens; no
  global shell or component rule changes here.
*/

.inventory-setup {
  --atelier-rule: #e3e5d7;
  --atelier-panel: #fffdf8;
  --atelier-section-space: clamp(2rem, 3.6vw, 3.25rem);
  --atelier-radius: 10px;
}

/* Page rhythm: generous, even spacing between the hero, cards and panels. */
.inventory-setup .ad-main {
  gap: var(--atelier-section-space);
  padding-bottom: var(--space-lg);
}

/* The setup layout wraps every screen in the inventory-form controller; the
   vertical rhythm lives there so the hero, cards and panels share one scale. */
.inventory-setup .ad-main > div[data-controller="inventory-form"] {
  display: flex;
  flex-direction: column;
  gap: var(--atelier-section-space);
  min-width: 0;
}

/* Sidebar labels stay compact and whole; body and control text remain 16px. */
.inventory-setup .ad-nav-label {
  font-size: 0.7rem;
  letter-spacing: 0.09em;
  line-height: 1.3;
  white-space: nowrap;
}

.inventory-setup .ad-management .ad-nav-link {
  gap: 0.6rem;
  padding-inline: 0.6rem;
  white-space: nowrap;
}

/* The technical notice becomes a quiet, short banner instead of a wall. */
.inventory-setup .ad-demo-notice {
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xs) var(--space-sm);
  border-color: var(--floral-line);
  background: var(--floral-sage-paper);
}

.inventory-setup .ad-demo-notice > span {
  color: var(--floral-muted);
  font-size: 0.68rem;
  letter-spacing: 0.09em;
}

.inventory-setup .ad-demo-notice p {
  border-left-color: var(--floral-line);
  color: var(--floral-muted);
  font-size: 0.8rem;
  line-height: 1.6;
}

/* Hero ------------------------------------------------------------------- */

.inventory-setup .inventory-atelier-hero {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md);
  padding: clamp(1.5rem, 2.8vw, 2.6rem);
  border: 1px solid var(--floral-line);
  border-radius: var(--atelier-radius);
  background:
    radial-gradient(circle at 92% 18%, rgba(209, 165, 178, 0.22), transparent 42%),
    linear-gradient(135deg, #faf7ee 0%, #eef1e4 100%);
  overflow: hidden;
}

.inventory-setup .inventory-atelier-hero__copy {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  min-width: 0;
}

.inventory-setup .inventory-atelier-hero h1 {
  margin: 0;
  color: var(--floral-ink);
  font-family: var(--floral-serif);
  font-size: clamp(2.1rem, 4vw, 3.4rem);
  font-weight: 400;
  letter-spacing: -0.045em;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.inventory-setup .inventory-atelier-hero h1 em {
  color: var(--floral-rose);
  font-style: italic;
}

.inventory-setup .inventory-atelier-hero .inventory-intro {
  max-width: 62ch;
  color: var(--floral-muted);
  font-size: 1rem;
  line-height: 1.7;
}

/* Compact eyebrow labels; body copy and controls keep the readable 16px size. */
.inventory-setup .inventory-eyebrow {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  line-height: 1.5;
}

.inventory-setup .inventory-atelier-hero__mark {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 4.25rem;
  height: 4.25rem;
  border: 1px solid var(--floral-rose-line);
  border-radius: 50%;
  background: rgba(255, 253, 248, 0.7);
  color: var(--floral-rose);
}

/* Summary cards ---------------------------------------------------------- */

.inventory-setup .inventory-atelier-overview {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  min-width: 0;
}

.inventory-setup .inventory-atelier-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-sm);
  min-width: 0;
}

.inventory-setup .inventory-atelier-stat {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  min-width: 0;
  padding: var(--space-md);
  border: 1px solid var(--atelier-rule);
  border-radius: var(--atelier-radius);
  background: var(--atelier-panel);
}

.inventory-setup .inventory-atelier-stat:nth-child(2) {
  border-color: #e8d6da;
  background: var(--floral-rose-paper);
}

.inventory-setup .inventory-atelier-stat:nth-child(4) {
  border-color: #dde2d2;
  background: var(--floral-sage-paper);
}

.inventory-setup .inventory-atelier-stat__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xs);
  min-width: 0;
}

.inventory-setup .inventory-atelier-stat__label {
  margin: 0;
  color: var(--floral-muted);
  font-family: var(--floral-sans);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  line-height: 1.4;
  text-transform: uppercase;
}

.inventory-setup .inventory-atelier-stat__icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--floral-line);
  border-radius: 50%;
  background: var(--floral-paper);
  color: var(--floral-rose);
}

.inventory-setup .inventory-atelier-stat:nth-child(4) .inventory-atelier-stat__icon {
  color: var(--floral-ink);
}

.inventory-setup .inventory-atelier-stat strong {
  margin: 0;
  color: var(--floral-ink);
  font-family: var(--floral-serif);
  font-size: clamp(2rem, 3vw, 2.75rem);
  font-variant-numeric: tabular-nums;
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 1;
}

.inventory-setup .inventory-atelier-stat__meta {
  margin: auto 0 0;
  padding-top: var(--space-xs);
  border-top: 1px solid var(--atelier-rule);
  color: var(--floral-muted);
  font-family: var(--floral-sans);
  font-size: 0.8rem;
  line-height: 1.5;
}

/* Actions ---------------------------------------------------------------- */

.inventory-setup .inventory-atelier-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs);
  min-width: 0;
}

.inventory-setup .inventory-atelier-actions .ui-floral-button {
  min-height: 44px;
}

/* Page actions sit just under their hero, then the sections resume the larger
   shared rhythm. Flex gaps do not collapse, so the offset is explicit. */
.inventory-setup .inventory-atelier-hero + .inventory-atelier-actions {
  margin-top: calc(var(--space-sm) - var(--atelier-section-space));
}

/* Sections --------------------------------------------------------------- */

.inventory-setup .inventory-atelier-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  min-width: 0;
  padding-top: var(--space-md);
  border-top: 1px solid var(--atelier-rule);
}

.inventory-setup .inventory-atelier-section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-sm);
  min-width: 0;
}

.inventory-setup .inventory-atelier-section h2 {
  margin: 0;
  color: var(--floral-ink);
  font-family: var(--floral-serif);
  font-size: clamp(1.55rem, 2.5vw, 2.15rem);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.inventory-setup .inventory-atelier-kicker {
  margin: 0 0 var(--space-3xs);
  color: var(--floral-rose);
  font-family: var(--floral-sans);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.11em;
  line-height: 1.4;
  text-transform: uppercase;
}

.inventory-setup .inventory-atelier-section .inventory-section-note {
  margin: 0;
  color: var(--floral-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.inventory-setup .inventory-atelier-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--floral-rose);
  font-family: var(--floral-sans);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.4;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.inventory-setup .inventory-atelier-link:focus-visible {
  outline: 2px solid var(--floral-ink);
  outline-offset: 3px;
}

/* Published shops map: the shared branch partial keeps its own card/map
   presentation; the Atelier section only supplies the surrounding rhythm. */

/* Quiet secondary panels (technical guide and audit histories) ----------- */

.inventory-setup .inventory-atelier-panel {
  min-width: 0;
  border: 1px solid var(--atelier-rule);
  border-radius: var(--atelier-radius);
  background: var(--atelier-panel);
}

.inventory-setup .inventory-atelier-panel > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  min-height: 48px;
  padding: var(--space-sm) var(--space-md);
  color: var(--floral-ink);
  font-family: var(--floral-sans);
  font-size: 1rem;
  line-height: 1.4;
  list-style: none;
  cursor: pointer;
}

.inventory-setup .inventory-atelier-panel > summary::-webkit-details-marker {
  display: none;
}

.inventory-setup .inventory-atelier-panel > summary::after {
  content: "+";
  flex: 0 0 auto;
  color: var(--floral-rose);
  font-family: var(--floral-serif);
  font-size: 1.4rem;
  line-height: 1;
}

.inventory-setup .inventory-atelier-panel[open] > summary::after {
  content: "–";
}

.inventory-setup .inventory-atelier-panel > summary:focus-visible {
  outline: 2px solid var(--floral-ink);
  outline-offset: -3px;
}

.inventory-setup .inventory-atelier-panel__count {
  margin-left: auto;
  color: var(--floral-muted);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
}

.inventory-setup .inventory-atelier-panel__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  min-width: 0;
  padding: 0 var(--space-md) var(--space-md);
}

.inventory-setup .inventory-atelier-panel__body > .inventory-note {
  margin: 0;
}

/* Setup guide numbering: one marker per step (the global list styling was
   drawing a second, circled number on the same item). */
.inventory-setup .inventory-steps {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  max-width: none;
  margin: 0;
  padding: 0;
  list-style: none;
}

.inventory-setup .inventory-steps li {
  position: relative;
  padding-left: 2.6rem;
  color: var(--floral-ink);
  font-size: 1rem;
  line-height: 1.65;
}

.inventory-setup .inventory-steps li::before {
  content: counter(step-counter);
  position: absolute;
  top: 0.1em;
  left: 0;
  display: grid;
  place-items: center;
  width: 1.7rem;
  height: 1.7rem;
  border: 1px solid var(--floral-rose-line);
  border-radius: 50%;
  background: var(--floral-blush);
  color: var(--floral-rose);
  font-family: var(--floral-sans);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1;
}

.inventory-setup .inventory-steps li strong {
  font-weight: 600;
}

.inventory-setup .inventory-steps .inventory-text-link {
  display: inline;
  min-height: 0;
  font-size: inherit;
}

/* Registered shops: distinct, real inventory records. */
.inventory-setup .inventory-atelier-locations {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  max-width: none;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* The global list styling decorates every list item with a floral bullet;
   these two data lists use their own markers and hairlines instead. */
.inventory-setup .inventory-atelier-locations li::before,
.inventory-setup .inventory-history li::before {
  content: none;
  display: none;
}

.inventory-setup .inventory-atelier-location {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
  min-width: 0;
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--atelier-rule);
  border-radius: var(--atelier-radius);
  background: var(--atelier-panel);
}

.inventory-setup .inventory-atelier-location__mark {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--floral-line);
  border-radius: 50%;
  background: var(--floral-sage-paper);
  color: var(--floral-ink);
}

.inventory-setup .inventory-atelier-location__identity {
  display: grid;
  flex: 1 1 14rem;
  gap: 0.15rem;
  min-width: 0;
}

.inventory-setup .inventory-atelier-location__identity strong {
  color: var(--floral-ink);
  font-family: var(--floral-sans);
  font-size: 1rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.inventory-setup .inventory-atelier-location__identity small {
  color: var(--floral-muted);
  font-family: var(--floral-sans);
  font-size: 0.8rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.inventory-setup .inventory-atelier-location__badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2xs);
  min-width: 0;
}

.inventory-setup .inventory-atelier-location__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
  margin-left: auto;
}

/* Catalog table: the description is part of the stored storefront metadata,
   not a second fake product card. */
.inventory-setup .inventory-atelier-table th[scope="row"] {
  min-width: 15rem;
}

.inventory-setup .inventory-atelier-item__description {
  display: block;
  max-width: 44ch;
  margin-top: 0.3rem;
  color: var(--floral-muted);
  font-family: var(--floral-sans);
  font-size: 0.85rem;
  font-weight: 400;
  line-height: 1.5;
}

/* Histories -------------------------------------------------------------- */

.inventory-setup .inventory-history {
  gap: var(--space-xs);
  max-width: none;
  margin: 0;
  padding: 0;
  list-style: none;
}

.inventory-setup .inventory-history__item {
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--atelier-rule);
  border-left: 3px solid var(--floral-rose-line);
  border-radius: 8px;
  background: var(--floral-paper);
}

.inventory-setup .inventory-history__facts dt {
  color: var(--floral-muted);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.inventory-setup .inventory-history__facts dd {
  font-size: 0.95rem;
}

/* Empty states ----------------------------------------------------------- */

.inventory-setup .ui-floral-feedback--empty {
  align-items: center;
  padding: var(--space-md);
  border-radius: var(--atelier-radius);
  background: #fbfaf4;
}

.inventory-setup .ui-floral-feedback--empty .ui-floral-feedback__title {
  color: var(--floral-ink);
  font-family: var(--floral-serif);
  font-size: 1.15rem;
  font-weight: 400;
}

/* Forms ------------------------------------------------------------------ */

.inventory-setup .inventory-atelier-form {
  width: 100%;
  max-width: 46rem;
  padding: var(--space-md);
  border: 1px solid var(--atelier-rule);
  border-radius: var(--atelier-radius);
  background: var(--atelier-panel);
}

.inventory-setup .inventory-atelier-form .inventory-setup-form {
  gap: var(--space-md);
}

.inventory-setup .inventory-atelier-form .inventory-field-row--coordinates {
  align-items: start;
}

.inventory-setup .inventory-atelier-form code {
  font-size: 0.85em;
  overflow-wrap: anywhere;
}

.inventory-setup .inventory-atelier-form .inventory-form-actions {
  padding-top: var(--space-xs);
  border-top: 1px solid var(--atelier-rule);
}

.inventory-setup .inventory-atelier-status {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  margin: 0;
  color: var(--floral-muted);
  font-size: 0.85rem;
}

/* Product -> recipe -> storefront ---------------------------------------- */

.inventory-setup .inventory-storefront-state {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2xs);
}

.inventory-setup .inventory-recipe-cell__link {
  margin: 0.3rem 0 0;
  line-height: 1.5;
}

.inventory-setup .inventory-atelier-recipe {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  min-width: 0;
  padding: var(--space-md);
  border: 1px solid var(--atelier-rule);
  border-radius: var(--atelier-radius);
  background:
    radial-gradient(circle at 96% 12%, rgba(209, 165, 178, 0.14), transparent 45%),
    var(--atelier-panel);
}

.inventory-setup .inventory-atelier-recipe__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-sm);
  min-width: 0;
}

.inventory-setup .inventory-atelier-recipe__head > div:first-child {
  display: flex;
  flex-direction: column;
  gap: var(--space-3xs);
  min-width: 0;
}

.inventory-setup .inventory-atelier-recipe h2 {
  margin: 0;
  color: var(--floral-ink);
  font-family: var(--floral-serif);
  font-size: clamp(1.4rem, 2.2vw, 1.9rem);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.inventory-setup .inventory-atelier-recipe .inventory-section-note {
  margin: 0;
  max-width: 62ch;
  color: var(--floral-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.inventory-setup .inventory-atelier-recipe__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs);
}

.inventory-setup .inventory-atelier-recipe__facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-sm);
  margin: 0;
  padding-top: var(--space-sm);
  border-top: 1px solid var(--atelier-rule);
}

.inventory-setup .inventory-atelier-recipe__facts dt {
  color: var(--floral-muted);
  font-family: var(--floral-sans);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.inventory-setup .inventory-atelier-recipe__facts dd {
  margin: 0.2rem 0 0;
  color: var(--floral-ink);
  font-size: 0.95rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.inventory-setup .inventory-recipe-note {
  margin: 0;
  color: var(--floral-muted);
  font-size: 0.85rem;
  line-height: 1.6;
}

/* Responsive ------------------------------------------------------------- */

/* The shell switches to a horizontal nav at 900px, but the shared inventory
   rules wrap each link into its own full-width row. Keep the compact scroller
   the rest of the Atelier workspace uses instead of a tall stacked menu. */
@media (max-width: 56.25rem) {
  .inventory-setup .ad-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: var(--space-xs);
    -webkit-overflow-scrolling: touch;
  }

  .inventory-setup .ad-nav-link {
    flex: 0 0 auto;
    justify-content: center;
    white-space: nowrap;
  }
}

@media (max-width: 72rem) {
  .inventory-setup .inventory-atelier-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 48rem) {
  .inventory-setup .ad-main {
    gap: var(--space-lg);
  }

  .inventory-setup .inventory-atelier-hero {
    flex-direction: column-reverse;
    gap: var(--space-sm);
  }

  .inventory-setup .inventory-atelier-hero__mark {
    width: 3.25rem;
    height: 3.25rem;
  }

  .inventory-setup .inventory-atelier-stats {
    grid-template-columns: 1fr;
  }

  .inventory-setup .inventory-atelier-actions {
    align-items: stretch;
    flex-direction: column;
    margin-top: 0;
  }

  .inventory-setup .inventory-atelier-actions .ui-floral-button {
    width: 100%;
  }

  .inventory-setup .inventory-atelier-location {
    align-items: flex-start;
  }

  .inventory-setup .inventory-atelier-location__actions {
    width: 100%;
    margin-left: 0;
    justify-content: space-between;
  }

  .inventory-setup .inventory-atelier-location__badges {
    width: 100%;
  }

  .inventory-setup .inventory-atelier-form {
    padding: var(--space-sm);
  }

  .inventory-setup .inventory-atelier-recipe {
    padding: var(--space-sm);
  }

  .inventory-setup .inventory-atelier-recipe__facts {
    grid-template-columns: 1fr;
  }

  .inventory-setup .inventory-atelier-recipe__actions {
    align-items: stretch;
    flex-direction: column;
    width: 100%;
  }

  .inventory-setup .inventory-atelier-recipe__actions .ui-floral-button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .inventory-setup .inventory-atelier-panel > summary::after {
    transition: none;
  }
}
