html[data-initial-page="merch-orders"] #home-view {
  display: none;
}

.merch-feed-action {
  display: flex;
  align-items: center;
  margin: 12px 0 2px;
}

.merch-feed-action button,
.post-detail-merch-button {
  min-height: 36px;
  border: 1px solid rgba(91, 140, 255, 0.5);
  border-radius: 999px;
  background: linear-gradient(135deg, #4169e1, #5b8cff);
  color: #fff;
  padding: 0 15px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.merch-feed-action button.secondary,
.post-detail-merch-button.secondary {
  background: rgba(91, 140, 255, 0.1);
  color: #9db8ff;
}

.merch-feed-action span,
.post-detail-merch-state {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: #a9b4c8;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
}

.post-detail-merch-button,
.post-detail-merch-state {
  margin: 8px 12px 12px;
}

.merch-dialog-open {
  overflow: hidden;
}

.merch-modal {
  position: fixed;
  inset: 0;
  z-index: 260;
  display: grid;
  place-items: center;
  padding: 24px;
}

.merch-modal[hidden] {
  display: none;
}

.merch-modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(2, 7, 16, 0.78);
  backdrop-filter: blur(8px);
}

.merch-dialog {
  position: relative;
  z-index: 1;
  width: min(960px, 100%);
  max-height: min(880px, calc(100vh - 48px));
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  background: #101722;
  color: #eaf0fb;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.55);
}

.merch-dialog-head {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(16, 23, 34, 0.96);
  backdrop-filter: blur(12px);
}

.merch-dialog-head h2,
.merch-page-head h1,
.merch-orders-card h2 {
  margin: 0;
}

.merch-dialog-head .eyebrow,
.merch-page-head .eyebrow {
  margin: 0 0 4px;
  color: #769eff;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.merch-dialog-head > button {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  font-size: 24px;
  cursor: pointer;
}

#merch-dialog-body {
  padding: 24px;
}

.merch-stepper {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}

.merch-stepper span {
  border-radius: 9px;
  background: #182231;
  color: #728097;
  padding: 9px 12px;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
}

.merch-stepper span.active {
  background: rgba(91, 140, 255, 0.18);
  color: #a9c0ff;
}

.merch-source-summary {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;
  background: #131d2a;
}

.merch-source-summary img {
  width: 80px;
  aspect-ratio: 1;
  border-radius: 10px;
  object-fit: cover;
  background: #0a1018;
}

.merch-source-summary div {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.merch-source-summary strong,
.merch-source-summary span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.merch-source-summary span {
  color: #8d9aaf;
  font-size: 13px;
}

.merch-source-summary.order {
  margin-bottom: 18px;
}

.merch-request-form,
.merch-order-form {
  display: grid;
  gap: 18px;
}

.merch-request-form > label,
.merch-form-grid label,
.merch-crop-controls label {
  display: grid;
  gap: 7px;
  color: #c7d1e1;
  font-size: 13px;
  font-weight: 700;
}

.merch-request-form input,
.merch-request-form textarea,
.merch-form-grid input {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 10px;
  background: #0b121c;
  color: #fff;
  padding: 12px;
  font: inherit;
}

.merch-request-form textarea {
  min-height: 90px;
  resize: vertical;
}

.merch-request-guide,
.merch-quality-note,
.merch-payment-notice {
  border: 1px solid rgba(91, 140, 255, 0.22);
  border-radius: 13px;
  background: rgba(91, 140, 255, 0.08);
  color: #b9c8e5;
  padding: 14px 16px;
  line-height: 1.6;
}

.merch-request-guide p {
  margin: 5px 0 0;
}

.merch-consents {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 15px;
}

.merch-consents label,
.merch-check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: #bdc8d8;
  font-size: 13px;
  line-height: 1.5;
}

.merch-consents input,
.merch-check input {
  flex: 0 0 auto;
  margin-top: 3px;
}

.merch-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

