/* ============================================================
   Expert Panel — Stylesheet
   Design system aligned with APL landing page
   ============================================================ */

/* ─── DESIGN TOKENS ─── */
:root {
  --bg: #f2f1ef;
  --surface: #e9e8e5;
  --surface2: #dddbd7;
  --border: rgba(0,0,0,0.09);
  --text: #1a1916;
  --text-muted: #5c5a56;
  --text-dim: #9b9890;
  --accent: #a07840;
  --accent2: #c49656;
  --coral: #b85f44;
  --rose: #a45a6e;
  --sage: #4d7d65;
  --warm: rgba(160,120,64,0.10);
  --mono: 'DM Mono', monospace;
  --serif: 'Noto Serif KR', serif;
  --sans: 'Noto Sans KR', 'Noto Sans JP', 'Noto Sans SC', sans-serif;
  --header-bg: rgba(242,241,239,0.92);
  --shadow: 0 2px 20px rgba(0,0,0,0.08);
  --radius: 10px;
  --radius-sm: 6px;
  --transition: 0.2s ease;
  --sidebar-w: 280px;
  --header-h: 56px;

  /* Status indicators */
  --status-pending: #e74c3c;
  --status-progress: #f39c12;
  --status-done: #27ae60;
}

/* ─── DARK THEME ─── */
[data-theme="dark"] {
  --bg: #1a1a1a;
  --surface: #2a2a2a;
  --surface2: #222222;
  --border: #404040;
  --text: #e0e0e0;
  --text-muted: #aaaaaa;
  --text-dim: #777777;
  --accent: #c4a484;
  --accent2: #d4b898;
  --coral: #d4836a;
  --rose: #c97b8f;
  --sage: #7a9e8a;
  --warm: rgba(196,164,132,0.12);
  --header-bg: rgba(26,26,26,0.92);
  --shadow: 0 2px 20px rgba(0,0,0,0.3);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #1a1a1a; --surface: #2a2a2a; --surface2: #222222;
    --border: #404040; --text: #e0e0e0; --text-muted: #aaaaaa;
    --text-dim: #777777; --accent: #c4a484; --accent2: #d4b898;
    --coral: #d4836a; --rose: #c97b8f; --sage: #7a9e8a;
    --warm: rgba(196,164,132,0.12);
    --header-bg: rgba(26,26,26,0.92);
    --shadow: 0 2px 20px rgba(0,0,0,0.3);
  }
}


/* ─── RESET & BASE ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

/* ─── GRAIN OVERLAY ─── */
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='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
  opacity: 0.25;
}
[data-theme="dark"] body::before { opacity: 0.5; }


/* ─── HEADER ─── */
.panel-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: var(--header-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-logo {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.header-logo span {
  color: var(--text-dim);
  font-weight: 300;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-user {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-muted);
}


/* ─── LANGUAGE SWITCHER ─── */
.lang-switcher {
  position: relative;
}

.lang-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 12px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}
.lang-btn:hover { border-color: var(--accent); color: var(--accent); }

.lang-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  overflow: hidden;
  z-index: 200;
  min-width: 100px;
}
.lang-dropdown.open { display: block; }

.lang-option {
  display: block;
  width: 100%;
  padding: 8px 14px;
  background: none;
  border: none;
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  transition: background var(--transition);
}
.lang-option:hover { background: var(--warm); }
.lang-option.active { color: var(--accent); font-weight: 500; }


/* ─── THEME TOGGLE ─── */
.theme-toggle {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all var(--transition);
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }


/* ─── ICON BUTTON (generic) ─── */
.icon-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 12px;
  transition: all var(--transition);
}
.icon-btn:hover { border-color: var(--coral); color: var(--coral); }


/* ─── APP LAYOUT ─── */
.app-layout {
  display: flex;
  margin-top: var(--header-h);
  min-height: calc(100vh - var(--header-h));
}


/* ─── SIDEBAR ─── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  height: calc(100vh - var(--header-h));
  position: sticky;
  top: var(--header-h);
}

.sidebar-empty {
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  padding: 40px 10px;
  line-height: 1.7;
}

/* ─── Name + Badges row ─── */
.sidebar-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.sidebar-name {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
.sidebar-badges-inline {
  display: flex;
  gap: 4px;
  align-items: center;
}

.sidebar-delete-btn {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  padding: 2px 4px;
  border-radius: var(--radius-sm);
  opacity: 0.4;
  transition: opacity var(--transition), background var(--transition);
}
.sidebar-delete-btn:hover {
  opacity: 1;
  background: rgba(184,95,68,0.12);
}

.sidebar-apply-date {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: -2px;
  margin-bottom: 2px;
}

.sidebar-customer-id-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 4px;
}
.sidebar-customer-id {
  font-size: 11px;
  color: var(--text-dim);
  font-family: 'DM Mono', monospace;
}
.sidebar-copy-id-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  padding: 1px 5px;
  color: var(--text-dim);
  transition: all 0.15s;
}
.sidebar-copy-id-btn:hover {
  background: var(--surface);
  color: var(--text);
}

