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

:root {
    --gf-black: #0a0a0a; --gf-white: #FFF; --gf-lime: #E2E2E2;
    --border: rgba(255,255,255,.10); --bg-card: rgba(255,255,255,.04);
    --radius: 8px; --font: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
}


/* ── GHOSTFRAME shared color tokens (synced with design-system.css) ── */
:root {
  --gf-bg:           #0a0a0a;
  --gf-surface:      #111111;
  --gf-surface-2:    #1a1a1a;
  --gf-border:       rgba(255,255,255,0.10);
  --gf-border-solid: #2a2a2a;
  --gf-text:         #e2e2e2;
  --gf-text-dim:     #888888;
  --gf-accent:       #E2E2E2;
  --gf-amber:        #FFA500;
  --gf-danger:       #ff4444;
  --gf-success:      #4ade80;
  --gf-radius:       12px;
  --gf-radius-sm:    8px;
  --gf-radius-lg:    20px;
}

html { scroll-behavior: smooth; }
body { background: var(--gf-black); color: var(--gf-white); font-family: var(--font); min-height: 100vh; }

.gf-top-bar {
    position: sticky; top: 0; z-index: 100;
    height: 52px; display: flex; align-items: center; justify-content: space-between;
    padding: 0 20px;
    background: rgba(10,10,10,.9); border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px);
}
.gf-top-bar__back {
    display: flex; align-items: center; gap: 6px;
    color: rgba(255,255,255,.65); text-decoration: none;
    font-size: 12px; letter-spacing: .08em; text-transform: uppercase; transition: color .2s;
}
.gf-top-bar__back:hover { color: var(--gf-text); }
.gf-top-bar__title { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.5); }


.page-section { max-width: 720px; margin: 0 auto; padding: 28px 20px; }

/* Results section — fullscreen chat layout */
#results-section.page-section {
    max-width: none;
    padding: 0;
    margin: 0;
    height: calc(100dvh - 50px);
    display: flex;
    flex-direction: column;
}

.upload-hero { text-align: center; margin-bottom: 24px; }
.upload-hero h1 { font-size: 26px; font-weight: 800; margin-bottom: 8px; }
.upload-hero p  { font-size: 13px; color: rgba(255,255,255,.5); line-height: 1.6; max-width: 460px; margin: 0 auto; }

#upload-zone {
    border: 1.5px dashed rgba(255,255,255,.2); border-radius: 12px;
    padding: 36px 20px; text-align: center; cursor: pointer;
    background: var(--bg-card); transition: border-color .25s, background .25s;
}
#upload-zone:hover, #upload-zone.drag-over { border-color: var(--gf-lime); background: rgba(212,255,0,.04); }
#upload-zone.has-file { border-style: solid; border-color: var(--gf-lime); }
.upload-icon  { font-size: 32px; margin-bottom: 10px; opacity:.6; }
.upload-title { font-size: 15px; font-weight: 600; margin-bottom: 5px; }
.upload-hint  { font-size: 12px; color: rgba(255,255,255,.4); }
.upload-types { font-size: 10px; color: rgba(255,255,255,.25); margin-top: 4px; letter-spacing: .05em; text-transform: uppercase; }
#upload-preview { display:none; margin-top:14px; border-radius: 8px; overflow: hidden; max-height: 220px; }
#upload-preview img { width:100%; object-fit:cover; }
.upload-actions { display:flex; gap:10px; justify-content:center; margin-top:18px; }

