:root {
  --background: #f6f7f4;
  --surface: #ffffff;
  --surface-strong: #eef3ef;
  --ink: #202124;
  --muted: #676f73;
  --line: #d7ddd8;
  --primary: #2f6b57;
  --primary-strong: #245443;
  --blue: #2f5f8f;
  --danger: #b42318;
  --danger-soft: #fff0ee;
  --success: #28705c;
  --success-soft: #e6f5ee;
  --warning-soft: #fff7df;
  --shadow: 0 18px 50px rgba(25, 32, 29, 0.1);
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  min-height: 100%;
  margin: 0;
  background: linear-gradient(180deg, rgba(238, 243, 239, 0.9), rgba(246, 247, 244, 0)), var(--background);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: inherit; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
.auth-shell, .buyer-shell, .dashboard-shell, .gallery-shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.auth-shell, .buyer-shell { min-height: 100vh; display: grid; align-items: center; padding: 32px 0; }
.auth-panel, .tool-panel, .inventory-panel, .painting-photo, .painting-buy-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.auth-panel { width: min(460px, 100%); margin: 0 auto; padding: 28px; }
.brand-mark, .section-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: white;
  background: var(--primary);
  font-weight: 900;
}
.section-icon { width: 34px; height: 34px; flex: 0 0 auto; }
.eyebrow {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 12px; font-size: clamp(2rem, 5vw, 4.4rem); line-height: 0.96; letter-spacing: 0; }
h2 { margin-bottom: 6px; font-size: 1.2rem; line-height: 1.2; letter-spacing: 0; }
h3 { margin-bottom: 4px; font-size: 1rem; line-height: 1.25; letter-spacing: 0; }
.muted, .section-heading p, .empty-state p, .handoff-note, .buyer-note, .checkout-help { color: var(--muted); }
.stacked-form, .painting-form { display: grid; gap: 14px; }
label { display: grid; gap: 7px; color: var(--muted); font-size: 0.9rem; font-weight: 700; }
.field-label { color: var(--muted); font-size: 0.9rem; font-weight: 700; }
.photo-picker-group { display: grid; gap: 7px; }
.photo-source-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.photo-source-grid label { min-width: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-strong); padding: 10px; }
input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 13px 14px;
  outline: none;
}
input:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47, 107, 87, 0.16); }
textarea { resize: vertical; }
.primary-action, .secondary-action, .icon-button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 800;
}
.primary-action { width: 100%; padding: 12px 16px; background: var(--primary); color: white; }
.primary-action:hover { background: var(--primary-strong); }
.secondary-action { padding: 10px 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.secondary-action:hover { border-color: var(--primary); }
.icon-button { min-width: 44px; padding: 0 10px; border: 1px solid var(--line); background: var(--surface); }
.danger-button { color: var(--danger); }
.notice {
  margin: 16px 0;
  border: 1px solid #edd58d;
  border-radius: 8px;
  background: var(--warning-soft);
  color: #5c4818;
  padding: 12px 14px;
  line-height: 1.45;
}
.notice.danger { border-color: #f3b5af; background: var(--danger-soft); color: var(--danger); }
.notice.success { border-color: #9ad7bf; background: var(--success-soft); color: var(--success); }
.dashboard-shell { padding: 28px 0 56px; }
.dashboard-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 20px 0 24px; }
.header-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.dashboard-header h1 { margin-bottom: 8px; }
.status-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-bottom: 18px; }
.status-pill {
  min-height: 78px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
  display: grid;
  align-content: center;
  gap: 3px;
}
.status-pill span { color: var(--muted); font-size: 0.78rem; font-weight: 700; }
.status-pill strong { color: var(--ink); font-size: 1rem; }
.status-pill.good { border-left: 4px solid var(--success); }
.status-pill.needs-work { border-left: 4px solid var(--blue); }
.admin-grid { display: grid; grid-template-columns: minmax(280px, 390px) minmax(0, 1fr); gap: 18px; align-items: start; }
.tool-panel, .inventory-panel { padding: 18px; box-shadow: 0 12px 32px rgba(25, 32, 29, 0.06); }
.tool-panel { position: sticky; top: 18px; }
.section-heading { display: flex; gap: 11px; align-items: flex-start; margin-bottom: 18px; }
.section-heading p { margin-bottom: 0; line-height: 1.45; }
.painting-list { display: grid; gap: 12px; }
.painting-row {
  display: grid;
  grid-template-columns: 58px 112px 112px minmax(0, 1fr);
  gap: 16px;
  min-height: 132px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.batch-print-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-strong); padding: 12px; }
.batch-print-bar strong { display: block; margin-bottom: 2px; }
.batch-print-bar p { margin: 0; color: var(--muted); font-size: 0.88rem; line-height: 1.35; }
.batch-print-button { width: auto; }
.select-qr-label { min-height: 112px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-strong); color: var(--ink); display: grid; place-items: center; align-content: center; gap: 6px; font-size: 0.76rem; font-weight: 800; text-align: center; }
.select-qr-label input { width: 22px; height: 22px; padding: 0; accent-color: var(--primary); }
.qr-box {
  width: 112px;
  height: 112px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}