/* ─── Photo Thumbnails Row ─── */
.sidebar-photos-row {
  display: flex;
  gap: 12px;
}
.sidebar-photo-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.sidebar-photo-thumb {
  width: 70px;
  height: 90px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.sidebar-photo-thumb:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.sidebar-photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.sidebar-photo-placeholder {
  font-size: 24px;
  color: var(--text-dim);
  opacity: 0.3;
}
.sidebar-photo-label {
  font-size: 10px;
  color: var(--text-dim);
  font-family: var(--mono);
}

/* ─── Sidebar Divider ─── */
.sidebar-divider {
  border-top: 1px solid var(--border);
  margin: 4px 0;
}

.meta-badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 20px;
  background: var(--warm);
  color: var(--accent);
  letter-spacing: 0.5px;
}
.meta-badge.status-pending   { background: rgba(231,76,60,0.12);  color: var(--status-pending); }
.meta-badge.status-progress  { background: rgba(243,156,18,0.12); color: var(--status-progress); }
.meta-badge.status-done      { background: rgba(39,174,96,0.12);  color: var(--status-done); }

.sidebar-detail {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sidebar-detail dt { color: var(--text-dim); font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; }
.sidebar-detail dd { margin: 0 0 6px; }

.sidebar-actions {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}


/* ─── MAIN CONTENT ─── */
.main-content {
  flex: 1;
  padding: 20px 28px;
  overflow-y: auto;
  min-width: 0;
  max-width: 860px;
  margin: 0 auto;
}


/* ─── TAB NAVIGATION ─── */
.tab-nav {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
  overflow-x: auto;
}

.tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 18px;
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 500;
}


/* ─── TAB PANELS ─── */
.tab-panel { display: none; }
.tab-panel.active { display: block; }


/* ─── SECTION CARDS ─── */
.section-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  text-align: center;
}
.section-card .form-textarea,
.section-card .form-input,
.section-card .form-select { text-align: left; }

.section-title {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-subtitle {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  margin-bottom: 12px;
}


/* ─── DASHBOARD: STATS ROW ─── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}

.stat-value {
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 500;
  color: var(--accent);
  line-height: 1.2;
}

.stat-label {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}


/* ─── DASHBOARD: FILTERS ─── */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
  align-items: center;
}

.filter-input {
  flex: 1;
  min-width: 180px;
}


/* ─── DASHBOARD: CUSTOMER QUEUE ─── */
.queue-group {
  margin-bottom: 20px;
}

.queue-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  cursor: pointer;
  user-select: none;
}

.queue-group-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.queue-group-title {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.queue-group-count {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  margin-left: auto;
}

.queue-group-chevron {
  font-size: 12px;
  color: var(--text-dim);
  transition: transform var(--transition);
}
.queue-group.collapsed .queue-group-chevron { transform: rotate(-90deg); }
.queue-group.collapsed .queue-list { display: none; }

.queue-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 4px 0;
}

.queue-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}
.queue-card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.queue-card.selected { border-color: var(--accent); background: var(--warm); }

.queue-card-name {
  font-size: 14px;
  font-weight: 400;
  flex: 1;
}

.queue-card-badges {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}


/* ─── COLOR ANALYSIS: TYPE GRID ─── */
.color-type-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.season-column { display: flex; flex-direction: column; gap: 8px; }

.season-label {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-align: center;
  padding: 6px 0;
  border-radius: var(--radius-sm);
  font-weight: 500;
}

.color-type-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  font-size: 12px;
}
.color-type-card:hover { border-color: var(--accent); }
.color-type-card.selected {
  border-color: var(--accent);
  background: var(--warm);
  font-weight: 500;
}

.color-type-swatch {
  width: 16px; height: 16px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid var(--border);
}


/* ─── COLOR ANALYSIS: FACE PHOTO ─── */
.color-face-photo-row {
  display: flex;
  gap: 12px;
  justify-content: center;
}
.color-face-photo-row img {
  max-width: 160px;
  max-height: 200px;
  border-radius: var(--radius);
  cursor: pointer;
  border: 1px solid var(--border);
  object-fit: cover;
}

/* ─── COLOR ANALYSIS: TONE TABLE ─── */
.tone-table-wrap {
  position: relative;
  max-width: 480px;
  margin: 0 auto;
}

.tone-table-wrap img {
  width: 100%;
  display: block;
  border-radius: var(--radius);
}

.tone-marker {
  position: absolute;
  width: 91px; height: 91px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: all var(--transition);
  border: 2px solid transparent;
  background: transparent;
  opacity: 0;
  pointer-events: none;
}
.tone-marker.tone-main {
  opacity: 1;
  border: 3px solid #e63946;
  box-shadow: 0 0 12px 4px rgba(230,57,70,0.5);
}
.tone-marker.tone-sub {
  opacity: 1;
  border: 2px solid #457b9d;
  box-shadow: 0 0 8px 3px rgba(69,123,157,0.4);
}
.tone-marker.tone-point {
  opacity: 1;
  border: 2px dashed #2a9d8f;
  box-shadow: 0 0 8px 3px rgba(42,157,143,0.4);
}

