/* ── Gallery visitor account dashboard ─────────────────────────────────────── */

.gallery-account-page {
  min-height: 100vh;
  background: var(--bg, #fff);
  font-family: 'Avenir LT Std', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, 'Helvetica Neue', Arial, sans-serif;
}

/* ── Account header sign-out button ── */
.acct-topbar-btn { background: none; border: none; cursor: pointer; color: var(--muted, #888); }
.acct-topbar-btn:hover { color: var(--text, #111); }
/* .header-icons button:not(#account-panel *):not(...) in gallery.css carries
   ID-level specificity (see its own !important comment) and squeezes every
   icon button to a flush 16x16 box with zero padding — fine for symmetric
   icons, but this asymmetric log-out glyph (door bracket + arrow) reads as
   crammed against the edge with no breathing room. !important to win. */
.header-icons .acct-topbar-btn {
  width: 22px !important;
  height: 22px !important;
  padding: 3px !important;
}

.acct-main {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 48px var(--page-margin, 32px) 80px;
}

.acct-page-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--text, #111);
  margin: 0 0 6px;
}
.acct-page-sub {
  font-size: 14px;
  color: var(--muted, #888);
  margin: 0 0 36px;
}

.acct-page-login { max-width: 400px; margin: 60px auto; }
.acct-page-login .acct-page-title { text-align: center; }
.acct-page-login .acct-page-sub   { text-align: center; margin-bottom: 28px; }

.acct-card {
  background: var(--bg, #fff);
  border: 1px solid rgba(0,0,0,.1);
  border-radius: 12px;
  padding: 24px;
}

.acct-section { margin-bottom: 56px; }
.acct-section > *:not(.acct-section-head):not(.acct-section-title) {
  margin-left: 16px;
}
.acct-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.acct-section-head .acct-section-title { margin: 0; }
.acct-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted, #888);
  margin: 0 0 16px;
}

/* Link-a-gallery inline form */
.acct-link-gallery-form {
  background: rgba(0,0,0,.025);
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 20px;
}
.acct-link-gallery-form .acct-hint { margin: 0 0 10px; }

.acct-empty { font-size: 14px; color: var(--muted, #888); }

.acct-btn-sm { font-size: 12px; padding: 5px 12px; border-radius: 7px; }

/* ── Gallery grid ── */
.acct-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.acct-gallery-card-wrap {
  position: relative;
}
.acct-gallery-unlink {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,.45);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .15s;
  z-index: 2;
}
.acct-gallery-card-wrap:hover .acct-gallery-unlink { opacity: 1; }
.acct-gallery-unlink:hover { background: rgba(180,0,0,.7); }
.acct-gallery-card {
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,.08);
  transition: box-shadow .2s;
}
.acct-gallery-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,.1); }
.acct-gallery-cover {
  position: relative;
  aspect-ratio: 4/3;
  background: #eee;
  background-size: cover;
  overflow: hidden;
}
.acct-gallery-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.acct-gallery-info { padding: 12px 14px; }
.acct-gallery-info h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text, #111);
  margin: 0 0 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.acct-gallery-date { font-size: 12px; color: var(--muted, #888); margin: 0 0 6px; }
.acct-gallery-meta { display: flex; gap: 10px; font-size: 12px; color: var(--muted, #888); }

/* ── Grouped gallery layout (job → persons) ── */
/* ── Tab strip ── */
.acct-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 28px;
  border-bottom: 1px solid rgba(0,0,0,.08);
  padding-bottom: 0;
}
.acct-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted, #888);
  cursor: pointer;
  margin-bottom: -1px;
  transition: color .15s, border-color .15s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.acct-tab:hover { color: var(--text, #111); }
.acct-tab.is-active { color: var(--text, #111); border-bottom-color: var(--gold, #d5a63a); }
.acct-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--gold, #d5a63a);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}
.acct-tab-panel { display: block; }
.acct-tab-panel[hidden] { display: none; }

/* ── Settings tab card ── */
.acct-settings-card {
  margin: 0;
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 10px;
  background: #fff;
  box-shadow: none;
  padding: 16px;
}

.acct-job-group {
  margin-bottom: 28px;
}
.acct-job-group:last-child { margin-bottom: 0; }

.acct-job-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(0,0,0,.07);
  /* reset button styles */
  width: 100%;
  background: none;
  border-left: none;
  border-right: none;
  border-top: none;
  border-radius: 0;
  padding-left: 0;
  padding-right: 0;
  cursor: pointer;
  text-align: left;
}
.acct-job-header-link {
  text-decoration: none;
  color: inherit;
}
.acct-job-datecode {
  font-feature-settings: "tnum";
  letter-spacing: .02em;
  color: var(--muted, #888);
  font-weight: 600;
}
.acct-job-chevron {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-left: auto;
  color: var(--muted, #888);
  transition: transform .2s ease;
}
.acct-job-header[aria-expanded="false"] .acct-job-chevron {
  transform: rotate(-90deg);
}
.acct-job-cover {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 6px;
  overflow: hidden;
  background: #e8e8e8;
}
.acct-job-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.acct-job-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text, #111);
  margin: 0 0 2px;
}
.acct-job-date {
  font-size: 12px;
  color: var(--muted, #888);
  margin: 0;
}

.acct-person-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

.acct-person-card-wrap {
  position: relative;
}
.acct-person-card-wrap:hover .acct-gallery-unlink { opacity: 1; }

.acct-person-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,.08);
  transition: box-shadow .2s;
  background: #fff;
}
.acct-person-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.1); }

.acct-person-thumb {
  position: relative;
  aspect-ratio: 3/4;
  background: #eee;
  overflow: hidden;
}
.acct-person-thumb-empty { background: #f0f0f0; }
.acct-person-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.acct-person-info {
  padding: 10px 12px;
}
.acct-person-name {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text, #111);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}
.acct-person-group {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--gold, #c9a84c);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}
.acct-person-meta {
  display: block;
  font-size: 11px;
  color: var(--muted, #888);
}
.acct-person-shared-icon {
  width: 12px;
  height: 12px;
  vertical-align: middle;
  margin-left: 4px;
  margin-bottom: 2px;
  color: var(--muted, #888);
}

/* ── Orders ── */
.acct-orders { display: flex; flex-direction: column; gap: 10px; }
.acct-order-row {
  background: rgba(0,0,0,.03);
  border-radius: 8px;
  overflow: hidden;
}
.acct-order-row summary { list-style: none; }
.acct-order-row summary::-webkit-details-marker { display: none; }
.acct-order-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}
.acct-order-summary:hover { background: rgba(0,0,0,.03); }
.acct-order-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.acct-order-ref  { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acct-order-date { font-size: 12px; color: var(--muted, #888); }
/* Fixed columns so type/amount/status line up across every order row,
   regardless of how long any one row's status label happens to be. Status
   column is sized for the true longest label across all order types
   ("Sending to print lab" / "In production" — lab-routed print orders),
   not just whatever's visible on a given (e.g. digital-only) gallery. */
.acct-order-detail { display: grid; grid-template-columns: 60px 70px 105px; align-items: center; gap: 12px; flex-shrink: 0; }
.acct-order-type   { font-size: 13px; color: var(--muted, #888); text-align: right; }
.acct-order-amount { font-size: 14px; font-weight: 600; text-align: left; }
.acct-order-status              { font-size: 9.5px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; padding: 2px 8px; border-radius: 20px; background: rgba(0,0,0,.06); width: 105px; box-sizing: border-box; text-align: center; justify-self: center; }
.acct-order-status-pj-new       { background: #f3f4f6; color: #374151; }
.acct-order-status-pj-processing{ background: #e0e7ff; color: #3730a3; }
.acct-order-status-pj-ready     { background: #fef9c3; color: #854d0e; }
.acct-order-status-pj-printing  { background: #dbeafe; color: #1e40af; }
.acct-order-status-pj-shipped   { background: #d1fae5; color: #065f46; }
.acct-order-status-pj-done      { background: #dcfce7; color: #166534; }
.acct-order-status-pj-cancelled { background: #fee2e2; color: #991b1b; }
.acct-order-notes {
  font-size: 12px; color: var(--muted, #888); padding: 8px 16px 0;
  font-style: italic;
}

/* Order items */
.acct-order-items {
  display: flex; flex-direction: column; gap: 0;
  border-top: 1px solid rgba(0,0,0,.06);
  padding: 8px 16px 12px;
}
/* Grid: [thumb] [name+detail] [status] [action] */
.acct-order-item {
  display: grid;
  grid-template-columns: 48px 1fr auto auto;
  align-items: center;
  gap: 0 14px;
  padding: 9px 0;
}
.acct-order-item:not(:last-child) { border-bottom: 1px solid rgba(0,0,0,.04); }
.acct-item-thumb {
  width: 48px; height: 48px;
  border-radius: 5px; overflow: hidden; background: rgba(0,0,0,.06);
}
.acct-item-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.acct-item-info { min-width: 0; }
.acct-item-name {
  font-size: 13px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.acct-item-detail {
  font-size: 11px; color: var(--muted, #888);
  margin-top: 2px; white-space: nowrap;
}
.acct-item-type {
  display: inline-block; padding: 1px 6px; border-radius: 9px;
  background: rgba(0,0,0,.06); font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em;
}
.acct-item-status-text {
  font-size: 11px; color: var(--muted, #888);
  white-space: nowrap; font-style: italic;
}
.acct-item-dl-btn {
  flex-shrink: 0; align-self: center;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 6px;
  background: rgba(213,166,58,.08);
  border: 1px solid var(--gold, #d5a63a);
  color: var(--gold, #c49428);
  font-family: inherit; font-size: 10px; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase; text-decoration: none;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.acct-item-dl-btn:hover {
  background: rgba(213,166,58,.18);
  color: #a07820;
}

/* Download-all button on group heading */
.acct-group-head {
  display: flex; align-items: center; gap: 10px;
  margin: 18px 0 8px;
}
.acct-group-label {
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted, #888);
}
.acct-group-dl-all {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 6px;
  background: rgba(213,166,58,.08);
  border: 1px solid var(--gold, #d5a63a);
  color: var(--gold, #c49428);
  font-family: inherit; font-size: 10px; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase; text-decoration: none;
  white-space: nowrap; transition: background .15s, color .15s;
}
.acct-group-dl-all:hover { background: rgba(213,166,58,.18); color: #a07820; }

/* Per-class collapsible groups within the Digital section — orders bundling
   more than one roster class (e.g. two "Full Gallery" purchases in one
   checkout) get broken out here instead of one flat mixed list. */
.acct-class-group {
  margin: 4px 0;
  border: 1px solid var(--border, #ececec);
  border-radius: 6px;
  overflow: hidden;
}
.acct-class-summary {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
  background: var(--bg-subtle, #fafafa);
  list-style: none;
}
.acct-class-summary::-webkit-details-marker { display: none; }
.acct-class-summary::before {
  content: '▸'; font-size: 10px; color: var(--muted, #888);
  transition: transform .15s;
}
.acct-class-group[open] > .acct-class-summary::before { transform: rotate(90deg); }
.acct-class-label {
  font-size: 12px; font-weight: 600; color: #333;
}
.acct-class-count {
  font-weight: 400; color: var(--muted, #888);
}
.acct-class-group .acct-group-dl-all { margin-left: auto; }
.acct-class-group .acct-order-item { padding: 10px 12px; }

/* ── Settings ── */
.acct-settings-card { display: flex; flex-direction: column; gap: 24px; }
.acct-settings-group { display: flex; flex-direction: column; gap: 8px; }
.acct-settings-group .acct-label { margin-bottom: 0; }

/* Right-align standalone action links / buttons */
#settings-addr-btn { margin-left: auto; }
#acct-logout-top-btn { margin-left: auto; }

/* Right-align ← Back links and secondary actions in the login card */
.acct-card .acct-link,
.acct-card button.acct-link { display: block; text-align: right; width: 100%; }

@media (max-width: 700px) {
  .acct-gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .acct-order-row { flex-direction: column; align-items: flex-start; }
  .acct-main { padding: 28px 16px 60px; }
  .acct-section-head { flex-direction: column; align-items: flex-start; gap: 10px; }
}
@media (prefers-color-scheme: dark) {
  .acct-card { background: #1c1c1e; border-color: rgba(255,255,255,.1); }
  .acct-gallery-card { border-color: rgba(255,255,255,.08); }
  .acct-order-row { background: rgba(255,255,255,.05); }
  .acct-gallery-cover { background: #2c2c2e; }
}

/* ── Selections tab ── */
.sel-section {
  border-bottom: 1px solid #f0f0f0;
  margin: 0;
  padding: 0 0 20px;
  margin-bottom: 20px;
}
.sel-section:last-child { border-bottom: none; margin-bottom: 0; }
.sel-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 0 10px;
}
.sel-section-title { font-size: 15px; font-weight: 600; color: #1a1a1a; }
.sel-section-status { font-size: 12px; font-weight: 500; color: #bbb; flex-shrink: 0; }
.sel-status-done { color: #b08a00; }
.sel-status-partial { color: #888; }

/* Gold progress bar */
.sel-progress-track {
  height: 3px;
  background: #f0eeea;
  margin: 0 0 0;
}
.sel-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #d4a017 0%, #f0c940 100%);
  border-radius: 0 2px 2px 0;
  transition: width .5s ease;
  min-width: 0;
}

/* Two-column body — proofs get the width, shelf is compact */
.sel-body {
  display: grid;
  grid-template-columns: 1fr 155px;
  gap: 0;
  border: 1px solid #f0f0f0;
  border-radius: 10px;
  overflow: hidden;
  margin-top: 12px;
}

/* LEFT: source thumbnail grid */
.sel-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 14px 14px 16px;
  align-content: flex-start;
}
.sel-thumb {
  display: block;
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 5px;
  overflow: hidden;
  background: #f5f5f5;
  flex-shrink: 0;
}
a.sel-thumb-done { cursor: pointer; }
.sel-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.sel-thumb-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #f0f0f0 25%, #e8e8e8 100%);
}
/* Gold dot on retouched thumbnails */
.sel-thumb-done::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 2px solid #d4a017;
  border-radius: 5px;
  pointer-events: none;
}
.sel-thumb-badge {
  position: absolute;
  bottom: 3px;
  right: 3px;
  background: #d4a017;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  padding: 2px 3px;
  border-radius: 3px;
}

/* RIGHT: download shelf */
.sel-shelf {
  border-left: 1px solid #f2f2f2;
  padding: 12px 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.sel-shelf-pending {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  text-align: center;
  color: #bbb;
  font-size: 12px;
  line-height: 1.5;
  gap: 8px;
}
.sel-shelf-pending-icon { font-size: 20px; opacity: .4; }
.sel-dl-all {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 2px 4px;
  font-size: 10px;
  font-weight: 600;
  color: #b08a00;
  background: #fdf8e8;
  border: 1px solid #e8d06a;
  border-radius: 7px;
  padding: 7px 8px;
  text-decoration: none;
  text-align: center;
  text-transform: uppercase;
  line-height: 1.3;
  letter-spacing: .06em;
  transition: background .15s;
}
/* The fixed 155px .sel-shelf column can't guarantee "Download all (N files)"
   fits on one line for every N — wrap the count onto its own line instead of
   letting nowrap text overflow the button's border on both sides. */
.sel-dl-all span { display: block; width: 100%; font-weight: 400; color: #c4a020; text-transform: none; letter-spacing: normal; }
.sel-dl-all:hover { background: #faf2c0; }
.sel-file-list { display: flex; flex-direction: column; gap: 1px; overflow-y: auto; max-height: 240px; }
.sel-file-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border-radius: 5px;
  text-decoration: none;
  color: #444;
  font-size: 11px;
  transition: background .1s;
}
.sel-file-row:hover { background: #fdf8e8; }
.sel-file-name {
  flex: 1;
  font-family: monospace;
  font-size: 10.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #555;
}
.sel-file-tick { color: #d4a017; font-size: 10px; flex-shrink: 0; }
.sel-file-hidden { display: none; }
.sel-file-caughtup {
  font-size: 11px;
  color: #bbb;
  text-align: center;
  padding: 6px 4px 2px;
}
.sel-show-more {
  background: none;
  border: none;
  color: #bbb;
  font-size: 11px;
  cursor: pointer;
  padding: 3px 6px;
  text-align: left;
}
.sel-show-more:hover { color: #888; }

@media (max-width: 540px) {
  .sel-body { grid-template-columns: 1fr; }
  .sel-shelf { border-left: none; border-top: 1px solid #f2f2f2; }
  .sel-thumb { width: 60px; height: 60px; }
}
@media (prefers-color-scheme: dark) {
  .sel-job { background: #1c1c1e; border-color: rgba(255,255,255,.1); }
  .sel-job-name { color: #f0f0f0; }
  .sel-body, .sel-shelf { border-color: rgba(255,255,255,.08); }
  .sel-progress-track { background: rgba(255,255,255,.08); }
  .sel-thumb { background: #2a2a2a; }
  .sel-file-row { color: #ccc; }
  .sel-file-row:hover { background: rgba(212,160,23,.12); }
  .sel-file-name { color: #aaa; }
  .sel-dl-all { background: rgba(212,160,23,.12); border-color: rgba(212,160,23,.3); }
  .sel-dl-all:hover { background: rgba(212,160,23,.2); }
  .sel-shelf-pending { color: rgba(255,255,255,.3); }
}
