/* ==========================================================================
   Show Off Inc - Dynamic Intake Form
   Design: Embossed paper aesthetic (matches costume picker & shipping form)
   Fonts: Cormorant Garamond (display) + Inter (body)
   ========================================================================== */

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 13px;
  font-weight: 400;
  color: #2a2220;
  background: #faf9f7;
  line-height: 1.5;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  opacity: 0;
  animation: pageEnter 0.8s ease 0.1s forwards;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

@keyframes pageEnter { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes checkBounce { 0% { transform: scale(0); } 50% { transform: scale(1.2); } 100% { transform: scale(1); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* === CONTAINER === */
.container {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 32px 60px;
  min-height: 100vh;
}

@media (max-width: 640px) {
  .container { padding: 24px 16px 40px; }
}

/* === HEADER === */
.form-header {
  text-align: center;
  margin-bottom: 32px;
  animation: slideUp 0.6s ease;
}

.logo-mark {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  background: #2a2220;
  color: #faf9f7;
  font-family: 'Cormorant Garamond', serif;
  font-size: 24px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
}

.form-header h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 28px;
  font-weight: 600;
  color: #2a2220;
  letter-spacing: 0.02em;
}

.subtitle {
  font-size: 13px;
  color: #8a7e7a;
  margin-top: 4px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* === PROGRESS BAR === */
.progress-bar {
  margin-bottom: 32px;
  animation: slideUp 0.6s ease 0.1s both;
}

.progress-steps {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e8e4e0;
  color: #8a7e7a;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.step.active .step-num {
  background: #2a2220;
  color: #faf9f7;
}

.step.completed .step-num {
  background: #5a8f5a;
  color: #fff;
}

.step-label {
  font-size: 10px;
  color: #8a7e7a;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: color 0.3s ease;
}

.step.active .step-label { color: #2a2220; font-weight: 500; }
.step.completed .step-label { color: #5a8f5a; }

.progress-track {
  height: 3px;
  background: #e8e4e0;
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: #2a2220;
  border-radius: 2px;
  width: 16.67%;
  transition: width 0.4s ease;
}

/* === FORM STEPS === */
.form-step {
  display: none;
  animation: slideUp 0.4s ease;
}

.form-step.active { display: block; }

.step-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 600;
  color: #2a2220;
  margin-bottom: 8px;
}

.step-intro {
  color: #6b5f5a;
  margin-bottom: 24px;
  line-height: 1.6;
}

/* === FIELDS === */
.field-group {
  margin-bottom: 16px;
  position: relative;
}

label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: #5a504c;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.req { color: #c4605a; }

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #d8d2cc;
  border-radius: 8px;
  background: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: #2a2220;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: #2a2220;
  box-shadow: 0 0 0 3px rgba(42, 34, 32, 0.08);
}

input::placeholder, textarea::placeholder { color: #bbb4ae; }

textarea { resize: vertical; }

.field-hint {
  font-size: 11px;
  color: #8a7e7a;
  margin-top: 4px;
}

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

.field-row-3 { grid-template-columns: 2fr 1fr 1fr; }

@media (max-width: 480px) {
  .field-row, .field-row-3 { grid-template-columns: 1fr; }
}

/* Input with prefix ($) */
.input-prefix {
  position: relative;
}

.input-prefix .prefix {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #8a7e7a;
  font-size: 14px;
  pointer-events: none;
}

.input-prefix input { padding-left: 28px; }

/* === ORDER CONTEXT SELECTOR === */
.order-context-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.context-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 20px 16px;
  border: 2px solid #d8d2cc;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  text-align: center;
  font-family: 'Inter', sans-serif;
}

.context-card:hover {
  border-color: #8a7e7a;
  box-shadow: 0 2px 8px rgba(42, 34, 32, 0.08);
}

.context-card.selected {
  border-color: #2a2220;
  background: #f5f2ee;
  box-shadow: 0 0 0 3px rgba(42, 34, 32, 0.08);
}

.context-icon {
  font-size: 24px;
  line-height: 1;
}

.context-label {
  font-size: 15px;
  font-weight: 600;
  color: #2a2220;
}

.context-desc {
  font-size: 11px;
  color: #8a7e7a;
  line-height: 1.4;
}

@media (max-width: 480px) {
  .order-context-selector { grid-template-columns: 1fr; }
}

/* === CHECKBOX === */
.checkbox-field {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 16px 0;
}

.checkbox-field input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  accent-color: #2a2220;
  flex-shrink: 0;
}

.checkbox-field label {
  text-transform: none;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0;
  color: #2a2220;
  cursor: pointer;
}

/* === CONDITIONAL SECTIONS === */
.conditional-section {
  background: #f5f2ee;
  border-radius: 10px;
  padding: 20px;
  margin: 16px 0;
  border: 1px solid #e8e4e0;
}

.section-label {
  font-family: 'Cormorant Garamond', serif;
  font-size: 16px;
  font-weight: 600;
  color: #2a2220;
  margin-bottom: 16px;
}

/* === AUTOCOMPLETE === */
.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #d8d2cc;
  border-top: none;
  border-radius: 0 0 8px 8px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 100;
  display: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.autocomplete-dropdown.visible { display: block; }

.autocomplete-item {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 13px;
  border-bottom: 1px solid #f0ece8;
  transition: background 0.15s;
}

.autocomplete-item:hover { background: #f5f2ee; }
.autocomplete-item:last-child { border-bottom: none; }

.autocomplete-item .match-type {
  font-size: 10px;
  color: #8a7e7a;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.autocomplete-item .new-badge {
  font-size: 10px;
  background: #e8e4e0;
  color: #5a504c;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 8px;
}

/* === TOGGLE BUTTONS === */
.toggle-buttons {
  display: flex;
  gap: 8px;
}

.toggle-btn {
  flex: 1;
  padding: 10px 16px;
  border: 1px solid #d8d2cc;
  border-radius: 8px;
  background: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: #5a504c;
  cursor: pointer;
  transition: all 0.2s;
}

.toggle-btn.active {
  background: #2a2220;
  color: #faf9f7;
  border-color: #2a2220;
}

.toggle-btn:hover:not(.active) { border-color: #2a2220; }

/* === RADIO CARDS === */
.radio-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.radio-card {
  flex: 1;
  min-width: calc(50% - 4px);
  padding: 10px 14px;
  border: 1px solid #d8d2cc;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  text-transform: none;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0;
}

.radio-card input { display: none; }

.radio-card.active,
.radio-card:has(input:checked) {
  background: #2a2220;
  color: #faf9f7;
  border-color: #2a2220;
}

.radio-card:hover:not(.active):not(:has(input:checked)) { border-color: #2a2220; }

.radio-card-label { pointer-events: none; }

/* === UPLOAD ZONE === */
.upload-zone {
  border: 2px dashed #d8d2cc;
  border-radius: 10px;
  padding: 32px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: #fff;
}

.upload-zone:hover, .upload-zone.dragover {
  border-color: #2a2220;
  background: #f5f2ee;
}

.upload-icon { font-size: 32px; margin-bottom: 8px; }

.upload-text { font-size: 14px; color: #2a2220; margin-bottom: 4px; }
.upload-text strong { font-weight: 500; }
.upload-hint { font-size: 11px; color: #8a7e7a; }

.upload-previews {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}

.upload-preview {
  position: relative;
  width: 180px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e8e4e0;
}

.upload-preview img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
}

.upload-caption {
  width: 100%;
  padding: 8px;
  border: none;
  border-top: 1px solid #e8e4e0;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  line-height: 1.4;
  color: #2a2220;
  background: #faf9f7;
  outline: none;
  resize: none;
  min-height: 52px;
}
.upload-caption:focus {
  background: #fff;
  box-shadow: inset 0 0 0 1px #c9a96e;
}
.upload-caption::placeholder {
  color: #b0a8a0;
  font-style: italic;
}
.upload-caption.caption-error {
  box-shadow: inset 0 0 0 1px #c4605a;
  background: #fef8f7;
}

.upload-preview .remove-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.upload-tip {
  background: #f0ece8;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 12px;
  color: #5a504c;
  margin-top: 12px;
  line-height: 1.5;
}

/* === WARNING BANNER === */
.warning-banner {
  background: #fef3e6;
  border: 1px solid #f0d4a8;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 12px;
  color: #7a5a2a;
  margin: 16px 0;
  line-height: 1.5;
}

/* === RETURNING CUSTOMER BANNER === */
.returning-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #eef5ee;
  border: 1px solid #c4dcc4;
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 20px;
}

.returning-icon { font-size: 20px; color: #5a8f5a; }

.returning-text { font-size: 13px; color: #3a5a3a; }
.returning-text strong { display: block; font-weight: 600; }

/* === BUDGET GUIDANCE / FEASIBILITY === */
.budget-guidance {
  background: #eef5ee;
  border-radius: 6px;
  padding: 8px 12px;
  color: #3a5a3a;
}

.feasibility-warning {
  background: #fef3e6;
  border-radius: 6px;
  padding: 8px 12px;
  color: #7a5a2a;
}

.feasibility-warning.red {
  background: #feeee6;
  color: #8a3a2a;
}

/* === REVIEW SUMMARY === */
.review-summary {
  background: #f5f2ee;
  border-radius: 10px;
  padding: 20px;
  margin: 20px 0;
  border: 1px solid #e8e4e0;
}

.review-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 16px;
  font-size: 13px;
}

.review-label { color: #8a7e7a; font-weight: 500; }
.review-value { color: #2a2220; }

.edit-link {
  display: inline-block;
  margin-top: 12px;
  background: none;
  border: none;
  color: #2a2220;
  font-size: 12px;
  font-weight: 500;
  text-decoration: underline;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
}

/* === CONFIRM CHECKBOX === */
.confirm-checkbox {
  background: #f5f2ee;
  border-radius: 8px;
  padding: 16px;
  border: 1px solid #e8e4e0;
}

/* === BUTTONS === */
.step-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid #e8e4e0;
}

.btn {
  padding: 12px 28px;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.btn-next, .btn-submit {
  background: #2a2220;
  color: #faf9f7;
}

.btn-next:hover, .btn-submit:hover {
  background: #3a3230;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.btn-back {
  background: transparent;
  color: #8a7e7a;
  border: 1px solid #d8d2cc;
}

.btn-back:hover { border-color: #2a2220; color: #2a2220; }

.btn-submit {
  padding: 14px 36px;
  font-size: 14px;
  letter-spacing: 0.02em;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
}

/* === SUCCESS SCREEN === */
.success-screen {
  text-align: center;
  padding: 60px 20px;
}

.success-check {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  background: #5a8f5a;
  color: #fff;
  font-size: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: checkBounce 0.5s ease;
}

.success-screen h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 12px;
}

.success-screen p { color: #5a504c; font-size: 14px; margin-bottom: 8px; }

.success-order {
  background: #f5f2ee;
  display: inline-block;
  padding: 8px 16px;
  border-radius: 8px;
  margin-top: 12px;
}

/* === ERROR BANNER === */
.error-banner {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #c4605a;
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  z-index: 1000;
  max-width: 90%;
}

.error-banner button {
  background: none;
  border: none;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
}

/* === FIELD VALIDATION ERROR === */
.field-error input,
.field-error select,
.field-error textarea {
  border-color: #c4605a;
}

.field-error .field-hint {
  color: #c4605a;
}

/* === DESIGN VISION SECTION === */
.description-prompts {
  background: #f5f2ee;
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 12px;
  border: 1px solid #e8e4e0;
}

.prompt-item {
  font-size: 12px;
  color: #5a504c;
  padding: 4px 0;
  line-height: 1.5;
}

.prompt-item + .prompt-item {
  border-top: 1px solid #e8e4e0;
}

.example-toggle {
  margin-bottom: 10px;
}

.example-btn {
  background: none;
  border: none;
  color: #2a2220;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

.example-btn:hover { color: #5a504c; }

.example-box {
  background: #eef5ee;
  border: 1px solid #c4dcc4;
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 12px;
}

.example-label {
  font-size: 11px;
  font-weight: 600;
  color: #3a5a3a;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.example-text {
  font-size: 13px;
  color: #3a5a3a;
  line-height: 1.6;
  font-style: italic;
}

.word-counter {
  font-size: 11px;
  color: #8a7e7a;
  margin-top: 6px;
  text-align: right;
}

.word-counter.under-minimum {
  color: #c4605a;
  font-weight: 500;
}

.word-counter.met-minimum {
  color: #5a8f5a;
}

.description-cost-note {
  background: #fef3e6;
  border-radius: 6px;
  padding: 8px 12px;
  color: #7a5a2a;
  margin-top: 8px;
}

/* Design Tabs (Instagram, Our Designs, Build Your Own) */
.design-tabs {
  margin-top: 16px;
}

.design-tab-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.design-tab-btn {
  display: inline-block;
  padding: 8px 16px;
  border: 1px solid #d8d2cc;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: #2a2220;
  text-decoration: none;
  background: #faf9f7;
  cursor: pointer;
  transition: all 0.2s;
}

.design-tab-btn:hover {
  background: #2a2220;
  color: #faf9f7;
  border-color: #2a2220;
}

.design-tab-btn.active {
  background: #2a2220;
  color: #faf9f7;
  border-color: #2a2220;
}

.design-tab-panel {
  border: 1px solid #e8e4df;
  border-radius: 10px;
  padding: 16px;
  background: #faf9f7;
  margin-bottom: 16px;
  max-height: 500px;
  overflow-y: auto;
}

/* Gallery grid inside tab */
.gallery-loading {
  text-align: center;
  padding: 24px;
  color: #8a7f78;
  font-size: 13px;
}

/* Disclaimers */
.caption-disclaimer {
  background: #fdf6ec;
  border: 1px solid #e8d5a8;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 12px;
  color: #7a6530;
  margin-bottom: 10px;
  line-height: 1.5;
  font-weight: 500;
}

.address-disclaimer {
  background: #f5f0eb;
  border: 1px solid #d8d2cc;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 12px;
  color: #5a504c;
  margin-bottom: 12px;
  line-height: 1.5;
}

/* Gallery filters */
.gallery-filters {
  margin-bottom: 12px;
}

.gallery-search-wrap {
  position: relative;
  margin-bottom: 8px;
}

.gallery-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  opacity: 0.5;
}

.gallery-search-input {
  width: 100%;
  padding: 8px 12px 8px 32px;
  border: 1px solid #d8d2cc;
  border-radius: 6px;
  font-size: 12px;
  font-family: inherit;
  background: #fff;
  color: #2a2220;
}

.gallery-search-input:focus {
  outline: none;
  border-color: #c9a96e;
}

.gallery-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
  align-items: center;
}

.gallery-sport-pill {
  padding: 4px 12px;
  border: 1px solid #d8d2cc;
  border-radius: 20px;
  background: #fff;
  font-size: 11px;
  font-family: inherit;
  color: #5a504c;
  cursor: pointer;
  transition: all 0.15s;
}

.gallery-sport-pill:hover {
  border-color: #c9a96e;
}

.gallery-sport-pill.active {
  background: #2a2220;
  color: #fff;
  border-color: #2a2220;
}

.gallery-color-swatch {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  padding: 0;
}

.gallery-color-swatch:hover {
  transform: scale(1.15);
}

.gallery-color-swatch.active {
  border-color: #2a2220;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #2a2220;
}

.gallery-results-info {
  font-size: 11px;
  color: #8a7f78;
  padding: 2px 0;
}

.gallery-no-results {
  text-align: center;
  padding: 32px 16px;
  color: #8a7f78;
  font-size: 13px;
}

.gallery-no-results p { margin-bottom: 4px; }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.gallery-card {
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background: #fff;
  transition: all 0.2s;
  position: relative;
}

.gallery-card:hover {
  border-color: #c9a96e;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.gallery-card.picked {
  border-color: #2a2220;
  opacity: 0.6;
}

.gallery-card.picked::after {
  content: '\2713';
  position: absolute;
  top: 4px;
  right: 6px;
  background: #2a2220;
  color: #fff;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

.gallery-card img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  display: block;
}

.gallery-card-label {
  padding: 4px 6px;
  font-size: 11px;
  font-weight: 500;
  color: #5a504c;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Gallery pick badge (overlays on upload-preview card) */
.gallery-pick-badge {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(42,34,32,0.75);
  color: #fff;
  font-size: 10px;
  padding: 3px 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  top: auto;
}

@media (max-width: 600px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  }
  .design-tab-panel {
    max-height: 400px;
  }
}

.upload-count {
  font-size: 12px;
  font-weight: 500;
  color: #5a8f5a;
  margin-top: 8px;
}

/* === VISION LAYOUT (Textarea + AI Companion) === */
.vision-layout {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.vision-write {
  flex: 1;
  min-width: 0;
}
.vision-write textarea {
  width: 100%;
  min-height: 360px;
  resize: vertical;
}
.word-counter {
  text-align: right;
  font-size: 11px;
  color: #9a8e84;
  margin-top: 4px;
}

/* AI Companion Panel */
.ai-companion {
  flex: 1;
  min-width: 0;
  border: 1px solid #e0d8d0;
  border-radius: 10px;
  background: #faf8f5;
  overflow: hidden;
  transition: border-color 0.3s;
}
.ai-companion.active {
  border-color: #c9a96e;
}
.companion-header {
  padding: 10px 14px;
  background: #2a2220;
  color: #faf9f7;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.companion-body {
  padding: 14px;
  min-height: 320px;
  max-height: 400px;
  overflow-y: auto;
}
.companion-idle {
  text-align: center;
  padding: 20px 8px;
  color: #9a8e84;
}
.companion-icon {
  font-size: 24px;
  margin-bottom: 8px;
}
.companion-prompt {
  font-size: 12px;
  line-height: 1.5;
}

/* Companion Tips */
.companion-tips {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.companion-tip {
  font-size: 12px;
  line-height: 1.45;
  padding: 8px 10px;
  border-radius: 6px;
  animation: tipFade 0.3s ease;
}
@keyframes tipFade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.companion-tip.covered {
  background: #edf5ed;
  color: #3a6b3a;
}
.companion-tip.suggestion {
  background: #fff3e0;
  color: #8a6020;
}
.companion-tip.praise {
  background: #f0edf7;
  color: #5a4a8a;
}
.companion-notice {
  font-size: 12px;
  line-height: 1.5;
  padding: 10px 12px;
  border-radius: 6px;
  background: #e8f4fd;
  color: #1a5276;
  border-left: 3px solid #3498db;
  animation: tipFade 0.3s ease;
}

/* Companion Sketch Suggestions */
.companion-sketches {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #e8e0d8;
}
.companion-sketches-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #9a8e84;
  margin-bottom: 8px;
}
.companion-sketches-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.companion-sketch {
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid #e0d8d0;
  transition: border-color 0.2s;
}
.companion-sketch:hover {
  border-color: #c9a96e;
}
.companion-sketch img {
  width: 100%;
  height: 70px;
  object-fit: cover;
  display: block;
}
.companion-sketch-id {
  font-size: 9px;
  text-align: center;
  padding: 2px 0;
  color: #6b5e54;
  background: #f5f0eb;
}

/* Refine Button */
.btn-refine {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 12px 20px;
  background: linear-gradient(135deg, #2a2220, #3d3330);
  color: #faf9f7;
  border: 1px solid #c9a96e;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  animation: tipFade 0.4s ease;
}
.btn-refine:hover {
  background: linear-gradient(135deg, #3d3330, #4a4340);
  box-shadow: 0 2px 12px rgba(201, 169, 110, 0.25);
}
.btn-refine:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* Refine Chat */
.refine-chat {
  margin-top: 14px;
  border: 1px solid #c9a96e;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  animation: tipFade 0.4s ease;
}
.refine-header {
  padding: 10px 16px;
  background: #2a2220;
  color: #faf9f7;
  font-family: 'Cormorant Garamond', serif;
  font-size: 15px;
  font-weight: 600;
}
.refine-messages {
  padding: 14px;
  max-height: 300px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.refine-bubble {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.5;
  animation: tipFade 0.3s ease;
}
.refine-bubble.ai {
  align-self: flex-start;
  background: #f5f0eb;
  color: #2a2220;
  border-bottom-left-radius: 4px;
}
.refine-bubble.user {
  align-self: flex-end;
  background: #2a2220;
  color: #faf9f7;
  border-bottom-right-radius: 4px;
}
.refine-bubble.ai-typing {
  align-self: flex-start;
  background: #f5f0eb;
  color: #9a8e84;
  border-bottom-left-radius: 4px;
  font-style: italic;
}
.refine-input-row {
  display: flex;
  border-top: 1px solid #e0d8d0;
}
.refine-input {
  flex: 1;
  padding: 12px 16px;
  border: none;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  background: #faf9f7;
  outline: none;
}
.refine-input:focus { background: #fff; }
.refine-send {
  padding: 12px 20px;
  border: none;
  background: #2a2220;
  color: #faf9f7;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.refine-send:hover { background: #3d3330; }
.refine-send:disabled { opacity: 0.5; cursor: wait; }

/* Refine Brief */
.refine-brief {
  padding: 16px;
  border-top: 1px solid #e8e0d8;
  background: #faf8f5;
  animation: tipFade 0.4s ease;
}
.refine-brief-header {
  font-family: 'Cormorant Garamond', serif;
  font-size: 16px;
  font-weight: 600;
  color: #2a2220;
  margin-bottom: 10px;
}
.refine-brief-text {
  font-size: 13px;
  line-height: 1.6;
  color: #2a2220;
  padding: 12px;
  background: #fff;
  border: 1px solid #e8e0d8;
  border-radius: 6px;
  margin-bottom: 12px;
}
.refine-brief-actions {
  display: flex;
  gap: 10px;
}
.btn-brief-edit, .btn-brief-accept {
  padding: 8px 18px;
  border-radius: 6px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-brief-edit {
  background: #faf9f7;
  color: #2a2220;
  border: 1px solid #d8d2cc;
}
.btn-brief-edit:hover { background: #f0ece8; }
.btn-brief-accept {
  background: #2a2220;
  color: #faf9f7;
  border: 1px solid #2a2220;
}
.btn-brief-accept:hover {
  background: #3d3330;
  border-color: #c9a96e;
}

/* Mobile: stack vision layout */
@media (max-width: 640px) {
  .vision-layout { flex-direction: column; }
  .ai-companion { width: 100%; }
}

/* === CUSTOM MODAL === */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(42, 34, 32, 0.5);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
}

.modal-overlay.visible {
  display: flex;
}

.modal {
  background: #faf9f7;
  border-radius: 14px;
  padding: 32px;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
  animation: slideUp 0.3s ease;
}

.modal-body {
  font-size: 14px;
  color: #2a2220;
  line-height: 1.7;
  margin-bottom: 24px;
}

.modal-body strong {
  display: block;
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.modal-btn {
  padding: 10px 24px;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.modal-btn-primary {
  background: #2a2220;
  color: #faf9f7;
}

.modal-btn-primary:hover {
  background: #3a3230;
  transform: translateY(-1px);
}

.modal-btn-secondary {
  background: transparent;
  color: #5a504c;
  border: 1px solid #d8d2cc;
}

.modal-btn-secondary:hover {
  border-color: #2a2220;
  color: #2a2220;
}