.tone-legend {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
}

.tone-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.tone-legend-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 2px solid;
}
.tone-legend-dot.main  { border-color: #e63946; }
.tone-legend-dot.sub   { border-color: #457b9d; }
.tone-legend-dot.point { border-color: #2a9d8f; border-style: dashed; }

/* ─── Tone Select Drawer ─── */
.drawer-tone-section {
  margin-bottom: 20px;
}
.drawer-tone-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  display: inline-block;
}
.drawer-tone-label.main  { color: #e63946; background: rgba(230,57,70,0.1); }
.drawer-tone-label.sub   { color: #457b9d; background: rgba(69,123,157,0.1); }
.drawer-tone-label.point { color: #2a9d8f; background: rgba(42,157,143,0.1); }

.drawer-tone-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.drawer-tone-divider {
  width: 1px;
  height: 28px;
  background: var(--border);
  margin: 0 4px;
}
.tone-select-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}
.tone-select-btn:hover {
  border-color: var(--text-dim);
  transform: scale(1.08);
}
.tone-select-btn.active[data-type="main"] {
  border-color: #e63946;
  background: rgba(230,57,70,0.12);
  color: #e63946;
  box-shadow: 0 0 8px rgba(230,57,70,0.35);
}
.tone-select-btn.active[data-type="sub"] {
  border-color: #457b9d;
  background: rgba(69,123,157,0.12);
  color: #457b9d;
  box-shadow: 0 0 8px rgba(69,123,157,0.35);
}
.tone-select-btn.active[data-type="point"] {
  border-color: #2a9d8f;
  background: rgba(42,157,143,0.12);
  color: #2a9d8f;
  box-shadow: 0 0 8px rgba(42,157,143,0.35);
}

/* ─── COLOR DIAGNOSIS: 5-Step Chip UI ─── */
.diagnosis-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
}
.diagnosis-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}
.diagnosis-label {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
}
.color-chips-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  justify-content: center;
}
.color-chip-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.chip-wrapper {
  position: relative;
  width: 48px;
  height: 48px;
}
.chip-wrapper .chip {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.chip-wrapper .chip:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}
.chip-check-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 0;
}
.chip-check-btn:hover {
  border-color: var(--accent);
  transform: scale(1.1);
}
.chip-check-btn.active {
  background: #ffd700;
  border-color: #ffd700;
}
.chip-check-btn.active::after {
  content: '\2713';
  font-size: 12px;
  font-weight: bold;
  color: #333;
}
.chip-label {
  font-size: 10px;
  color: var(--text-dim);
  font-weight: 500;
  text-align: center;
  white-space: nowrap;
  min-height: 14px;
}

/* ─── COLOR ANALYSIS: INDICATORS ─── */
.indicator-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.indicator-group { display: flex; flex-direction: column; gap: 6px; }

.indicator-label {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
}

.indicator-options {
  display: flex;
  gap: 4px;
}

.indicator-opt {
  flex: 1;
  padding: 6px 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 11px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text-muted);
}
.indicator-opt:hover { border-color: var(--accent); }
.indicator-opt.selected {
  background: var(--warm);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 500;
}


/* ─── COLOR ANALYSIS: CONTRAST IMAGES ─── */
.contrast-desc {
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.contrast-subsection {
  margin-bottom: 20px;
}
.contrast-subsection:last-child { margin-bottom: 0; }

.contrast-subsection-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 12px;
}

.contrast-gender-btns {
  display: flex;
  gap: 4px;
}
.contrast-gender-btn {
  font-family: var(--mono);
  font-size: 11px;
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}
.contrast-gender-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.contrast-image-grid {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.contrast-image-item {
  position: relative;
  flex: 0 0 auto;
  width: 160px;
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: var(--radius);
  overflow: hidden;
  transition: all var(--transition);
  background: var(--bg);
}
.contrast-image-item:hover { border-color: var(--accent2); }
.contrast-image-item.selected { border-color: var(--accent); box-shadow: 0 4px 12px rgba(160,120,64,0.3); }

.contrast-image-item img {
  width: 100%;
  display: block;
  transition: opacity 0.3s;
}

.contrast-label {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
  padding: 6px 0;
  text-align: center;
}

.contrast-check {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(160,120,64,0.9);
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.contrast-check svg { width: 16px; height: 16px; }
.contrast-image-item.selected .contrast-check { display: flex; }

/* ─── COLOR ANALYSIS: COLOR EXAMPLES ─── */
.color-example-grid {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}
.color-example-item {
  width: 120px;
  height: 150px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
  border: 1px solid var(--border);
}
.color-example-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
}
.color-example-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  border-style: dashed;
  cursor: pointer;
  color: var(--text-dim);
  font-size: 24px;
  transition: all var(--transition);
}
.color-example-empty:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.color-example-add {
  width: 120px;
  height: 150px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-dim);
  font-size: 24px;
  transition: all var(--transition);
}
.color-example-add:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.color-example-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border: none;
  background: rgba(184,95,68,0.85);
  color: #fff;
  font-size: 14px;
  border-radius: 4px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.color-example-item:hover .color-example-remove {
  display: flex;
}