/* skeleton */
#skeleton-section {}
.skeleton-header { text-align:center; margin-bottom:20px; }
.skeleton-spinner { width:36px; height:36px; border-radius:50%; border:2px solid rgba(255,255,255,.08); border-top-color:var(--gf-lime); animation:spin .7s linear infinite; margin:0 auto 10px; }
@keyframes spin{to{transform:rotate(360deg)}}
.skeleton-label    { font-size:11px; letter-spacing:.12em; text-transform:uppercase; color:rgba(255,255,255,.4); }
.skeleton-sublabel { font-size:10px; color:rgba(255,255,255,.25); margin-top:3px; }
.skeleton-steps { display:flex; flex-direction:column; gap:8px; }
.skel-step { background:var(--bg-card); border:1px solid var(--border); border-radius:var(--radius); padding:12px; display:flex; align-items:center; gap:10px; transition:background .3s,border-color .3s; }
.skel-step.done { border-color:rgba(212,255,0,.3); background:rgba(212,255,0,.04); }
.skel-step-icon { width:28px; height:28px; border-radius:50%; background:rgba(255,255,255,.06); animation:shimmer 1.4s infinite; flex-shrink:0; }
.skel-step.done .skel-step-icon { background:rgba(212,255,0,.15); animation:none; }
.skel-step-lines { flex:1; display:flex; flex-direction:column; gap:5px; }
.skel-line { height:9px; border-radius:5px; background:rgba(255,255,255,.07); animation:shimmer 1.4s infinite; }
.skel-line.w80{width:80%}.skel-line.w70{width:70%}.skel-line.w60{width:60%}.skel-line.w50{width:50%}.skel-line.w40{width:40%}
.skel-step-status { font-size:10px; color:rgba(255,255,255,.25); white-space:nowrap; }
.skel-step.done .skel-step-status { color:var(--gf-lime); }
@keyframes shimmer{0%,100%{opacity:.6}50%{opacity:1}}

/* results */
.results-header-row { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-bottom:22px; flex-wrap:wrap; }
#result-photo { width:72px; height:72px; object-fit:cover; border-radius:var(--radius); border:1px solid var(--border); flex-shrink:0; }
.results-title-wrap { flex:1; }
.results-title   { font-size:20px; font-weight:800; margin-bottom:3px; }
.results-subtitle{ font-size:11px; color:rgba(255,255,255,.4); }

.section-title { font-size:10px; letter-spacing:.12em; text-transform:uppercase; color:rgba(255,255,255,.4); margin:22px 0 10px; }
.results-card  { background:var(--bg-card); border:1px solid var(--border); border-radius:var(--radius); padding:14px; }

