:root {
  --bg: #f7f8f6;
  --surface: #ffffff;
  --surface-soft: #f9faf8;
  --ink: #161616;
  --muted: #66706b;
  --line: #dfe6e1;
  --primary: #0f5b54;
  --primary-strong: #0a3f3a;
  --accent: #8d6e28;
  --danger: #a33b35;
  --shadow: 0 12px 28px rgba(20, 34, 29, 0.06);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100dvh;
  margin: 0;
  color: var(--ink);
  background: var(--bg);
}

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

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.05;
}

h2 {
  font-size: 19px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px clamp(18px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
  background: rgba(246, 244, 239, 0.92);
  position: sticky;
  top: 0;
  z-index: 10;
}

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.nav-pill {
  border: 1px solid var(--primary);
  border-radius: 999px;
  padding: 9px 13px;
  color: #fff;
  background: var(--primary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-actions form {
  margin: 0;
}

.login-shell {
  display: grid;
  min-height: 100dvh;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(420px, 100%);
  padding: 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-panel h1 {
  margin-bottom: 22px;
}

.login-form {
  display: grid;
  gap: 15px;
}

.form-error {
  color: var(--danger);
  font-size: 13px;
  font-weight: 800;
}

.admin-shell {
  display: grid;
  gap: 18px;
  padding: 22px clamp(18px, 4vw, 48px) 48px;
}

.client-shell {
  display: grid;
  gap: 20px;
  padding: 22px clamp(18px, 4vw, 48px) 48px;
}

.client-dashboard {
  max-width: 1440px;
  margin: 0 auto;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.metric,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric {
  display: grid;
  gap: 8px;
  padding: 16px;
}

.metric span,
.client-meta,
label,
.empty {
  color: var(--muted);
}

.metric span,
label {
  font-size: 13px;
  font-weight: 700;
}

.metric strong {
  font-size: 30px;
  line-height: 1;
}

.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  gap: 18px;
  align-items: stretch;
}

.overview-panel,
.account-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.overview-panel {
  display: grid;
  gap: 20px;
  padding: 22px;
}

.overview-panel h2 {
  font-size: 28px;
}

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

.overview-grid div {
  display: grid;
  gap: 8px;
  min-height: 92px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.overview-grid span,
.account-list dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.overview-grid strong {
  align-self: end;
  font-size: 24px;
  line-height: 1.1;
}

.account-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 4px 18px 18px;
}

.account-list div {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.account-list div:last-child {
  border-bottom: 0;
}

.account-list dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 800;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(320px, 520px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.client-grid {
  display: grid;
  grid-template-columns: minmax(320px, 460px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.workbench-grid,
.management-grid {
  display: grid;
  grid-template-columns: minmax(340px, 430px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.management-grid {
  grid-template-columns: minmax(420px, 560px) minmax(0, 1fr);
}

.client-grid .panel:nth-child(3) {
  grid-column: 1 / span 2;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.panel-heading.compact {
  padding-bottom: 14px;
}

.details-form {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

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

label {
  display: grid;
  gap: 7px;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: var(--surface-soft);
  padding: 11px 12px;
  outline: none;
}

.file-drop input {
  margin-top: 4px;
  padding: 10px;
  border-style: dashed;
  background: #fff;
  cursor: pointer;
}

.file-drop input::file-selector-button {
  min-height: 34px;
  margin-right: 10px;
  border: 1px solid rgba(15, 91, 84, 0.3);
  border-radius: 6px;
  padding: 7px 10px;
  color: var(--primary);
  background: #eef6f4;
  cursor: pointer;
  font-weight: 800;
}

.file-drop span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

textarea {
  resize: vertical;
  line-height: 1.5;
}

input:focus,
textarea:focus,
select:focus,
button:focus-visible {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 91, 84, 0.18);
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

button {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 800;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.primary-button {
  color: #fff;
  background: var(--primary);
}

.secondary-button {
  color: var(--primary);
  border-color: rgba(15, 91, 84, 0.3);
  background: #eef6f4;
}

.danger-button {
  color: #fff;
  background: var(--danger);
}

.pill {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  background: var(--surface-soft);
}

.pill.muted {
  color: var(--muted);
}

.alert-stack {
  display: grid;
  gap: 10px;
}

.notice {
  border: 1px solid rgba(182, 107, 47, 0.35);
  border-radius: 8px;
  padding: 12px 14px;
  color: #59300f;
  background: #fff4e7;
  font-size: 14px;
  font-weight: 800;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
}

.review-panel .image-grid {
  padding-top: 0;
}

.draft-summary {
  display: grid;
  gap: 5px;
  margin: 18px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.draft-summary strong {
  overflow-wrap: anywhere;
}

.draft-summary span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

figure {
  display: grid;
  gap: 8px;
  margin: 0;
}

figcaption {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.image-frame {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

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

.image-frame img:not([src]) {
  display: none;
}

.panel-actions {
  padding: 0 18px 18px;
}

.client-list {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.segmented-control {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.segmented-control button {
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
}

.segmented-control button.is-active {
  color: #fff;
  background: var(--primary);
}

.listing-table {
  display: grid;
  gap: 0;
  padding: 8px 12px 12px;
}

.listing-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) minmax(130px, auto) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 72px;
  padding: 10px 0;
  color: var(--ink);
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}

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

.listing-thumb {
  display: grid;
  place-items: center;
  width: 56px;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.listing-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.listing-thumb-fallback {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  color: var(--muted);
  opacity: 0.7;
}

.listing-main {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.listing-main strong,
.listing-main span {
  overflow-wrap: anywhere;
}

.listing-main span,
.listing-side small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.listing-side {
  display: grid;
  justify-items: end;
  gap: 5px;
}

.client-item {
  display: grid;
  gap: 9px;
  width: 100%;
  min-height: auto;
  padding: 13px;
  color: var(--ink);
  text-align: left;
  background: var(--surface-soft);
  border: 1px solid var(--line);
}

.client-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.client-row strong {
  overflow-wrap: anywhere;
}

.client-meta {
  font-size: 13px;
  font-weight: 600;
}

.client-meta.warning {
  color: var(--danger);
  font-weight: 800;
}

.status-badge {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 5px 8px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  background: var(--primary);
}

.status-badge.paused {
  background: var(--accent);
}

.status-badge.expired {
  background: var(--danger);
}

.status-badge.image_processing,
.status-badge.collecting_photos {
  background: #4b6682;
}

.status-badge.copy_ready,
.status-badge.image_ready {
  background: var(--primary);
}

.status-badge.published {
  background: #327047;
}

.usage-bar {
  display: block;
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #ece6dc;
}

.usage-bar span {
  display: block;
  height: 100%;
  background: var(--primary);
}

.empty {
  padding: 12px;
  line-height: 1.5;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(24px);
  opacity: 0;
  pointer-events: none;
  max-width: min(520px, calc(100vw - 32px));
  padding: 12px 14px;
  border-radius: 8px;
  color: #fff;
  background: #20201e;
  box-shadow: var(--shadow);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.portal-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100dvh;
}

.portal-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  padding: 24px 16px;
  border-right: 1px solid var(--line);
  background: #fbfaf7;
}

.sidebar-brand {
  padding: 0 10px 22px;
}

.sidebar-brand h1 {
  font-size: 24px;
}

.sidebar-brand span,
.account-chip small,
.page-heading p {
  color: #526075;
  font-weight: 600;
}

.portal-nav {
  display: grid;
  gap: 6px;
}

.portal-nav a {
  min-height: 48px;
  border-left: 4px solid transparent;
  border-radius: 7px;
  padding: 13px 14px;
  color: #2f4057;
  text-decoration: none;
  font-weight: 800;
}

.portal-nav a.is-active {
  border-left-color: var(--primary);
  color: var(--primary-strong);
  background: #e8f5f1;
}

.sidebar-promo {
  display: grid;
  gap: 10px;
  margin-top: auto;
  padding: 20px 10px;
  border-top: 1px solid var(--line);
}

.sidebar-promo strong {
  max-width: 180px;
  font-size: 24px;
  line-height: 1.15;
}

.sidebar-promo span {
  color: var(--accent);
  font-weight: 800;
}

.portal-main {
  min-width: 0;
}

.portal-topbar {
  position: sticky;
  top: 0;
  z-index: 8;
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  min-height: 74px;
  padding: 16px clamp(18px, 3vw, 30px);
  border-bottom: 1px solid var(--line);
  background: rgba(247, 248, 246, 0.94);
  backdrop-filter: blur(12px);
}

.account-chip {
  display: flex;
  align-items: center;
  gap: 10px;
}

.account-chip > span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: #eee7dc;
  font-weight: 900;
}

.account-chip div {
  display: grid;
  gap: 2px;
}

.menu-button {
  display: none;
  margin-right: auto;
}

.client-page[hidden] {
  display: none;
}

.page-heading {
  display: grid;
  gap: 6px;
}

.page-heading h2 {
  font-size: clamp(30px, 4vw, 40px);
  line-height: 1.05;
}

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

.stat-card {
  display: grid;
  gap: 8px;
  min-height: 112px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.stat-card span {
  color: #526075;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.stat-card strong {
  align-self: end;
  font-size: 28px;
  line-height: 1;
}

.stat-card small {
  color: #526075;
  font-weight: 700;
}

.quick-action-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
}

.quick-action {
  display: grid;
  gap: 6px;
  min-height: 84px;
  padding: 16px;
  color: var(--ink);
  text-align: left;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.quick-action.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
}

.quick-action span {
  font-size: 13px;
  font-weight: 650;
  opacity: 0.8;
}

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

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

.workflow-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 18px;
  text-align: center;
}

.workflow-steps div,
.stepper div {
  display: grid;
  place-items: center;
  gap: 8px;
  color: var(--primary);
  font-size: 18px;
  font-weight: 900;
}

.workflow-steps span,
.stepper span {
  color: #526075;
  font-size: 13px;
  font-weight: 800;
}

.usage-panel {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.usage-panel p {
  color: var(--primary-strong);
  font-weight: 800;
}

.activity-list,
.support-list {
  display: grid;
  gap: 12px;
  padding: 16px 18px 18px;
}

.activity-item {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.activity-item > span {
  width: 9px;
  height: 9px;
  margin-top: 5px;
  border-radius: 999px;
  background: #18a04f;
}

.activity-item div,
.support-list p {
  display: grid;
  gap: 4px;
}

.activity-item small,
.support-list span {
  color: #526075;
  font-weight: 650;
}

.stepper {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.stepper div {
  min-height: 84px;
  background: var(--surface);
}

.stepper .is-active,
.stepper .is-complete {
  color: #fff;
  background: var(--primary);
}

.stepper .is-active span,
.stepper .is-complete span {
  color: #fff;
}

.listing-workspace {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr) minmax(280px, 360px);
  gap: 12px;
  align-items: start;
}

.details-panel {
  grid-column: span 2;
}

.upload-slots {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.upload-slots div {
  display: grid;
  gap: 5px;
  min-height: 74px;
  padding: 11px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.upload-slots div.has-file {
  border-color: rgba(15, 91, 84, 0.45);
  background: #e8f5f1;
}

.upload-slots strong,
.upload-slots span,
.counter,
.save-state {
  color: #526075;
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.checklist {
  display: grid;
  gap: 11px;
  padding: 18px;
}

.checklist div {
  display: flex;
  gap: 10px;
  align-items: center;
  color: #526075;
  font-weight: 800;
}

.checklist span {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 1px solid #b9c5c0;
  border-radius: 999px;
  color: #fff;
  background: #fff;
}

.checklist .is-complete {
  color: var(--ink);
}

.checklist .is-complete span {
  border-color: var(--primary);
  background: var(--primary);
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 10px;
}

.row-actions {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 6px;
}

.row-actions button,
.tiny-button {
  min-height: 34px;
  padding: 7px 10px;
  border-color: rgba(15, 91, 84, 0.25);
  color: var(--primary);
  background: #eef6f4;
  font-size: 12px;
}

.row-actions .danger-text {
  color: var(--danger);
  border-color: rgba(163, 59, 53, 0.25);
  background: #fff0ed;
}

.nav-pill.is-disabled {
  pointer-events: none;
  opacity: 0.48;
}

body:has(.portal-layout) {
  color: #172033;
  background:
    radial-gradient(circle at 88% 2%, rgba(154, 118, 40, 0.08), transparent 28%),
    linear-gradient(180deg, #fbfaf7 0%, #f7f7f3 52%, #f5f6f2 100%);
  font-weight: 400;
}

.portal-layout {
  grid-template-columns: 292px minmax(0, 1fr);
}

.portal-sidebar {
  padding: 24px 18px;
  background: rgba(252, 250, 246, 0.86);
  backdrop-filter: blur(14px);
}

.sidebar-brand {
  padding: 0 12px 24px;
}

.sidebar-brand h1 {
  max-width: 220px;
  color: #101727;
  font-size: 24px;
  font-weight: 720;
  line-height: 1.08;
}

.sidebar-brand span,
.account-chip small,
.page-heading p,
.stat-card small,
.quick-action span,
.activity-item small,
.support-list span {
  color: #637089;
  font-weight: 450;
}

.portal-nav {
  gap: 8px;
}

.portal-nav a {
  min-height: 48px;
  padding: 13px 16px;
  color: #354258;
  border-left-width: 3px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 560;
}

.portal-nav a.is-active {
  color: #064e49;
  background: linear-gradient(90deg, rgba(12, 101, 93, 0.14), rgba(12, 101, 93, 0.05));
}

.sidebar-promo {
  padding: 24px 12px;
}

.sidebar-promo strong {
  max-width: 200px;
  color: #111827;
  font-size: 23px;
  font-weight: 620;
}

.sidebar-promo span {
  font-weight: 560;
}

.portal-topbar {
  min-height: 76px;
  padding-inline: clamp(22px, 3vw, 36px);
  background: rgba(251, 250, 247, 0.86);
}

.account-chip strong {
  font-size: 14px;
  font-weight: 620;
}

.account-chip > span {
  font-weight: 650;
}

.client-dashboard {
  max-width: 1420px;
  gap: 18px;
  padding: 42px clamp(22px, 4vw, 48px) 56px;
}

.page-heading {
  gap: 7px;
}

.page-heading h2 {
  color: #0f172a;
  font-size: clamp(30px, 3vw, 38px);
  font-weight: 690;
  letter-spacing: 0;
}

.panel,
.stat-card,
.overview-panel,
.account-panel {
  border-color: rgba(31, 41, 55, 0.11);
  border-radius: 8px;
  box-shadow: 0 16px 36px rgba(17, 24, 39, 0.045);
}

.panel-heading {
  padding: 18px 20px;
}

.panel-heading h2,
.panel-heading h3 {
  color: #121826;
  font-weight: 650;
}

.eyebrow,
.stat-card span,
.account-list dt {
  color: #8a6b24;
  font-size: 11px;
  font-weight: 650;
}

.stat-grid {
  gap: 14px;
}

.stat-card {
  min-height: 116px;
  padding: 19px 20px;
  background: rgba(255, 255, 255, 0.88);
}

.stat-card strong {
  font-size: 29px;
  font-weight: 680;
}

.quick-action-grid {
  gap: 12px;
  padding: 16px;
}

.quick-action {
  gap: 8px;
  min-height: 88px;
  padding: 17px 18px;
  border-color: rgba(31, 41, 55, 0.1);
  background: rgba(255, 255, 255, 0.72);
}

.quick-action strong {
  font-weight: 650;
}

.quick-action.primary {
  background: linear-gradient(135deg, #0b6b63, #074943);
  box-shadow: 0 14px 26px rgba(7, 73, 67, 0.18);
}

.account-list dd,
.usage-panel strong,
.activity-item strong,
.support-list strong,
.listing-main strong {
  font-weight: 610;
}

.usage-panel p {
  color: #0b5b53;
  font-weight: 560;
}

.workflow-steps div,
.stepper div {
  font-weight: 650;
}

.workflow-steps span,
.stepper span,
.listing-main span,
.listing-side small,
.upload-slots strong,
.upload-slots span,
.counter,
.save-state,
.checklist div {
  font-weight: 500;
}

button,
.nav-pill,
.tiny-button,
.row-actions button,
.status-badge,
.pill {
  font-weight: 650;
}

input,
textarea,
select {
  color: #182133;
  background: rgba(255, 255, 255, 0.78);
}

.dashboard-grid {
  gap: 14px;
}

.listing-row {
  padding: 12px 4px;
}

.empty {
  color: #6b7280;
  font-weight: 400;
}

body:has(.portal-layout) h1,
body:has(.portal-layout) h2,
body:has(.portal-layout) h3,
body:has(.portal-layout) strong,
body:has(.portal-layout) button,
body:has(.portal-layout) a,
body:has(.portal-layout) dd {
  letter-spacing: 0;
}

body:has(.portal-layout) strong {
  font-weight: 560;
}

.portal-sidebar {
  width: 292px;
}

.sidebar-brand h1 {
  font-size: 22px;
  font-weight: 620;
}

.sidebar-brand span {
  font-size: 14px;
}

.portal-nav a {
  min-height: 46px;
  font-size: 14px;
  font-weight: 500;
}

.sidebar-promo strong {
  font-size: 21px;
  font-weight: 560;
}

.client-dashboard {
  padding-top: 40px;
}

.page-heading h2 {
  font-size: clamp(27px, 2.6vw, 36px);
  font-weight: 620;
}

.page-heading p {
  font-size: 15px;
}

.stat-card {
  min-height: 104px;
  padding: 17px 18px;
}

.stat-card span,
.eyebrow,
.account-list dt {
  color: #8b7130;
  font-weight: 560;
}

.stat-card strong {
  font-size: 27px;
  font-weight: 600;
}

.stat-card small {
  font-size: 13px;
}

.quick-action strong,
.panel-heading h2,
.panel-heading h3,
.account-list dd,
.usage-panel strong,
.activity-item strong,
.support-list strong,
.listing-main strong {
  font-weight: 560;
}

.quick-action {
  min-height: 82px;
}

.quick-action span,
.account-list dd,
.usage-panel p,
.workflow-steps span,
.stepper span,
.listing-main span,
.listing-side small {
  font-weight: 420;
}

.workflow-steps div,
.stepper div {
  font-weight: 560;
}

.primary-button,
.secondary-button,
.nav-pill,
.tiny-button,
.row-actions button,
.status-badge,
.pill {
  font-weight: 560;
}

.panel-heading {
  padding-block: 17px;
}

.account-list div {
  padding-block: 11px;
}

.icon,
.stat-icon,
.section-icon,
.action-icon,
.workflow-steps i {
  display: inline-grid;
  place-items: center;
  color: currentColor;
}

.icon svg,
.stat-icon svg,
.section-icon svg,
.action-icon svg,
.workflow-steps i svg {
  width: 20px;
  height: 20px;
}

body:has(.portal-layout) .portal-nav a {
  display: flex;
  align-items: center;
  gap: 14px;
}

body:has(.portal-layout) .portal-nav .icon {
  width: 24px;
  flex: 0 0 auto;
}

body:has(.portal-layout) .nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

body:has(.portal-layout) .sidebar-promo img {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  border-radius: 0;
  object-fit: cover;
  object-position: 56% 38%;
  box-shadow: none;
  grid-area: 1 / 1;
}

body:has(.portal-layout) .stat-card {
  grid-template-columns: 52px minmax(130px, 1fr);
  align-items: center;
}

body:has(.portal-layout) .stat-card > div {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.stat-icon,
.section-icon,
.action-icon,
.workflow-steps i {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border-radius: 999px;
  color: #0c655d;
  background: #e6f3ee;
}

.stat-icon.gold,
.section-icon.gold {
  color: #9a6819;
  background: #fbefd9;
}

body:has(.portal-layout) .panel-heading.compact {
  align-items: center;
  justify-content: flex-start;
  min-height: 76px;
  padding: 20px 22px;
  gap: 16px;
}

body:has(.portal-layout) .panel-heading.compact .tiny-button {
  margin-left: auto;
}

body:has(.portal-layout) .quick-action-grid {
  grid-template-columns: repeat(2, minmax(230px, 1fr)) minmax(280px, 0.9fr);
}

body:has(.portal-layout) .quick-action {
  grid-template-columns: 46px minmax(0, 1fr);
  align-content: center;
  gap: 6px 14px;
}

body:has(.portal-layout) .quick-action > span:last-child {
  grid-column: 2;
}

body:has(.portal-layout) .quick-action.primary .action-icon {
  color: #0b5b53;
  background: #fff;
}

.quick-promo {
  display: grid;
  align-content: center;
  min-height: 88px;
  overflow: hidden;
  border: 1px solid rgba(31, 41, 55, 0.1);
  border-radius: 8px;
  padding: 20px;
  background-image:
    linear-gradient(90deg, rgba(255,255,255,0.96) 0%, rgba(255,255,255,0.76) 44%, rgba(255,255,255,0.1) 100%),
    url("/assets/jewelry-promo.png");
  background-position: center;
  background-size: cover;
}

.quick-promo span {
  width: 26px;
  height: 2px;
  margin-bottom: 14px;
  background: #b98a2c;
}

.quick-promo strong {
  max-width: 170px;
  color: #2b2118;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.2;
}

body:has(.portal-layout) .dashboard-grid {
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1.15fr);
}

body:has(.portal-layout) .workflow-steps div {
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 10px;
}

.workflow-steps .step-number {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  color: #fff;
  background: var(--primary);
  font-size: 16px;
  font-weight: 650;
}

.empty-state {
  display: grid;
  place-items: center;
  gap: 10px;
  min-height: 126px;
  padding: 24px;
  color: #6b7280;
  text-align: center;
}

.empty-state .section-icon {
  color: #a7adb8;
  background: #f1f3f4;
}

.empty-state strong {
  color: #5f6878;
  font-weight: 450;
}

.empty-state.full {
  min-height: 260px;
  align-content: center;
  gap: 8px;
  padding: 38px 24px;
}

.empty-state.full .section-icon {
  width: 52px;
  height: 52px;
  margin-bottom: 4px;
  color: #17695f;
  background: #eaf5f2;
}

.empty-state.full strong {
  color: #263347;
  font-size: 17px;
  font-weight: 620;
}

.empty-state.full p {
  max-width: 390px;
  margin: 0;
  color: #718096;
  font-size: 13px;
  line-height: 1.5;
}

.empty-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  margin-top: 10px;
  padding: 8px 15px;
  border-radius: 6px;
  color: #fff;
  font-size: 12px;
  font-weight: 560;
  text-decoration: none;
}

body:has(.portal-layout) .client-page[data-page="drafts"] .toolbar {
  gap: 12px;
}

body:has(.portal-layout) .client-page[data-page="drafts"]:not([hidden]) {
  display: grid;
  align-content: start;
  gap: 14px;
}

body:has(.portal-layout) .client-page[data-page="published"]:not([hidden]),
body:has(.portal-layout) .client-page[data-page="products"]:not([hidden]) {
  display: grid;
  align-content: start;
  gap: 14px;
}

body:has(.portal-layout) .client-page[data-page="products"] .toolbar {
  gap: 12px;
}

body:has(.portal-layout) .client-page[data-page="drafts"] .toolbar input,
body:has(.portal-layout) .client-page[data-page="drafts"] .toolbar select {
  min-height: 46px;
  background: #fff;
}

body:has(.portal-layout) .client-page[data-page="drafts"] > .panel {
  overflow: hidden;
  box-shadow: 0 14px 34px rgba(31, 41, 55, 0.06);
}

body:has(.portal-layout) .client-page[data-page="published"] > .panel,
body:has(.portal-layout) .client-page[data-page="products"] > .panel {
  overflow: hidden;
  box-shadow: 0 14px 34px rgba(31, 41, 55, 0.06);
}

body:has(.portal-layout) .client-page[data-page="products"] .toolbar input,
body:has(.portal-layout) .client-page[data-page="products"] .toolbar select {
  min-height: 46px;
  background: #fff;
}

body:has(.portal-layout) .client-page[data-page="subscription"]:not([hidden]) {
  display: grid;
  align-content: start;
  gap: 18px;
}

.plan-alerts:empty {
  display: none;
}

.plan-overview-grid,
.plan-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.plan-summary-body,
.plan-credit-body {
  padding: 18px 20px 20px;
}

.plan-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 12px;
}

.plan-price strong {
  color: #172033;
  font-size: 25px;
  font-weight: 650;
}

.plan-price span,
.plan-credit-body p {
  color: #718096;
  font-size: 12px;
}

.credit-numbers {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.credit-numbers strong {
  color: #172033;
  font-size: 17px;
}

.credit-numbers span {
  color: #526174;
  font-size: 13px;
}

.plan-credit-body .usage-bar {
  display: block;
  height: 9px;
  margin-bottom: 12px;
}

.upgrade-panel {
  overflow: hidden;
}

.plan-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
}

.plan-options article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px 14px;
  padding: 18px;
  border: 1px solid #dfe6e3;
  border-radius: 7px;
  background: #fbfcfb;
}

.plan-options article.recommended {
  border-color: #8bbab2;
  background: #f1f8f6;
}

.plan-options article > span,
.plan-options article > small {
  grid-column: 1;
}

.plan-options article > strong {
  grid-column: 1;
  color: #172033;
  font-size: 22px;
}

.plan-options article > span {
  color: #9a6819;
  font-size: 11px;
  font-weight: 650;
}

.plan-options article > small {
  color: #718096;
  font-size: 11px;
}

.plan-options article > button {
  grid-column: 2;
  grid-row: 1 / 4;
  min-width: 132px;
}

.plan-history {
  padding: 6px 18px 16px;
}

.plan-history-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  min-height: 62px;
  border-bottom: 1px solid #e6ebe9;
}

.history-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #17695f;
  background: #eaf5f2;
}

.history-icon svg {
  width: 15px;
  height: 15px;
}

.plan-history-row > span:nth-child(2) {
  display: grid;
  gap: 3px;
}

.plan-history-row small,
.plan-history-row time {
  color: #718096;
  font-size: 10px;
}

.plan-history-row b {
  color: #354258;
  font-size: 11px;
}

.plan-history-empty {
  display: grid;
  place-items: center;
  gap: 5px;
  min-height: 132px;
  color: #718096;
  font-size: 11px;
  text-align: center;
}

.plan-history-empty strong {
  color: #354258;
  font-size: 13px;
}

@media (max-width: 900px) {
  .plan-overview-grid,
  .plan-detail-grid,
  .plan-options {
    grid-template-columns: 1fr;
  }

  .plan-options article > button {
    grid-column: 1;
    grid-row: auto;
    justify-self: start;
    margin-top: 8px;
  }
}

body:has(.portal-layout) .client-page[data-page="support"]:not([hidden]) {
  display: grid;
  align-content: start;
  gap: 16px;
}

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

.support-status-grid > section {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 74px;
  padding: 14px 16px;
  border: 1px solid #dfe6e3;
  border-radius: 7px;
  background: #fff;
}

.support-status-grid > section > div {
  display: grid;
  gap: 3px;
}

.support-status-grid small {
  color: #718096;
  font-size: 10px;
}

.support-status-grid strong {
  color: #263347;
  font-size: 14px;
  font-weight: 620;
}

.support-workspace {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(420px, 1.1fr);
  gap: 16px;
  align-items: start;
}

.support-faq,
.support-form {
  padding: 8px 18px 18px;
}

.support-faq details {
  border-bottom: 1px solid #e5eae8;
}

.support-faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 54px;
  color: #263347;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.support-faq summary::-webkit-details-marker {
  display: none;
}

.support-faq summary::after {
  content: "+";
  color: #17695f;
  font-size: 18px;
  font-weight: 400;
}

.support-faq details[open] summary::after {
  content: "-";
}

.support-faq details p {
  margin: -2px 28px 16px 0;
  color: #718096;
  font-size: 12px;
  line-height: 1.55;
}

.support-form {
  display: grid;
  gap: 13px;
}

.support-form label {
  display: grid;
  gap: 6px;
  color: #354258;
  font-size: 11px;
  font-weight: 600;
}

.support-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.support-form-actions button,
.support-form-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 9px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 560;
  text-decoration: none;
}

.support-form-actions svg {
  width: 15px;
  height: 15px;
}

.support-form-result {
  min-height: 18px;
  margin: 0;
  color: #17695f;
  font-size: 11px;
}

@media (max-width: 900px) {
  .support-status-grid,
  .support-workspace {
    grid-template-columns: 1fr;
  }
}

body:has(.portal-layout) .client-dashboard {
  max-width: none;
  gap: 24px;
}

body:has(.portal-layout) .stat-grid {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
}

body:has(.portal-layout) .stat-card span:not(.stat-icon),
body:has(.portal-layout) .stat-card small {
  display: block;
  line-height: 1.35;
}

body:has(.portal-layout) .stat-card strong {
  display: block;
  white-space: nowrap;
}

body:has(.portal-layout) .quick-action strong {
  line-height: 1.25;
}

body:has(.portal-layout) .quick-action span:not(.action-icon) {
  display: block;
  line-height: 1.35;
}

body:has(.portal-layout) .quick-action.primary span:not(.action-icon) {
  color: rgba(255, 255, 255, 0.82);
}

body:has(.portal-layout) .quick-promo {
  min-height: 116px;
}

body:has(.portal-layout) .quick-actions {
  margin-top: 6px;
  margin-bottom: 10px;
}

body:has(.portal-layout) .quick-actions .panel-heading {
  padding-bottom: 17px;
}

body:has(.portal-layout) .quick-action-grid {
  gap: 16px;
  padding: 18px;
}

body:has(.portal-layout) .quick-action,
body:has(.portal-layout) .quick-promo {
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.035);
}

body:has(.portal-layout) .panel,
body:has(.portal-layout) .stat-card {
  border-color: rgba(31, 41, 55, 0.14);
  box-shadow: 0 18px 42px rgba(17, 24, 39, 0.06);
}

body:has(.portal-layout) .dashboard-grid .panel:nth-child(1),
body:has(.portal-layout) .dashboard-grid .panel:nth-child(2) {
  min-height: 256px;
}

body:has(.portal-layout) .account-list,
body:has(.portal-layout) .usage-panel,
body:has(.portal-layout) .activity-list,
body:has(.portal-layout) .listing-table {
  padding-top: 4px;
}

body:has(.portal-layout) .account-list div:first-child {
  padding-top: 14px;
}

body:has(.portal-layout) .dashboard-grid {
  gap: 24px;
  row-gap: 26px;
  margin-top: 8px;
}

/* Dashboard spacing rhythm: title group, metrics, actions, and card rows. */
body:has(.portal-layout) .client-page[data-page="dashboard"]:not([hidden]) {
  display: grid;
  gap: 24px;
}

body:has(.portal-layout) .client-page[data-page="dashboard"] .page-heading {
  gap: 8px;
  padding-bottom: 2px;
}

body:has(.portal-layout) .client-page[data-page="dashboard"] .quick-actions,
body:has(.portal-layout) .client-page[data-page="dashboard"] .dashboard-grid {
  margin: 0;
}

body:has(.portal-layout) .client-page[data-page="dashboard"] .dashboard-grid {
  column-gap: 24px;
  row-gap: 28px;
}

body:has(.portal-layout) .client-page[data-page="dashboard"] .panel {
  overflow: hidden;
}

body:has(.portal-layout) .client-page[data-page="dashboard"] .panel-heading.compact {
  min-height: 80px;
  padding: 20px 22px;
}

body:has(.portal-layout) .client-page[data-page="dashboard"] .quick-action-grid {
  padding: 20px;
}

body:has(.portal-layout) .sidebar-promo {
  position: relative;
  display: grid;
  min-height: 306px;
  margin: auto 12px 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(31, 41, 55, 0.1);
  border-radius: 8px;
  background: #fbf8f2;
  box-shadow: 0 18px 38px rgba(101, 72, 24, 0.1);
}

body:has(.portal-layout) .sidebar-promo::after {
  content: "";
  grid-area: 1 / 1;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.18) 44%, rgba(255, 255, 255, 0.96) 80%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.68), rgba(255, 255, 255, 0.04));
  pointer-events: none;
}

body:has(.portal-layout) .sidebar-promo strong,
body:has(.portal-layout) .sidebar-promo span {
  position: relative;
  z-index: 1;
  grid-area: 1 / 1;
  align-self: end;
  justify-self: start;
  max-width: 138px;
  margin-left: 24px;
}

body:has(.portal-layout) .sidebar-promo strong {
  margin-bottom: 54px;
  color: #2d261f;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.12;
}

body:has(.portal-layout) .sidebar-promo strong::before {
  content: "";
  display: block;
  width: 28px;
  height: 2px;
  margin-bottom: 12px;
  background: #b98a2c;
}

body:has(.portal-layout) .sidebar-promo span {
  margin-bottom: 20px;
  color: #9a6819;
  font-size: 11px;
  font-weight: 560;
}

body:has(.portal-layout) .sidebar-promo {
  width: calc(100% + 36px);
  min-height: 360px;
  margin: auto -18px -24px;
  border: 0;
  border-radius: 0;
  background: #fbfaf7;
  box-shadow: none;
}

body:has(.portal-layout) .sidebar-promo::after {
  background:
    linear-gradient(180deg, rgba(251, 250, 247, 0) 0%, rgba(251, 250, 247, 0.08) 40%, rgba(251, 250, 247, 0.9) 72%, #fbfaf7 91%),
    linear-gradient(90deg, rgba(251, 250, 247, 0.38) 0%, rgba(251, 250, 247, 0) 42%, rgba(251, 250, 247, 0.18) 100%);
}

body:has(.portal-layout) .sidebar-promo img {
  object-position: 52% 43%;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.18) 14%, #000 34%, #000 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.18) 14%, #000 34%, #000 100%);
}

body:has(.portal-layout) .sidebar-promo strong,
body:has(.portal-layout) .sidebar-promo span,
body:has(.portal-layout) .sidebar-promo small {
  position: relative;
  z-index: 1;
  grid-area: 1 / 1;
  align-self: end;
  justify-self: start;
  margin-left: 28px;
}

body:has(.portal-layout) .sidebar-promo strong {
  max-width: 155px;
  margin-bottom: 122px;
  font-size: 17px;
  line-height: 1.08;
}

body:has(.portal-layout) .sidebar-promo span {
  margin-bottom: 82px;
}

body:has(.portal-layout) .sidebar-promo small {
  margin-bottom: 66px;
  color: #7c8590;
  font-size: 9px;
  font-weight: 450;
}

body:has(.portal-layout) .listing-workspace {
  grid-template-columns: minmax(330px, 0.95fr) minmax(420px, 1.25fr);
  gap: 16px;
}

body:has(.portal-layout) .review-panel {
  min-width: 0;
}

body:has(.portal-layout) .details-panel {
  grid-column: 1 / 2;
}

body:has(.portal-layout) .checklist-panel {
  grid-column: 2 / 3;
}

body:has(.portal-layout) .draft-summary {
  line-height: 1.35;
}

body:has(.portal-layout) .image-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body:has(.portal-layout) .stepper div {
  min-height: 78px;
}

/* New listing workspace */
body:has(.portal-layout) .client-page[data-page="listings/new"]:not([hidden]) {
  display: grid;
  gap: 16px;
}

.listing-form-anchor {
  display: none;
}

body:has(.portal-layout) .listing-stepper {
  gap: 0;
  overflow: visible;
  border: 1px solid rgba(31, 41, 55, 0.12);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 28px rgba(17, 24, 39, 0.04);
}

body:has(.portal-layout) .listing-stepper > div {
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  place-items: center start;
  gap: 12px;
  min-height: 84px;
  padding: 14px 22px;
  color: #172033;
  background: transparent;
}

body:has(.portal-layout) .listing-stepper > div:not(:last-child)::after {
  content: "";
  position: absolute;
  right: -20px;
  top: 50%;
  z-index: 2;
  width: 40px;
  height: 2px;
  background: #d8dedc;
}

body:has(.portal-layout) .listing-stepper > .is-complete::after,
body:has(.portal-layout) .listing-stepper > .is-active::after {
  background: #17695f;
}

body:has(.portal-layout) .listing-stepper .step-badge {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid #dce2e1;
  border-radius: 999px;
  color: #344054;
  background: #f4f6f7;
  font-size: 16px;
  font-weight: 650;
}

body:has(.portal-layout) .listing-stepper .is-active .step-badge,
body:has(.portal-layout) .listing-stepper .is-complete .step-badge {
  border-color: #17695f;
  color: #fff;
  background: #17695f;
  box-shadow: 0 0 0 7px rgba(23, 105, 95, 0.09);
}

body:has(.portal-layout) .listing-stepper .step-badge svg {
  width: 22px;
  height: 22px;
}

body:has(.portal-layout) .listing-stepper .step-copy {
  display: grid;
  gap: 4px;
  color: #172033;
}

body:has(.portal-layout) .listing-stepper .step-copy strong {
  color: #172033;
  font-size: 14px;
  font-weight: 600;
}

body:has(.portal-layout) .listing-stepper .step-copy small {
  color: #697489;
  font-size: 11px;
  font-weight: 430;
}

body:has(.portal-layout) .listing-workspace {
  grid-template-columns: minmax(300px, 0.9fr) minmax(460px, 1.45fr);
  grid-template-areas:
    "upload review"
    "basics details"
    "rail rail";
  gap: 16px;
  align-items: start;
}

body:has(.portal-layout) .listing-workspace > .panel,
body:has(.portal-layout) .listing-side-rail .panel {
  overflow: hidden;
}

body:has(.portal-layout) .listing-workspace .panel-heading.compact {
  min-height: 68px;
  padding: 15px 18px;
  gap: 12px;
}

body:has(.portal-layout) .listing-workspace .panel-heading.compact .section-icon {
  width: 36px;
  height: 36px;
}

body:has(.portal-layout) .listing-workspace .panel-heading h3 {
  font-size: 16px;
  line-height: 1.25;
}

body:has(.portal-layout) .listing-workspace .panel-heading p {
  margin-top: 3px;
  color: #6a7588;
  font-size: 12px;
  line-height: 1.35;
}

.upload-panel {
  grid-area: upload;
}

.product-basics-panel {
  grid-area: basics;
}

body:has(.portal-layout) .review-panel {
  grid-area: review;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

body:has(.portal-layout) .details-panel {
  grid-area: details;
}

.listing-side-rail {
  grid-area: rail;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.listing-side-rail .checklist-panel {
  grid-column: auto;
}

.upload-panel-body {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.product-mode-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border: 1px solid #d8e1de;
  border-radius: 7px;
  background: #f4f7f6;
}

.product-mode-picker button {
  min-height: 36px;
  border: 0;
  border-radius: 5px;
  color: #526174;
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.product-mode-picker button.is-active {
  color: #fff;
  background: #12685f;
}

.set-piece-picker {
  padding: 12px 13px 13px;
  border: 1px solid #d8e1de;
  border-radius: 7px;
  background: #fbfdfc;
}

.set-piece-picker p {
  margin: 0 0 10px;
  color: #354258;
  font-size: 11px;
  font-weight: 600;
}

.set-piece-picker > div {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.set-piece-picker label {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 34px;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid #e2e8e6;
  border-radius: 5px;
  color: #526174;
  background: #fff;
  font-size: 11px;
  font-weight: 550;
  line-height: 1.2;
  cursor: pointer;
}

.set-piece-picker label:has(input:checked) {
  border-color: #8bbab2;
  color: #0d5e56;
  background: #eef8f5;
}

.set-piece-picker input[type="checkbox"] {
  width: 15px;
  height: 15px;
  min-width: 15px;
  margin: 0;
  padding: 0;
  flex: 0 0 15px;
  accent-color: #12685f;
}

.single-product-type {
  display: grid;
  gap: 6px;
  color: #526174;
  font-size: 11px;
  font-weight: 600;
}

.single-product-type[hidden] {
  display: none;
}

.single-product-type select {
  min-height: 38px;
  border: 1px solid #d8e1de;
  border-radius: 6px;
  padding: 0 10px;
  color: #273449;
  background: #fff;
  font: inherit;
  font-size: 12px;
}

.upload-dropzone {
  position: relative;
  display: grid;
  place-items: center;
  gap: 5px;
  min-height: 154px;
  padding: 20px;
  border: 1px dashed #bdcbc7;
  border-radius: 7px;
  color: #273449;
  background: #fcfdfc;
  text-align: center;
  cursor: pointer;
}

.upload-dropzone:hover {
  border-color: #17695f;
  background: #f5faf8;
}

.upload-dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.dropzone-icon {
  display: grid;
  place-items: center;
  color: #17695f;
}

.dropzone-icon svg {
  width: 32px;
  height: 32px;
}

.upload-dropzone strong {
  font-size: 13px;
  font-weight: 600;
}

.upload-dropzone small,
.upload-guidance {
  color: #68758a;
  font-size: 11px;
  line-height: 1.45;
}

.choose-files {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  margin-top: 5px;
  padding: 8px 16px;
  font-size: 12px;
}

.upload-guidance {
  margin: 0;
}

body:has(.portal-layout) .upload-slots div {
  place-items: center;
  min-height: 82px;
  padding: 10px 6px;
  text-align: center;
}

body:has(.portal-layout) .upload-slots .piece-upload-card {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 136px;
  padding: 10px 8px;
  border: 1px dashed #cad5d2;
  border-radius: 7px;
  color: #526174;
  background: #fbfdfc;
  text-align: center;
  cursor: pointer;
}

.piece-upload-card.has-file {
  border-style: solid;
  border-color: #85b8ae;
  background: #f4faf8;
}

.piece-upload-action {
  color: #17695f;
  font-size: 10px;
  font-weight: 600;
}

.piece-preview {
  display: grid;
  width: 100%;
  gap: 5px;
}

.piece-thumbnails {
  display: flex;
  justify-content: center;
  gap: 3px;
}

.piece-thumbnails img {
  width: 38px;
  height: 38px;
  border: 1px solid #d8e1de;
  border-radius: 4px;
  object-fit: cover;
}

.piece-preview small {
  overflow: hidden;
  color: #526174;
  font-size: 9px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.main-upload-preview {
  display: none;
  width: min(100%, 220px);
  gap: 7px;
  place-items: center;
}

.main-upload-preview img {
  width: 78px;
  height: 62px;
  border: 1px solid #d8e1de;
  border-radius: 5px;
  object-fit: cover;
}

.main-upload-preview span {
  max-width: 100%;
  overflow: hidden;
  color: #526174;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-dropzone.has-preview .main-upload-preview {
  display: grid;
}

.piece-upload-card input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.piece-upload-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 12px;
  border: 1px dashed #cad5d2;
  border-radius: 6px;
  color: #68758a;
  background: #fbfdfc;
  font-size: 10px;
  line-height: 1.4;
  text-align: center;
}

.upload-slots i {
  display: grid;
  place-items: center;
  color: #8e9aa8;
}

.upload-slots i svg {
  width: 20px;
  height: 20px;
}

body:has(.portal-layout) .review-panel .draft-summary {
  margin: 14px 16px 0;
}

body:has(.portal-layout) .review-panel .image-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px 16px;
  min-height: 0;
}

body:has(.portal-layout) .review-panel figure {
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(31, 41, 55, 0.1);
  border-radius: 7px;
  background: #fbfcfb;
}

body:has(.portal-layout) .review-panel figcaption {
  color: #344054;
  font-size: 12px;
  font-weight: 550;
}

body:has(.portal-layout) .review-panel .image-frame {
  width: 100%;
  min-height: 300px;
  aspect-ratio: auto;
  border: 0;
  background: #f6f7f5;
}

.image-zoom {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  gap: 7px;
  min-height: 34px;
  padding: 7px 14px;
  border-color: rgba(15, 91, 84, 0.2);
  color: #3c5265;
  background: #fff;
  font-size: 11px;
}

.image-zoom svg {
  width: 15px;
  height: 15px;
}

body:has(.portal-layout) .review-panel .panel-actions {
  align-self: end;
  gap: 10px;
  padding: 0 16px 16px;
}

body:has(.portal-layout) .review-panel .panel-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

body:has(.portal-layout) .review-panel .panel-actions svg {
  width: 17px;
  height: 17px;
}

.compact-form {
  padding-top: 16px;
}

.field-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.details-description-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 12px;
}

.details-copy-column {
  display: grid;
  gap: 12px;
}

.details-description-grid > label {
  align-content: start;
}

.details-description-grid > label textarea {
  min-height: 150px;
}

.listing-side-rail .account-list {
  padding-inline: 16px;
}

.listing-side-rail .account-list div {
  grid-template-columns: minmax(100px, 0.9fr) minmax(0, 1.1fr);
  padding-block: 10px;
}

.compact-queue .listing-row {
  grid-template-columns: 42px minmax(0, 1fr);
  min-height: 60px;
  padding: 7px 0;
}

.compact-queue .listing-thumb {
  width: 42px;
  height: 42px;
}

.compact-queue .listing-side {
  grid-column: 2;
  justify-items: start;
}

.compact-queue .listing-main span,
.compact-queue .listing-side small,
.compact-queue .row-actions {
  display: none;
}

@media (min-width: 1500px) {
  body:has(.portal-layout) .listing-workspace {
    grid-template-columns: minmax(270px, 0.82fr) minmax(500px, 1.65fr) minmax(270px, 0.78fr);
    grid-template-areas:
      "upload review rail"
      "basics details rail";
  }

  .listing-side-rail {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  body:has(.portal-layout) .listing-stepper {
    grid-template-columns: 1fr;
  }

  body:has(.portal-layout) .listing-stepper > div:not(:last-child)::after {
    display: none;
  }

  body:has(.portal-layout) .listing-workspace {
    grid-template-columns: 1fr;
    grid-template-areas: "upload" "basics" "review" "details" "rail";
  }

  .listing-side-rail,
  .details-description-grid,
  .field-grid.three {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1180px) {
  body:has(.portal-layout) .listing-workspace {
    grid-template-columns: 1fr;
    grid-template-areas: "upload" "basics" "review" "details" "rail";
  }

  .listing-side-rail {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 1500px) {
  body:has(.portal-layout) .stat-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  body:has(.portal-layout) .quick-action-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(250px, 320px);
  }

  body:has(.portal-layout) .dashboard-grid {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1.15fr) minmax(280px, 0.8fr);
  }
}

@media (max-width: 1180px) {
  body:has(.portal-layout) .quick-action-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }

  body:has(.portal-layout) .quick-promo {
    grid-column: 1 / -1;
  }

  body:has(.portal-layout) .listing-workspace,
  body:has(.portal-layout) .image-grid {
    grid-template-columns: 1fr;
  }

  body:has(.portal-layout) .details-panel,
  body:has(.portal-layout) .checklist-panel {
    grid-column: auto;
  }
}

@media (max-width: 900px) {
  .topbar,
  .top-actions,
  .client-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-grid,
  .client-grid,
  .dashboard-hero,
  .workbench-grid,
  .management-grid,
  .metric-grid,
  .overview-grid,
  .field-grid.two {
    grid-template-columns: 1fr;
  }

  .client-grid .panel:nth-child(3) {
    grid-column: auto;
  }

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

  .listing-row {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .listing-side {
    grid-column: 2;
    justify-items: start;
  }

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

  .portal-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 20;
    width: 280px;
    transform: translateX(-100%);
    transition: transform 180ms ease;
  }

  .sidebar-open .portal-sidebar {
    transform: translateX(0);
  }

  .portal-topbar {
    justify-content: space-between;
  }

  .menu-button {
    display: inline-flex;
    align-items: center;
  }

  .account-chip {
    display: none;
  }

  .stat-grid,
  .quick-action-grid,
  .dashboard-grid,
  .dashboard-grid.two-col,
  .stepper,
  .listing-workspace,
  .upload-slots,
  .toolbar {
    grid-template-columns: 1fr;
  }

  .details-panel {
    grid-column: auto;
  }

  .row-actions {
    grid-column: 2;
    flex-wrap: wrap;
    justify-content: flex-start;
  }
}

/* Keep the New Listing utility cards in one stable right-hand rail. */
body:has(.portal-layout) .listing-workspace .listing-side-rail {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
  min-width: 0;
}

body:has(.portal-layout) .listing-workspace .listing-side-rail > .panel {
  width: 100%;
  min-width: 0;
  grid-column: auto;
}

body:has(.portal-layout) .listing-workspace .listing-side-rail .panel-heading.compact {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
}

body:has(.portal-layout) .listing-workspace .listing-side-rail .panel-heading.compact > div {
  min-width: 0;
}

body:has(.portal-layout) .listing-workspace .listing-side-rail .panel-heading.compact h3 {
  overflow-wrap: normal;
}

/* Match the upload tile to the AI review tile and let the drop zone fill it. */
@media (min-width: 1181px) {
  body:has(.portal-layout) .listing-workspace {
    align-items: stretch;
  }

  body:has(.portal-layout) .listing-workspace > .upload-panel,
  body:has(.portal-layout) .listing-workspace > .review-panel {
    height: 100%;
  }

  body:has(.portal-layout) .listing-workspace > .upload-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
  }

  body:has(.portal-layout) .upload-panel-body {
    grid-template-rows: auto auto minmax(220px, 1fr) auto auto;
    height: 100%;
  }

  body:has(.portal-layout) .upload-dropzone {
    min-height: 220px;
    height: 100%;
  }

  body:has(.portal-layout) .upload-slots > div {
    aspect-ratio: 1;
  }
}
