*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
    --bg: #08080c; --bg-glass: rgba(14,14,20,0.7); --border: rgba(255,255,255,0.06);
    --text-1: rgba(255,255,255,0.92); --text-2: rgba(255,255,255,0.5);
    --purple: #8b5cf6; --cyan: #00f3ff; --green: #10b981; --amber: #f59e0b; --red: #ef4444;
    --radius: 12px;
}
html { font-size: 16px; }
body { font-family: 'Inter', -apple-system, sans-serif; background: var(--bg); color: var(--text-1); min-height: 100vh; line-height: 1.6; overflow-x: hidden; }
.bg-mesh { position: fixed; inset: 0; z-index: 0; pointer-events: none; background-image: linear-gradient(rgba(255,255,255,0.012) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.012) 1px, transparent 1px); background-size: 50px 50px; }
.container { max-width: 780px; margin: 0 auto; padding: 0 1.5rem; position: relative; z-index: 1; }
.glass-bar { backdrop-filter: blur(16px); background: var(--bg-glass); border-bottom: 1px solid var(--border); }
.glass-card { background: var(--bg-glass); backdrop-filter: blur(12px); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; }
.gradient-text { background: linear-gradient(135deg, var(--purple), var(--cyan)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

/* Nav */
.nav { display: flex; justify-content: space-between; align-items: center; padding: 0.8rem 2rem; position: sticky; top: 0; z-index: 50; }
.brand { display: flex; align-items: center; gap: 0.4rem; text-decoration: none; color: var(--text-1); }
.brand-text { font-weight: 700; font-size: 0.85rem; letter-spacing: 3px; }
.brand-dot { color: var(--cyan); font-weight: 800; font-size: 1.2rem; }
.brand-sub { font-size: 0.6rem; letter-spacing: 2px; color: var(--text-2); margin-left: 0.3rem; }
.nav-tag { font-size: 0.65rem; letter-spacing: 1px; color: var(--text-2); background: rgba(139,92,246,0.1); border: 1px solid rgba(139,92,246,0.2); padding: 0.25rem 0.7rem; border-radius: 20px; text-decoration: none; transition: all 0.3s ease; }
.nav-tag:hover { background: rgba(139,92,246,0.2); color: var(--text-1); }

/* Hero */
.hero { text-align: center; padding: 3.5rem 0 1.5rem; }
.hero h1 { font-size: 2.5rem; font-weight: 800; letter-spacing: -1px; margin-bottom: 0.75rem; }
.subtitle { color: var(--text-2); font-size: 1rem; max-width: 600px; margin: 0 auto 1rem; line-height: 1.7; }
.market-badge { display: inline-block; font-size: 0.65rem; letter-spacing: 2px; color: var(--green); background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.2); padding: 0.2rem 0.75rem; border-radius: 20px; text-transform: uppercase; }

/* Agent Index */
.agent-index { text-align: center; padding: 3rem 0; }
.agent-index h1 { font-size: 2.5rem; font-weight: 800; margin-bottom: 0.75rem; }
.agent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.8rem; margin-top: 2rem; }
.agent-link { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; padding: 1.2rem 0.8rem; background: var(--bg-glass); border: 1px solid var(--border); border-radius: 10px; text-decoration: none; color: var(--text-1); transition: all 0.3s ease; }
.agent-link:hover { transform: translateY(-3px); border-color: rgba(255,255,255,0.15); box-shadow: 0 8px 25px rgba(0,0,0,0.4); }
.al-icon { font-size: 1.8rem; }
.al-name { font-size: 0.8rem; font-weight: 600; }
.al-market { font-size: 0.6rem; color: var(--green); letter-spacing: 1px; }

