/* static/styles.css */
* { box-sizing: border-box; }

html {
  min-height: 100%;
  background-color: #0b1226;
  overscroll-behavior-y: none;
}

:root{
  --bg1:#2a1748;
  --bg2:#050816;
  --bg3:#02010b;

  --card: rgba(15, 23, 42, 0.90);
  --border: rgba(148, 163, 184, 0.25);
  --muted: #9ca3af;
  --text: #f9fafb;
  --sub: #cbd5f5;

  --grad: linear-gradient(90deg, #8b5cf6, #ec4899, #f97316);
  --ease-smooth: cubic-bezier(.22, 1, .36, 1);
  --ease-soft: cubic-bezier(.16, 1, .3, 1);
}

body{
  margin:0;
  min-height: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", sans-serif;
  background-color: #0b1226;
  background: linear-gradient(180deg, #1e0f35 0%, #0b1226 100%);
  background-attachment: fixed; 
  color: var(--text);
  overscroll-behavior-y: none;
}

a{ color: inherit; text-decoration: none; }
a:hover{ text-decoration: underline; text-underline-offset: 3px; }

.page{
  min-height: 100vh;
  display:flex;
  flex-direction:column;
  align-items:center;
  padding: 32px 16px 48px;
}

.card{
  width:100%;
  max-width: 1100px;
  background: var(--card);
  border-radius: 24px;
  padding: 32px 28px 28px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

.topbar{
  display:flex;
  justify-content:flex-end;
  margin-bottom: 10px;
}
.topbar-text{
  margin:0;
  font-size: 13px;
  color: var(--muted);
}
.dot{ margin: 0 6px; color: rgba(156,163,175,0.8); }

.badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, #4c1d95, #ec4899, #f97316);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 18px;
}

.hero-title{
  font-size: clamp(30px, 5vw, 44px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}

.hero-title .highlight{
  background: linear-gradient(90deg, #a855f7, #ec4899, #f97316);
  -webkit-background-clip: text;
  color: transparent;
}

.hero-subtitle{
  margin: 0 0 18px;
  font-size: 14px;
  color: var(--sub);
  max-width: 620px;
}

.pills-row{
  display:flex;
  flex-wrap:wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.pill{
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,0.45);
  font-size: 12px;
  display:inline-flex;
  align-items:center;
  gap: 8px;
  background: rgba(15,23,42,0.85);
}

.pill-dot{
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #22c55e;
}

.section-label{
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #94a3b8;
  margin-top: 10px;
}

.section-title{
  font-size: 14px;
  color: #e5e7eb;
  margin: 6px 0 10px;
}

.vibe-grid{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin: 12px 0 22px;
  align-items: stretch;
}

.vibe-option{
  position: relative;
  width: 100%;
}

.vibe-option input{
  position:absolute;
  opacity:0;
  pointer-events:none;
}

.vibe-card{
  border-radius: 18px;
  padding: 14px 16px;
  min-height: 92px;

  border: 1px solid rgba(148,163,184,0.45);
  background: linear-gradient(135deg, rgba(15,23,42,0.92), rgba(15,23,42,0.72));
  cursor:pointer;

  display:flex;
  align-items:flex-end;
  overflow:hidden;
}

.vibe-text{
  display:flex;
  flex-direction:column;
  gap: 6px;
  width: 100%;
  min-width: 0;
}

.vibe-card .label{
  font-size: 18px;
  font-weight: 750;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.vibe-card .tagline{
  font-size: 12px;
  line-height: 1.35;
  color: rgba(203,213,245,0.92);

  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow:hidden;
}

.vibe-card[data-color="purple"] {
  border-color: rgba(168, 85, 247, 0.95);
  box-shadow: 0 0 0 1px rgba(168, 85, 247, 0.08), inset 0 1px 0 rgba(255,255,255,0.02);
}

.vibe-card[data-color="amber"] {
  border-color: rgba(245, 158, 11, 0.95);
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.08), inset 0 1px 0 rgba(255,255,255,0.02);
}

.vibe-card[data-color="magenta"] {
  border-color: rgba(217, 70, 239, 0.95);
  box-shadow: 0 0 0 1px rgba(217, 70, 239, 0.08), inset 0 1px 0 rgba(255,255,255,0.02);
}

.vibe-card[data-color="orange"] {
  border-color: rgba(249, 115, 22, 0.95);
  box-shadow: 0 0 0 1px rgba(249, 115, 22, 0.08), inset 0 1px 0 rgba(255,255,255,0.02);
}

.vibe-card[data-color="slate"] {
  border-color: rgba(100, 116, 139, 0.82);
  box-shadow: 0 0 0 1px rgba(100, 116, 139, 0.08), inset 0 1px 0 rgba(255,255,255,0.02);
}

.vibe-card[data-color="sky"] {
  border-color: rgba(56, 189, 248, 0.92);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.08), inset 0 1px 0 rgba(255,255,255,0.02);
}

.vibe-card[data-color="blue"] {
  border-color: rgba(59, 130, 246, 0.92);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.08), inset 0 1px 0 rgba(255,255,255,0.02);
}

.vibe-card[data-color="peach"] {
  border-color: rgba(251, 146, 60, 0.88);
  box-shadow: 0 0 0 1px rgba(251, 146, 60, 0.08), inset 0 1px 0 rgba(255,255,255,0.02);
}

.vibe-card[data-color="pink"] {
  border-color: rgba(236, 72, 153, 0.88);
  box-shadow: 0 0 0 1px rgba(236, 72, 153, 0.08), inset 0 1px 0 rgba(255,255,255,0.02);
}

.vibe-card[data-color="cyan"] {
  border-color: rgba(34, 211, 238, 0.88);
  box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.08), inset 0 1px 0 rgba(255,255,255,0.02);
}

.vibe-option input:checked + .vibe-card{
  transform: translateY(-1px);
  border-color: rgba(249, 115, 22, 1);
  box-shadow: 0 16px 48px rgba(147, 51, 234, 0.28);
}

.upload-row{
  margin: 10px 0;
}

.actions-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap: 12px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.secondary-text{
  font-size: 12px;
  color: var(--muted);
  max-width: 520px;
}

.actions-buttons{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
}

.button-primary{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 10px 18px;
  border-radius: 999px;
  border:none;
  cursor:pointer;
  font-size: 14px;
  font-weight: 700;
  background-image: var(--grad);
  color: white;
  box-shadow: 0 14px 45px rgba(15,23,42,0.9);
  white-space: nowrap;
}

.button-primary:hover{
  transform: translateY(-1px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.9);
}

.result-card{
  margin-top: 24px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(148,163,184,0.45);
  background: radial-gradient(circle at top left, rgba(88, 28, 135, 0.35), rgba(15, 23, 42, 0.98));
}

.result-header{
  display:flex;
  justify-content:space-between;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.result-title{
  font-size: 16px;
  font-weight: 750;
}

.result-pill{
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,0.55);
  font-size: 11px;
  color: var(--sub);
}

.result-message{
  font-size: 13px;
  color: var(--sub);
  margin: 8px 0 0;
}

.result-message.error{
  color: #fca5a5;
}

.result-image{
  margin-top: 12px;
  border-radius: 16px;
  max-width: 100%;
  border: 1px solid rgba(15,23,42,0.8);
}

.save-status{
  font-size: 13px;
  margin-top: 8px;
  color: var(--sub);
}
.save-status.ok{ color: #86efac; }
.save-status.bad{ color: #fca5a5; }

.save-status.ok {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.save-library-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 9px 15px;
  border: 1px solid rgba(134, 239, 172, .42);
  border-radius: 999px;
  background: rgba(34, 197, 94, .13);
  color: #dcfce7;
  font-weight: 800;
  text-decoration: none;
  transition: transform .18s ease, background-color .18s ease, border-color .18s ease;
}

.save-library-link:hover {
  transform: translateY(-1px);
  border-color: rgba(134, 239, 172, .72);
  background: rgba(34, 197, 94, .22);
  text-decoration: none;
}

.result-save-button:disabled {
  cursor: default;
  opacity: .68;
}

.save-name-field {
  display: grid;
  gap: 7px;
  max-width: 520px;
  margin-top: 18px;
}

.save-name-field label {
  color: #f8fafc;
  font-size: 13px;
  font-weight: 800;
}

.save-name-field label span,
.save-name-field small {
  color: var(--muted);
  font-weight: 500;
}

.save-name-field .text-input { min-height: 44px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.library-rename-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.library-rename-form .text-input { min-height: 40px; }
.library-rename-form .ai-ghost-btn { min-height: 40px; }

.rename-status {
  grid-column: 1 / -1;
  min-height: 16px;
  color: #86efac;
  font-size: 11px;
}

.ai-actions-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.mini-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #cbd5f5;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.03);
  padding: 6px 10px;
  border-radius: 999px;
}

.ai-title {
  font-size: 18px;
  font-weight: 700;
  margin-top: 6px;
  margin-bottom: 4px;
  color: #ffffff;
}

@media (max-width: 520px){
  .card{ padding: 24px 18px; }
  .vibe-grid{ grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
  .button-primary{ width: 100%; }
  .actions-buttons{ width: 100%; }
}

/* Hide the native file input, keep it accessible */
.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.file-picker {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(15, 23, 42, 0.85);
  color: #f9fafb;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.file-picker:hover {
  transform: translateY(-1px);
  border-color: rgba(249, 115, 22, 0.9);
  box-shadow: 0 14px 40px rgba(0,0,0,0.35);
}

.file-picker-icon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;

  background: linear-gradient(135deg, rgba(139, 92, 246, 0.35), rgba(236, 72, 153, 0.25));
  border: 1px solid rgba(148, 163, 184, 0.25);
  font-size: 14px;
}

.file-picker-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.file-picker-title {
  font-size: 13px;
  font-weight: 700;
  color: #f9fafb;
}

.file-picker-sub {
  font-size: 12px;
  color: rgba(203, 213, 245, 0.85);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-picker-btn {
  padding: 9px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  background-image: linear-gradient(90deg, #8b5cf6, #ec4899, #f97316);
  color: white;
  white-space: nowrap;
}

/* Vibe title vs description */
.vibe-card .vibe-title {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.vibe-card .vibe-desc {
  font-size: 12px;
  line-height: 1.35;
  color: rgba(203, 213, 245, 0.85);

  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ai-report {
  margin-top: 14px;
}

.ai-report-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.ai-report-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0;
  color: #ffffff;
}

.ai-report-summary {
  margin: 8px 0 0;
  color: #cbd5f5;
  font-size: 13px;
  line-height: 1.6;
  max-width: 70ch;
}

.ai-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.ai-tab {
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.05);
  color: #e5e7eb;
  padding: 7px 11px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  user-select: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.ai-tab:hover {
  background: rgba(255,255,255,0.08);
}

.ai-tab.active {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.24);
}

.ai-panel {
  margin-top: 12px;
}

.ai-panel-wrap {
  margin-top: 10px;
}

.ai-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 950px) {
  .ai-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.ai-card {
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.03);
  border-radius: 16px;
  padding: 12px;
}

.ai-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.ai-card-title {
  font-weight: 800;
  font-size: 13px;
  color: #ffffff;
  margin: 0;
}

.ai-chip {
  font-size: 12px;
  color: #cbd5f5;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.03);
  padding: 4px 8px;
  border-radius: 999px;
}

.ai-text {
  color: #cbd5f5;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.ai-list {
  margin: 0;
  padding-left: 18px;
  color: #cbd5f5;
  font-size: 13px;
  line-height: 1.55;
}

.ai-list li { margin: 6px 0; }

.ai-clamp {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ai-clamp.is-collapsed {
  -webkit-line-clamp: 6;
}

.ai-more-row {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ai-ghost-btn {
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.04);
  color: #e5e7eb;

  padding: 12px 16px; 
  border-radius: 12px; 

  font-size: 13px;
  font-weight: 600;

  cursor: pointer;
  transition: all 0.18s ease;

  display: flex;
  align-items: center;
  justify-content: center;

  min-height: 42px;
}

.ai-ghost-btn:hover {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.18);
}

.ai-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
}

.ai-ig-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 950px) {
  .ai-ig-grid {
    grid-template-columns: 1fr 1fr;
  }
  .ai-ig-grid .ai-card.full {
    grid-column: 1 / -1;
  }
}

.ai-hashtags {
  word-break: break-word;
  line-height: 1.8;
}

.ai-divider {
  height: 1px;
  background: rgba(255,255,255,0.10);
  margin: 10px 0;
}

.library-grid{
  display:grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin-top: 14px;
}

.library-item{
  border-radius: 18px;
  border: 1px solid rgba(148,163,184,0.45);
  background: radial-gradient(circle at top left, rgba(88, 28, 135, 0.22), rgba(15, 23, 42, 0.98));
  overflow: hidden;
}

.library-thumb{
  height: 220px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.library-image{
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.library-body{
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.library-title{
  font-size: 15px;
  font-weight: 900;
  letter-spacing: -0.01em;
  color: #fff;
  margin: 0;
  line-height: 1.25;
  overflow-wrap: anywhere;
  word-break: break-word;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.library-summary{
  font-size: 13px;
  color: #cbd5f5;
  line-height: 1.55;
  margin: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
}

.library-pills{
  display:flex;
  gap: 8px;
  row-gap: 8px;
  flex-wrap: wrap;
}

.library-actions{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

@media (min-width: 900px){
  .library-item{
    display:grid;
    grid-template-columns: 320px 1fr;
    align-items: stretch;
  }

  .library-thumb{
    height: 100%;
    min-height: 260px;
    border-bottom: none;
    border-right: 1px solid rgba(255,255,255,0.08);
  }

  .library-body{
    padding: 16px;
  }
}

@media (max-width: 520px){
  .library-actions{
    flex-direction: column;
    align-items: stretch;
  }
  .library-actions .ai-ghost-btn{
    width: 100%;
    justify-content: center;
  }
}

.ai-readable{
  white-space: normal; 
}

.ai-readable .ai-line{
  margin: 0 0 10px;
  line-height: 1.75;
  font-size: 14px;
}

.ai-readable .ai-bullet{
  position: relative;
  padding-left: 14px;
  margin: 0 0 10px;
  line-height: 1.75;
  font-size: 14px;
}

.ai-readable .ai-bullet::before{
  content: "•";
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0.9;
}

.ai-readable .ai-kv{
  display:flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: baseline;
  margin: 0 0 10px;
  line-height: 1.75;
  font-size: 14px;
}

.ai-readable .ai-k{
  font-weight: 900;
  color: rgba(255,255,255,0.92);
}

.ai-readable .ai-v{
  color: #cbd5f5;
}

body.modal-open{ overflow: hidden; }

.report-modal{
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
}

.report-modal.open{ display: block; }

.report-modal-backdrop{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.62);
  backdrop-filter: blur(6px);
}

.report-modal-sheet{
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: 50%;
  width: min(1240px, calc(100% - 36px));
  transform: translate(-50%, 10px);
  opacity: 0;

  border-radius: 22px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(15,23,42,0.92);
  box-shadow: 0 30px 110px rgba(0,0,0,0.75);
  overflow: hidden;

  transition: transform .16s ease, opacity .16s ease;
}

.report-modal.open .report-modal-sheet{
  transform: translate(-50%, 0);
  opacity: 1;
}

.report-modal-x{
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color: #fff;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  z-index: 2;
}

.report-modal-x:hover{
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.22);
}

.report-modal-content{
  height: 100%;
  overflow: auto;
  padding: 18px 18px 22px;
}

.report-modal-head{
  display:flex;
  align-items:flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-right: 54px;
}

.report-modal-title{
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0;
  color: #fff;
}

.report-modal-sub{
  display:flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.report-modal-actions{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.report-modal-top{
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: start;
}

@media (min-width: 900px){
  .report-modal-top{
    grid-template-columns: 520px 1fr;
  }
}

.report-modal-image{
  border-radius: 18px;
  overflow:hidden;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.03);
}

.report-modal-image img{
  width:100%;
  height:auto;
  display:block;
}

.report-modal-side{
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.03);
  padding: 14px;
}

.report-modal-summary-text{
  margin-top: 8px;
  color: #cbd5f5;
  font-size: 14.5px;
  line-height: 1.75;
  max-width: 72ch;
}

.report-modal-mini{
  margin-top: 14px;
}

.report-modal-mini-row{
  margin-top: 8px;
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
}

.report-modal-grid{
  margin-top: 10px;
  display:grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 900px){
  .report-modal-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1200px){
  .report-modal-grid{
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.report-modal-grid .ai-card{
  border-radius: 18px;
  padding: 14px;
}

@media (max-width: 520px){
  .report-modal-sheet{
    top: 10px;
    bottom: 10px;
    width: calc(100% - 20px);
    border-radius: 18px;
  }
  .report-modal-content{
    padding: 14px 14px 18px;
  }
  .report-modal-title{
    font-size: 18px;
  }
  .report-modal-summary-text{
    font-size: 14px;
  }
}

/* Smooth app-wide animations */

/* subtle animated ambient glow */
body::before,
body::after{
  content:"";
  position: fixed;
  inset: auto;
  pointer-events: none;
  z-index: 0;
  filter: blur(80px);
  opacity: 0.22;
  animation: ambientFloat 14s ease-in-out infinite alternate;
}

body::before{
  width: 380px;
  height: 380px;
  top: 80px;
  left: -80px;
  background: radial-gradient(circle, rgba(168,85,247,0.32), transparent 68%);
}

body::after{
  width: 420px;
  height: 420px;
  right: -120px;
  bottom: 40px;
  background: radial-gradient(circle, rgba(249,115,22,0.20), transparent 68%);
  animation-duration: 18s;
}

@keyframes ambientFloat{
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(18px, -14px, 0) scale(1.06); }
}

/* keep app above glow */
.page,
.card{
  position: relative;
  z-index: 1;
}

/* page entrance */
.card{
  animation: pageRise 0.8s var(--ease-smooth) both;
  will-change: transform, opacity;
}

@keyframes pageRise{
  from{
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }
  to{
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* reusable reveal classes */
.reveal-up,
.reveal-fade,
.reveal-scale{
  animation-fill-mode: both;
  animation-duration: 0.72s;
  animation-timing-function: var(--ease-smooth);
  will-change: transform, opacity;
}

.reveal-up{ animation-name: revealUp; }
.reveal-fade{ animation-name: revealFade; }
.reveal-scale{ animation-name: revealScale; }

.delay-1{ animation-delay: 0.05s; }
.delay-2{ animation-delay: 0.12s; }
.delay-3{ animation-delay: 0.19s; }
.delay-4{ animation-delay: 0.26s; }
.delay-5{ animation-delay: 0.33s; }
.delay-6{ animation-delay: 0.40s; }
.delay-7{ animation-delay: 0.47s; }
.delay-8{ animation-delay: 0.54s; }

@keyframes revealUp{
  from{
    opacity: 0;
    transform: translateY(18px);
  }
  to{
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes revealFade{
  from{ opacity: 0; }
  to{ opacity: 1; }
}

@keyframes revealScale{
  from{
    opacity: 0;
    transform: scale(0.97);
  }
  to{
    opacity: 1;
    transform: scale(1);
  }
}

/* topbar + badge polish */
.topbar,
.badge,
.hero-title,
.hero-subtitle,
.pills-row,
.section-label,
.section-title,
.upload-row,
.actions-row,
.result-card,
.ai-report,
.library-item,
.report-modal-head,
.report-modal-top,
.report-modal-grid .ai-card{
  backface-visibility: hidden;
}

a,
.button-primary,
.ai-ghost-btn,
.ai-tab,
.file-picker,
.vibe-card,
.library-item,
.report-modal-sheet,
.report-modal-x{
  transition:
    transform 0.28s var(--ease-soft),
    box-shadow 0.28s var(--ease-soft),
    border-color 0.28s var(--ease-soft),
    background-color 0.28s var(--ease-soft),
    opacity 0.28s var(--ease-soft);
}

.button-primary{
  position: relative;
  overflow: hidden;
}

.button-primary::before{
  content:"";
  position:absolute;
  inset:0;
  background: linear-gradient(120deg, transparent 20%, rgba(255,255,255,0.18) 50%, transparent 80%);
  transform: translateX(-140%);
  transition: transform 0.7s var(--ease-soft);
}

.button-primary:hover{
  transform: translateY(-2px) scale(1.01);
}

.button-primary:hover::before{
  transform: translateX(140%);
}

.button-primary:active{
  transform: translateY(0) scale(0.985);
}

/* vibe cards feel more premium */
.vibe-card{
  transform-origin: center;
}

.vibe-option:hover .vibe-card{
  transform: translateY(-4px);
  box-shadow: 0 20px 52px rgba(0,0,0,0.28);
}

.vibe-option input:checked + .vibe-card{
  transform: translateY(-3px) scale(1.01);
}

.pill{
  transition:
    transform 0.25s var(--ease-soft),
    border-color 0.25s var(--ease-soft),
    background-color 0.25s var(--ease-soft);
}

.pill:hover{
  transform: translateY(-1px);
  border-color: rgba(255,255,255,0.26);
}

/* upload card */
.file-picker:hover{
  transform: translateY(-2px);
}

/* results and reports */
.result-card,
.ai-card,
.library-item{
  transition:
    transform 0.32s var(--ease-soft),
    box-shadow 0.32s var(--ease-soft),
    border-color 0.32s var(--ease-soft);
}

.result-card:hover,
.ai-card:hover{
  box-shadow: 0 18px 54px rgba(0,0,0,0.20);
}

.library-item:hover{
  transform: translateY(-4px);
  box-shadow: 0 22px 58px rgba(0,0,0,0.26);
}

.result-image,
.library-image{
  animation: imageSoftIn 0.8s var(--ease-smooth) both;
  transform-origin: center;
}

@keyframes imageSoftIn{
  from{
    opacity: 0;
    transform: scale(0.985);
  }
  to{
    opacity: 1;
    transform: scale(1);
  }
}

.ai-tab.active{
  transform: translateY(-1px);
}

.ai-panel-wrap{
  opacity: 1;
}

/* AI panels animate */
.ai-panel-wrap.is-entering{
  animation: panelIn 0.34s var(--ease-smooth);
}

@keyframes panelIn{
  from{
    opacity: 0;
    transform: translateY(8px);
  }
  to{
    opacity: 1;
    transform: translateY(0);
  }
}

/* save status + live feedback */
.save-status{
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.save-status.ok,
.save-status.bad{
  animation: statusPop 0.35s var(--ease-smooth);
}

@keyframes statusPop{
  0%{
    opacity: 0;
    transform: translateY(4px);
  }
  100%{
    opacity: 1;
    transform: translateY(0);
  }
}

/* library stagger */
.library-grid .library-item{
  opacity: 0;
  animation: revealUp 0.7s var(--ease-smooth) both;
}

.library-grid .library-item:nth-child(1){ animation-delay: 0.05s; }
.library-grid .library-item:nth-child(2){ animation-delay: 0.12s; }
.library-grid .library-item:nth-child(3){ animation-delay: 0.19s; }
.library-grid .library-item:nth-child(4){ animation-delay: 0.26s; }
.library-grid .library-item:nth-child(5){ animation-delay: 0.33s; }
.library-grid .library-item:nth-child(6){ animation-delay: 0.40s; }
.library-grid .library-item:nth-child(7){ animation-delay: 0.47s; }
.library-grid .library-item:nth-child(8){ animation-delay: 0.54s; }

/* modal feels smoother */
.report-modal{
  transition: opacity 0.22s ease;
}

.report-modal-backdrop{
  opacity: 0;
  transition: opacity 0.24s ease;
}

.report-modal.open .report-modal-backdrop{
  opacity: 1;
}

.report-modal-sheet{
  transform: translate(-50%, 18px) scale(0.985);
  opacity: 0;
}

.report-modal.open .report-modal-sheet{
  transform: translate(-50%, 0) scale(1);
  opacity: 1;
}

.loading-shimmer{
  position: relative;
  overflow: hidden;
}

.loading-shimmer::after{
  content:"";
  position:absolute;
  inset:0;
  background: linear-gradient(
    110deg,
    transparent 0%,
    rgba(255,255,255,0.06) 40%,
    rgba(255,255,255,0.12) 50%,
    transparent 60%
  );
  transform: translateX(-120%);
  animation: shimmer 1.35s linear infinite;
}

@keyframes shimmer{
  to{ transform: translateX(120%); }
}

@media (prefers-reduced-motion: reduce){
  *,
  *::before,
  *::after{
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }

  .reveal-up,
  .reveal-fade,
  .reveal-scale,
  .library-grid .library-item{
    opacity: 1 !important;
  }
}

.file-picker:focus {
  border-color: #ec4899;
  box-shadow: 0 0 0 2px rgba(236,72,153,0.25);
}

.library-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

.library-actions-grid form {
  margin: 0;
}

.library-actions-grid .ai-ghost-btn {
  width: 100%;
}

.ai-ghost-btn.danger {
  border-color: rgba(248,113,113,0.25);
  color: #fca5a5;
}

.ai-ghost-btn.danger:hover {
  background: rgba(248,113,113,0.08);
  border-color: rgba(248,113,113,0.45);
}

a.ai-ghost-btn {
  text-decoration: none;
}

/* === Custom Aesthetic Input (matches file-picker + ai-card style) === */

.custom-aesthetic-box {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.custom-aesthetic-label {
  font-size: 12px;
  color: var(--muted);
}

/* main textbox */
.custom-aesthetic-input {
  width: 100%;
  padding: 14px;
  border-radius: 16px;

  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(15, 23, 42, 0.65);

  color: var(--text);
  font: inherit;

  resize: vertical;
  min-height: 90px;

  transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

.custom-aesthetic-input::placeholder {
  color: rgba(203, 213, 245, 0.6);
}

.custom-aesthetic-input:hover {
  transform: translateY(-1px);
  border-color: rgba(249, 115, 22, 0.9);
  box-shadow: 0 14px 40px rgba(0,0,0,0.35);
}

.custom-aesthetic-input:focus {
  outline: none;
  border-color: rgba(236, 72, 153, 0.9);
  box-shadow: 0 0 0 2px rgba(236,72,153,0.25);
}

#ai-filter-preview {
  margin-top: 14px;
}

.ai-filter-grid {
  align-items: start;
}

.ai-card-compact {
  max-width: 100%;
}

.before-after-card{
  margin-top: 18px;
  padding: 12px;
  border: 1px solid rgba(148,163,184,.16);
  border-radius: 20px;
  background: rgba(2,6,23,.32);
}

.comparison-toolbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap: 12px;
  padding: 2px 2px 12px;
}

.comparison-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--sub);
  font-size: 12px;
  font-weight: 700;
}

.comparison-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c084fc;
  box-shadow: 0 0 0 4px rgba(192,132,252,.1);
}

.compare-toggle-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 14px;
  border: 1px solid rgba(192,132,252,.32);
  border-radius: 999px;
  background: rgba(139,92,246,.11);
  color: #f3e8ff;
  font: 800 12px/1 inherit;
  cursor: pointer;
  transition: transform .18s ease, background-color .18s ease, border-color .18s ease;
}

.compare-toggle-button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(244,114,182,.58);
  background: rgba(139,92,246,.19);
}

.compare-toggle-button > span:first-child {
  color: #f0abfc;
  font-size: 15px;
}

.comparison-frame{
  position: relative;
  display: grid;
  width: 100%;
  overflow: hidden;
  place-items: center;
  border: 1px solid rgba(148,163,184,.13);
  border-radius: 14px;
  background:
    linear-gradient(45deg, rgba(255,255,255,.018) 25%, transparent 25%, transparent 75%, rgba(255,255,255,.018) 75%),
    linear-gradient(45deg, rgba(255,255,255,.018) 25%, transparent 25%, transparent 75%, rgba(255,255,255,.018) 75%),
    #050816;
  background-position: 0 0, 10px 10px;
  background-size: 20px 20px;
  aspect-ratio: 16 / 10;
}

.comparison-image{
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  transition: opacity .2s ease, transform .2s ease;
}

.comparison-frame.is-switching .comparison-image {
  opacity: 0;
  transform: scale(.995);
}

.image-state-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 6px 10px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  background: rgba(2,6,23,.76);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  box-shadow: 0 8px 24px rgba(0,0,0,.24);
}

.custom-aesthetic-input-sm{
  min-height: 64px;
}

/* Home creator workspace */
html { scroll-behavior: smooth; }

.app-shell { overflow: hidden; }

.topbar {
  align-items: center;
  justify-content: space-between;
  padding-bottom: 18px;
  margin-bottom: 0;
  border-bottom: 1px solid rgba(148,163,184,0.14);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 850;
  letter-spacing: -0.02em;
}

.brand:hover { text-decoration: none; }

.brand-mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 10px;
  background: var(--grad);
  box-shadow: 0 8px 24px rgba(168,85,247,0.28);
  font-size: 13px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, .75fr);
  gap: clamp(30px, 6vw, 72px);
  align-items: center;
  padding: clamp(44px, 8vw, 82px) 0;
}

.hero-copy { max-width: 700px; }
.hero-title { font-size: clamp(38px, 6vw, 64px); max-width: 13ch; }
.hero-subtitle { max-width: 62ch; font-size: 15px; line-height: 1.7; margin-bottom: 24px; }
.hero-cta { gap: 10px; padding: 12px 20px; }

.hero-features {
  border: 1px solid rgba(148,163,184,0.18);
  border-radius: 20px;
  padding: 8px 18px;
  background: linear-gradient(145deg, rgba(139,92,246,.09), rgba(15,23,42,.38));
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 0;
}

.feature-item + .feature-item { border-top: 1px solid rgba(148,163,184,0.13); }
.feature-icon { color: #c084fc; font: 700 11px/1 ui-monospace, monospace; }
.feature-item div { display: flex; flex-direction: column; gap: 4px; }
.feature-item strong { font-size: 13px; }
.feature-item div span { color: var(--muted); font-size: 11px; line-height: 1.4; }

.creator-form { scroll-margin-top: 22px; }

.workspace-panel {
  border: 1px solid rgba(148,163,184,0.18);
  border-radius: 20px;
  background: rgba(8,14,30,0.48);
  padding: 20px;
}

.section-heading { display: flex; align-items: flex-start; gap: 13px; }
.step-number {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(192,132,252,.45);
  border-radius: 11px;
  color: #d8b4fe;
  background: rgba(139,92,246,.1);
  font: 800 11px/1 ui-monospace, monospace;
}
.step-number.optional { color: #f9a8d4; border-color: rgba(236,72,153,.4); background: rgba(236,72,153,.08); }
.section-label { margin: 0 0 5px; color: #a78bfa; }
.section-title { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.section-description { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }

.upload-panel { display: grid; grid-template-columns: minmax(220px, .75fr) minmax(300px, 1.25fr); gap: 24px; align-items: center; }
.upload-row { margin: 0; }
.file-picker { min-height: 74px; border-style: dashed; background: rgba(255,255,255,.025); }

.creator-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(270px, .75fr); gap: 14px; margin-top: 14px; align-items: stretch; }
.vibe-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 18px 0 0; gap: 9px; }
.vibe-card { min-height: 74px; padding: 12px 14px; border-color: rgba(148,163,184,.24); transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease; }
.vibe-card .vibe-title { font-size: 15px; }
.vibe-option input:focus-visible + .vibe-card { outline: 2px solid #c084fc; outline-offset: 2px; }
.vibe-option input:checked + .vibe-card { background: linear-gradient(135deg, rgba(88,28,135,.42), rgba(15,23,42,.84)); }

.ai-custom-panel { display: flex; flex-direction: column; }
.ai-custom-panel .custom-aesthetic-box:first-of-type { margin-top: 20px; }
.ai-custom-action { margin-top: 10px; }
.ai-custom-action .button-primary, .refine-action .ai-ghost-btn { width: 100%; }
.refine-action { margin-top: 9px; }
.panel-divider { display: flex; align-items: center; gap: 10px; margin: 19px 0; color: #64748b; font-size: 10px; text-transform: uppercase; letter-spacing: .14em; }
.panel-divider::before, .panel-divider::after { content: ""; height: 1px; flex: 1; background: rgba(148,163,184,.14); }
.custom-aesthetic-input { resize: vertical; }

.generate-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 14px;
  padding: 18px 20px;
  border: 1px solid rgba(192,132,252,.24);
  border-radius: 20px;
  background: linear-gradient(100deg, rgba(76,29,149,.22), rgba(236,72,153,.07), rgba(249,115,22,.06));
}
.generate-copy { display: flex; align-items: center; gap: 13px; }
.generate-copy div { display: flex; flex-direction: column; gap: 4px; }
.generate-copy strong { font-size: 14px; }
.generate-copy div span { color: var(--muted); font-size: 11px; }
.generate-bar .button-primary { gap: 8px; }
.result-studio {
  padding: clamp(18px, 3vw, 28px);
  border-color: rgba(192,132,252,.26);
  background:
    radial-gradient(circle at 8% 0%, rgba(139,92,246,.16), transparent 34%),
    rgba(8,14,30,.76);
}
.result-eyebrow {
  margin-bottom: 5px;
  color: #c084fc;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .15em;
  text-transform: uppercase;
}
.result-studio .result-title { font-size: clamp(20px, 3vw, 26px); }
.result-studio .result-message { max-width: 64ch; line-height: 1.6; }
.result-actions { justify-content: flex-end; margin-top: 14px; }
.result-actions > * { min-height: 44px; }
.result-save-button { padding-inline: 18px; }
#download-btn { text-decoration: none; }

.vibe-card { position: relative; }
.vibe-card::after {
  content: "✓";
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #a855f7, #ec4899);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  opacity: 0;
  transform: scale(.7);
  transition: opacity .18s ease, transform .18s ease;
  box-shadow: 0 5px 16px rgba(168,85,247,.28);
}
.vibe-option input:checked + .vibe-card::after {
  opacity: 1;
  transform: scale(1);
}

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; gap: 28px; padding: 44px 0; }
  .hero-features { display: grid; grid-template-columns: repeat(3, 1fr); }
  .feature-item { align-items: flex-start; padding: 12px; }
  .feature-item + .feature-item { border-top: 0; border-left: 1px solid rgba(148,163,184,.13); }
  .creator-grid, .upload-panel { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .page { padding: 12px 10px 28px; }
  .app-shell { padding: 20px 15px; border-radius: 20px; }
  .topbar { align-items: flex-start; gap: 12px; }
  .topbar-text { max-width: 65%; text-align: right; line-height: 1.7; }
  .hero { padding: 36px 0; }
  .hero-title { font-size: 38px; }
  .hero-features { grid-template-columns: 1fr; }
  .feature-item { padding: 13px 0; }
  .feature-item + .feature-item { border-left: 0; border-top: 1px solid rgba(148,163,184,.13); }
  .workspace-panel { padding: 16px; }
  .vibe-grid { grid-template-columns: 1fr 1fr; }
  .generate-bar { align-items: stretch; flex-direction: column; }
  .generate-bar .actions-buttons { flex-direction: column-reverse; }
  .file-picker-btn { display: none; }
}

/* Shared secondary pages */
.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, .95fr);
  max-width: 980px;
  min-height: min(700px, calc(100vh - 64px));
  padding: 0;
  overflow: hidden;
}

.auth-intro {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 630px;
  padding: 34px;
  overflow: hidden;
  background: radial-gradient(circle at 10% 85%, rgba(236,72,153,.2), transparent 44%), radial-gradient(circle at 90% 10%, rgba(139,92,246,.26), transparent 42%), rgba(8,14,30,.55);
  border-right: 1px solid rgba(148,163,184,.16);
}
.auth-intro::after { content: ""; position: absolute; width: 280px; height: 280px; right: -140px; bottom: 50px; border: 1px solid rgba(192,132,252,.16); border-radius: 50%; box-shadow: 0 0 0 42px rgba(192,132,252,.025), 0 0 0 84px rgba(236,72,153,.02); }
.auth-intro > * { position: relative; z-index: 1; }
.auth-intro-copy .hero-title { max-width: 9ch; font-size: clamp(38px, 5vw, 54px); }
.auth-intro-copy .hero-subtitle { max-width: 42ch; }
.auth-note { display: inline-flex; align-items: center; gap: 9px; color: var(--sub); font-size: 12px; }

.auth-form-panel { display: flex; flex-direction: column; justify-content: center; padding: clamp(32px, 6vw, 58px); }
.auth-form-head { margin-bottom: 22px; }
.auth-form-head h2 { margin: 7px 0 7px; font-size: 24px; letter-spacing: -.025em; }
.auth-form-head p { margin: 0; color: var(--muted); font-size: 13px; }
.auth-provider-btn { width: 100%; min-height: 46px; border: 1px solid rgba(148,163,184,.24); border-radius: 13px; background: rgba(255,255,255,.045); color: var(--text); cursor: pointer; font: 700 13px/1 inherit; transition: background .18s ease, border-color .18s ease, transform .18s ease; }
.auth-provider-btn:hover { transform: translateY(-1px); background: rgba(255,255,255,.075); border-color: rgba(192,132,252,.4); }
.provider-content { display: inline-flex; align-items: center; gap: 10px; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 22px 0; color: #64748b; font-size: 10px; text-transform: uppercase; letter-spacing: .12em; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: rgba(148,163,184,.16); }
.auth-form { display: grid; gap: 15px; }
.form-field { display: grid; gap: 7px; }
.form-field label { font-size: 12px; font-weight: 750; color: #e5e7eb; }
.text-input { width: 100%; min-height: 46px; padding: 11px 13px; border: 1px solid rgba(148,163,184,.24); border-radius: 12px; outline: none; background: rgba(8,14,30,.62); color: var(--text); font: inherit; font-size: 13px; transition: border-color .18s ease, box-shadow .18s ease; }
.text-input::placeholder { color: #64748b; }
.text-input:focus { border-color: #a855f7; box-shadow: 0 0 0 3px rgba(168,85,247,.12); }
.field-hint { color: #64748b; font-size: 10px; }
.auth-submit { width: 100%; min-height: 46px; gap: 9px; margin-top: 3px; }
.auth-error { margin: 0 0 14px; padding: 10px 12px; border: 1px solid rgba(248,113,113,.2); border-radius: 10px; background: rgba(127,29,29,.13); }
.auth-footer { display: flex; justify-content: space-between; gap: 15px; margin-top: 22px; color: var(--muted); font-size: 11px; }
.auth-footer a { color: #e9d5ff; font-weight: 700; }

.library-hero, .public-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; padding: 48px 0 30px; }
.library-hero .hero-title, .public-hero .hero-title { max-width: 16ch; }
.library-hero .hero-subtitle { margin-bottom: 0; }
.library-grid { gap: 14px; }
.library-item { border-color: rgba(148,163,184,.2); transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.library-item:hover { transform: translateY(-2px); border-color: rgba(192,132,252,.36); box-shadow: 0 18px 48px rgba(0,0,0,.24); }
.library-title { font-size: 18px; }
.library-body { justify-content: center; gap: 13px; }
.library-actions-grid { padding-top: 2px; }
.empty-state { display: grid; justify-items: center; gap: 12px; margin-top: 12px; padding: 68px 24px; border: 1px dashed rgba(148,163,184,.26); border-radius: 20px; background: rgba(8,14,30,.35); text-align: center; }
.empty-state-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 15px; color: #f0abfc; background: linear-gradient(135deg, rgba(139,92,246,.2), rgba(236,72,153,.15)); font-size: 22px; }
.empty-state p { max-width: 48ch; margin: 0 0 4px; color: var(--muted); font-size: 13px; line-height: 1.6; }

.public-shell { max-width: 1040px; }
.public-summary { max-width: 62ch; margin: 10px 0 0; color: var(--sub); font-size: 15px; line-height: 1.7; }
.public-meta { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.compact-btn { min-height: auto; padding: 9px 13px; text-decoration: none; }
.public-image-wrap { margin: 0; overflow: hidden; border: 1px solid rgba(148,163,184,.2); border-radius: 20px; background: rgba(8,14,30,.48); }
.public-image-wrap img { display: block; width: 100%; max-height: 680px; object-fit: contain; background: #050816; }
.public-image-wrap figcaption { padding: 11px 14px; border-top: 1px solid rgba(148,163,184,.14); color: var(--muted); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.public-report { margin-top: 34px; }
.public-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.public-section-head h2 { margin: 5px 0 0; font-size: 23px; letter-spacing: -.025em; }
.public-section-head > span { color: var(--muted); font-size: 11px; }
.public-report-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.public-report-card { padding: 16px; }
.public-report-card .ai-card-title { margin-bottom: 9px; }
.public-footer { display: flex; justify-content: space-between; margin-top: 34px; padding-top: 18px; border-top: 1px solid rgba(148,163,184,.14); color: var(--muted); font-size: 11px; }
.public-footer a { color: #e9d5ff; font-weight: 750; }

@media (max-width: 760px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-intro { min-height: 310px; padding: 26px; }
  .auth-intro-copy { margin: 44px 0; }
  .auth-intro-copy .hero-title { font-size: 40px; }
  .auth-form-panel { padding: 30px 24px; }
  .library-hero, .public-hero { align-items: flex-start; flex-direction: column; padding: 38px 0 24px; }
  .public-meta { justify-content: flex-start; }
  .public-report-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .auth-intro { min-height: 280px; }
  .auth-note { display: none; }
  .auth-footer { flex-direction: column; }
  .library-hero .button-primary { width: 100%; }
  .public-shell .topbar-text { max-width: none; }
  .compact-btn { width: auto; font-size: 11px; }
}

button:disabled{
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

.shimmer-card{
  position: relative;
  overflow: hidden;
}

.skeleton{
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  background: rgba(255,255,255,0.08);
}

.skeleton::after{
  content: "";
  position: absolute;
  top: 0;
  left: -150%;
  width: 120%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255,255,255,0.18),
    transparent
  );
  animation: shimmerMove 1.25s infinite;
}

@keyframes shimmerMove{
  100%{
    left: 150%;
  }
}

.skeleton-title{
  width: 220px;
  max-width: 60%;
  height: 22px;
  margin-bottom: 10px;
}

.skeleton-subtitle{
  width: 340px;
  max-width: 78%;
  height: 13px;
}

.skeleton-pill{
  width: 110px;
  height: 28px;
  border-radius: 999px;
}

.skeleton-card-title{
  width: 130px;
  height: 16px;
  margin-bottom: 12px;
}

.skeleton-line{
  width: 100%;
  height: 12px;
  margin-bottom: 10px;
}

.skeleton-line.short{
  width: 72%;
}

.loading-copy{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  font-size: 13px;
  color: #cbd5f5;
}

.loading-spinner{
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,0.22);
  border-top-color: rgba(255,255,255,0.9);
  animation: spin 0.8s linear infinite;
}

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

#ai-filter-preview > *{
  animation: fadeInSoft 0.22s ease;
}

@keyframes fadeInSoft{
  from{
    opacity: 0;
    transform: translateY(4px);
  }
  to{
    opacity: 1;
    transform: translateY(0);
  }
}
.link-button {
  text-decoration: none;
}

.library-delete-form {
  margin: 0;
}

/* Editor feedback and phone-first refinements */
.file-picker-visual {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  place-items: center;
  overflow: hidden;
  border-radius: 12px;
}

.file-picker-visual .file-picker-icon {
  width: 100%;
  height: 100%;
}

.upload-thumbnail {
  position: absolute;
  inset: 0;
  display: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.file-picker.has-preview {
  border-color: rgba(192,132,252,.58);
  background: linear-gradient(100deg, rgba(88,28,135,.17), rgba(15,23,42,.72));
}

.file-picker.has-preview .upload-thumbnail { display: block; }
.file-picker.has-preview .file-picker-icon { visibility: hidden; }

@media (max-width: 560px) {
  body {
    background-attachment: scroll;
  }

  .card,
  .reveal-up,
  .reveal-fade,
  .reveal-scale {
    animation-duration: .38s;
    animation-delay: 0s;
    will-change: auto;
  }

  .card {
    backdrop-filter: none;
  }

  .topbar {
    align-items: center;
    flex-wrap: wrap;
  }

  .topbar-text {
    max-width: 100%;
    flex: 1 1 190px;
    font-size: 12px;
  }

  .hero {
    padding: 30px 0 34px;
  }

  .hero-title {
    font-size: clamp(34px, 10.5vw, 40px);
  }

  .hero-subtitle {
    font-size: 14px;
    line-height: 1.62;
  }

  .workspace-panel,
  .generate-bar,
  .result-card {
    border-radius: 16px;
  }

  .section-heading {
    gap: 11px;
  }

  .section-title {
    font-size: 17px;
  }

  .file-picker {
    min-height: 76px;
    padding: 12px;
    backdrop-filter: none;
  }

  .generate-bar .actions-buttons,
  .result-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .generate-bar button,
  .result-actions > * {
    width: 100%;
    min-height: 46px;
  }

  .comparison-frame {
    border-radius: 12px;
    aspect-ratio: 4 / 5;
  }

  .ai-grid,
  .ai-ig-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 430px) {
  .page {
    padding: 0;
  }

  .app-shell {
    padding: 17px 13px 24px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .brand-mark {
    width: 28px;
    height: 28px;
  }

  .hero-features {
    padding-inline: 14px;
  }

  .workspace-panel {
    padding: 15px 13px;
  }

  .vibe-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .vibe-card {
    min-height: 68px;
  }

  .vibe-card .vibe-desc {
    -webkit-line-clamp: 1;
  }

  .file-picker-btn {
    display: none;
  }

  .file-picker-sub {
    max-width: 190px;
  }

  .result-header,
  .comparison-toolbar {
    align-items: flex-start;
  }

  .comparison-toolbar {
    flex-direction: column;
  }

  .compare-toggle-button {
    width: 100%;
    min-height: 46px;
  }

  .before-after-card {
    padding: 9px;
  }
}

/* Preset color system: every aesthetic keeps its own visual identity. */
.vibe-card[data-color] {
  border-color: color-mix(in srgb, var(--vibe-accent) 55%, transparent);
  background:
    radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--vibe-accent) 25%, transparent), transparent 52%),
    linear-gradient(135deg, color-mix(in srgb, var(--vibe-deep) 52%, #0f172a), rgba(8, 14, 30, .92));
  box-shadow: inset 3px 0 0 color-mix(in srgb, var(--vibe-accent) 80%, transparent);
}

.vibe-card[data-color="purple"]  { --vibe-accent: #c084fc; --vibe-deep: #581c87; }
.vibe-card[data-color="amber"]   { --vibe-accent: #fbbf24; --vibe-deep: #78350f; }
.vibe-card[data-color="magenta"] { --vibe-accent: #f472d0; --vibe-deep: #831843; }
.vibe-card[data-color="orange"]  { --vibe-accent: #fb923c; --vibe-deep: #7c2d12; }
.vibe-card[data-color="slate"]   { --vibe-accent: #cbd5e1; --vibe-deep: #1e293b; }
.vibe-card[data-color="sky"]     { --vibe-accent: #7dd3fc; --vibe-deep: #0c4a6e; }
.vibe-card[data-color="blue"]    { --vibe-accent: #60a5fa; --vibe-deep: #172554; }
.vibe-card[data-color="peach"]   { --vibe-accent: #fdba74; --vibe-deep: #9a3412; }
.vibe-card[data-color="pink"]    { --vibe-accent: #f9a8d4; --vibe-deep: #701a75; }
.vibe-card[data-color="cyan"]    { --vibe-accent: #67e8f9; --vibe-deep: #164e63; }

.vibe-card[data-color] .vibe-title { color: color-mix(in srgb, var(--vibe-accent) 45%, white); }

.vibe-option input:checked + .vibe-card[data-color] {
  border-color: var(--vibe-accent);
  background:
    radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--vibe-accent) 38%, transparent), transparent 56%),
    linear-gradient(135deg, color-mix(in srgb, var(--vibe-deep) 72%, #0f172a), rgba(8, 14, 30, .9));
  box-shadow: 0 12px 30px color-mix(in srgb, var(--vibe-accent) 18%, transparent), inset 4px 0 0 var(--vibe-accent);
}

.vibe-option input:checked + .vibe-card[data-color]::after {
  background: var(--vibe-accent);
  color: #07101f;
}

.vibe-option input:focus-visible + .vibe-card[data-color] {
  outline-color: var(--vibe-accent);
}

@media (max-width: 560px) {
  .save-status.ok {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: stretch;
  }

  .save-library-link {
    width: 100%;
    min-height: 46px;
  }

  .save-name-field { max-width: none; }

  .library-rename-form {
    grid-template-columns: 1fr;
  }

  .library-rename-form .text-input,
  .library-rename-form .ai-ghost-btn {
    width: 100%;
    min-height: 46px;
  }
}
