/* Starcrafts Studio 2.0 — Brand Stylesheet */
/* Reference: BRAND-GUIDE.md + 1.0 portal CSS */

*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }

:root {
  --bg: #ede8e0;
  --text: #222;
  --muted: #555;
  --accent: #8b7355;
  --card-bg: #f5f1eb;
  --border: #d4cfc6;
  --gold: #c9a84c;
  --font: 'Cormorant Garamond', Georgia, serif;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 960px; margin: 0 auto; padding: 0 24px; }

/* Logo mark (top left) */
.logomark {
  position: fixed; top: 20px; left: 20px; z-index: 40;
  text-decoration: none; display: block; width: 40px; height: 40px;
  transition: transform 0.2s, opacity 0.2s;
}
.logomark:hover { transform: scale(1.08); }
.logomark svg { width: 100%; height: 100%; }

/* Header */
header {
  text-align: center; padding: 72px 24px 48px;
  position: relative; border-bottom: 1px solid var(--border); margin-bottom: 2rem;
}
.wordmark {
  font-size: 14px; font-weight: 600; letter-spacing: 0.4em;
  text-transform: uppercase; color: var(--text); margin-bottom: 32px;
}
header h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 400; line-height: 1.3; margin-bottom: 8px; }

/* Wordmark tier label */
.wordmark-tier {
  font-size: 14px; font-weight: 600; letter-spacing: 0.35em;
  text-transform: uppercase; margin-top: 6px; color: var(--text);
}
.wordmark-tier.atelier {
  color: var(--gold); letter-spacing: 0.35em;
  font-weight: 600; font-size: 18px;
}

/* User menu */
.user-menu-wrap { position: relative; }
.user-menu-trigger {
  display: flex; align-items: center; gap: 10px;
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 24px;
  padding: 8px 18px 8px 16px; font-family: var(--font); font-size: 0.9rem;
  color: var(--text); cursor: pointer; transition: all 0.2s;
}
.user-menu-trigger:hover { border-color: var(--accent); background: #fff; }
.user-name { font-weight: 600; letter-spacing: 0.01em; }
.user-role-tag {
  font-size: 0.6rem; font-weight: 600; padding: 2px 8px; border-radius: 10px;
  letter-spacing: 0.06em; text-transform: uppercase; line-height: 1;
}
.user-role-tag.admin { background: var(--gold); color: #fff; }
.user-menu-trigger::after {
  content: ''; display: inline-block; width: 6px; height: 6px;
  border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg); margin-left: 2px; margin-top: -2px;
  transition: transform 0.15s;
}
.user-menu-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0; min-width: 200px;
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.04);
  z-index: 60; overflow: hidden; padding: 4px 0;
}
.user-menu-item {
  display: block; padding: 10px 20px; font-size: 0.9rem; color: var(--text);
  text-decoration: none; transition: all 0.1s; font-weight: 400;
}
.user-menu-item:hover { background: var(--card-bg); color: var(--text); }
.user-menu-item.logout {
  color: var(--muted); border-top: 1px solid var(--border); margin-top: 4px; padding-top: 12px;
}
.user-menu-item.logout:hover { color: #c0392b; }

/* Back to admin */
.back-to-admin-btn {
  background: var(--gold); color: #1a1200; border: none; border-radius: 20px;
  padding: 6px 16px; font-family: var(--font); font-size: 0.8rem; font-weight: 600;
  text-decoration: none; letter-spacing: 0.04em; transition: opacity 0.15s;
}
.back-to-admin-btn:hover { opacity: 0.85; }
header .header-client {
  font-size: 1.1rem; font-weight: 500; font-style: italic;
  color: var(--muted);
}
.auth-controls {
  position: absolute; top: 24px; right: 24px;
  display: flex; gap: 8px; align-items: center;
}
.auth-btn {
  background: none; border: 1px solid var(--border); border-radius: 20px;
  padding: 4px 14px; font-family: var(--font); font-size: 0.8rem;
  color: var(--muted); cursor: pointer; transition: all 0.15s; text-decoration: none;
}
.auth-btn:hover { border-color: var(--text); color: var(--text); }

/* Gate screen */
.gate-screen {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 100vh; padding: 40px 24px; text-align: center;
}
.gate-screen .gate-wordmark {
  font-size: 13px; font-weight: 600; letter-spacing: 0.4em;
  text-transform: uppercase; color: var(--text); margin-bottom: 8px;
}
.gate-screen .gate-subtitle {
  font-size: 12px; font-weight: 600; letter-spacing: 0.35em;
  text-transform: uppercase; color: var(--text); margin-bottom: 48px;
}
.gate-screen .gate-message {
  max-width: 440px; font-size: 1.1rem; font-style: italic;
  color: var(--muted); line-height: 1.7;
}
.gate-screen .gate-logo { width: 56px; height: 56px; margin-bottom: 24px; }
.gate-form { margin-top: 32px; display: flex; gap: 10px; max-width: 400px; width: 100%; }
.gate-form input {
  flex: 1; padding: 10px 14px; border: 1px solid var(--border); border-radius: 4px;
  font-family: var(--font); font-size: 1rem; background: #fff;
}
.gate-form button {
  background: var(--text); color: var(--bg); border: none; padding: 10px 24px;
  border-radius: 4px; cursor: pointer; font-family: var(--font); font-size: 1rem;
}

/* Tab navigation */
.tab-nav {
  border-bottom: 1px solid var(--border); background: var(--bg);
  position: sticky; top: 0; z-index: 50;
}
.tab-nav .container { display: flex; gap: 0; align-items: center; }
.tab-logomark {
  width: 28px; height: 28px; margin-right: 16px; flex-shrink: 0;
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.tab-logomark svg { width: 100%; height: 100%; }
body.scrolled .tab-logomark { opacity: 1; pointer-events: auto; }
body.scrolled .logomark { opacity: 0; pointer-events: none; }
.tab-btn {
  background: none; border: none; border-bottom: 2px solid transparent;
  padding: 14px 24px; font-family: var(--font); font-size: 1rem; font-weight: 500;
  color: var(--muted); cursor: pointer; transition: all 0.15s;
  letter-spacing: 0.02em;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--text); border-bottom-color: var(--text); }
.tab-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 24px; height: 24px; border-radius: 12px;
  background: var(--gold); color: #fff; font-size: 0.85rem; font-weight: 700;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  margin-left: 8px; padding: 0 7px; vertical-align: middle;
}
.tab-loading {
  text-align: center; padding: 48px 0; color: var(--muted); font-style: italic;
}
#tab-moodboard, #tab-thread, #tab-brief, #tab-details {
  min-height: 60vh;
}