/* ─── COLOR ANALYSIS: MAKEUP MUSE ─── */
.muse-editor {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.muse-image-wrap {
  position: relative;
  flex-shrink: 0;
}
.muse-image-box {
  width: 280px;
  height: 360px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  transition: all var(--transition);
}
.muse-image-box:hover {
  border-color: var(--accent);
}
.muse-image-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.muse-placeholder {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-dim);
  text-align: center;
}
.muse-remove-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border: none;
  background: rgba(184,95,68,0.85);
  color: #fff;
  font-size: 14px;
  border-radius: 4px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.muse-comment-wrap {
  width: 100%;
}

/* ─── COLOR ANALYSIS: MAKEUP KEYWORD GRID ─── */
.makeup-keyword-grid {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  min-height: 32px;
  align-items: center;
  justify-content: center;
}
.makeup-keyword-item {
  width: 120px;
  height: 150px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
  border: 1px solid var(--border);
}
.makeup-keyword-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
}
.makeup-keyword-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  border: none;
  background: rgba(184,95,68,0.85);
  color: #fff;
  font-size: 12px;
  border-radius: 4px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.makeup-keyword-item:hover .makeup-keyword-remove {
  display: flex;
}

/* ─── MAKEUP CATEGORY & PRODUCT PICKS ─── */
.makeup-category { margin-bottom: 20px; }
.makeup-category:last-child { margin-bottom: 0; }
.makeup-sub-section { margin-top: 12px; }
.makeup-sub-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  margin-bottom: 8px;
}

/* ─── PASTE IMAGE BOX (shared) ─── */
.paste-image-grid {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}
.paste-image-box {
  width: 120px;
  height: 150px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  text-align: center;
  color: var(--text-dim);
  font-size: 9px;
  line-height: 1.3;
  transition: all var(--transition);
  outline: none;
}
.paste-image-box.focused {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(184,95,68,0.2);
}
.paste-image-box.drag-over {
  border-color: var(--accent);
  background: rgba(184,95,68,0.06);
}
.paste-image-box.has-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.paste-image-remove {
  position: absolute;
  top: 4px; right: 4px;
  width: 22px; height: 22px;
  background: rgba(184,95,68,0.85);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
}
.paste-image-box:hover .paste-image-remove { display: flex; }
.paste-image-add {
  width: 120px;
  height: 150px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 24px;
  color: var(--text-dim);
  transition: all var(--transition);
}
.paste-image-add:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ─── COLOR ANALYSIS: COLOR USAGE GRID ─── */
.usage-image-grid {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  min-height: 32px;
  align-items: center;
  justify-content: center;
}
.usage-image-item {
  width: 120px;
  height: 150px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
  border: 1px solid var(--border);
}
.usage-image-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
}
.usage-image-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  border: none;
  background: rgba(184,95,68,0.85);
  color: #fff;
  font-size: 12px;
  border-radius: 4px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.usage-image-item:hover .usage-image-remove {
  display: flex;
}

/* ─── Drawer: Tone sub-tabs ─── */
.drawer-tone-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.drawer-tone-tab {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}
.drawer-tone-tab:hover {
  border-color: var(--accent);
}
.drawer-tone-tab.active {
  background: var(--warm);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 500;
}

/* ─── Drawer: Preset image grid ─── */
.drawer-preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
}

/* ─── COLOR ANALYSIS: PALETTES ─── */
.palette-section {
  margin-bottom: 16px;
}

.palette-label {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.palette-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: center;
}

.best-worst-row.palette-stack {
  grid-template-columns: 1fr;
}

.palette-chip {
  width: 48px; height: 48px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: pointer;
  position: relative;
  transition: all var(--transition);
}
.palette-chip:hover { transform: scale(1.15); }
.palette-chip .remove-chip {
  position: absolute;
  top: -6px; right: -6px;
  width: 14px; height: 14px;
  background: var(--coral);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 9px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.palette-chip:hover .remove-chip { display: flex; }

.palette-add {
  width: 48px; height: 48px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 16px;
  transition: all var(--transition);
}
.palette-add:hover { border-color: var(--accent); color: var(--accent); }

/* ─── COLOR SET PRESET SYSTEM ─── */
.color-set-section { margin-top: 20px; }

.color-set-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}
.color-set-tab {
  font-family: var(--mono);
  font-size: 12px;
  padding: 6px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}
.color-set-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.color-set-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 400px;
  overflow-y: auto;
}

.color-set-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}
.color-set-item:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.color-set-name {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
  min-width: 70px;
  white-space: nowrap;
}

.color-set-swatches {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  flex: 1;
}

.color-set-swatch {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.color-set-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity var(--transition);
}
.color-set-item:hover .color-set-actions { opacity: 1; }