/* skin / hair */
.analysis-row   { display:flex; align-items:center; gap:10px; margin-bottom:10px; }
.swatch-circle  { width:32px; height:32px; border-radius:50%; border:2px solid rgba(255,255,255,.15); flex-shrink:0; }
.analysis-main  { font-size:14px; font-weight:600; color: var(--gf-text); }
.analysis-sub   { font-size:11px; color:rgba(255,255,255,.5); margin-top:2px; }
.section-mini-title { font-size:10px; letter-spacing:.08em; text-transform:uppercase; color:rgba(255,255,255,.35); margin-bottom:5px; }
.tag-row { display:flex; gap:5px; flex-wrap:wrap; margin-bottom:6px; }
.tag { background:rgba(255,255,255,.08); border-radius:20px; padding:3px 9px; font-size:10px; color:rgba(255,255,255,.6); letter-spacing:.04em; text-transform:uppercase; }
.avoid-note { font-size:11px; color:rgba(255,100,100,.7); margin-top:4px; }
.hat-list { display:flex; flex-direction:column; gap:4px; }
.hat-item { font-size:12px; color:rgba(255,255,255,.65); padding:4px 0; border-bottom:1px solid var(--border); }
.hat-item:last-child { border-bottom:none; }
.hat-link { display:flex; align-items:center; gap:5px; color:inherit; text-decoration:none; transition:color .2s; }
.hat-link:hover { color:#d4ff00; }
.hat-link svg { flex-shrink:0; opacity:.5; }

/* celebrity cards */
#celebrity-list { display:flex; flex-direction:column; gap:14px; }
.celeb-card { background:var(--bg-card); border:1px solid var(--border); border-radius:var(--radius); padding:16px; }
.celeb-header { display:flex; align-items:center; gap:12px; margin-bottom:10px; }
.celeb-avatar  { width:48px; height:48px; border-radius:50%; background:rgba(212,255,0,.15); display:flex; align-items:center; justify-content:center; font-size:16px; font-weight:800; color:var(--gf-lime); flex-shrink:0; }
.celeb-avatar-img { width:48px; height:48px; border-radius:50%; object-fit:cover; object-position:top; border:1px solid rgba(255,255,255,0.15); flex-shrink:0; }
.celeb-info { flex:1; }
.celeb-name  { font-size:15px; font-weight:700; color: var(--gf-text); }
.celeb-group { font-size:11px; color:rgba(255,255,255,.45); margin-top:1px; }
.celeb-style-tag { display:inline-block; margin-top:4px; font-size:10px; padding:2px 8px; border-radius:20px; background:rgba(212,255,0,.1); color:#d4ff00; border:1px solid rgba(212,255,0,.25); font-weight:600; letter-spacing:.04em; }
.celeb-style-tag:empty { display:none; }

/* PDF export row */
.fa-export-row { display:flex; justify-content:flex-end; margin-top:24px; padding-top:16px; border-top:1px solid var(--border); }
.btn-export-pdf { display:inline-flex; align-items:center; gap:7px; padding:9px 18px; border-radius:8px; border:1px solid rgba(255,255,255,.18); background:rgba(255,255,255,.06); color:rgba(255,255,255,.8); font-size:13px; font-weight:600; cursor:pointer; transition:background .2s, color .2s; font-family:inherit; }
.btn-export-pdf:hover { background:rgba(212,255,0,.12); border-color:rgba(212,255,0,.4); color:#d4ff00; }
.btn-export-pdf svg { opacity:.7; }
.btn-generate-look { display:inline-flex; align-items:center; gap:7px; padding:9px 18px; border-radius:8px; border:1px solid rgba(212,255,0,.35); background:rgba(212,255,0,.08); color:#d4ff00; font-size:13px; font-weight:700; cursor:pointer; transition:background .2s, border-color .2s, opacity .2s; font-family:inherit; letter-spacing:.04em; }
.btn-generate-look:hover { background:rgba(212,255,0,.16); border-color:rgba(212,255,0,.6); }
.btn-generate-look:disabled { opacity:.4; cursor:not-allowed; }
.btn-generate-look svg { opacity:.8; }
.celeb-match { text-align:right; }
.celeb-match { font-size:22px; font-weight:800; color:var(--gf-lime); line-height:1; }
.celeb-match span { display:block; font-size:9px; font-weight:400; color:rgba(255,255,255,.4); letter-spacing:.06em; text-transform:uppercase; }
.celeb-desc { font-size:12px; color:rgba(255,255,255,.6); line-height:1.5; margin-bottom:12px; }
.occasion-section { margin-bottom:10px; }
.occasion-title   { font-size:10px; letter-spacing:.1em; text-transform:uppercase; color:rgba(255,255,255,.35); margin-bottom:6px; }
.frame-mini-row   { display:flex; gap:8px; overflow-x:auto; padding-bottom:4px; }
.frame-mini       { flex-shrink:0; width:90px; background:rgba(255,255,255,.04); border:1px solid var(--border); border-radius:6px; padding:8px; text-align:center; }
.frame-mini img   { width:70px; height:44px; object-fit:contain; margin-bottom:4px; }
.frame-mini-name  { font-size:9px; color:rgba(255,255,255,.5); margin-bottom:6px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.frame-mini-actions { display:flex; gap:3px; justify-content:center; }

/* style cards */
#styles-list { display:flex; flex-direction:column; gap:10px; }
.style-card { background:var(--bg-card); border:1px solid var(--border); border-radius:var(--radius); padding:14px; }
.style-header { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:7px; }
.style-name  { font-size:14px; font-weight:700; }
.style-score { display:flex; align-items:center; gap:7px; }
.score-bar   { width:72px; height:4px; background:rgba(255,255,255,.1); border-radius:2px; overflow:hidden; }
.score-fill  { height:100%; background:var(--gf-lime); border-radius:2px; transition:width .8s ease-out; }
.style-score span { font-size:12px; font-weight:700; color:var(--gf-lime); }
.palette-row { display:flex; gap:5px; margin:6px 0; flex-wrap:wrap; }
.swatch { display:inline-block; width:16px; height:16px; border-radius:50%; border:1px solid rgba(255,255,255,.15); }
.swatch.lg { width:22px; height:22px; }
.palette-row.lg { gap:7px; margin-bottom:10px; }
.style-caption { font-size:12px; color:rgba(255,255,255,.6); line-height:1.5; margin-top:6px; }

/* color analysis */
.ca-season { font-size:17px; font-weight:700; margin-bottom:3px; }
.ca-tag    { font-size:11px; font-weight:400; color:rgba(255,255,255,.45); margin-left:6px; }
.ca-rec    { font-size:12px; color:rgba(255,255,255,.65); line-height:1.55; margin-bottom:5px; }
.ca-avoid  { font-size:11px; color:rgba(255,100,100,.7); }

/* frame recommendation cards */
#frame-suggestions { display:flex; flex-direction:column; gap:10px; }
.frame-card { display:flex; align-items:center; gap:12px; background:var(--bg-card); border:1px solid var(--border); border-radius:var(--radius); padding:12px; transition:border-color .2s; }
.frame-card:hover { border-color:rgba(255,255,255,.25); }
.frame-card-img  { width:72px; height:46px; object-fit:contain; background:rgba(255,255,255,.04); border-radius:4px; flex-shrink:0; }
.frame-card-body { flex:1; min-width:0; }
.frame-card-name { font-size:14px; font-weight:600; }
.frame-card-meta { font-size:10px; color:rgba(255,255,255,.4); margin-top:2px; }
.frame-card-actions { display:flex; flex-direction:column; gap:5px; flex-shrink:0; }

.cta-row { display:flex; gap:10px; margin-top:24px; padding-bottom:36px; flex-wrap:wrap; }

/* buttons */
.btn { display:inline-flex; align-items:center; justify-content:center; padding:11px 22px; border-radius:var(--radius); font-size:12px; font-weight:700; letter-spacing:.1em; text-transform:uppercase; cursor:pointer; font-family:var(--font); text-decoration:none; transition:opacity .2s; border:none; }
.btn-primary   { background:var(--gf-lime); color:var(--gf-black); }
.btn-secondary { background:rgba(255,255,255,.07); color:rgba(255,255,255,.8); border:1px solid var(--border); }
.btn:hover { opacity:.85; } .btn:disabled { opacity:.35; pointer-events:none; }

.btn-sm { display:inline-flex; align-items:center; justify-content:center; padding:7px 14px; border-radius:5px; font-size:10px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; cursor:pointer; font-family:var(--font); text-decoration:none; transition:opacity .2s; border:none; }
.btn-lime-sm  { background:var(--gf-lime); color:var(--gf-black); }
.btn-ghost-sm { background:transparent; color:rgba(255,255,255,.7); border:1px solid var(--border); }
.btn-xs { display:inline-flex; align-items:center; justify-content:center; padding:4px 8px; border-radius:4px; font-size:9px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; cursor:pointer; font-family:var(--font); text-decoration:none; transition:opacity .2s; border:none; }
.btn-lime-xs  { background:var(--gf-lime); color:var(--gf-black); }
.btn-ghost-xs { background:transparent; color:rgba(255,255,255,.6); border:1px solid rgba(255,255,255,.15); }
.btn-sm:hover, .btn-xs:hover { opacity:.85; }

.input-tabs { display:flex; gap:0; margin-bottom:14px; border:1px solid var(--border); border-radius:var(--radius); overflow:hidden; }
.input-tab { flex:1; padding:10px; background:var(--bg-card); border:none; color:rgba(255,255,255,.5); font-family:var(--font); font-size:11px; font-weight:700; letter-spacing:.1em; text-transform:uppercase; cursor:pointer; transition:background .2s,color .2s; }
.input-tab.active { background:rgba(212,255,0,.12); color:var(--gf-lime); }
.camera-view-wrap { position:relative; border-radius:10px; overflow:hidden; background:var(--gf-surface); }
.camera-controls { display:flex; gap:8px; justify-content:center; margin-top:10px; }

.fa-toast { position:fixed; bottom:24px; left:50%; transform:translateX(-50%) translateY(6px); background:rgba(0,0,0,0.92); color: var(--gf-text); border:1px solid var(--border); border-radius:var(--radius); font-size:12px; padding:10px 20px; opacity:0; transition:opacity .25s,transform .25s; z-index:9999; pointer-events:none; }
.fa-toast.show { opacity:1; transform:translateX(-50%) translateY(0); }

/* eyewear match section */
.ew-detected-row { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:8px; }
.ew-badge { display:inline-flex; align-items:center; gap:5px; background:rgba(212,255,0,.08); border:1px solid rgba(212,255,0,.2); border-radius:20px; padding:3px 10px; font-size:10px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--gf-lime); }
.ew-badge::before { content:''; width:5px; height:5px; border-radius:50%; background:var(--gf-lime); }
.ew-attrs { font-size:12px; color:rgba(255,255,255,.6); }
.ew-desc { font-size:11px; color:rgba(255,255,255,.4); margin-bottom:10px; }
.ew-match-row { display:flex; gap:8px; overflow-x:auto; padding-bottom:4px; }
.ew-match-card { flex-shrink:0; width:100px; background:rgba(255,255,255,.04); border:1px solid var(--border); border-radius:8px; padding:10px 8px; text-align:center; display:flex; flex-direction:column; align-items:center; gap:6px; transition:border-color .2s; }
.ew-match-card:hover { border-color:rgba(255,255,255,.2); }
.ew-match-card img { width:80px; height:50px; object-fit:contain; }
.ew-match-name { font-size:9px; color:rgba(255,255,255,.5); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; width:100%; }

/* celebrity style detection */
.btn-detect-style {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    padding: 7px 14px;
    background: rgba(212,255,0,0.08);
    border: 1px solid rgba(212,255,0,0.25);
    border-radius: 6px;
    color: #d4ff00;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-family: inherit;
    cursor: pointer;
    transition: background .2s, opacity .2s;
}
.btn-detect-style:hover { background: rgba(212,255,0,0.15); }
.btn-detect-style:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-detect-style svg { display: inline-block; }

.celeb-detect-result { margin-top: 12px; }
.detect-found { }
.detect-style-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: rgba(255,255,255,0.7);
    margin-bottom: 10px;
}
.ew-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 1px solid rgba(255,255,255,0.2);
}
.detect-note {
    font-size: 12px;
    color: rgba(255,255,255,0.35);
    margin-top: 8px;
    font-style: italic;
}
.detect-loading {
    font-size: 12px;
    color: rgba(255,255,255,0.4);
    margin-top: 8px;
}

/* ── Meshy 3D Generation UI ──────────────────────────────────────── */
.meshy-gen-wrap {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,.08);
}
.ew-desc-alt {
    font-size: 12px;
    color: rgba(255,255,255,.4);
    margin: 0 0 8px;
}
.btn-meshy-gen {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(212,255,0,.12);
    border: 1px solid rgba(212,255,0,.35);
    border-radius: 8px;
    color: #d4ff00;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s, border-color .2s;
}
.btn-meshy-gen:hover { background: rgba(212,255,0,.22); border-color: rgba(212,255,0,.6); }
.btn-meshy-gen:disabled { opacity: .5; cursor: not-allowed; }

.meshy-progress-wrap {
    margin-top: 4px;
}
.meshy-progress-label {
    font-size: 12px;
    color: rgba(255,255,255,.55);
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
}
.meshy-pct { color: #d4ff00; font-weight: 600; }
.meshy-progress-bar {
    height: 4px;
    background: rgba(255,255,255,.1);
    border-radius: 4px;
    overflow: hidden;
}
.meshy-progress-fill {
    height: 100%;
    background: #d4ff00;
    border-radius: 4px;
    transition: width .4s ease;
}

.meshy-done {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 4px;
    flex-wrap: wrap;
}
.meshy-done-label {
    font-size: 13px;
    color: #d4ff00;
    font-weight: 600;
}
.btn-tryon-meshy {
    display: inline-flex;
    align-items: center;
    padding: 8px 18px;
    background: #d4ff00;
    color: #0a0a0a;
    font-weight: 700;
    font-size: 13px;
    border-radius: 8px;
    text-decoration: none;
    transition: opacity .2s;
}
.btn-tryon-meshy:hover { opacity: .85; }

/* ── Generated image / video in chat ───────────────────────────── */
.fa-imggen-block {
    border-left: 2px solid rgba(212,255,0,.3);
}
.fa-gen-status {
    font-size: 12px;
    color: rgba(255,255,255,.45);
    margin-left: 8px;
    vertical-align: middle;
}
.fa-gen-image {
    display: block;
    width: 100%;
    max-width: 420px;
    border-radius: 10px;
    margin-bottom: 12px;
    object-fit: cover;
}
.fa-gen-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.fa-gen-hint {
    font-size: 10px;
    color: rgba(255,255,255,.3);
    letter-spacing: .04em;
    padding: 0 2px;
}

.meshy-error {
    font-size: 12px;
    color: #ff6b6b;
    margin-bottom: 8px;
}

/* ── Chat Results UI ──────────────────────────────────────────────────────── */
.fa-chat-wrap {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0;
    overflow: hidden;
    flex: 1;
    height: 100%;
}

.fa-chat-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    background: rgba(212,255,0,.04);
    flex-shrink: 0;
}
.fa-chat-gf-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gf-lime);
    color: #000;
    font-size: 11px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: .04em;
    flex-shrink: 0;
}
.fa-chat-header-info { flex: 1; }
.fa-chat-name  { font-size: 13px; font-weight: 700; color: var(--gf-text); }
.fa-chat-status { font-size: 10px; color: rgba(255,255,255,.4); margin-top: 1px; }

