/* The buyer and workspace views share the catalogue's warm-white, ink and
   persimmon tokens. This file intentionally changes presentation only. */

#page-saved,
#page-profile,
#page-shop-dashboard,
#page-admin {
  width: min(100%, 1248px);
  padding-block: clamp(24px, 4vw, 48px) 64px;
}

#page-saved .page-title,
#page-profile .page-title,
#page-shop-dashboard .page-title,
#page-admin .page-title {
  padding: 0 0 clamp(20px, 3vw, 32px);
}

#page-saved .page-title h1,
#page-profile .page-title h1,
#page-shop-dashboard .page-title h1,
#page-admin .page-title h1 {
  font-size: clamp(2rem, 3.5vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.05em;
  line-height: 1.22;
}

/* Saved shops: large photography and a quieter, scannable summary. */
.saved-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 2vw, 24px);
}

.saved-card-wrap {
  min-width: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.saved-card {
  display: block;
  min-height: 0;
  overflow: visible;
  border-radius: 0;
  background: transparent;
}

.saved-card:hover {
  background: transparent;
}

.saved-card img {
  width: 100%;
  height: auto;
  aspect-ratio: 1.12;
  border-radius: 11px;
  background: var(--surface-muted);
  object-fit: cover;
  transition: transform 220ms ease;
}

.saved-card:hover img {
  transform: translateY(-2px);
}

.saved-card > span {
  display: block;
  padding: 14px 2px 6px;
}

.saved-card small {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.saved-card strong {
  display: block;
  margin: 5px 0 3px;
  font-size: clamp(1rem, 1.5vw, 1.22rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.4;
}

.saved-card em {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.45;
}

.saved-card mark {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 9px;
  border-radius: 99px;
  background: var(--surface-warm);
  color: var(--berry-dark);
  font-size: 0.68rem;
}

.saved-alert-button {
  width: auto;
  min-height: 44px;
  padding: 4px 2px;
  border: 0;
  background: transparent;
  color: var(--berry-dark);
  font-size: 0.72rem;
  font-weight: 600;
  text-align: left;
}

.saved-alert-button:hover,
.saved-alert-button:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Empty and guest states are part of the product, not an error page. */
.account-empty-state {
  padding: clamp(24px, 4vw, 44px);
  border: 0;
  border-radius: 12px;
  background: var(--surface-muted);
  box-shadow: none;
}

.account-empty-state h2 {
  font-weight: 600;
  letter-spacing: -0.035em;
}

.account-empty-state div > p:last-child {
  max-width: 46ch;
  line-height: 1.65;
}

.empty-state-mark {
  background: var(--surface-warm);
  color: var(--berry-dark);
}

.account-gateway {
  overflow: hidden;
  border: 0;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: none;
}

.account-gateway__intro {
  border: 0;
  background: var(--surface-warm);
}

.account-gateway__intro h2 {
  margin-top: 24px;
  font-size: clamp(2rem, 3.2vw, 3.1rem);
  font-weight: 600;
  letter-spacing: -0.05em;
  line-height: 1.25;
}

.account-gateway__intro p {
  color: var(--muted);
  font-size: 0.89rem;
  line-height: 1.75;
}

.account-role-cards {
  gap: 10px;
}

.account-role-cards button {
  min-height: 150px;
  padding: 22px;
  border: 0;
  border-radius: 10px;
  background: var(--surface-muted);
  transition: background 160ms ease, transform 160ms ease;
}

.account-role-cards button:hover {
  border: 0;
  background: var(--surface-warm);
  transform: translateY(-2px);
}

.account-role-cards strong {
  font-size: 1.23rem;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.account-role-cards small {
  line-height: 1.6;
}

.account-role-cards em {
  color: var(--berry-dark);
  font-weight: 600;
}

/* Buyer account: stronger primary identity and compact utility navigation. */
.profile-layout {
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 16px;
}

.profile-summary,
.profile-stats,
.profile-menu,
.user-review-history {
  border: 0;
  border-radius: 12px;
  box-shadow: none;
}

.profile-summary {
  padding: clamp(24px, 3vw, 40px);
  background: var(--surface-warm);
  gap: 24px;
}

.profile-avatar {
  background: var(--surface);
  color: var(--berry-dark);
}

.profile-summary h2 {
  font-size: clamp(1.7rem, 2.5vw, 2.35rem);
  font-weight: 600;
  letter-spacing: -0.04em;
}

.profile-summary small {
  color: var(--berry-dark);
  font-weight: 600;
}

.profile-stats {
  background: var(--surface-muted);
}

.profile-stats article {
  padding: 20px 8px;
}

.profile-stats strong {
  font-family: var(--font-brand);
  font-size: 1.8rem;
  font-weight: 500;
  line-height: 1.2;
}

.profile-menu {
  padding: 4px 16px;
  background: var(--surface);
}

.profile-menu button {
  min-height: 48px;
  padding-inline: 4px;
  border-color: var(--line);
  font-size: 0.82rem;
  font-weight: 550;
}

.profile-menu button:hover {
  color: var(--berry-dark);
}

.user-review-history {
  padding: clamp(20px, 3vw, 32px);
  background: var(--surface);
}

.user-review-history h2 {
  font-weight: 600;
  letter-spacing: -0.03em;
}

.review-history-card {
  border-color: var(--line);
}

/* Owner and admin areas deliberately use a denser rhythm than the catalogue. */
.dashboard-title {
  align-items: end;
}

.dashboard-title p:last-child {
  max-width: 62ch;
  font-size: 0.88rem;
  line-height: 1.6;
}

.dashboard-stats {
  margin-bottom: 16px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}

.dashboard-stats article {
  min-width: 0;
  min-height: 132px;
  padding: 20px;
  border: 0;
  border-radius: 10px;
  background: var(--surface-muted);
}

.dashboard-stats article:nth-child(2n) {
  background: var(--surface-warm);
}

.dashboard-stats strong {
  overflow-wrap: anywhere;
  font-family: var(--font-body);
  font-size: clamp(1.7rem, 2.5vw, 2.3rem);
  font-weight: 500;
  letter-spacing: -0.04em;
}

.admin-dashboard .dashboard-stats strong,
#dashboard-product-count,
#dashboard-save-count,
#dashboard-order-click-count,
#dashboard-review-count {
  font-family: var(--font-brand);
}

.dashboard-stats span,
.dashboard-stats small {
  line-height: 1.45;
}

.dashboard-grid,
.admin-dashboard {
  gap: 16px;
}

.dashboard-panel {
  padding: clamp(20px, 2.5vw, 30px);
  border: 0;
  border-radius: 12px;
  background: var(--surface);
}

.dashboard-panel__head {
  align-items: baseline;
  margin-bottom: 22px;
}

.dashboard-panel__head h2 {
  font-size: clamp(1.16rem, 1.8vw, 1.5rem);
  font-weight: 600;
  letter-spacing: -0.035em;
}

.shop-editor__intro {
  margin-top: -8px;
  line-height: 1.6;
}

.shop-facts {
  display: grid;
  margin-bottom: 20px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.shop-facts div {
  display: block;
  min-width: 0;
  padding: 14px 16px;
  border: 0;
  border-radius: 9px;
  background: var(--surface-muted);
}

.shop-facts div:first-child {
  grid-column: 1 / -1;
}

.shop-facts dt {
  margin-bottom: 5px;
  font-size: 0.7rem;
  font-weight: 550;
}

.shop-facts dd {
  overflow-wrap: anywhere;
  font-size: 0.83rem;
}

.dashboard-menu {
  display: grid;
  gap: 8px;
}

.dashboard-menu li {
  min-width: 0;
  padding: 13px 15px;
  border: 0;
  border-radius: 9px;
  background: var(--surface-muted);
}

.dashboard-menu li > span:first-child {
  min-width: 0;
}

.dashboard-menu strong,
.dashboard-menu b {
  font-size: 0.89rem;
}

.dashboard-menu b {
  white-space: nowrap;
}

.dashboard-menu__actions {
  flex-shrink: 0;
}

/* Form grouping and photo upload: clear fields without outlined boxes everywhere. */
.editor-progress,
.media-upload-field,
.product-image-editor {
  border: 0;
  border-radius: 10px;
  background: var(--surface-muted);
}

.editor-progress progress,
.editor-progress progress::-webkit-progress-bar,
.editor-progress progress::-webkit-progress-value {
  border-radius: 99px;
}

.editor-form__grid {
  gap: 16px;
}

.editor-form label {
  gap: 7px;
  font-weight: 600;
}

.editor-form input,
.editor-form select,
.editor-form textarea,
.account-dialog input[type="text"],
.account-dialog input[type="email"],
.account-dialog input[type="password"],
.account-dialog input[type="url"],
.account-dialog input[type="number"],
.account-dialog input[type="date"],
.account-dialog input[type="datetime-local"],
.account-dialog select,
.account-dialog textarea {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

.editor-form input:focus,
.editor-form select:focus,
.editor-form textarea:focus,
.account-dialog input:focus,
.account-dialog select:focus,
.account-dialog textarea:focus {
  border-color: var(--berry);
}

.editor-form__actions {
  flex-wrap: wrap;
  gap: 10px;
}

.editor-preview {
  border: 0;
  border-radius: 10px;
  background: var(--surface-warm);
}

.editor-preview img {
  border-radius: 7px;
}

.media-upload-picker {
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--berry-dark);
}

.product-image-row {
  border: 0;
  border-radius: 8px;
  background: var(--surface);
}

.product-image-row > img {
  border-radius: 6px;
}

.product-image-row__actions button {
  border-color: var(--line);
  border-radius: 6px;
}

.product-image-empty {
  border-color: var(--line);
  border-radius: 8px;
  background: var(--surface);
}

/* Authentication and edit dialogs retain all existing interaction semantics. */
.dialog-overlay {
  background: rgb(43 41 37 / 54%);
}

.account-dialog {
  border-radius: 14px;
  background: var(--canvas);
  box-shadow: 0 24px 68px rgb(43 41 37 / 18%);
}

.account-dialog h2 {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.045em;
}

.dialog-close {
  background: var(--surface-muted);
}

.auth-role-selector button {
  border: 0;
  border-radius: 9px;
  background: var(--surface);
}

.auth-role-selector button.is-selected {
  border: 0;
  background: var(--surface-warm);
  color: var(--berry-dark);
  box-shadow: inset 0 0 0 1px var(--berry);
}

.form-error {
  border-radius: 7px;
}

.admin-auth-form {
  align-content: center;
}

.admin-auth-form .primary-button {
  width: min(100%, 400px);
  justify-self: center;
}

.admin-list {
  border: 0;
  gap: 8px;
}

.admin-item {
  padding: 16px;
  border: 0;
  border-radius: 9px;
  background: var(--surface-muted);
}

.admin-item__copy {
  gap: 6px;
}

.admin-item__title {
  font-weight: 600;
}

.admin-item__actions button {
  min-height: 42px;
  border-color: var(--line);
  border-radius: 6px;
  color: var(--berry-dark);
}

.admin-item__actions button:hover {
  background: var(--surface-warm);
}

.admin-empty,
#page-profile .inline-empty-state,
#page-shop-dashboard .inline-empty-state,
#page-admin .inline-empty-state {
  padding: 22px;
  border: 0;
  border-radius: 9px;
  background: var(--surface-muted);
  color: var(--muted);
  line-height: 1.6;
}

@media (max-width: 980px) {
  .saved-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-layout,
  .account-gateway {
    grid-template-columns: 1fr;
  }

  .account-gateway__intro {
    border: 0;
  }

  .account-role-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  #page-saved,
  #page-profile,
  #page-shop-dashboard,
  #page-admin {
    padding-block: 24px 40px;
  }

  .saved-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 14px;
  }

  .saved-card img {
    aspect-ratio: 0.95;
  }

  .saved-card > span {
    padding-top: 10px;
  }

  .saved-card strong {
    font-size: 0.93rem;
  }

  .saved-card small,
  .saved-card em,
  .saved-alert-button {
    font-size: 0.68rem;
  }

  .account-gateway__intro {
    padding: 28px 22px;
  }

  .account-gateway__intro h2 {
    margin-top: 14px;
    font-size: 2rem;
  }

  .account-role-cards {
    padding: 16px;
    grid-template-columns: 1fr;
  }

  .account-role-cards button {
    min-height: 132px;
    padding: 18px;
  }

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

  .profile-summary {
    grid-row: auto;
    padding: 24px;
  }

  .dashboard-title {
    align-items: start;
  }

  .dashboard-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-stats article {
    min-height: 118px;
    padding: 16px;
  }

  .dashboard-stats article:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

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

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

  .shop-facts div:first-child {
    grid-column: auto;
  }

  .admin-item,
  .dashboard-menu li {
    align-items: start;
  }

  .admin-item__actions {
    justify-content: start;
  }

  .account-dialog {
    border-radius: 14px 14px 0 0;
  }
}

@media (max-width: 380px) {
  .account-empty-state {
    grid-template-columns: 1fr;
  }

  .account-empty-state > button {
    grid-column: auto;
  }

  .profile-summary {
    align-items: start;
    flex-direction: column;
  }

  .dashboard-stats span,
  .dashboard-stats small {
    font-size: 0.68rem;
  }

  .dashboard-menu li {
    align-items: start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  .saved-card img,
  .account-role-cards button {
    transition: none;
  }
}