.color-set-edit-btn,
.color-set-delete-btn {
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  background: var(--surface2);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.color-set-edit-btn:hover { background: var(--accent); color: #fff; }
.color-set-delete-btn:hover { background: var(--coral); color: #fff; }

.color-set-item.add-new-set {
  border-style: dashed;
  justify-content: center;
  background: none;
}
.color-set-item.add-new-set:hover { background: var(--warm); }
.add-new-set-label {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
}

/* Color set editor (modal) */
.color-set-editor {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.color-set-editor-item {
  position: relative;
}
.color-set-editor-swatch {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
  transition: transform 0.15s;
}
.color-set-editor-swatch:hover { transform: scale(1.1); }
.color-set-editor-remove {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: none;
  background: var(--coral);
  color: #fff;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition);
}
.color-set-editor-item:hover .color-set-editor-remove { opacity: 1; }


/* ─── COLOR ANALYSIS: MAKEUP KEYWORDS ─── */
.keyword-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.keyword-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}
.keyword-tag:hover { border-color: var(--accent); }
.keyword-tag.selected {
  background: var(--warm);
  border-color: var(--accent);
  color: var(--accent);
}

.keyword-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}


/* ─── FACE SHAPE: FACE TYPE COMPARISON (horizontal) ─── */
.face-compare-grid {
  display: flex;
  flex-direction: row;
  gap: 16px;
  align-items: flex-start;
  justify-content: center;
}

.face-compare-item {
  text-align: center;
}

.face-compare-label {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 8px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.face-compare-box {
  width: 200px;
  height: 260px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: var(--text-dim);
  font-size: 12px;
  text-align: center;
}
.face-compare-box.has-image {
  border-style: solid;
}
.face-compare-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}


/* ─── SHAPE ANALYSIS: FACE TYPE DRAWER ─── */
.face-type-drawer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.face-type-drawer-item {
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  overflow: hidden;
  text-align: center;
  transition: all var(--transition);
}
.face-type-drawer-item:hover {
  border-color: var(--accent);
}
.face-type-drawer-item.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent)33;
}
.face-type-drawer-item img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  display: block;
}
.face-type-drawer-item .type-label {
  padding: 6px 4px;
  font-size: 11px;
  color: var(--text-muted);
}


/* ─── FACE SHAPE: EYEBROW COMPARE GRID ─── */
.eyebrow-compare-grid {
  display: flex;
  flex-direction: row;
  gap: 16px;
  align-items: flex-start;
  justify-content: center;
  margin-top: 8px;
}
.eyebrow-compare-item {
  text-align: center;
}
.eyebrow-compare-label {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 8px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.eyebrow-after-box {
  cursor: pointer;
  transition: all var(--transition);
}
.eyebrow-after-box:hover {
  border-color: var(--accent);
  background: var(--warm);
}
.eyebrow-after-box.has-image {
  cursor: pointer;
}

/* ─── FACE SHAPE: EYEBROW DRAWER STYLES ─── */
.eyebrow-drawer-styles {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.eyebrow-style-btn {
  flex: 1;
  min-width: 60px;
  padding: 8px 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  text-align: center;
}
.eyebrow-style-btn:hover {
  border-color: var(--accent);
  background: var(--warm);
}
.eyebrow-style-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}
.eyebrow-style-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Generate button */
.eyebrow-generate-btn {
  width: 100%;
  padding: 10px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity var(--transition);
  margin-bottom: 12px;
}
.eyebrow-generate-btn:hover { opacity: 0.85; }
.eyebrow-generate-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Results list (horizontal scroll) */
.eyebrow-results-list {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 0 8px;
  scrollbar-width: thin;
}
.eyebrow-results-list::-webkit-scrollbar { height: 4px; }
.eyebrow-results-list::-webkit-scrollbar-track { background: var(--bg); border-radius: 2px; }
.eyebrow-results-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* Result slot */
.eyebrow-result-slot {
  flex: 0 0 100px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.eyebrow-slot-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  text-align: center;
}
.eyebrow-slot-img {
  width: 100px;
  height: 140px;
  background: var(--bg);
  border: 2px dashed var(--border);
  border-radius: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}
.eyebrow-result-slot.done .eyebrow-slot-img {
  border-style: solid;
  border-color: var(--accent);
  cursor: pointer;
}
.eyebrow-result-slot.done .eyebrow-slot-img:hover {
  box-shadow: 0 0 0 2px var(--accent)33;
}
.eyebrow-slot-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.eyebrow-slot-error {
  font-size: 11px;
  color: var(--coral);
  text-align: center;
  line-height: 1.4;
}

/* Spinner */
.eyebrow-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: eyebrow-spin 0.8s linear infinite;
}
@keyframes eyebrow-spin {
  to { transform: rotate(360deg); }
}


/* ─── FACE SHAPE: REC IMAGE GRID & ITEMS ─── */
.face-rec-grid {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  min-height: 32px;
  align-items: center;
  justify-content: center;
}
.rec-image-item {
  position: relative;
  width: 120px;
  height: 150px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}
.rec-image-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
}
.rec-image-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  border: none;
  background: rgba(184,95,68,0.85);
  color: #fff;
  font-size: 12px;
  border-radius: 4px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.rec-image-item:hover .rec-image-remove {
  display: flex;
}