.fa-chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 18px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-height: 0;
    scroll-behavior: smooth;
}

/* AI message block */
.fa-chat-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
    animation: blockIn 0.35s ease forwards;
}
@keyframes blockIn {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}
.fa-block-header {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 2px;
}
.fa-block-icon  { font-size: 14px; line-height: 1; }
.fa-block-label { font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.4); }
.fa-block-content {
    font-size: 13px;
    line-height: 1.65;
    color: rgba(255,255,255,.85);
    padding-left: 21px;
}
.fa-block-content strong { color: var(--gf-text); font-weight: 700; }
.fa-block-content em     { color: rgba(255,255,255,.6); font-style: italic; }

/* User message bubble */
.fa-user-block {
    align-items: flex-end;
}
.fa-user-block .fa-block-content {
    background: rgba(212,255,0,.1);
    border: 1px solid rgba(212,255,0,.2);
    border-radius: 12px 12px 3px 12px;
    padding: 9px 13px;
    font-size: 13px;
    color: var(--gf-text);
    max-width: 80%;
}

/* Inline elements */
.chat-link {
    color: var(--gf-lime);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px solid rgba(212,255,0,.3);
    transition: border-color .2s;
}
.chat-link:hover { border-color: var(--gf-lime); }
.chat-cta-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #0a0a0a;
    background: var(--gf-lime);
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    margin-top: 4px;
    transition: opacity .2s;
}
.chat-cta-link:hover { opacity: .85; }
.chat-sub   { font-size: 11px; color: rgba(255,255,255,.45); }
.chat-avoid { font-size: 11px; color: rgba(255,120,120,.75); margin-top: 4px; display: block; }
.chat-tag   { display: inline-block; background: rgba(255,255,255,.08); border-radius: 20px; padding: 2px 8px; font-size: 10px; color: rgba(255,255,255,.6); letter-spacing: .04em; text-transform: uppercase; margin: 0 2px; }
.dot-label  { font-size: 10px; color: rgba(255,255,255,.45); margin-right: 6px; vertical-align: middle; }