/* Section titles */
.section-title { font-size: 1.6rem; font-weight: 500; margin-bottom: 8px; }
.section-sub { font-size: 0.95rem; color: var(--muted); margin-bottom: 32px; font-style: italic; }
section { padding: 48px 0; }
section + section { border-top: 1px solid var(--border); }

/* Gallery */
.gallery-count {
  font-size: 0.85rem; color: var(--muted); margin-bottom: 12px;
  font-style: italic;
}
.gallery-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px;
}
.gallery-card {
  position: relative; background: var(--card-bg); border-radius: 6px;
  overflow: hidden; cursor: pointer; transition: transform 0.2s;
}
.gallery-card:hover { transform: translateY(-2px); }
.gallery-card img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.card-overlay {
  position: absolute; inset: 0; background: rgba(0,0,0,0.45);
  display: flex; align-items: flex-end; justify-content: space-between;
  padding: 12px; opacity: 0; transition: opacity 0.25s;
}
.gallery-card:hover .card-overlay { opacity: 1; }

/* Archive button */
.archive-btn {
  position: absolute; top: 8px; right: 8px;
  background: rgba(0,0,0,0.6); border: none; border-radius: 50%;
  width: 28px; height: 28px; color: #ccc; font-size: 14px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.15s, background 0.15s; z-index: 2;
}
.gallery-card:hover .archive-btn { opacity: 1; }
.archive-btn:hover { background: rgba(192,57,43,0.8); color: #fff; }
.pin-btn {
  position: absolute; top: 8px; right: 40px;
  background: rgba(0,0,0,0.6); border: none; border-radius: 50%;
  width: 28px; height: 28px; font-size: 12px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.15s; z-index: 2;
}
.gallery-card:hover .pin-btn { opacity: 1; }
.pin-btn:hover { background: rgba(201,168,76,0.8); }
.cover-btn {
  position: absolute; top: 8px; right: 72px;
  background: rgba(0,0,0,0.6); border: none; border-radius: 50%;
  width: 28px; height: 28px; font-size: 12px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.15s; z-index: 2;
}
.gallery-card:hover .cover-btn { opacity: 1; }
.cover-btn:hover { background: rgba(139,115,85,0.8); }
.cover-btn.is-cover { opacity: 1; background: rgba(139,115,85,0.9); }

/* Archived section */
.archived-section { margin-top: 2rem; border-top: 1px solid var(--border); padding-top: 1rem; }
.archived-toggle {
  background: none; border: none; font-family: var(--font); font-size: 1rem;
  color: var(--muted); cursor: pointer; padding: 0;
}
.archived-toggle:hover { color: var(--text); }
.archived-hint { font-size: 0.8rem; color: var(--muted); font-style: italic; margin-top: 4px; margin-bottom: 8px; }
.bulk-reject-btn {
  background: none; border: 1px solid var(--border); border-radius: 20px;
  padding: 6px 16px; font-family: var(--font); font-size: 0.85rem;
  cursor: pointer; color: var(--muted); transition: all 0.15s;
}
.bulk-reject-btn:hover { border-color: #c0392b; color: #c0392b; }
.archived-grid {
  margin-top: 1rem; display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px;
}
.archived-grid img {
  width: 100%; border-radius: 4px; opacity: 0.5; cursor: pointer;
  transition: opacity 0.15s; aspect-ratio: 1; object-fit: cover;
}
.archived-grid img:hover { opacity: 0.8; }

/* Reaction buttons */
.reaction-btns { display: flex; gap: 8px; }
.reaction-btns button {
  background: rgba(255,255,255,0.9); border: none; border-radius: 50%;
  width: 36px; height: 36px; font-size: 16px; cursor: pointer;
  transition: transform 0.15s, background 0.15s;
  display: flex; align-items: center; justify-content: center;
}
.reaction-btns button:hover { transform: scale(1.15); }
.reaction-btns button.active.heart { background: #c0392b; color: #fff; }
.reaction-btns button.active.thumbsup { background: #27ae60; color: #fff; }
.reaction-btns button.active.thumbsdown { background: #555; color: #fff; }

/* Gallery filters */
.gallery-filters { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.gallery-filters button {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 20px;
  padding: 6px 16px; font-family: var(--font); font-size: 0.85rem;
  cursor: pointer; color: var(--muted); transition: all 0.15s;
}
.gallery-filters button:hover { border-color: var(--text); color: var(--text); }
.gallery-filters button.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.gallery-filters button.exclude { background: #c0392b; color: #fff; border-color: #c0392b; }
.filter-mode-btn {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em;
  min-width: 36px; padding: 6px 10px; border-radius: 4px;
  background: var(--card-bg); border: 1px solid var(--border); color: var(--muted);
  cursor: pointer; transition: all 0.15s;
}
.filter-mode-btn.and { background: var(--text); color: var(--bg); border-color: var(--text); }
.sort-select {
  margin-left: auto; font-family: var(--font); font-size: 0.85rem;
  border: 1px solid var(--border); border-radius: 4px; padding: 6px 12px;
  background: var(--card-bg); color: var(--text); cursor: pointer;
}

/* Badges */
.comment-badge {
  background: rgba(255,255,255,0.9); border-radius: 12px; padding: 4px 10px;
  font-size: 13px; font-family: var(--font); color: var(--text);
  display: flex; align-items: center; gap: 4px;
}
.upload-badge {
  position: absolute; top: 42px; right: 8px; background: var(--accent);
  color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 10px; letter-spacing: 0.05em;
}
.sc-collection-badge {
  position: absolute; top: 8px; left: 8px; width: 28px; height: 28px;
  cursor: default; opacity: 0.85;
}
.sc-collection-badge svg { width: 100%; height: 100%; }
.sc-collection-toggle {
  position: absolute; top: 8px; left: 8px; width: 28px; height: 28px;
  cursor: pointer; opacity: 0.3; transition: opacity 0.15s, transform 0.15s; z-index: 3;
}
.sc-collection-toggle:hover { opacity: 1; transform: scale(1.2); }
.sc-collection-toggle.active { opacity: 0.85; }
.sc-collection-toggle.active:hover { opacity: 1; transform: scale(1.2); }

/* Lightbox */
.lightbox {
  display: none; position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.92); flex-direction: column;
}
.lightbox.open { display: flex; }
.lb-top { display: flex; justify-content: flex-end; padding: 16px 24px; }
.lb-close { background: none; border: none; color: #fff; font-size: 28px; cursor: pointer; font-family: var(--font); }
.lb-body { flex: 1; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.lb-body img { max-width: 85vw; max-height: 70vh; object-fit: contain; border-radius: 4px; }
.lb-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,0.15); border: none; color: #fff;
  font-size: 32px; padding: 12px 16px; cursor: pointer; border-radius: 4px;
  transition: background 0.2s;
}
.lb-arrow:hover { background: rgba(255,255,255,0.3); }
.lb-arrow.prev { left: 16px; }
.lb-arrow.next { right: 16px; }
.lb-info { max-height: 30vh; overflow-y: auto; padding: 16px 24px 24px; color: #eee; }
.lb-reactions { margin-bottom: 16px; }
.lb-reactions .reaction-btns { justify-content: center; }
.lb-reactions .reaction-btns button { width: 44px; height: 44px; font-size: 20px; }
.lb-comments-section h3 { font-size: 1rem; font-weight: 400; margin-bottom: 12px; color: #ccc; }
.lb-comment { margin-bottom: 14px; font-size: 1.1rem; line-height: 1.6; }
.lb-comment .author { font-weight: 500; color: var(--accent); margin-right: 6px; }
.lb-comment .sc-badge {
  display: inline-block; background: var(--gold); color: #fff;
  font-size: 10px; font-weight: 600; padding: 1px 7px; border-radius: 8px;
  letter-spacing: 0.04em; text-transform: uppercase; margin-right: 6px;
  vertical-align: middle; position: relative; top: -1px;
}
.lb-comment .time { font-size: 0.85rem; color: #888; margin-left: 8px; }
.lb-comment-form { display: flex; gap: 10px; margin-top: 12px; }
.lb-comment-form input {
  flex: 1; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2);
  color: #fff; padding: 8px 12px; border-radius: 4px; font-family: var(--font); font-size: 0.95rem;
}
.lb-comment-form button {
  background: var(--accent); color: #fff; border: none; padding: 8px 20px;
  border-radius: 4px; cursor: pointer; font-family: var(--font); font-size: 0.95rem;
}

/* Upload */
.drop-zone {
  border: 2px dashed var(--border); border-radius: 8px; padding: 48px 24px;
  text-align: center; cursor: pointer; transition: border-color 0.2s, background 0.2s;
  color: var(--muted); font-style: italic;
}
.drop-zone:hover, .drop-zone.dragover { border-color: var(--accent); background: rgba(139,115,85,0.05); }
.drop-zone input[type="file"] { display: none; }
.upload-progress { margin-top: 16px; height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; display: none; }
.upload-progress .bar { height: 100%; background: var(--accent); width: 0; transition: width 0.3s; }

/* Sliders */
.slider-row { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.slider-label { width: 100px; font-size: 0.95rem; font-weight: 500; color: var(--text); text-align: right; flex-shrink: 0; }
.slider-label.right { text-align: left; }
.slider-row input[type="range"] {
  flex: 1; -webkit-appearance: none; appearance: none;
  height: 4px; background: var(--border); border-radius: 2px; outline: none;
}
.slider-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent); cursor: pointer; border: 2px solid var(--bg);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.slider-row input[type="range"]::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%; background: var(--accent);
  cursor: pointer; border: 2px solid var(--bg); box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.pref-history-hint {
  font-size: 0.75rem; color: var(--muted); font-style: italic;
  text-align: center; margin-top: -16px; margin-bottom: 16px;
}
.slider-saved { font-size: 0.85rem; color: var(--accent); text-align: center; margin-top: 8px; opacity: 0; transition: opacity 0.3s; }
.slider-saved.show { opacity: 1; }

/* Thread */
.thread-container { max-height: 500px; overflow-y: auto; margin-bottom: 16px; padding-right: 8px; }
.thread-entry { display: flex; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.thread-entry:last-child { border-bottom: none; }
.thread-avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; font-weight: 600; color: var(--muted); flex-shrink: 0;
}
.thread-avatar.sc { background: #050605; color: var(--bg); }
.thread-body { flex: 1; min-width: 0; }
.thread-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.thread-author { font-weight: 600; font-size: 0.95rem; }
.thread-badge {
  background: var(--gold); color: #fff; font-size: 10px; font-weight: 600;
  padding: 2px 8px; border-radius: 8px; letter-spacing: 0.04em; text-transform: uppercase;
}
.thread-time { font-size: 0.8rem; color: var(--muted); margin-left: auto; }
.thread-text { font-size: 1.05rem; line-height: 1.7; color: var(--text); }
.thread-input { display: flex; gap: 10px; margin-top: 8px; }
.thread-input textarea {
  flex: 1; background: var(--card-bg); border: 1px solid var(--border); border-radius: 6px;
  padding: 12px 14px; font-family: var(--font); font-size: 1rem; color: var(--text);
  resize: vertical; min-height: 60px; line-height: 1.5;
}
.thread-input textarea:focus { outline: none; border-color: var(--text); }
.thread-input button {
  align-self: flex-end; background: var(--text); color: var(--bg);
  border: none; border-radius: 6px; padding: 10px 20px;
  font-family: var(--font); font-size: 0.95rem; font-weight: 500;
  cursor: pointer; transition: opacity 0.15s;
}
.thread-input button:hover { opacity: 0.8; }
.thread-del, .comment-del {
  background: none; border: 1px solid var(--border); border-radius: 4px;
  color: var(--muted); font-size: 0.75rem; cursor: pointer;
  padding: 2px 8px; margin-left: 8px; transition: all 0.15s;
}
.thread-del:hover, .comment-del:hover { background: #c0392b; color: #fff; border-color: #c0392b; }
.thread-empty { text-align: center; color: var(--muted); font-style: italic; padding: 24px 0; }

/* Email capture */
.email-capture { text-align: center; padding: 32px 0; }
.email-capture p { font-style: italic; color: var(--muted); margin-bottom: 16px; }
.email-form { display: flex; gap: 10px; max-width: 420px; margin: 0 auto; }
.email-form input {
  flex: 1; padding: 10px 14px; border: 1px solid var(--border); border-radius: 4px;
  font-family: var(--font); font-size: 1rem; background: #fff;
}
.email-form button {
  background: var(--accent); color: #fff; border: none; padding: 10px 24px;
  border-radius: 4px; cursor: pointer; font-family: var(--font); font-size: 1rem;
}

/* Invite modal */
.invite-overlay {
  display: none; position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,0.6); align-items: center; justify-content: center;
}
.invite-overlay.open { display: flex; }
.invite-box {
  background: var(--bg); padding: 32px; border-radius: 8px; max-width: 440px; width: 90%;
}
.invite-box h3 { font-size: 1.3rem; font-weight: 500; margin-bottom: 16px; }
.invite-box input {
  width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: 4px;
  font-family: var(--font); font-size: 1rem; background: #fff; margin-bottom: 12px;
}
.invite-box button {
  background: var(--text); color: var(--bg); border: none; padding: 10px 24px;
  border-radius: 4px; cursor: pointer; font-family: var(--font); font-size: 1rem;
}

/* Design decisions */
.decisions-list { margin-bottom: 24px; }
.decision-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.decision-row:last-child { border-bottom: none; }
.decision-label {
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); min-width: 120px; flex-shrink: 0;
}
.decision-value { font-size: 1.05rem; flex: 1; }
.decision-locked { color: var(--accent); font-size: 1.1rem; flex-shrink: 0; }
.decision-actions { display: flex; gap: 4px; flex-shrink: 0; }
.decision-edit-btn, .decision-del-btn {
  background: none; border: 1px solid var(--border); border-radius: 4px;
  padding: 2px 10px; font-family: var(--font); font-size: 0.75rem; cursor: pointer;
  color: var(--muted); transition: all 0.15s;
}
.decision-edit-btn:hover { border-color: var(--text); color: var(--text); }
.decision-del-btn:hover { background: #c0392b; color: #fff; border-color: #c0392b; }
.decision-row.editing { flex-wrap: wrap; gap: 8px; }
.decision-edit-input {
  padding: 6px 10px; border: 1px solid var(--border); border-radius: 4px;
  font-family: var(--font); font-size: 0.95rem; background: #fff;
}
.decision-edit-input.wide { flex: 1; min-width: 200px; }
.decision-row.editing select {
  padding: 6px 10px; border: 1px solid var(--border); border-radius: 4px;
  font-family: var(--font); font-size: 0.85rem; background: #fff;
}
.decision-row.editing button {
  padding: 6px 14px; border: 1px solid var(--border); border-radius: 4px;
  font-family: var(--font); font-size: 0.8rem; cursor: pointer; background: none;
}
.decision-row.editing button[type="submit"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.decision-lock-label { font-size: 0.8rem; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.decisions-empty { color: var(--muted); font-style: italic; padding: 16px 0; }
.decision-add-form {
  display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px;
  padding-top: 16px; border-top: 1px solid var(--border);
}
.decision-add-form input, .decision-add-form select {
  padding: 8px 12px; border: 1px solid var(--border); border-radius: 4px;
  font-family: var(--font); font-size: 0.9rem; background: #fff;
}
.decision-add-form input { flex: 1; min-width: 160px; }
.decision-add-form button {
  background: var(--text); color: var(--bg); border: none; padding: 8px 20px;
  border-radius: 4px; cursor: pointer; font-family: var(--font); font-size: 0.9rem;
}

/* Activity timeline */
.activity-timeline { max-width: 640px; }
.activity-entry {
  display: flex; gap: 12px; padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.activity-entry:last-child { border-bottom: none; }
.activity-icon {
  width: 32px; height: 32px; border-radius: 50%; background: var(--card-bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0;
}
.activity-icon.reaction { background: rgba(192,57,43,0.08); }
.activity-icon.upload { background: rgba(139,115,85,0.1); }
.activity-icon.admin { background: rgba(201,168,76,0.15); }
.activity-icon.create { background: rgba(39,174,96,0.1); }
.activity-body { flex: 1; min-width: 0; }
.activity-text { font-size: 0.95rem; line-height: 1.4; }
.activity-time { font-size: 0.8rem; color: var(--muted); margin-top: 2px; }

/* Open questions */
.open-question {
  padding: 20px; background: var(--card-bg); border-radius: 6px;
  margin-bottom: 12px; border-left: 3px solid var(--gold);
}
.oq-label {
  font-size: 0.85rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 8px;
}
.oq-body { font-size: 1rem; line-height: 1.7; margin-bottom: 12px; }
.oq-response-form { display: flex; gap: 8px; }
.oq-response-form input {
  flex: 1; padding: 10px 14px; border: 1px solid var(--border); border-radius: 6px;
  font-family: var(--font); font-size: 1rem; background: #fff;
}
.oq-response-form input:focus { outline: none; border-color: var(--gold); }
.oq-response-form button {
  background: var(--gold); color: #1a1200; border: none; padding: 10px 20px;
  border-radius: 6px; cursor: pointer; font-family: var(--font); font-size: 0.9rem;
  font-weight: 600; transition: opacity 0.15s;
}
.oq-response-form button:hover { opacity: 0.85; }
.oq-admin-actions { margin-top: 8px; display: flex; gap: 8px; }
.open-question.answered { border-left-color: #27ae60; }
.oq-answer {
  background: rgba(39,174,96,0.08); border-radius: 6px; padding: 12px 16px;
  margin-bottom: 12px;
}
.oq-answer-label { font-size: 0.8rem; font-weight: 600; color: #27ae60; display: block; margin-bottom: 4px; }
.oq-answer-text { font-size: 1.05rem; font-weight: 500; }
.oq-confirm-btn {
  background: #27ae60; color: #fff; border: none; padding: 6px 16px;
  border-radius: 4px; font-family: var(--font); font-size: 0.8rem;
  font-weight: 600; cursor: pointer; transition: opacity 0.15s;
}
.oq-confirm-btn:hover { opacity: 0.85; }

/* Details tab */
.details-form, .details-readonly { max-width: 560px; }
.detail-field { margin-bottom: 20px; }
.detail-field label {
  display: block; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 6px;
}
.detail-field input, .detail-field select, .detail-field textarea {
  width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: 4px;
  font-family: var(--font); font-size: 1rem; background: #fff; color: var(--text);
}
.detail-field input.disabled { background: var(--card-bg); color: var(--muted); }
.detail-field textarea { resize: vertical; line-height: 1.5; }
.detail-field input:focus, .detail-field select:focus, .detail-field textarea:focus {
  outline: none; border-color: var(--text);
}
.detail-hint { font-size: 0.75rem; color: var(--muted); margin-top: 4px; display: block; }
.detail-save {
  background: var(--text); color: var(--bg); border: none; padding: 10px 28px;
  border-radius: 4px; cursor: pointer; font-family: var(--font); font-size: 1rem;
  font-weight: 500; transition: opacity 0.15s;
}
.detail-save:hover { opacity: 0.8; }
.detail-saved-msg {
  margin-left: 12px; font-size: 0.9rem; color: var(--accent); font-style: italic;
}
.details-readonly p { font-size: 1.05rem; line-height: 1.6; }
.detail-card {
  background: var(--card-bg); border-radius: 8px; padding: 20px 24px;
}
.detail-value-large { font-size: 1.3rem; font-weight: 500; }
.status-pill {
  display: inline-block; padding: 3px 12px; border-radius: 12px;
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.04em;
}
.status-pill.discovery { background: rgba(139,115,85,0.12); color: var(--accent); }
.status-pill.designing { background: rgba(201,168,76,0.15); color: var(--gold); }
.status-pill.specifying { background: rgba(91,155,213,0.12); color: #4a7fa3; }
.status-pill.invoicing { background: rgba(39,174,96,0.12); color: #1a8a4a; }
.status-pill.producing { background: rgba(155,89,182,0.12); color: #7b4d9b; }
.status-pill.complete { background: rgba(39,174,96,0.15); color: #1a8a4a; }

/* Members panel */
.member-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.member-row:last-child { border-bottom: none; }
.member-row.pending { background: rgba(201,168,76,0.05); padding: 10px 8px; border-radius: 4px; margin-bottom: 4px; }
.member-info { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.member-name { font-weight: 600; font-size: 0.95rem; }
.member-email { font-size: 0.8rem; color: var(--muted); }
.member-role-badge {
  font-size: 0.7rem; font-weight: 600; padding: 2px 8px; border-radius: 8px;
  letter-spacing: 0.04em; text-transform: uppercase;
}
.member-role-badge.admin { background: var(--gold); color: #fff; }
.member-role-badge.designer { background: var(--accent); color: #fff; }
.member-role-badge.client { background: var(--text); color: var(--bg); }
.member-role-badge.collaborator { background: var(--border); color: var(--text); }
.member-actions { display: flex; gap: 6px; }
.member-approve, .member-deny, .member-remove {
  background: none; border: 1px solid var(--border); border-radius: 4px;
  padding: 4px 12px; font-family: var(--font); font-size: 0.75rem; cursor: pointer;
  transition: all 0.15s;
}
.member-approve:hover { background: #27ae60; color: #fff; border-color: #27ae60; }
.member-deny:hover, .member-remove:hover { background: #c0392b; color: #fff; border-color: #c0392b; }
.invite-inline { display: flex; gap: 8px; flex-wrap: wrap; }
.invite-inline input, .invite-inline select {
  padding: 8px 12px; border: 1px solid var(--border); border-radius: 4px;
  font-family: var(--font); font-size: 0.9rem; background: #fff;
}
.invite-inline input { flex: 1; min-width: 180px; }
.invite-inline select { width: auto; }
.invite-inline button {
  background: var(--text); color: var(--bg); border: none; padding: 8px 20px;
  border-radius: 4px; cursor: pointer; font-family: var(--font); font-size: 0.9rem;
}

/* Footer */
footer {
  text-align: center; padding: 48px 24px; color: var(--muted); font-size: 0.85rem;
  border-top: 1px solid var(--border); margin-top: 2rem;
}
footer .footer-star { width: 24px; height: 24px; margin-bottom: 12px; opacity: 0.3; }
footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--text); }

/* Project list cards */
.project-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px;
  margin-top: 32px;
}
.project-card {
  background: var(--card-bg); border-radius: 8px; overflow: hidden;
  text-decoration: none; color: var(--text); transition: transform 0.2s;
}
.project-card:hover { transform: translateY(-3px); }
.project-card-thumb {
  width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block;
  background: var(--border);
}
.project-card-body { padding: 16px 20px; }
.project-card-title { font-size: 1.2rem; font-weight: 500; margin-bottom: 2px; }
.project-card-client { font-size: 0.9rem; color: var(--muted); font-style: italic; margin-bottom: 4px; }
.project-card-meta { font-size: 0.85rem; color: var(--muted); }
.tier-label-small {
  font-size: 0.6rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--gold); margin-left: 6px; vertical-align: middle;
}

/* Responsive */
@media (max-width: 600px) {
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
  header { padding: 48px 16px 32px; }
  header h1 { font-size: 1.8rem; }
  .container { padding: 0 16px; }
  .auth-controls { top: 12px; right: 12px; }
  .gallery-filters { gap: 6px; }
  .gallery-filters button { padding: 4px 12px; font-size: 0.8rem; }
  .slider-label { width: 70px; font-size: 0.85rem; }
  .lb-body img { max-width: 95vw; max-height: 60vh; }
  .lb-arrow { font-size: 24px; padding: 8px 12px; }
  .tab-btn { padding: 12px 16px; font-size: 0.9rem; }
  .gate-form { flex-direction: column; }
  .gate-form button { width: 100%; }
  .gate-screen .gate-message { font-size: 1rem; padding: 0 8px; }
  .logomark { top: 12px; left: 12px; width: 32px; height: 32px; }
  .project-grid { grid-template-columns: 1fr; }
  .thread-input { flex-direction: column; }
  .thread-input button { align-self: flex-end; }
  .lb-info { max-height: 35vh; }
}

/* Empty gallery state */
.empty-gallery {
  text-align: center; padding: 64px 24px 32px;
}

/* Drag-to-reorder */
.sortable-ghost { opacity: 0.3; }
.sortable-chosen { box-shadow: 0 4px 16px rgba(0,0,0,0.15); transform: scale(1.02); }

/* Start/onboarding page */
.start-page {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 40px 24px; background: var(--bg);
}
.start-card {
  max-width: 480px; width: 100%; text-align: center;
}
.start-logo { width: 48px; height: 48px; margin-bottom: 20px; }
.start-wordmark { height: 48px; display: block; margin: 0 auto 6px; }
.start-studio {
  font-size: 13px; font-weight: 600; letter-spacing: 0.35em;
  text-transform: uppercase; color: var(--text); margin-bottom: 32px;
}
.start-intro {
  font-size: 1.1rem; font-style: italic; color: var(--muted);
  line-height: 1.7; margin-bottom: 32px; max-width: 400px; margin-left: auto; margin-right: auto;
}
.start-form { text-align: left; }
.start-field { margin-bottom: 20px; }
.start-field label {
  display: block; font-size: 0.85rem; font-weight: 600;
  color: var(--text); margin-bottom: 6px;
}
.start-field input[type="text"], .start-field input[type="email"], .start-field textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 6px;
  font-family: var(--font); font-size: 1rem; background: #fff; color: var(--text);
}
.start-field textarea { resize: vertical; line-height: 1.5; }
.start-field input:focus, .start-field textarea:focus { outline: none; border-color: var(--text); }
.start-options { display: flex; flex-wrap: wrap; gap: 8px; }
.start-chip {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px; border: 1px solid var(--border); border-radius: 20px;
  font-family: var(--font); font-size: 0.9rem; color: var(--muted);
  cursor: pointer; transition: all 0.15s; user-select: none;
}
.start-chip:has(input:checked) { background: var(--text); color: var(--bg); border-color: var(--text); }
.start-chip input { display: none; }
.start-submit {
  width: 100%; padding: 14px; background: var(--text); color: var(--bg);
  border: none; border-radius: 6px; font-family: var(--font); font-size: 1.1rem;
  font-weight: 500; cursor: pointer; letter-spacing: 0.02em; transition: opacity 0.15s;
  margin-top: 8px;
}
.start-submit:hover { opacity: 0.85; }
.start-success { padding: 24px 0; }
.start-success h2 { font-size: 1.8rem; font-weight: 400; margin-bottom: 16px; }
.start-success p { font-size: 1.05rem; color: var(--muted); line-height: 1.6; }
.start-blurb {
  background: var(--card-bg); border-left: 3px solid var(--accent);
  padding: 20px 24px; border-radius: 0 6px 6px 0; margin: 8px 0;
  text-align: left;
}
.start-blurb p { font-size: 1.1rem; font-style: italic; line-height: 1.7; color: var(--text); }
.start-hint { font-size: 0.85rem; margin-top: 16px; }
.start-hint a { color: var(--accent); }
.start-error { color: #c0392b; font-style: italic; margin-bottom: 16px; }
.start-footer {
  margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--border);
  font-size: 0.85rem; color: var(--muted);
  display: flex; justify-content: center; gap: 12px;
}
.start-footer a { color: var(--muted); text-decoration: none; }
.start-footer a:hover { color: var(--text); }

/* HTMX indicator */
.htmx-indicator { opacity: 0; transition: opacity 200ms ease-in; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }

/* Style snapshot (on /start after submit) */
.snapshot-palette {
  display: flex; justify-content: center; gap: 8px; margin: 24px 0;
}
.snapshot-swatch {
  width: 60px; height: 60px; border-radius: 50%; border: 2px solid rgba(0,0,0,0.08);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.snapshot-products {
  display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin: 24px 0;
}
.snapshot-card {
  width: 140px; text-align: center; background: var(--card-bg);
  border-radius: 8px; overflow: hidden; border: 1px solid var(--border);
}
.snapshot-card-img {
  width: 100%; aspect-ratio: 1; object-fit: cover; display: block;
  background: var(--border);
}
.snapshot-card-placeholder {
  background: linear-gradient(135deg, var(--border) 0%, var(--card-bg) 100%);
}
.snapshot-card-info {
  padding: 10px 8px; display: flex; flex-direction: column; gap: 2px;
}
.snapshot-card-name {
  font-size: 0.85rem; font-weight: 600; color: var(--text);
}
.snapshot-card-price {
  font-size: 0.8rem; color: var(--muted); font-style: italic;
}
.snapshot-fit {
  font-size: 1.05rem; color: var(--muted); font-style: italic;
  margin: 16px 0 8px; line-height: 1.6;
}
.snapshot-cta {
  font-size: 1.1rem; font-weight: 500; color: var(--text);
  margin-top: 20px; letter-spacing: 0.02em;
}

/* Radio chips (for /start tone + intent selectors) */
.start-chip:has(input[type="radio"]:checked) {
  background: var(--text); color: var(--bg); border-color: var(--text);
}
.start-chip input[type="radio"] { display: none; }

@media (max-width: 600px) {
  .snapshot-palette { gap: 6px; }
  .snapshot-swatch { width: 48px; height: 48px; }
  .snapshot-products { gap: 10px; }
  .snapshot-card { width: 120px; }
}