.merch-dialog-actions button,
.merch-dialog-actions a {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: #172231;
  color: #eaf0fb;
  padding: 0 18px;
  text-decoration: none;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.merch-dialog-actions .button-primary {
  border-color: #5b8cff;
  background: #4f7cf0;
  color: #fff;
}

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

.merch-product-option {
  position: relative;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 4px 12px;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  background: #131d2a;
  padding: 15px;
  cursor: pointer;
}

.merch-product-option.selected {
  border-color: #5b8cff;
  box-shadow: inset 0 0 0 1px #5b8cff;
}

.merch-product-option input {
  position: absolute;
  opacity: 0;
}

.merch-product-icon {
  grid-row: 1 / 5;
  display: grid;
  place-items: center;
  width: 58px;
  height: 72px;
  border-radius: 8px;
  background: linear-gradient(145deg, #344862, #182333);
  color: #a9c0ff;
  font-size: 11px;
  font-weight: 900;
}

.merch-product-option > span:not(.merch-product-icon),
.merch-product-option small {
  grid-column: 2;
  color: #8e9bb0;
}

.merch-product-option b {
  grid-column: 3;
  grid-row: 1 / 3;
  color: #fff;
}

.merch-quality-note {
  margin-top: 16px;
}

.merch-crop-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(280px, 1.1fr);
  gap: 28px;
  align-items: center;
}

.merch-crop-stage {
  position: relative;
  width: min(100%, 420px);
  max-height: 520px;
  overflow: hidden;
  justify-self: center;
  border: 12px solid #202c3a;
  background: #fff;
  box-shadow: 0 18px 35px rgba(0, 0, 0, 0.35);
}

.merch-crop-stage::after {
  content: "";
  position: absolute;
  inset: 6%;
  border: 1px dashed rgba(255, 255, 255, 0.85);
  pointer-events: none;
}

.merch-crop-stage img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform-origin: center;
}

.merch-crop-controls {
  display: grid;
  gap: 16px;
}

.merch-crop-controls h3,
.merch-crop-controls p {
  margin: 0;
}

.merch-crop-controls p,
.merch-crop-controls small {
  color: #8e9bb0;
  line-height: 1.6;
}

.merch-crop-controls button {
  width: fit-content;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 9px;
  background: #172231;
  color: #fff;
  padding: 9px 13px;
}

.merch-order-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 24px;
}

.merch-order-columns h3 {
  margin: 8px 0 12px;
}

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

.merch-form-grid .wide {
  grid-column: 1 / -1;
}

.merch-order-summary {
  align-self: start;
  display: grid;
  gap: 16px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 16px;
  background: #0d151f;
  padding: 16px;
}

.merch-order-summary dl,
.merch-order-summary p {
  margin: 0;
}

.merch-order-summary dl div {
  display: flex;
  justify-content: space-between;
  padding: 7px 0;
  color: #aeb9ca;
}

.merch-order-summary dl .total {
  margin-top: 5px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 13px;
  color: #fff;
  font-size: 17px;
  font-weight: 900;
}

.merch-order-summary p {
  border-radius: 9px;
  background: rgba(255, 184, 77, 0.1);
  color: #ffd08a;
  padding: 10px;
  font-size: 12px;
  line-height: 1.5;
}

.merch-order-complete {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 36px 16px;
  text-align: center;
}

.merch-order-complete > span {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(64, 196, 128, 0.16);
  color: #61d696;
  font-size: 28px;
}

.merch-order-complete h3,
.merch-order-complete p {
  margin: 0;
}

.merch-order-complete p {
  max-width: 520px;
  color: #9eabbe;
  line-height: 1.7;
}

.merch-orders-page {
  min-height: calc(100vh - 72px);
  background: #080e16;
  color: #eaf0fb;
  padding: 36px 20px 80px;
}