/* ─── DRAWER: CATEGORY TABS ─── */
.drawer-category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.drawer-category-tab {
  padding: 6px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}
.drawer-category-tab:hover {
  border-color: var(--accent);
}
.drawer-category-tab.active {
  background: var(--warm);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 500;
}


/* ─── DRAWER: PRESET IMAGE GRID ─── */
.drawer-preset-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.drawer-preset-item {
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: all var(--transition);
}
.drawer-preset-item:hover {
  border-color: var(--accent);
}
.drawer-preset-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}
.drawer-loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 0;
  color: var(--text-dim);
  font-size: 13px;
}


/* ─── SHAPE ANALYSIS: TYPE SELECTORS ─── */
.shape-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
}

.shape-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
  font-size: 12px;
}
.shape-card:hover { border-color: var(--accent); }
.shape-card.selected {
  border-color: var(--accent);
  background: var(--warm);
  font-weight: 500;
}

.shape-icon {
  font-size: 28px;
  color: var(--text-dim);
}


/* ─── SHAPE ANALYSIS: FEATURE NOTES ─── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}


/* ─── SHAPE ANALYSIS: RECOMMENDATION GRIDS ─── */
.rec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.rec-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
}

.rec-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}

.rec-item .rec-label {
  padding: 6px 8px;
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}

.rec-upload {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-dim);
  font-size: 12px;
  gap: 4px;
  transition: all var(--transition);
}
.rec-upload:hover { border-color: var(--accent); color: var(--accent); }


/* ─── BODY TAB: TYPE SELECTOR ─── */
/* ─── BODY TAB: TYPE RESULT ROW ─── */
.body-type-result-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 16px;
  overflow: hidden;
}
.body-type-result-item {
  flex: 1;
  text-align: center;
  padding: 20px 25px;
}
.body-type-divider {
  width: 1px;
  height: 50px;
  background: var(--border);
}
.body-type-result-item .result-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}
.body-type-result-item .result-value {
  font-size: 20px;
  font-weight: 600;
  color: var(--accent);
}

/* ─── BODY TYPE DRAWER ─── */
.drawer-body-type-wrapper {
  padding: 8px 0;
}
.drawer-section-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  margin-bottom: 10px;
  margin-top: 16px;
}
.drawer-section-label:first-child {
  margin-top: 0;
}
.body-type-drawer-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.body-type-btn {
  padding: 10px 18px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg);
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}
.body-type-btn:hover { border-color: var(--accent); color: var(--accent); }
.body-type-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 500;
}

/* ─── BODY TAB: PHOTOS ─── */
.body-photos-row {
  display: flex;
  gap: 12px;
  justify-content: center;
}
.body-photo-box {
  width: 160px;
  height: 220px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 12px;
  overflow: hidden;
}
.body-photo-box.wide {
  width: 100%;
  height: 200px;
}
.body-photo-box.has-image {
  border-style: solid;
}
.body-photo-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ─── BODY TAB: BEST/WORST SECTION ─── */
.bw-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.bw-group {
  padding: 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
}
.bw-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.best-badge, .worst-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 3px;
  color: #fff;
}
.best-badge { background: var(--sage); }
.worst-badge { background: var(--coral); }
.bw-comment {
  margin-top: 8px;
}

/* ─── SHAPE: CLOTHING RECS ─── */
.clothing-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.clothing-tab {
  padding: 6px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}
.clothing-tab:hover { border-color: var(--accent); }
.clothing-tab.active {
  background: var(--warm);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 500;
}

.clothing-panel { display: none; }
.clothing-panel.active { display: block; }

.best-worst-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.best-col .section-subtitle { color: var(--sage); }
.worst-col .section-subtitle { color: var(--coral); }


/* ─── STYLE GUIDE: KEYWORDS ─── */
.style-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  justify-content: center;
}

.style-keyword {
  padding: 8px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}
.style-keyword:hover { border-color: var(--accent); }
.style-keyword.selected {
  background: var(--warm);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 500;
}
.drawer-keyword-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 0;
}


/* ─── STYLE GUIDE: OCCASION PACKAGES ─── */
.occasion-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
}

.occasion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
  transition: background var(--transition);
}
.occasion-header:hover { background: var(--warm); }

.occasion-title {
  font-size: 14px;
  font-weight: 400;
}

.occasion-chevron {
  font-size: 12px;
  color: var(--text-dim);
  transition: transform var(--transition);
}
.occasion-card.expanded .occasion-chevron { transform: rotate(90deg); }

.occasion-body {
  display: none;
  padding: 0 16px 16px;
}
.occasion-card.expanded .occasion-body { display: block; }


/* ─── STYLE GUIDE: RECOMMENDATION LISTS ─── */
.rec-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rec-list-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.rec-list-item .remove-item {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 14px;
  padding: 0 4px;
}
.rec-list-item .remove-item:hover { color: var(--coral); }

.add-item-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}