/* Input */
.analyzer { margin-bottom: 2rem; }
.input-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; }
.input-header label { font-weight: 600; font-size: 0.85rem; }
.context-select { display: flex; align-items: center; gap: 0.5rem; }
.context-select label { font-size: 0.75rem; color: var(--text-2); }
.context-select select { background: rgba(255,255,255,0.04); border: 1px solid var(--border); color: var(--text-1); border-radius: 6px; padding: 0.3rem 0.6rem; font-size: 0.75rem; font-family: inherit; cursor: pointer; }
.context-select select:focus { outline: none; border-color: var(--purple); }
textarea { width: 100%; background: rgba(0,0,0,0.3); border: 1px solid var(--border); border-radius: 8px; padding: 1rem; color: var(--text-1); font-family: inherit; font-size: 0.9rem; resize: vertical; transition: border-color 0.3s; line-height: 1.6; }
textarea:focus { outline: none; border-color: var(--purple); box-shadow: 0 0 20px rgba(139,92,246,0.1); }
textarea::placeholder { color: rgba(255,255,255,0.2); }
.input-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 0.75rem; }
.char-count { font-size: 0.72rem; color: var(--text-2); }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.7rem 1.5rem; border-radius: 8px; font-family: inherit; font-weight: 600; font-size: 0.85rem; cursor: pointer; border: none; transition: all 0.3s ease; }
.btn-primary { background: linear-gradient(135deg, var(--purple), #6d28d9); color: white; box-shadow: 0 4px 15px rgba(139,92,246,0.3); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 25px rgba(139,92,246,0.4); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-small { padding: 0.35rem 0.8rem; font-size: 0.72rem; background: rgba(255,255,255,0.06); color: var(--text-2); border: 1px solid var(--border); border-radius: 6px; }
.btn-small:hover { background: rgba(255,255,255,0.1); color: var(--text-1); }
.btn-back { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.4rem 1rem; margin-bottom: 1.2rem; font-size: 0.75rem; font-weight: 500; background: rgba(255,255,255,0.04); color: var(--text-2); border: 1px solid var(--border); border-radius: 8px; text-decoration: none; transition: all 0.3s ease; }
.btn-back:hover { background: rgba(255,255,255,0.08); color: var(--text-1); border-color: rgba(255,255,255,0.15); transform: translateX(-2px); }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,0.2); border-top-color: white; border-radius: 50%; animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Score */
.score-card { display: flex; align-items: center; gap: 1.5rem; margin-bottom: 1.5rem; animation: fadeUp 0.5s ease; }
.score-ring-wrap { flex-shrink: 0; width: 100px; height: 100px; position: relative; }
.score-ring { width: 100%; height: 100%; }
.score-arc { transition: stroke-dashoffset 1.2s cubic-bezier(0.4,0,0.2,1), stroke 0.5s ease; }
.score-value { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); font-size: 1.8rem; font-weight: 800; }
.score-info h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.3rem; }
.score-info p { font-size: 0.85rem; color: var(--text-2); line-height: 1.5; }

/* Issues */
.section-label { font-size: 0.7rem; letter-spacing: 2px; color: var(--text-2); text-transform: uppercase; margin-bottom: 0.75rem; }
.issue-card { background: var(--bg-glass); border: 1px solid var(--border); border-radius: 10px; padding: 1rem 1.2rem; margin-bottom: 0.6rem; border-left: 3px solid var(--amber); animation: fadeUp 0.4s ease forwards; opacity: 0; }
.issue-card[data-sev='low'] { border-left-color: var(--green); }
.issue-card[data-sev='medium'] { border-left-color: var(--amber); }
.issue-card[data-sev='high'] { border-left-color: #f97316; }
.issue-card[data-sev='critical'] { border-left-color: var(--red); }
.issue-header { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.5rem; }
.issue-badge { font-size: 0.6rem; font-weight: 700; letter-spacing: 1px; padding: 0.15rem 0.5rem; border-radius: 4px; text-transform: uppercase; }
.issue-badge.low { background: rgba(16,185,129,0.15); color: var(--green); }
.issue-badge.medium { background: rgba(245,158,11,0.15); color: var(--amber); }
.issue-badge.high { background: rgba(249,115,22,0.15); color: #f97316; }
.issue-badge.critical { background: rgba(239,68,68,0.15); color: var(--red); }
.issue-type { font-size: 0.75rem; font-weight: 600; }
.issue-excerpt { font-size: 0.8rem; color: var(--red); background: rgba(239,68,68,0.06); padding: 0.4rem 0.6rem; border-radius: 4px; margin-bottom: 0.4rem; font-style: italic; border-left: 2px solid rgba(239,68,68,0.2); }
.issue-detail { font-size: 0.78rem; color: var(--text-2); margin-bottom: 0.4rem; line-height: 1.5; }
.issue-suggestion { font-size: 0.78rem; color: var(--green); background: rgba(16,185,129,0.06); padding: 0.4rem 0.6rem; border-radius: 4px; border-left: 2px solid rgba(16,185,129,0.2); }
.issue-suggestion::before { content: '💡 '; }

/* Rewrite / Recommendation */
.rewrite-section { animation: fadeUp 0.6s ease; margin-top: 1.5rem; }
.rewrite-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; }
.rewrite-header h3 { font-size: 1rem; font-weight: 700; }
.rewrite-text { background: rgba(16,185,129,0.04); border: 1px solid rgba(16,185,129,0.1); border-radius: 8px; padding: 1rem; font-size: 0.85rem; line-height: 1.7; white-space: pre-wrap; }

/* Error */
.error-msg { display: flex; align-items: center; gap: 0.75rem; border-left: 3px solid var(--red); padding: 1rem; font-size: 0.85rem; color: var(--text-2); animation: fadeUp 0.3s ease; }

/* Footer */
.footer { text-align: center; padding: 1rem 2rem; margin-top: 4rem; font-size: 0.72rem; color: var(--text-2); border-top: 1px solid var(--border); border-bottom: none; }
.footer a { color: var(--cyan); text-decoration: none; }

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

@media (max-width: 640px) {
    .hero h1 { font-size: 2rem; }
    .nav { padding: 0.8rem 1rem; }
    .score-card { flex-direction: column; text-align: center; }
    .container { padding: 0 1rem; }
    .agent-grid { grid-template-columns: repeat(2, 1fr); }
}