/* Style score rows */
.chat-style-row      { margin-bottom: 12px; }
.chat-style-top      { display: flex; align-items: center; justify-content: space-between; margin-bottom: 5px; }
.chat-style-name     { font-size: 13px; font-weight: 700; color: var(--gf-text); }
.chat-style-pct      { font-size: 13px; font-weight: 800; color: var(--gf-lime); }
.chat-score-bar      { height: 3px; background: rgba(255,255,255,.08); border-radius: 2px; overflow: hidden; margin-bottom: 5px; }
.chat-score-fill     { height: 100%; background: var(--gf-lime); border-radius: 2px; transition: width .6s ease; }

/* Typing animation */
.fa-typing { display: inline-flex; gap: 4px; align-items: center; padding: 6px 0; }
.fa-typing span { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.4); animation: typingDot 1.2s infinite; }
.fa-typing span:nth-child(2) { animation-delay: .2s; }
.fa-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes typingDot { 0%,60%,100% { opacity:.3; transform:scale(.9); } 30% { opacity:1; transform:scale(1.1); } }

/* Word reveal spans */
.tw-w { display: inline; }

/* Input row */
.fa-chat-input-wrap {
    padding: 12px 18px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}
.fa-chat-input-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
.fa-chat-input {
    flex: 1;
    background: rgba(255,255,255,.06);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 13px;
    color: var(--gf-text);
    outline: none;
    transition: border-color .2s;
}
.fa-chat-input::placeholder { color: rgba(255,255,255,.3); }
.fa-chat-input:focus { border-color: rgba(212,255,0,.4); }
.fa-chat-send-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid rgba(212,255,0,.3);
    background: rgba(212,255,0,.1);
    color: var(--gf-lime);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background .2s;
}
.fa-chat-send-btn:hover { background: rgba(212,255,0,.2); }

