:is(.portal-customer, .portal-designer, .portal-factory) {
  --catalog-paper: #fff;
  --catalog-ink: #141f24;
  --catalog-mist: #eef1f1;
  --catalog-rule: #dce3e3;
  --catalog-thread: #12493f;
  --catalog-accent: #dcf477;
  --catalog-muted: #52646a;
  --platform-page: #f7f8f6;
  --platform-text: var(--catalog-ink);
  --platform-muted: var(--catalog-muted);
  --platform-accent: var(--catalog-thread);
  --platform-accent-hover: #0d362e;
  --platform-border: var(--catalog-rule);
  --platform-radius: 7px;
  --platform-panel-radius: 12px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--platform-page);
  color: var(--catalog-ink);
}

.customer-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.customer-header {
  display: block;
  min-height: 67px;
  padding: 0;
  background: var(--catalog-paper);
}

.customer-header-inner {
  width: min(100%, 1360px);
  margin-inline: auto;
  min-height: inherit;
  display: grid;
  grid-template-columns: minmax(max-content, 1fr) auto minmax(max-content, 1fr);
  align-items: center;
  padding-inline: clamp(20px, 4.25vw, 60px);
  gap: clamp(12px, 3vw, 48px);
}

.customer-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  width: fit-content;
  white-space: nowrap;
  text-decoration: none;
  color: var(--catalog-ink);
}

.customer-wordmark strong {
  font-family: Inter, "Helvetica Neue", Arial, sans-serif;
  font-size: 23px;
  font-weight: 850;
  letter-spacing: -.055em;
  line-height: 1;
}

.customer-wordmark span {
  border-left: 1px solid var(--catalog-rule);
  padding-left: 12px;
  color: var(--catalog-muted);
  font-size: 12px;
}

.customer-header-access {
  grid-column: 3;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  min-width: 0;
  padding-block: 6px;
  font-size: 13px;
}

.customer-header-access a {
  color: var(--catalog-muted);
  white-space: nowrap;
  text-decoration: none;
}

.customer-header-access a:hover { text-decoration: underline; }

.customer-header-access #session-name {
  flex-basis: auto;
  max-width: 144px;
  color: var(--catalog-ink);
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-nav {
  flex-wrap: nowrap;
  gap: clamp(14px, 2.3vw, 32px);
  height: 100%;
}

.catalog-nav button {
  height: 100%;
  position: relative;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0 5px;
  color: var(--catalog-muted);
  font-weight: 590;
  white-space: nowrap;
}

.catalog-nav button[aria-current="page"],
.catalog-nav button:hover {
  color: var(--catalog-thread);
  background: transparent;
}

.catalog-nav button[aria-current="page"]::after {
  content: "";
  position: absolute;
  right: 5px;
  bottom: 0;
  left: 5px;
  height: 3px;
  background: var(--catalog-thread);
  border-radius: 3px 3px 0 0;
}

.customer-main {
  width: min(100%, 1360px);
  flex: 1;
  padding: 28px clamp(20px, 4.25vw, 60px) 56px;
}

.customer-main #notice:empty { display: none; }
.customer-main :is(h1,h2)[tabindex="-1"]:focus { outline: none; }
.customer-main .notice { margin-bottom: 18px; }
.customer-main :is(input:not([type="checkbox"]),select,textarea) { min-height: 44px; padding-inline: 12px; }
.customer-main summary:hover { text-decoration: underline; }

.customer-main #auth-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  width: min(100%, 1000px);
  min-height: 540px;
  margin: clamp(8px, 3.2vh, 35px) auto 0;
  align-items: stretch;
  border: 1px solid var(--catalog-rule);
  border-radius: 16px;
  background: var(--catalog-paper);
}

.customer-auth-visual {
  display: flex;
  align-items: end;
  min-height: 100%;
  padding: clamp(24px, 4vw, 42px);
  background:
    linear-gradient(180deg, rgba(11,29,33,0) 38%, rgba(11,29,33,.9) 100%),
    #102329 var(--local-showcase-photo, none) 58% center / cover no-repeat;
  color: #fff;
}