/* ─── STYLE GUIDE: IMAGE GALLERY ─── */
.image-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.gallery-item {
  aspect-ratio: 3/4;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  position: relative;
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.gallery-item:hover { box-shadow: var(--shadow); }

.gallery-upload {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  aspect-ratio: 3/4;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-dim);
  font-size: 12px;
  gap: 6px;
  transition: all var(--transition);
}
.gallery-upload:hover { border-color: var(--accent); color: var(--accent); }


/* ─── FORM CONTROLS ─── */
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 300;
  outline: none;
  transition: border-color var(--transition);
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--accent);
}

.form-textarea {
  resize: vertical;
  min-height: 60px;
  line-height: 1.5;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%239b9890'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
  cursor: pointer;
}

.form-label {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}


/* ─── BUTTONS ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent2); border-color: var(--accent2); color: #fff; }

.btn-danger {
  border-color: var(--coral);
  color: var(--coral);
}
.btn-danger:hover { background: var(--coral); color: #fff; }

.delete-modal-title { color: var(--coral); }
.delete-warning { color: var(--coral); font-weight: 500; }

.btn-sm {
  padding: 6px 12px;
  font-size: 11px;
}

.btn-full { width: 100%; }


/* ─── MODALS ─── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 500;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open { display: flex; }

.modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 420px;
  width: 90%;
  box-shadow: var(--shadow);
}

.modal-title {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
}

.modal-body {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1.6;
}

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


/* ─── IMAGE PREVIEW MODAL ─── */
.preview-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 600;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}
.preview-overlay.open { display: flex; }
.preview-overlay img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: var(--radius);
}


/* ─── TOAST NOTIFICATION ─── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 800;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  font-size: 13px;
  color: var(--text);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toastIn 0.3s ease;
  max-width: 340px;
}

.toast.success { border-left: 3px solid var(--sage); }
.toast.error   { border-left: 3px solid var(--coral); }
.toast.info    { border-left: 3px solid var(--accent); }

.toast.removing { animation: toastOut 0.3s ease forwards; }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(12px); }
}


/* ─── LOADING OVERLAY ─── */
.loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.7);
  z-index: 700;
  align-items: center;
  justify-content: center;
}
.loading-overlay.active { display: flex; }

.loading-spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}


/* ─── DIVIDER ─── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}


/* ─── EMPTY STATE ─── */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-dim);
  font-size: 13px;
}
.empty-state-icon {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: 0.4;
}


/* ─── COLOR PICKER POPUP ─── */
.color-picker-popup {
  display: none;
  position: absolute;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  z-index: 300;
}
.color-picker-popup.open { display: block; }

.color-picker-popup input[type="color"] {
  width: 100%;
  height: 40px;
  border: none;
  cursor: pointer;
  border-radius: var(--radius-sm);
}


/* ─── SCROLL REVEAL ─── */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}


/* ─── RESPONSIVE ─── */
@media (max-width: 1200px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .color-type-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .app-layout { flex-direction: column; }

  .sidebar {
    width: 100%;
    min-width: 100%;
    height: auto;
    position: relative;
    top: 0;
    flex-direction: row;
    flex-wrap: wrap;
    padding: 12px;
    gap: 12px;
  }

  .sidebar-photo { width: 60px; height: 60px; aspect-ratio: 1; }
  .sidebar-actions { margin-top: 0; border-top: none; padding-top: 0; flex-direction: row; }

  .main-content { padding: 16px; }

  .stats-row { grid-template-columns: 1fr 1fr; }
  .best-worst-row { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .panel-header { padding: 0 12px; }
  .header-user { display: none; }
  .tab-btn { padding: 8px 12px; font-size: 12px; }
  .stats-row { grid-template-columns: 1fr; }
  .color-type-grid { grid-template-columns: 1fr; }
  .filter-bar { flex-direction: column; }
  .drawer-panel { width: 100vw; max-width: 100vw; }
  .drawer-body { padding: 12px; }
  .drawer-type-grid { grid-template-columns: 1fr; }
  .contrast-image-grid { flex-direction: column; align-items: center; }
  .contrast-image-item { width: 200px; }
}


/* ============================================================
   SLIDE DRAWER
   ============================================================ */

/* ─── Section title flex (support Browse button) ─── */
.section-title { display: flex; align-items: center; gap: 8px; }
.section-title .btn { margin-left: auto; flex-shrink: 0; }
.section-subtitle { display: flex; align-items: center; gap: 8px; }
.section-subtitle .btn { margin-left: auto; flex-shrink: 0; }

/* ─── Panel (YouTube Shorts style — flex child, no overlay) ─── */
.drawer-panel {
  width: 0;
  min-width: 0;
  flex-shrink: 0;
  height: calc(100vh - var(--header-h));
  position: sticky;
  top: var(--header-h);
  background: var(--surface);
  border-left: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              min-width 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              border-left-color 0.3s ease;
}
.drawer-panel.open {
  width: 480px;
  min-width: 480px;
  border-left: 1px solid var(--border);
  box-shadow: -4px 0 20px rgba(0,0,0,0.08);
}

[data-theme="dark"] .drawer-panel.open {
  box-shadow: -4px 0 20px rgba(0,0,0,0.3);
}

/* ─── Drawer inner content min-width (prevents collapse) ─── */
.drawer-header,
.drawer-body { min-width: 480px; }

/* ─── Header ─── */
.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.drawer-title {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.drawer-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  transition: all var(--transition);
}
.drawer-close:hover {
  border-color: var(--coral);
  color: var(--coral);
}

/* ─── Body ─── */
.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}
.drawer-body::-webkit-scrollbar { width: 4px; }
.drawer-body::-webkit-scrollbar-track { background: transparent; }
.drawer-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ─── Drawer internal: Gender tabs ─── */
.drawer-gender-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.drawer-gender-tab {
  flex: 1;
  padding: 10px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-size: 13px;
  font-weight: 400;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
}
.drawer-gender-tab:hover { border-color: var(--accent); color: var(--accent); }
.drawer-gender-tab.active {
  background: var(--warm);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 500;
}