.qr-box-link { text-decoration: none; }
.qr-box-link:hover, .qr-box-link:focus-visible { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47, 107, 87, 0.16); outline: none; }
.qr-box img { width: 96px; height: 96px; }
.admin-painting-thumb { width: 112px; height: 112px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-strong); color: var(--muted); font-size: 0.76rem; font-weight: 800; text-align: center; text-decoration: none; }
.admin-painting-thumb:hover, .admin-painting-thumb:focus-visible { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47, 107, 87, 0.16); outline: none; }
.admin-painting-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.painting-row-main { min-width: 0; }
.painting-row-title { display: flex; justify-content: space-between; gap: 12px; }
.painting-row-title p { margin-bottom: 0; color: var(--primary); font-weight: 800; }
.badge {
  height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}
.badge.available { background: var(--success-soft); color: var(--success); }
.badge.sold { background: var(--danger-soft); color: var(--danger); }
.public-url { display: block; max-width: 100%; margin: 8px 0 10px; color: var(--blue); font-size: 0.86rem; overflow-wrap: anywhere; }
.buyer-note { margin-bottom: 10px; font-size: 0.86rem; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.empty-state {
  min-height: 260px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  text-align: center;
  padding: 24px;
}
.buyer-page { width: 100%; }
.buyer-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.buyer-brand { display: inline-flex; align-items: center; gap: 8px; min-width: 0; color: var(--muted); font-weight: 800; text-decoration: none; }
.buyer-home-link { min-height: 42px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; gap: 7px; padding: 9px 12px; text-decoration: none; font-size: 0.92rem; font-weight: 800; }
.buyer-home-link:hover { border-color: var(--primary); }
.painting-hero { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.72fr); gap: 20px; align-items: stretch; }
.painting-photo { min-height: min(72vh, 760px); overflow: hidden; }
.painting-photo img { width: 100%; height: 100%; min-height: inherit; object-fit: cover; display: block; }
.photo-placeholder {
  min-height: inherit;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: linear-gradient(135deg, rgba(47, 107, 87, 0.12), rgba(47, 95, 143, 0.1)), var(--surface-strong);
  font-weight: 800;
}
.painting-buy-box { padding: 24px; display: flex; flex-direction: column; }
.painting-buy-box h1 { font-size: clamp(2.1rem, 6vw, 4.1rem); }
.price-line { display: flex; align-items: center; gap: 10px; margin: 14px 0 18px; color: var(--primary); }
.price-line strong { font-size: 2rem; line-height: 1; }
.handoff-note { margin-bottom: 16px; line-height: 1.45; }
.checkout-widget { margin-top: auto; }
.payment-actions { display: grid; gap: 8px; }
.payment-actions .primary-action, .payment-actions .secondary-action { width: 100%; }
.cash-app-action { background: #00d632; color: #06190c; }
.cash-app-action:hover { background: #00bd2c; }
.venmo-action { width: 100%; }
.venmo-profile-link { width: 100%; margin-top: 8px; }
.payment-details { display: grid; gap: 8px; margin: 0 0 14px; }
.payment-details div { display: grid; grid-template-columns: 82px 1fr; gap: 10px; align-items: baseline; }
.payment-details dt { color: var(--muted); font-size: 0.78rem; font-weight: 800; text-transform: uppercase; }
.payment-details dd { min-width: 0; margin: 0; overflow-wrap: anywhere; font-weight: 800; }
.checkout-message { margin: 12px 0 0; color: var(--danger); font-weight: 700; }
.checkout-help { margin: 12px 0 0; font-size: 0.9rem; line-height: 1.45; }
.sold-panel { margin-top: auto; border: 1px solid #9ad7bf; border-radius: 8px; background: var(--success-soft); color: var(--success); padding: 18px; }
.sold-panel p { margin-bottom: 0; }
.share-page-panel { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 12px; align-items: center; margin-top: 18px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-strong); }
.share-page-panel img { width: 92px; height: 92px; border: 1px solid var(--line); border-radius: 6px; background: white; }
.share-page-panel strong { display: block; margin-bottom: 4px; }
.share-page-panel p { margin: 0; color: var(--muted); font-size: 0.88rem; line-height: 1.4; }
.artist-story { display: grid; grid-template-columns: minmax(220px, 0.75fr) minmax(0, 1fr); gap: 22px; align-items: center; margin-top: 22px; overflow: hidden; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.artist-story-photo { min-height: 260px; height: 100%; overflow: hidden; }
.artist-story-photo img { width: 100%; height: 100%; min-height: inherit; object-fit: cover; object-position: 42% center; display: block; }
.artist-story-copy { padding: 22px 24px 22px 0; }
.artist-story-copy h2 { margin-bottom: 10px; font-size: 1.65rem; line-height: 1.08; }
.artist-story-copy p:last-child { margin-bottom: 0; color: var(--muted); line-height: 1.5; }
.gallery-shell { padding: 30px 0 42px; }
.landing-artist-hero { min-height: 390px; height: 48vh; max-height: 520px; position: relative; isolation: isolate; display: flex; align-items: flex-end; overflow: hidden; border-radius: 8px; padding: 38px; color: white; background: #1f251f; }
.landing-artist-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(12, 17, 13, 0.78), rgba(12, 17, 13, 0.22) 58%, rgba(12, 17, 13, 0.05)), linear-gradient(0deg, rgba(12, 17, 13, 0.58), rgba(12, 17, 13, 0.08) 54%); }
.landing-artist-hero img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; object-position: 39% center; display: block; }
.seller-login-link { position: absolute; top: 18px; right: 18px; z-index: 1; min-height: 42px; border: 1px solid rgba(255, 255, 255, 0.62); border-radius: 8px; background: rgba(12, 17, 13, 0.54); color: white; display: inline-flex; align-items: center; justify-content: center; padding: 10px 14px; text-decoration: none; font-size: 0.92rem; font-weight: 800; }
.seller-login-link:hover { background: rgba(12, 17, 13, 0.72); }
.landing-artist-copy { max-width: 650px; }
.landing-artist-copy .eyebrow { color: #d5f0ff; }
.landing-artist-copy h1 { margin-bottom: 10px; color: white; font-size: 4.2rem; }
.landing-artist-copy p:last-child { margin-bottom: 0; max-width: 560px; font-size: 1.18rem; line-height: 1.45; }
.gallery-jump-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.gallery-jump-links a { min-height: 40px; border: 1px solid rgba(255, 255, 255, 0.58); border-radius: 8px; background: rgba(255, 255, 255, 0.14); color: white; display: inline-flex; align-items: center; justify-content: center; padding: 9px 12px; text-decoration: none; font-size: 0.92rem; font-weight: 800; }
.gallery-jump-links a:hover { background: rgba(255, 255, 255, 0.24); }
.catalog-heading { padding: 22px 0 16px; }
.sold-catalog-heading { margin-top: 26px; border-top: 1px solid var(--line); }
.catalog-heading h2 { margin-bottom: 6px; font-size: 1.45rem; }
.catalog-heading p:not(.eyebrow) { max-width: 660px; margin-bottom: 0; color: var(--muted); line-height: 1.5; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.gallery-card { display: grid; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: 0 12px 32px rgba(25, 32, 29, 0.06); }
.sold-gallery-grid .gallery-card { background: #fbf9f2; }
.gallery-card-photo { aspect-ratio: 4 / 3; display: block; overflow: hidden; background: var(--surface-strong); text-decoration: none; }
.gallery-card-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-card-photo span { width: 100%; height: 100%; display: grid; place-items: center; color: var(--muted); font-weight: 800; }
.gallery-card-body { display: grid; gap: 12px; padding: 14px; }
.gallery-card-body .painting-row-title { align-items: flex-start; }
.gallery-card-body h2 { margin-bottom: 4px; font-size: 1.05rem; }
.gallery-card-body p { margin-bottom: 0; color: var(--muted); line-height: 1.4; }
.gallery-card-body .painting-row-title p { color: var(--primary); font-weight: 800; }
.sold-card-action { width: 100%; }
code { border-radius: 5px; background: rgba(0, 0, 0, 0.06); padding: 2px 5px; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 0.88em; }
@media (max-width: 880px) {
  .dashboard-header, .painting-row-title { flex-direction: column; }
  .status-strip, .admin-grid, .painting-hero, .artist-story { grid-template-columns: 1fr; }
  .tool-panel { position: static; }
  .painting-photo { min-height: 420px; }
  .artist-story-copy { padding: 0 18px 20px; }
}
@media (max-width: 560px) {
  .auth-shell, .buyer-shell, .dashboard-shell, .gallery-shell { width: min(100% - 20px, 1180px); }
  .auth-panel, .tool-panel, .inventory-panel, .painting-buy-box { padding: 16px; }
  .dashboard-header { padding-top: 12px; }
  .status-strip { gap: 8px; }
  .photo-source-grid { grid-template-columns: 1fr; }
  .painting-row { grid-template-columns: 48px 88px 88px minmax(0, 1fr); gap: 10px; padding: 10px; }
  .batch-print-bar { grid-template-columns: 1fr; }
  .batch-print-button { width: 100%; }
  .select-qr-label { min-height: 88px; }
  .qr-box { width: 88px; height: 88px; }
  .qr-box img { width: 76px; height: 76px; }
  .admin-painting-thumb { width: 88px; height: 88px; }
  .painting-row-main { grid-column: 1 / -1; }
  .row-actions { display: grid; grid-template-columns: 1fr 1fr; align-items: stretch; }
  .row-actions form:last-child { grid-column: span 2; }
  .secondary-action { min-width: 0; padding-inline: 8px; }
  .painting-photo { min-height: 300px; }
  .landing-artist-hero { min-height: 330px; height: auto; padding: 22px; }
  .landing-artist-copy h1 { font-size: 3rem; }
  .landing-artist-copy p:last-child { font-size: 1rem; }
}