.customer-auth-caption { display: grid; gap: 7px; }
.customer-auth-caption strong { font-size: clamp(25px, 3.25vw, 40px); font-weight: 720; line-height: 1.18; letter-spacing: -.045em; }
.customer-auth-caption span { color: #d2e1de; }

.customer-auth-content {
  align-self: center;
  padding: clamp(24px, 4.6vw, 60px);
  min-width: 0;
}

.customer-auth-content h1 {
  margin: 0 0 8px;
  color: var(--catalog-ink);
  font-size: clamp(25px, 3vw, 34px);
  font-weight: 730;
  line-height: 1.25;
  letter-spacing: -.04em;
}

.customer-auth-content > p { margin-bottom: 23px; color: var(--catalog-muted); }
.customer-auth-content label { margin-bottom: 12px; font-weight: 590; }
.customer-auth-content details { padding-top: 11px; margin-top: 17px; }
.customer-auth-content summary { margin-bottom: 7px; width: fit-content; font-size: 13px; }

.customer-auth-switch {
  display: flex;
  gap: 5px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 10px;
  color: var(--catalog-muted);
  font-size: 13px;
}

.customer-auth-switch button {
  min-height: 36px;
  padding: 0 2px;
  border-color: transparent;
  background: transparent;
  color: var(--catalog-thread);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.catalog-section { min-width: 0; }

.catalog-hero {
  min-height: clamp(285px, 27vw, 338px);
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  overflow: hidden;
  border-radius: 13px;
  padding: clamp(26px, 5.4vw, 68px);
  background: #102329;
  color: var(--catalog-paper);
}

.catalog-hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 0 0 28%;
  background:
    linear-gradient(90deg, #102329, rgba(16,35,41,0) 38%),
    var(--local-showcase-photo, none) 66% 39% / cover no-repeat;
}

.catalog-hero-content { width: min(530px, 100%); }

.catalog-hero h1 {
  margin: 0 0 12px;
  font-size: clamp(33px, 4.45vw, 63px);
  line-height: 1.15;
  letter-spacing: -.064em;
  font-weight: 780;
}

.catalog-hero p {
  max-width: 26em;
  margin: 0;
  color: #d7e7e2;
  font-size: clamp(14px, 1.35vw, 17px);
}

.catalog-hero-actions {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
  margin-top: 27px;
}

.catalog-hero-actions .primary {
  min-height: 48px;
  padding: 9px 14px 9px 16px;
  display: inline-flex;
  gap: 20px;
  justify-content: center;
  align-items: center;
  border-color: var(--catalog-accent);
  background: var(--catalog-accent);
  color: var(--catalog-ink);
  font-weight: 740;
}

.catalog-hero-actions .primary:hover:not(:disabled) { background: #f0ffaf; border-color: #f0ffaf; }

.catalog-hero-actions a {
  color: var(--catalog-paper);
  text-decoration: none;
  font-size: 13px;
  padding-block: 8px;
}

.catalog-hero-actions a:hover { text-decoration: underline; }
.catalog-hero-actions a span { margin-left: 3px; }
.catalog-hero-actions :is(a,button):focus-visible { outline-color: var(--catalog-accent); }

.catalog-content { margin-top: clamp(27px, 3.3vw, 39px); scroll-margin-top: 22px; min-width: 0; }
.catalog-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.catalog-heading h2,
.customer-page-heading h1 {
  margin: 0;
  font-weight: 740;
  font-size: clamp(25px, 3.2vw, 38px);
  line-height: 1.23;
  letter-spacing: -.048em;
}

#catalog-status, .customer-page-heading p {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--catalog-muted);
}

.catalog-controls {
  display: grid;
  grid-template-columns: minmax(145px, 248px) minmax(110px, 150px);
  gap: 8px;
}

.catalog-controls label { margin: 0; min-width: 0; }
.catalog-search-label { position: relative; }
.catalog-search-label::before {
  content: "";
  pointer-events: none;
  position: absolute;
  top: 14px;
  left: 14px;
  width: 10px;
  height: 10px;
  border: 1.5px solid var(--catalog-muted);
  border-radius: 50%;
}
.catalog-search-label::after {
  content: "";
  pointer-events: none;
  position: absolute;
  top: 26px;
  left: 24px;
  width: 5px;
  height: 1.5px;
  background: var(--catalog-muted);
  transform: rotate(45deg);
}
.catalog-controls .catalog-search-label input { padding-left: 36px; }

.catalog-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(12px, 2.2vw, 26px); }

.catalog-style {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--catalog-rule);
  background: var(--catalog-paper);
  border-radius: 11px;
}

.catalog-image {
  display: grid;
  place-items: center;
  aspect-ratio: 5 / 4;
  min-width: 0;
  overflow: hidden;
  background: var(--catalog-mist);
  color: var(--catalog-muted);
}

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

.catalog-style-preview {
  width: 100%;
  aspect-ratio: 8 / 5;
  padding: clamp(4px, .8vw, 12px);
  border: 0;
  border-radius: 10px 10px 0 0;
  background: #edf0ed;
}
.catalog-style-preview:hover { background: #e7eee8; }

.catalog-style-detail {
  display: grid;
  align-content: start;
  gap: 8px;
  flex: 1;
  min-width: 0;
  padding: 15px 18px 13px;
}

.catalog-style-identity {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  column-gap: 10px;
  color: var(--catalog-muted);
  font-size: 12px;
  margin: 0;
}

.catalog-style-detail h3 {
  overflow-wrap: anywhere;
  margin: 0;
  font-size: clamp(16px, 1.55vw, 21px);
  font-weight: 730;
  line-height: 1.36;
  letter-spacing: -.025em;
}

.catalog-sizes {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin: 0;
  color: var(--catalog-muted);
  font-size: 12px;
}
.catalog-sizes > span:first-child { margin-right: 3px; }
.catalog-size {
  padding: 1px 6px;
  background: var(--catalog-mist);
  border-radius: 4px;
  color: var(--catalog-ink);
}

.catalog-style-actions {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: 8px;
  padding: 0 18px 18px;
}
.catalog-style-actions button { min-height: 42px; padding: 6px; font-size: 13px; font-weight: 630; }
#catalog-clear, #catalog-retry { margin-top: 10px; }

.customer-page-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin: clamp(9px, 3vw, 29px) 0 23px;
}