/* Action buttons */
.fa-chat-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    padding-right: 72px; /* clear floating feedback widget (bottom-right) */
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .fa-chat-body { padding: 14px 14px; }
    .fa-chat-header { padding: 12px 14px; }
    .fa-chat-input-wrap { padding: 10px 14px; }
    .fa-chat-actions { padding: 10px 14px; }
    .fa-block-content { padding-left: 0; }
}

/* ── End Chat Results UI ────────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .page-section { padding: 22px 16px; }

    /* Upload area */
    .upload-hero h1 { font-size: 20px; }
    .upload-zone { padding: 28px 16px; }
    .upload-actions { flex-direction: column; align-items: stretch; }
    .upload-actions .btn-sm { text-align: center; }

    /* Tabs */
    .tab-bar { gap: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .tab-btn  { flex-shrink: 0; white-space: nowrap; }

    /* Results header */
    .results-header-row { flex-direction: column; gap: 10px; }
    #result-photo { width: 100%; max-height: 160px; object-fit: cover; border-radius: 10px; }

    /* Celeb cards */
    .celeb-header { flex-wrap: wrap; }
    .celeb-avatar-img, .celeb-avatar { width: 44px; height: 44px; min-width: 44px; }
    .celeb-match { font-size: 18px; }
    .frame-mini-row { gap: 8px; }
    .frame-mini { min-width: 80px; }
    .frame-mini img { width: 60px; height: 38px; }

    /* Style cards */
    .style-header { flex-direction: column; align-items: flex-start; gap: 6px; }
    .score-bar { width: 100%; }

    /* Frame cards */
    .frame-card { flex-wrap: wrap; gap: 10px; }
    .frame-card-img { width: 80px; height: 80px; }
    .frame-card-actions { flex-direction: row; width: 100%; flex-wrap: wrap; }
    .frame-card-actions .btn-sm { flex: 1; text-align: center; min-width: 90px; }

    /* CTA row */
    .cta-row { flex-direction: column; }
    .cta-row .btn-sm { text-align: center; }

    /* Eyewear match */
    .ew-match-row { gap: 8px; }
    .ew-match-card img { width: 70px; height: 44px; }

    /* Meshy button */
    .btn-meshy-gen { width: 100%; justify-content: center; }
    .meshy-done { flex-direction: column; gap: 8px; }
    .btn-tryon-meshy { text-align: center; }
}

@media (max-width: 480px) {
    .page-section { padding: 16px 14px; }
    .upload-hero h1 { font-size: 18px; }
    #result-photo { max-height: 120px; }
    .celeb-name { font-size: 14px; }
    .frame-card-img { width: 64px; height: 64px; }
    .results-title { font-size: 17px; }
    .gf-top-bar__title { font-size: 10px; }
}