.merch-orders-shell {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.merch-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.merch-page-head > div > p:last-child {
  margin: 8px 0 0;
  color: #8d9aaf;
}

.merch-payment-notice {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
}

.merch-orders-card {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  background: #101722;
  padding: 22px;
}

.merch-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.merch-section-head p {
  margin: 6px 0 0;
  color: #8d9aaf;
}

.merch-section-head button,
.merch-order-row button,
.merch-order-row a {
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 9px;
  background: #172231;
  color: #dce6f7;
  padding: 8px 12px;
  text-decoration: none;
  font: inherit;
  cursor: pointer;
}

#merch-orders-list {
  display: grid;
  gap: 10px;
}

.merch-order-row {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 13px;
  background: #0d151f;
  padding: 12px;
}

.merch-order-row > img {
  width: 70px;
  height: 70px;
  border-radius: 9px;
  object-fit: cover;
  background: #182231;
}

.merch-order-main,
.merch-order-main > div,
.merch-order-state {
  display: grid;
  gap: 4px;
}

.merch-order-main span,
.merch-order-main small,
.merch-order-state span {
  color: #8492a7;
  font-size: 12px;
}

.merch-order-state b {
  color: #9db8ff;
  font-size: 13px;
}

.merch-empty {
  display: grid;
  justify-items: center;
  gap: 9px;
  padding: 40px 20px;
  color: #8d9aaf;
  text-align: center;
}

.merch-empty p {
  margin: 0;
}

@media (max-width: 760px) {
  .merch-modal {
    padding: 0;
  }

  .merch-dialog {
    width: 100%;
    height: 100dvh;
    max-height: none;
    border: 0;
    border-radius: 0;
  }

  .merch-dialog-head,
  #merch-dialog-body {
    padding: 16px;
  }

  .merch-product-grid,
  .merch-crop-layout,
  .merch-order-columns,
  .merch-form-grid {
    grid-template-columns: 1fr;
  }

  .merch-form-grid .wide {
    grid-column: auto;
  }

  .merch-order-summary {
    order: -1;
  }

  .merch-orders-page {
    padding: 24px 12px 80px;
  }

  .merch-page-head,
  .merch-payment-notice {
    align-items: flex-start;
    flex-direction: column;
  }

  .merch-order-row {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .merch-order-row > img {
    width: 58px;
    height: 58px;
  }

  .merch-order-row > :nth-child(n + 3) {
    grid-column: 2;
  }
}

.post-merch-request-panel {
  grid-column: 1 / -1;
  border: 1px solid rgba(91, 140, 255, 0.2);
  border-radius: 14px;
  background: rgba(91, 140, 255, 0.07);
  padding: 14px;
}

.post-merch-request-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: #dfe8f8;
  cursor: pointer;
}

.post-merch-request-toggle > span {
  display: grid;
  gap: 4px;
}

.post-merch-request-toggle small,
.post-merch-request-consents p {
  color: #8f9db2;
  font-size: 12px;
  line-height: 1.5;
}

.post-merch-request-toggle input {
  width: 42px;
  height: 22px;
  accent-color: #5b8cff;
}

.post-merch-request-consents {
  display: grid;
  gap: 9px;
  margin-top: 13px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  padding-top: 12px;
}

.post-merch-request-consents[hidden] {
  display: none;
}

.post-merch-request-consents p {
  margin: 0 0 2px;
}

.post-merch-request-consents label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: #bac6d8;
  font-size: 12px;
  line-height: 1.5;
}

.merch-quantity-select {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
  color: #c7d1e1;
  font-size: 13px;
  font-weight: 800;
}

.merch-quantity-select select {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 9px;
  background: #131d2a;
  color: #fff;
  padding: 9px 30px 9px 11px;
}

.merch-image-quality {
  border-radius: 9px;
  background: rgba(64, 196, 128, 0.12);
  color: #6edd9f;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.5;
}

.merch-image-quality.error {
  background: rgba(255, 107, 107, 0.12);
  color: #ff9c9c;
}