.customer-heading-actions { display: flex; gap: 8px; }
.customer-heading-actions button { white-space: nowrap; }
.customer-account-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 18px; }
.customer-account-grid > section { margin: 0; min-width: 0; }
.customer-account-grid h2 { margin-bottom: 13px; font-size: 18px; }
.customer-account-action form { margin-top: 12px; }
.customer-account-links { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 14px; }

.customer-request-dialog {
  width: min(500px, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 1px solid var(--catalog-rule);
  border-radius: 16px;
  background: var(--catalog-paper);
  color: var(--catalog-ink);
}
.customer-request-dialog::backdrop { background: rgba(15, 25, 30, .66); }
.customer-request-dialog #create-order-panel { padding: 20px 24px 25px; }
.customer-request-dialog #create-order-panel > p { color: var(--catalog-muted); }
.customer-request-dialog label { margin-bottom: 11px; }
#customer-request-error { color: var(--platform-danger); }

.customer-footer {
  width: min(100%, 1360px);
  margin-inline: auto;
  padding: 0 clamp(20px, 4.25vw, 60px) 23px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  color: var(--catalog-muted);
  font-size: 11px;
}

.customer-footer span:first-child { font-family: Inter, Arial, sans-serif; font-weight: 750; letter-spacing: -.025em; }

@media (max-width: 850px) {
  .customer-header-inner { gap: 16px; }
  .customer-wordmark span { display: none; }
  .customer-header-access { gap: 10px; }
  .customer-header-access #session-name { max-width: 105px; }
  .catalog-hero::before { left: 21%; }
  .catalog-style-detail { padding-inline: 12px; }
  .catalog-style-actions { padding-inline: 12px; }
}

@media (max-width: 670px) {
  .customer-header { min-height: auto; }
  .customer-header-inner {
    align-content: start;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: minmax(55px, max-content) auto;
    gap: 0 12px;
  }
  .customer-header-access { grid-column: 2; grid-row: 1; }
  .catalog-nav { grid-column: 1 / -1; grid-row: 2; min-height: 44px; gap: 22px; }
  .catalog-nav button { padding-inline: 0; min-height: 44px; }
  .catalog-nav button[aria-current="page"]::after { inset-inline: 0; }
  .customer-main { padding-top: 14px; padding-bottom: 35px; }
  .catalog-hero {
    align-items: end;
    min-height: 360px;
    padding: 22px;
  }
  .catalog-hero::before {
    inset: 0;
    background:
      linear-gradient(180deg, rgba(16,35,41,0) 19%, rgba(16,35,41,.8) 64%, #102329 100%),
      var(--local-showcase-photo, none) 58% 27% / cover no-repeat;
  }
  .catalog-hero h1 { margin-bottom: 7px; }
  .catalog-hero p { max-width: 28ch; }
  .catalog-hero-actions { margin-top: 16px; gap: 13px; }
  .catalog-hero-actions .primary { min-height: 44px; gap: 11px; padding-inline: 11px; }
  .catalog-heading { align-items: start; flex-direction: column; gap: 12px; }
  .catalog-controls { width: 100%; grid-template-columns: minmax(0, 1fr) minmax(100px, .53fr); }
  .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .customer-main #auth-panel { grid-template-columns: 1fr; min-height: auto; margin-top: 3px; }
  .customer-auth-visual { min-height: 172px; padding: 20px; background-position: 55% 34%; }
  .customer-auth-caption { gap: 3px; }
  .customer-auth-caption span { font-size: 12px; }
  .customer-account-grid { grid-template-columns: 1fr; }
}

@media (max-width: 475px) {
  .customer-header-inner, .customer-main, .customer-footer { padding-inline: 14px; }
  .customer-header-access #session-name { max-width: 92px; }
  .customer-wordmark strong { font-size: 21px; }
  .catalog-hero { min-height: 328px; }
  .catalog-style-detail { padding: 10px 9px; gap: 5px; }
  .catalog-style-actions { padding: 0 9px 10px; gap: 5px; grid-template-columns: 1fr; }
  .catalog-style-actions button { min-height: 40px; font-size: 12px; }
  .catalog-style-identity { font-size: 11px; }
  .customer-heading-actions { flex-wrap: wrap; justify-content: end; }
  .customer-heading-actions button { font-size: 12px; padding-inline: 9px; }
}

@media (max-width: 340px) {
  .customer-header-access { gap: 5px; font-size: 11px; }
  .customer-header-access #session-name { max-width: 64px; }
  .catalog-hero { padding: 17px; }
  .catalog-hero-actions { gap: 9px; }
}
