:root {
  --ink: #172720;
  --forest: #12251f;
  --forest-2: #1e342c;
  --gold: #a96f1d;
  --gold-light: #d8ad63;
  --paper: #fbf9f5;
  --canvas: #f0ece4;
  --line: #d9d1c5;
  --muted: #66706b;
  --white: #fff;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
[hidden] { display: none !important; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--paper); color: var(--ink); }
button, input, select, textarea { font: inherit; }
.auth-pending > .topbar, .auth-pending > .workspace-shell { display: none; }
.owner-access { min-height: 100vh; place-items: center; padding: 24px; background: radial-gradient(circle at 15% 15%, #f7efe1, transparent 34%), var(--forest); }
.owner-access:not([hidden]) { display: grid; }
.owner-access-card { width: min(470px, 100%); padding: 42px 44px 36px; background: var(--paper); box-shadow: 0 30px 100px rgba(0,0,0,.35); }
.owner-access-card > img { width: 48px; height: 48px; margin-bottom: 27px; object-fit: contain; }
.owner-access-card h1 { margin: 15px 0; font-size: 36px; font-weight: 430; letter-spacing: -.04em; line-height: 1.06; }
.owner-access-card > p:not(.eyebrow):not(.form-error) { margin: 0 0 24px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.owner-access-card form { display: grid; gap: 14px; }
.owner-access-card label { display: grid; gap: 8px; color: #535d58; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.owner-access-card input { width: 100%; min-height: 44px; padding: 11px 12px; border: 1px solid var(--line); background: #fff; color: var(--ink); outline: 0; font-size: 13px; letter-spacing: 0; text-transform: none; }
.owner-access-card .button { width: 100%; margin-top: 3px; }
.password-reset-button { display: block; margin: 13px auto 0; border: 0; border-bottom: 1px solid var(--gold); background: transparent; color: var(--ink); cursor: pointer; font-size: 10px; }
.owner-access-card > small { display: block; margin-top: 18px; color: #8a918e; font-size: 9px; line-height: 1.5; text-align: center; }
.owner-email { color: var(--muted); font-size: 10px; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

.topbar, .collection-topbar { height: 76px; display: flex; align-items: center; justify-content: space-between; padding: 0 28px; border-bottom: 1px solid var(--line); background: rgba(251,249,245,.96); position: sticky; top: 0; z-index: 30; backdrop-filter: blur(14px); }
.topbar-brand-group { display: flex; align-items: center; gap: 15px; }
.sidebar-toggle { display: inline-flex; min-height: 36px; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; font-size: 9px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.sidebar-toggle > span:first-child { color: var(--gold); font-size: 17px; font-weight: 400; line-height: 1; }
.sidebar-toggle:hover { border-color: #b8a98e; color: var(--ink); }
.sidebar-toggle:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand img { width: 38px; height: 38px; object-fit: contain; }
.brand span { display: grid; line-height: 1; }
.brand strong { font-size: 18px; font-weight: 650; letter-spacing: .02em; }
.brand small { margin-top: 6px; color: var(--muted); font-size: 9px; letter-spacing: .16em; text-transform: uppercase; }
.topbar-actions { display: flex; align-items: center; gap: 22px; }
.prototype-badge { padding: 7px 10px; border: 1px solid #d5c7ae; color: #77501a; background: #f7efdf; font-size: 10px; font-weight: 650; letter-spacing: .11em; text-transform: uppercase; }
.text-button { border: 0; background: transparent; padding: 7px 0; color: var(--ink); font-size: 12px; font-weight: 650; letter-spacing: .045em; text-transform: uppercase; cursor: pointer; }
.text-button span { color: var(--gold); margin-left: 5px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--forest); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .05em; }

.workspace-shell { display: grid; grid-template-columns: 242px minmax(0, 1fr); min-height: calc(100vh - 76px); transition: grid-template-columns .22s ease; }
.sidebar { display: flex; min-width: 0; flex-direction: column; padding: 34px 20px 22px; overflow: hidden; border-right: 1px solid var(--line); background: #f7f4ee; opacity: 1; transition: padding .22s ease, opacity .15s ease, border-color .22s ease; }
.sidebar-collapsed .workspace-shell { grid-template-columns: 0 minmax(0, 1fr); }
.sidebar-collapsed .sidebar { padding-right: 0; padding-left: 0; border-right-color: transparent; opacity: 0; pointer-events: none; visibility: hidden; }
.nav-label { margin: 0 0 12px 12px; color: #8a8175; font-size: 9px; font-weight: 700; letter-spacing: .17em; text-transform: uppercase; }
.nav-item { display: grid; grid-template-columns: 26px 1fr auto; align-items: center; min-height: 43px; padding: 0 12px; color: #5e6762; font-size: 13px; border-left: 2px solid transparent; }
.nav-item b { font-size: 10px; font-weight: 550; color: #8a918e; }
.nav-item.active { color: var(--ink); background: #eae5dc; border-left-color: var(--gold); font-weight: 650; }
.nav-icon { color: var(--gold); font-size: 17px; }
.sidebar-collections { margin-top: 34px; padding-top: 26px; border-top: 1px solid var(--line); }
.sidebar-heading { display: flex; align-items: center; justify-content: space-between; }
.sidebar-heading button { border: 0; background: transparent; font-size: 20px; color: var(--gold); cursor: pointer; }
#sidebar-collection-list { display: grid; }
#sidebar-collection-list > a { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; align-items: center; gap: 8px; min-height: 38px; padding: 8px 12px; color: #66706b; font-size: 12px; line-height: 1.25; }
#sidebar-collection-list > a:hover { background: #eee9e1; color: var(--ink); }
#sidebar-collection-list > a .collection-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#sidebar-collection-list > a .collection-count { color: #8a918e; font-size: 10px; font-variant-numeric: tabular-nums; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: #8a9b91; }
.dot.private { background: var(--gold); }
.privacy-note { margin-top: auto; display: grid; grid-template-columns: 24px 1fr; gap: 8px; padding: 15px 13px; border: 1px solid #d7cdbd; background: #fbf8f1; }
.privacy-note > span { color: var(--gold); }
.privacy-note strong { font-size: 11px; }
.privacy-note p { margin: 6px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }

.workspace-main { min-width: 0; padding: 30px 4vw 70px; background: var(--paper); }
.workspace-intro { display: flex; justify-content: space-between; gap: 40px; align-items: end; }
.eyebrow { margin: 0; color: var(--gold); font-size: 10px; font-weight: 700; letter-spacing: .19em; text-transform: uppercase; }
.workspace-intro h1 { margin: 10px 0 7px; font-size: clamp(32px, 3.2vw, 48px); font-weight: 430; letter-spacing: -.04em; }
.workspace-intro > div:first-child > p:last-child { max-width: 670px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.intro-actions { display: flex; gap: 10px; flex-shrink: 0; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; border: 1px solid var(--forest); font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; cursor: pointer; }
.button.primary { background: var(--forest); color: #fff; }
.button.primary:hover { background: var(--forest-2); }
.button.secondary { background: transparent; color: var(--ink); border-color: #bdb5a9; }
.button.danger { border-color: #7b2f27; background: #7b2f27; color: #fff; }
.button.archive-button { margin-right: auto; border-color: #b5884d; background: transparent; color: #7a541f; }
.button.small { min-height: 38px; padding: 0 15px; font-size: 10px; }

.summary-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 26px; border: 1px solid var(--line); }
.summary-row article { min-height: 88px; padding: 14px 18px; border-right: 1px solid var(--line); }
.summary-row article:last-child { border-right: 0; }
.summary-row span { display: block; color: var(--muted); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.summary-row strong { display: block; margin: 6px 0 3px; font-size: 23px; font-weight: 500; }
.summary-row small { color: #8a918e; font-size: 10px; }
.summary-row .storage-card { background: var(--forest); }
.storage-card span, .storage-card small { color: #aeb9b3; }
.storage-card strong { color: var(--gold-light); font-size: 21px; }

.library-panel { margin-top: 34px; }
.collections-panel, .shared-panel { margin-top: 34px; }
.collections-meta { display: flex; align-items: center; justify-content: space-between; min-height: 64px; border-bottom: 1px solid var(--line); }
.collections-meta p { display: grid; gap: 5px; margin: 0; }
.collections-meta strong { font-size: 14px; }
.collections-meta span { color: var(--muted); font-size: 10px; }
.collections-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; padding-top: 22px; }
.collection-card { display: flex; min-height: 270px; flex-direction: column; border: 1px solid var(--line); background: #fbfaf7; cursor: pointer; transition: border-color .18s, box-shadow .18s, transform .18s; }
.collection-card:hover { border-color: #c9b68f; box-shadow: 0 10px 28px rgba(35,43,39,.08); transform: translateY(-2px); }
.collection-card:focus { outline: none; }
.collection-card.collection-focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(176,122,43,.16); }
.collection-card-preview { display: grid; grid-template-columns: repeat(3, 1fr); height: 112px; overflow: hidden; background: #ede8df; }
.collection-card-preview img { width: 100%; height: 112px; border-right: 1px solid rgba(255,255,255,.75); object-fit: cover; }
.collection-card-preview .collection-placeholder { grid-column: 1 / -1; display: grid; place-items: center; color: #8b8173; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.collection-card-copy { display: flex; flex: 1; flex-direction: column; padding: 18px; }
.collection-card-copy > p { margin: 0; color: var(--gold); font-size: 8px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.collection-card-copy h3 { margin: 9px 0 13px; font-size: 19px; font-weight: 520; }
.collection-card-details { display: grid; gap: 7px; margin-bottom: 18px; color: var(--muted); font-size: 10px; }
.collection-card-details span { display: flex; justify-content: space-between; gap: 12px; }
.collection-card-details strong { color: var(--ink); font-weight: 550; }
.collection-card-actions { display: flex; gap: 14px; margin-top: auto; padding-top: 13px; border-top: 1px solid var(--line); }
.collection-card-actions a, .collection-card-actions button { position: relative; z-index: 1; padding: 0; border: 0; background: transparent; color: var(--ink); cursor: pointer; font-size: 9px; font-weight: 700; letter-spacing: .06em; text-decoration: none; text-transform: uppercase; }
.collection-card-actions a { color: #8a5c20; }
.shared-links-grid { display: grid; gap: 14px; padding-top: 22px; }
.shared-link-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 25px; align-items: center; padding: 20px 22px; border: 1px solid var(--line); background: #fbfaf7; }
.shared-link-card.inactive { opacity: .68; }
.shared-link-copy > p { margin: 0 0 7px; color: var(--gold); font-size: 8px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.shared-link-copy h3 { margin: 0 0 11px; font-size: 19px; font-weight: 520; }
.shared-link-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--muted); font-size: 10px; }
.shared-link-meta strong { color: var(--ink); font-weight: 560; }
.shared-link-status { display: inline-flex; align-items: center; gap: 6px; }
.shared-link-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #4f785f; }
.shared-link-card.inactive .shared-link-status::before { background: #99938a; }
.shared-link-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.shared-link-actions button, .shared-link-actions a { display: inline-flex; min-height: 36px; align-items: center; padding: 0 12px; border: 1px solid #bdb5a9; background: transparent; color: var(--ink); cursor: pointer; font-size: 9px; font-weight: 700; letter-spacing: .06em; text-decoration: none; text-transform: uppercase; }
.shared-link-actions .copy-share-link { border-color: var(--forest); background: var(--forest); color: #fff; }
.library-toolbar { display: grid; grid-template-columns: minmax(230px, 1fr) auto auto; gap: 18px; align-items: center; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.search-wrap { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 13px; background: #fff; border: 1px solid var(--line); }
.search-wrap span { color: var(--gold); font-size: 20px; }
.search-wrap input { width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 12px; }
.filter-row { display: flex; gap: 3px; overflow-x: auto; }
.filter { min-height: 34px; padding: 0 11px; border: 0; background: transparent; color: var(--muted); font-size: 11px; cursor: pointer; white-space: nowrap; }
.filter.active { background: #e8e1d5; color: var(--ink); font-weight: 650; }
.filter.manage-design-types { margin-left: 5px; border-left: 1px solid var(--line); color: #8a5c20; font-weight: 650; }
.sort-button { min-height: 36px; padding: 0 12px; border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 11px; }
.library-meta { display: flex; justify-content: space-between; align-items: center; min-height: 64px; }
.library-meta p { display: flex; gap: 15px; margin: 0; align-items: baseline; }
.library-meta strong { font-size: 13px; }
.library-meta span { color: #8a918e; font-size: 11px; }
.library-meta.collection-add-mode { min-height: 58px; margin: 10px 0 18px; padding: 0 14px; border: 1px solid #d7c5a5; background: #f8f0e2; }
.library-meta.collection-add-mode p { align-items: center; }
.library-meta.collection-add-mode span { color: #6f572e; font-weight: 600; }
.selection-controls { display: flex; align-items: center; gap: 12px; }
.selection-action { border: 0; border-bottom: 1px solid var(--gold); padding: 7px 0; background: transparent; color: var(--ink); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; }
.selection-action:disabled { opacity: .35; cursor: default; border-color: transparent; }
.collection-add-mode .selection-action:not(:disabled) { min-height: 36px; padding: 0 13px; border: 1px solid var(--forest); background: var(--forest); color: #fff; }
.selection-cancel { padding: 6px 0; border: 0; border-bottom: 1px solid #aa9c87; background: transparent; color: var(--muted); cursor: pointer; font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }

.design-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 22px; }
.design-card { min-width: 0; border: 1px solid rgba(23,39,32,.11); background: rgba(255,255,255,.72); cursor: pointer; transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease; }
.design-card:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(23,39,32,.07); }
.design-card.selected { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.design-card:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.design-card figure { position: relative; aspect-ratio: 1.08; margin: 0; overflow: hidden; border-bottom: 1px solid rgba(23,39,32,.08); background: #f5f2ec; }
.design-card figure img { width: 100%; height: 100%; padding: 8px; object-fit: contain; cursor: zoom-in; transition: transform .35s ease; }
.design-card figure img:focus-visible { outline: 3px solid var(--gold); outline-offset: -3px; }
.design-card:hover figure img { transform: scale(1.025); }
.status { position: absolute; top: 12px; left: 12px; padding: 6px 8px; background: rgba(251,249,245,.91); color: var(--ink); font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; backdrop-filter: blur(5px); }
.status.private { color: #7c5014; }
.select-control { position: absolute; right: 12px; top: 12px; width: 30px; height: 30px; border: 1px solid rgba(255,255,255,.8); border-radius: 50%; background: rgba(18,37,31,.84); color: #fff; cursor: pointer; }
.image-count { position: absolute; left: 12px; bottom: 12px; padding: 6px 8px; background: rgba(18,37,31,.82); color: #fff; font-size: 9px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.design-card > div { padding: 12px 14px 14px; }
.design-card > div p { margin: 0 0 7px; color: var(--gold); font-size: 8px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.design-card h3 { margin: 0 0 6px; font-size: 15px; font-weight: 550; }
.design-card > div .design-brand { margin: -1px 0 7px; color: var(--ink); font-size: 9px; font-weight: 650; letter-spacing: .02em; line-height: 1.35; text-transform: none; }
.design-card small { color: var(--muted); font-size: 11px; }
.design-specs { display: grid; gap: 4px; margin-top: 2px; }
.design-specs span { color: var(--muted); font-size: 10px; line-height: 1.45; }
.design-specs .client-price { color: var(--ink); font-weight: 700; }
.design-description {
  display: -webkit-box;
  margin-top: 10px;
  overflow: hidden;
  color: #66706b;
  font-size: 11px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.stl-link { display: inline-flex; gap: 6px; margin-top: 12px; padding-bottom: 3px; border-bottom: 1px solid var(--gold); color: var(--ink); font-size: 9px; font-weight: 700; letter-spacing: .08em; text-decoration: none; text-transform: uppercase; }
.stl-link span { color: var(--gold); }
.edit-details {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding: 9px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .1em;
  text-align: left;
  text-transform: uppercase;
}
.edit-details span { color: var(--gold); }
.design-card .design-specs,
.design-card .design-description,
.design-card .stl-link { display: none; }
.archive-actions { display: flex; gap: 8px; margin-top: 16px; }
.archive-actions button { min-height: 36px; padding: 0 11px; border: 1px solid #bdb5a9; background: transparent; color: var(--ink); cursor: pointer; font-size: 9px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.archive-actions .delete-permanently { border-color: #c8aaa5; color: #7b2f27; }
.archive-empty { grid-column: 1 / -1; padding: 70px 25px; border: 1px solid var(--line); background: #fbfaf7; text-align: center; }
.archive-empty h3 { margin: 0 0 9px; font-size: 23px; font-weight: 500; }
.archive-empty p { margin: 0; color: var(--muted); font-size: 12px; }
.archived-collections { margin-top: 42px; padding-top: 28px; border-top: 1px solid var(--line); }
.archive-section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.archive-section-heading h2 { margin: 7px 0 0; font-size: 25px; font-weight: 500; }
.archive-section-heading > span { color: var(--muted); font-size: 10px; }
.archived-collections-grid { display: grid; gap: 12px; }
.archived-collection-card { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 20px; border: 1px solid var(--line); background: #fbfaf7; }
.archived-collection-card p { margin: 0 0 5px; color: var(--gold); font-size: 8px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.archived-collection-card h3 { margin: 0; font-size: 17px; font-weight: 530; }
.archived-collection-actions { display: flex; gap: 8px; }
.archived-collection-actions button { min-height: 36px; padding: 0 11px; border: 1px solid #bdb5a9; background: transparent; color: var(--ink); cursor: pointer; font-size: 9px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.archived-collection-actions .delete-permanently { border-color: #c8aaa5; color: #7b2f27; }

.design-type-dialog { width: min(620px, calc(100vw - 30px)); }
.design-type-manager { padding: 23px 30px 8px; }
.design-type-manager > p { margin: 0 0 20px; color: var(--muted); font-size: 11px; line-height: 1.65; }
.design-type-entry { display: grid; gap: 8px; }
.design-type-entry > label { color: #535d58; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.design-type-entry > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.design-type-entry input { min-height: 44px; padding: 11px 12px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-size: 13px; outline: 0; }
.design-type-entry input:focus { border-color: var(--gold); }
.design-type-list { display: grid; gap: 7px; margin-top: 22px; }
.design-type-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; min-height: 42px; padding: 7px 10px 7px 13px; border: 1px solid var(--line); background: #fff; }
.design-type-row strong { overflow: hidden; font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.design-type-row span { color: var(--muted); font-size: 8px; letter-spacing: .08em; text-transform: uppercase; }
.design-type-row button { border: 0; background: transparent; color: #7b2f27; cursor: pointer; font-size: 9px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }

.collection-details-modal { width: min(780px, calc(100vw - 30px)); }
.collection-owner-summary { display: grid; gap: 12px; padding: 22px 30px; border-bottom: 1px solid var(--line); background: #f7f3eb; }
.collection-owner-summary > p { margin: 0; color: var(--gold); font-size: 9px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.collection-owner-summary > div { display: flex; flex-wrap: wrap; gap: 10px 24px; color: var(--muted); font-size: 11px; }
.collection-owner-summary strong { color: var(--ink); font-weight: 600; }
.collection-owner-designs { padding: 23px 30px 8px; }
.collection-owner-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.collection-owner-heading h3 { margin: 0; font-size: 16px; font-weight: 600; }
.collection-owner-heading span { color: var(--muted); font-size: 10px; }
#collection-details-designs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.collection-owner-design { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--line); background: #fff; }
.collection-owner-design img { width: 72px; height: 58px; object-fit: cover; }
.collection-owner-design div { min-width: 0; }
.collection-owner-design strong, .collection-owner-design span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.collection-owner-design strong { font-size: 12px; font-weight: 600; }
.collection-owner-design span { margin-top: 5px; color: var(--muted); font-size: 9px; }
.collection-owner-empty { grid-column: 1 / -1; padding: 32px 20px; border: 1px solid var(--line); color: var(--muted); font-size: 11px; text-align: center; }

.modal { width: min(680px, calc(100vw - 30px)); max-height: calc(100vh - 30px); padding: 0; border: 0; background: var(--paper); box-shadow: 0 30px 90px rgba(10,22,18,.28); }
.modal::backdrop { background: rgba(10,22,18,.62); backdrop-filter: blur(4px); }
.capture-editor { width: min(1000px, calc(100vw - 30px)); }
.capture-editor-body { padding: 20px 30px 5px; }
.capture-editor-body > p { margin: 0 0 14px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.capture-canvas-wrap { display: grid; min-height: 260px; place-items: center; overflow: auto; background: #101814; }
.capture-canvas-wrap canvas { display: block; width: auto; max-width: 100%; height: auto; max-height: 58vh; cursor: crosshair; touch-action: none; }
.capture-tools { display: flex; flex-wrap: wrap; gap: 9px; padding: 14px 0 4px; }
.capture-tools .button { min-height: 34px; padding: 0 12px; }
.image-lightbox { width: min(1180px, calc(100vw - 30px)); max-width: none; max-height: calc(100vh - 30px); padding: 0; border: 0; overflow: visible; background: transparent; color: #fff; }
.image-lightbox::backdrop { background: rgba(5,12,9,.92); backdrop-filter: blur(8px); }
.lightbox-stage { display: grid; grid-template-columns: 48px minmax(0, 1fr) 48px; align-items: center; gap: 14px; }
.lightbox-stage figure { display: grid; grid-column: 2; width: 100%; justify-items: center; margin: 0; }
.lightbox-nav.previous { grid-column: 1; grid-row: 1; }
.lightbox-nav.next { grid-column: 3; grid-row: 1; }
.lightbox-stage img { display: block; max-width: 100%; max-height: 82vh; object-fit: contain; box-shadow: 0 22px 70px rgba(0,0,0,.42); }
.lightbox-stage figcaption { display: flex; width: min(760px, 100%); justify-content: space-between; gap: 20px; margin-top: 13px; color: rgba(255,255,255,.86); font-size: 11px; }
.lightbox-stage figcaption strong { font-weight: 600; }
.lightbox-stage figcaption span { color: rgba(255,255,255,.6); }
.lightbox-close, .lightbox-nav { border: 1px solid rgba(255,255,255,.45); border-radius: 50%; background: rgba(10,23,18,.72); color: #fff; cursor: pointer; }
.lightbox-close { position: fixed; top: 20px; right: 22px; z-index: 2; width: 44px; height: 44px; font-size: 26px; font-weight: 300; }
.lightbox-nav { width: 46px; height: 46px; font-size: 31px; line-height: 1; }
.lightbox-nav:hover, .lightbox-close:hover { border-color: var(--gold); color: #efbd70; }
.modal form > header { display: flex; justify-content: space-between; align-items: flex-start; padding: 26px 30px 20px; border-bottom: 1px solid var(--line); }
.modal h2 { margin: 9px 0 0; font-size: 29px; font-weight: 470; }
.edit-summary { display: grid; grid-template-columns: 88px 1fr; gap: 16px; align-items: center; padding: 18px 30px 0; }
.edit-summary img { width: 88px; height: 66px; border: 1px solid var(--line); object-fit: cover; }
.edit-summary div { display: grid; gap: 6px; }
.edit-summary span { color: var(--gold); font-size: 9px; letter-spacing: .12em; text-transform: uppercase; }
.edit-summary strong { font-size: 15px; font-weight: 550; }
.edit-photo-section { margin-top: 18px; padding: 18px 30px 0; border-top: 1px solid var(--line); }
.edit-photo-section > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.edit-photo-section p { margin: 0; color: #535d58; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.edit-photo-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.add-photo-button { display: inline-flex; align-items: center; min-height: 34px; padding: 0 12px; border: 1px solid #bdb5a9; background: transparent; color: var(--ink); cursor: pointer; font: inherit; font-size: 9px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.add-photo-button input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.edit-photo-section > small { display: block; margin-top: 9px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.edit-gallery { display: flex; gap: 10px; margin-top: 13px; padding-bottom: 3px; overflow-x: auto; }
.edit-gallery figure, .upload-preview figure { position: relative; flex: 0 0 92px; width: 92px; margin: 0; }
.edit-gallery img, .upload-preview img { display: block; width: 92px; height: 70px; border: 1px solid var(--line); object-fit: cover; }
.edit-gallery figcaption, .upload-preview figcaption { margin-top: 5px; overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.edit-gallery figure:first-child img { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.edit-gallery figure:first-child::after { content: "Cover"; position: absolute; top: 5px; left: 5px; padding: 3px 5px; background: rgba(251,249,245,.92); color: var(--gold); font-size: 7px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.remove-photo { position: absolute; top: 4px; right: 4px; z-index: 1; width: 22px; height: 22px; border: 0; border-radius: 50%; background: rgba(18,37,31,.85); color: #fff; cursor: pointer; line-height: 1; }
.close-button { border: 0; background: transparent; font-size: 27px; font-weight: 300; cursor: pointer; }
.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 165px; margin: 25px 30px 18px; border: 1px dashed #b8aa92; background: #f6f1e8; text-align: center; cursor: pointer; }
.dropzone > span { color: var(--gold); font-size: 28px; }
.dropzone strong { margin-top: 7px; font-size: 13px; }
.dropzone small { margin-top: 7px; color: var(--muted); font-size: 10px; }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.capture-actions { display: flex; align-items: center; gap: 14px; margin: -5px 30px 18px; }
.capture-actions .button { min-height: 36px; padding: 0 14px; }
.capture-actions > span { color: var(--muted); font-size: 10px; }
.capture-actions kbd { padding: 2px 5px; border: 1px solid var(--line); background: #fff; color: var(--ink); font: inherit; box-shadow: 0 1px 0 #cfc8bc; }
.upload-preview { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 30px; }
.upload-preview > span { display: flex; gap: 7px; align-items: center; padding: 7px 10px; border: 1px solid var(--line); background: #fff; color: var(--gold); }
.upload-preview > span small { max-width: 160px; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; padding: 22px 30px; }
.form-grid label, .client-notes label, .access-card label { display: grid; gap: 8px; color: #535d58; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid label > small { color: #8a918e; font-size: 9px; font-weight: 400; letter-spacing: 0; line-height: 1.45; text-transform: none; }
.form-section-heading { margin: 5px 0 -2px; padding-top: 15px; border-top: 1px solid var(--line); color: var(--gold); font-size: 9px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.form-section-heading.private { color: #55625c; }
.form-grid input[type="text"], .form-grid input[type="url"], .form-grid select, .form-grid textarea, .client-notes input, .client-notes textarea, .access-card input { width: 100%; min-height: 44px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 0; background: #fff; color: var(--ink); outline: 0; font-size: 13px; letter-spacing: 0; text-transform: none; }
.form-grid textarea, .client-notes textarea { min-height: 86px; resize: vertical; }
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus, .access-card input:focus { border-color: var(--gold); }
.toggle-row { display: flex !important; grid-template-columns: auto 1fr; align-items: start; gap: 11px !important; padding: 14px; background: #f3eee6; cursor: pointer; }
.toggle-row input { margin-top: 2px; accent-color: var(--forest); }
.toggle-row span { display: grid; gap: 4px; }
.toggle-row strong { color: var(--ink); font-size: 12px; letter-spacing: 0; text-transform: none; }
.toggle-row small { color: var(--muted); font-size: 10px; font-weight: 400; letter-spacing: 0; line-height: 1.5; text-transform: none; }
.security-callout { display: grid; grid-template-columns: 26px 1fr; gap: 8px; margin: 0 30px; padding: 14px; border-left: 2px solid var(--gold); background: #f7efe0; color: var(--gold); }
.security-callout p { display: grid; gap: 4px; margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.security-callout strong { color: var(--ink); font-size: 11px; }
.modal footer { display: flex; justify-content: flex-end; gap: 10px; padding: 19px 30px 26px; border-top: 1px solid var(--line); }
.edit-footer { align-items: center; justify-content: space-between; }
.edit-footer > div { display: flex; gap: 10px; }
.confirm-dialog { width: min(500px, calc(100vw - 24px)); }
.confirm-copy { padding: 25px 30px 8px; }
.confirm-copy p { margin: 0 0 13px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.confirm-copy strong { color: var(--ink); }
.toast { position: fixed; left: 50%; bottom: 25px; z-index: 100; transform: translate(-50%, 20px); padding: 12px 18px; background: var(--forest); color: #fff; font-size: 11px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Shared collection */
.collection-page { background: var(--canvas); }
.collection-topbar { position: relative; height: 82px; }
.collection-topbar > p { margin: 0; color: var(--muted); font-size: 11px; }
.collection-main { max-width: 1440px; margin: 0 auto; background: var(--paper); }
.collection-intro { padding: 42px 4vw 38px; border-bottom: 1px solid var(--line); }
.collection-intro h1 { margin: 13px 0 0; font-size: clamp(38px, 4.2vw, 60px); font-weight: 400; letter-spacing: -.045em; line-height: 1; }
.collection-intro h1 em { color: var(--gold); font-family: Georgia, serif; font-weight: 400; }
.collection-intro > div > p:last-child { max-width: 670px; margin: 14px 0 0; color: var(--muted); font-size: 14px; line-height: 1.7; }
.client-toolbar { display: flex; justify-content: space-between; align-items: center; padding: 24px 4vw; border-bottom: 1px solid var(--line); }
.client-toolbar p { display: flex; gap: 14px; align-items: baseline; margin: 0; }
.client-toolbar p strong { font-size: 13px; }
.client-toolbar p span { color: var(--muted); font-size: 11px; }
.client-toolbar > div { display: flex; align-items: center; gap: 22px; }
.client-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 45px 4vw 75px; gap: 34px; }
.client-card { overflow: hidden; border: 1px solid rgba(23,39,32,.11); background: rgba(255,255,255,.65); }
.client-card figure { position: relative; aspect-ratio: 1.12; margin: 0; overflow: hidden; border-bottom: 1px solid rgba(23,39,32,.08); background: #f5f2ec; }
.client-card figure img { width: 100%; height: 100%; padding: 10px; object-fit: contain; }
.client-card figure > span { position: absolute; top: 18px; left: 18px; color: #fff; font-size: 11px; text-shadow: 0 1px 8px rgba(0,0,0,.4); }
.client-card figure > button { position: absolute; top: 14px; right: 15px; width: 40px; height: 40px; border: 1px solid rgba(255,255,255,.75); border-radius: 50%; background: rgba(18,37,31,.73); color: #fff; font-size: 20px; cursor: pointer; }
.client-card figure > button.saved { color: #e4b665; }
.client-card figure > i { position: absolute; right: 17px; bottom: 13px; color: rgba(255,255,255,.75); font-size: 8px; font-style: normal; letter-spacing: .15em; }
.client-card > div { padding: 18px 19px 22px; }
.client-card > div .customer-brand { margin: 0 0 8px; color: var(--gold); font-size: 9px; font-weight: 700; letter-spacing: .1em; line-height: 1.4; text-transform: uppercase; }
.client-card h2 { margin: 0; font-size: 23px; font-weight: 480; }
.client-card p { margin: 9px 0 17px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.client-card .customer-price { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin: 13px 0 5px; padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.customer-price span { color: var(--gold); font-size: 8px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.customer-price strong { color: var(--ink); font-size: 14px; font-weight: 600; }
.client-card > div button { padding: 0 0 5px; border: 0; border-bottom: 1px solid var(--gold); background: transparent; font-size: 10px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; cursor: pointer; }
.client-notes { display: grid; grid-template-columns: 1fr 1fr; gap: 8vw; padding: 75px 6vw 86px; background: var(--forest); color: #fff; }
.client-notes h2 { margin: 20px 0; font-size: clamp(38px, 4vw, 58px); font-weight: 400; letter-spacing: -.04em; }
.client-notes > div > p:last-child { color: #b2bdb7; font-size: 14px; line-height: 1.8; }
.client-notes form { display: grid; gap: 15px; }
.client-notes label { color: #b2bdb7; }
.client-notes input, .client-notes textarea { border-color: #42534c; background: #1b3129; color: #fff; }
.client-notes .button { justify-self: start; background: #d4a95e; border-color: #d4a95e; color: var(--forest); }

.locked { overflow: hidden; }
.locked .collection-topbar, .locked .collection-main { filter: blur(10px); user-select: none; pointer-events: none; }
.access-gate { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(16,31,26,.77); backdrop-filter: blur(6px); }
.access-gate[hidden] { display: none; }
.access-card { width: min(470px, 100%); padding: 42px 44px 36px; background: var(--paper); box-shadow: 0 30px 100px rgba(0,0,0,.35); }
.access-card > img { width: 48px; height: 48px; object-fit: contain; margin-bottom: 29px; }
.access-card h1 { margin: 15px 0; font-size: 38px; font-weight: 430; letter-spacing: -.04em; }
.access-card > p:not(.eyebrow) { margin: 0 0 25px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.access-card form { display: grid; gap: 12px; }
.access-card input { margin-top: 3px; }
.access-card .button { width: 100%; }
.form-error { min-height: 16px; margin: -3px 0 0; color: #a23f32; font-size: 10px; }
.demo-code { display: block; width: 100%; margin-top: 15px; padding: 10px; border: 1px solid #d9cfbf; background: #f6f0e6; color: var(--muted); font-size: 10px; cursor: pointer; }
.demo-code strong { color: var(--gold); }
.access-card > small { display: block; margin-top: 18px; color: #8a918e; font-size: 9px; line-height: 1.5; text-align: center; }

@media (max-width: 1100px) {
  .workspace-shell { grid-template-columns: 205px minmax(0, 1fr); }
  .design-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .collections-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .library-toolbar { grid-template-columns: 1fr auto; }
  .filter-row { grid-column: 1 / -1; grid-row: 2; }
  .sort-button { grid-column: 2; grid-row: 1; }
}

@media (max-width: 780px) {
  .topbar, .collection-topbar { height: 68px; padding: 0 17px; }
  .topbar-actions .prototype-badge, .topbar-actions .text-button { display: none; }
  .workspace-shell { display: block; }
  .sidebar-collapsed .sidebar { display: none; }
  .sidebar { display: block; padding: 10px 13px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .sidebar nav { display: flex; min-width: 600px; }
  .sidebar .nav-label, .sidebar-collections, .privacy-note { display: none; }
  .nav-item { min-width: 145px; border-left: 0; border-bottom: 2px solid transparent; }
  .nav-item.active { border-left: 0; border-bottom-color: var(--gold); }
  .workspace-main { padding: 26px 20px 60px; }
  .workspace-intro { display: grid; align-items: start; }
  .summary-row { grid-template-columns: repeat(2, 1fr); }
  .summary-row article:nth-child(2) { border-right: 0; }
  .summary-row article:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .design-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .design-card > div { padding: 11px 12px 13px; }
  .design-card h3 { font-size: 14px; }
  .collection-topbar > p { display: none; }
  .collection-intro { padding: 36px 25px 32px; }
  .client-toolbar { align-items: flex-start; gap: 20px; }
  .client-toolbar > div { align-items: flex-end; flex-direction: column; gap: 10px; }
  .client-grid { padding: 30px 20px 55px; gap: 18px; }
  .client-notes { grid-template-columns: 1fr; padding: 58px 25px 65px; }
}

@media (max-width: 520px) {
  .sidebar-toggle { width: 36px; padding: 0; justify-content: center; }
  #sidebar-toggle-label { display: none; }
  .brand img { width: 33px; height: 33px; }
  .brand small { font-size: 8px; }
  .workspace-intro h1 { font-size: 34px; }
  .intro-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .summary-row article { min-height: 78px; padding: 13px; }
  .library-toolbar { grid-template-columns: 1fr; }
  .sort-button { grid-column: 1; grid-row: 3; justify-self: start; }
  .filter-row { padding-bottom: 4px; }
  .library-meta span { display: none; }
  .library-meta.collection-add-mode { align-items: flex-start; flex-direction: column; gap: 10px; padding: 12px; }
  .library-meta.collection-add-mode span { display: inline; }
  .selection-controls { width: 100%; justify-content: space-between; }
  .design-grid { grid-template-columns: 1fr; }
  .collections-meta { align-items: flex-start; flex-direction: column; gap: 14px; padding-bottom: 16px; }
  .collections-grid { grid-template-columns: 1fr; }
  .shared-link-card { grid-template-columns: 1fr; }
  .shared-link-actions { justify-content: flex-start; }
  .archived-collection-card { align-items: flex-start; flex-direction: column; }
  #collection-details-designs { grid-template-columns: 1fr; }
  .collection-details-modal footer { align-items: stretch; flex-direction: column; }
  .design-type-entry > div { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; padding: 18px; }
  .form-grid .full { grid-column: auto; }
  .dropzone { margin: 18px; }
  .capture-actions { align-items: stretch; flex-direction: column; gap: 9px; margin: -2px 18px 18px; }
  .capture-editor-body { padding: 16px 18px 4px; }
  .capture-canvas-wrap { min-height: 180px; }
  .capture-tools { display: grid; grid-template-columns: 1fr 1fr; }
  .lightbox-stage { grid-template-columns: 36px minmax(0, 1fr) 36px; gap: 5px; }
  .lightbox-nav { width: 34px; height: 34px; font-size: 24px; }
  .lightbox-close { top: 12px; right: 12px; width: 38px; height: 38px; }
  .lightbox-stage figcaption { font-size: 9px; }
  .modal form > header, .modal footer { padding-left: 18px; padding-right: 18px; }
  .edit-summary, .edit-photo-section { padding-left: 18px; padding-right: 18px; }
  .edit-photo-section > div:first-child { align-items: flex-start; flex-direction: column; }
  .edit-photo-actions { justify-content: flex-start; }
  .edit-footer { align-items: stretch; flex-direction: column; }
  .edit-footer .archive-button { margin-right: 0; }
  .edit-footer > div { display: grid; grid-template-columns: 1fr 1fr; }
  .confirm-copy { padding-left: 18px; padding-right: 18px; }
  .security-callout { margin: 0 18px; }
  .client-toolbar { display: grid; }
  .client-toolbar > div { align-items: stretch; }
  .client-grid { grid-template-columns: 1fr; }
  .collection-intro h1 { font-size: 40px; }
  .access-card { padding: 34px 25px 28px; }
  .access-card h1 { font-size: 32px; }
}