/* ─── Drawer internal: Season tabs ─── */
.drawer-season-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
}
.drawer-season-tab {
  flex: 1;
  padding: 8px 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
}
.drawer-season-tab:hover { border-color: var(--accent); }
.drawer-season-tab.active { font-weight: 500; }

/* ─── Drawer internal: Type list ─── */
.drawer-type-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.drawer-type-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}
.drawer-type-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}
.drawer-type-card.selected {
  border-color: var(--accent);
  border-width: 2px;
  background: var(--warm);
}
.drawer-type-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid var(--border);
}
.drawer-type-name {
  font-size: 14px;
  color: var(--text);
}
.drawer-type-check {
  margin-left: auto;
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
}

/* ─── Drawer internal: Image grid ─── */
.drawer-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}
.drawer-image-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition);
}
.drawer-image-card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.drawer-image-card.selected {
  border-color: var(--accent);
  border-width: 2px;
  box-shadow: 0 0 0 2px var(--warm);
}
.drawer-image-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}
.drawer-image-label {
  padding: 6px 8px;
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  font-family: var(--mono);
}

/* ─── Drawer internal: Preview area ─── */
.drawer-preview {
  margin-top: 16px;
  padding: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.drawer-preview-label {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  margin-bottom: 8px;
}

/* ─── Drawer internal: Placeholder ─── */
.drawer-placeholder {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 20px;
  color: var(--text-dim);
  font-size: 13px;
}

/* ─── Drawer internal: Footer action ─── */
.drawer-footer {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ─── Selected type preview card (Color tab main body) ─── */
.selected-type-preview {
  padding: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
}
.preview-type-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.preview-type-name {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.preview-type-season {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
}

/* ─── Color panel image ─── */
.color-panel-image-wrap {
  width: 50%;
  margin: 0 auto 16px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
.color-panel-img {
  width: 100%;
  display: block;
  border-radius: var(--radius);
}

/* ─── Face shape description panel ─── */
.shape-description {
  margin-top: 12px;
  padding: 12px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ─── Style preview sentence ─── */
.style-preview-sentence {
  margin-top: 10px;
  padding: 10px 14px;
  background: var(--warm);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--accent);
  font-style: italic;
}

/* ============================================================
   PHOTO DETAIL MODAL
   ============================================================ */
.photo-detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}
.photo-detail-modal {
  background: var(--surface);
  border-radius: var(--radius);
  max-width: 520px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.photo-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.photo-detail-header h3 {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}
.photo-detail-close {
  background: none;
  border: none;
  font-size: 22px;
  color: var(--text-dim);
  cursor: pointer;
  line-height: 1;
}
.photo-detail-body {
  padding: 16px 18px;
}
.photo-detail-section-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 14px 0 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.photo-detail-section-title:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}
.photo-detail-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.photo-detail-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.photo-detail-item {
  aspect-ratio: 3/4;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  position: relative;
  transition: box-shadow 0.2s, transform 0.2s;
}
.photo-detail-item:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transform: scale(1.02);
}
.photo-detail-item.wide {
  aspect-ratio: 16/9;
}
.photo-detail-item img,
.photo-detail-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.photo-detail-label {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  z-index: 1;
}
.photo-detail-empty {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 11px;
}
.photo-detail-video-row {
  display: flex;
  justify-content: center;
}
.photo-detail-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  background: rgba(0,0,0,0.55);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
}

/* ============================================================
   IMAGE FULLSCREEN PREVIEW
   ============================================================ */
.image-preview-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}
.image-preview-overlay img {
  max-width: 92vw;
  max-height: 92vh;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: 0 4px 40px rgba(0,0,0,0.4);
}
.image-preview-close {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 40px;
  height: 40px;
  border: none;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 26px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.image-preview-close:hover {
  background: rgba(255,255,255,0.3);
}

/* ─── Responsive: Drawer ─── */
@media (max-width: 768px) {
  .drawer-panel {
    position: fixed;
    top: 0; right: 0;
    width: 0; min-width: 0;
    height: 100vh;
  }
  .drawer-panel.open {
    width: 100vw;
    min-width: 100vw;
    max-width: 100vw;
    z-index: 451;
  }
  .drawer-header,
  .drawer-body { min-width: 100vw; }
}
