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

:root {
    --bg: #0f0f1a;
    --surface: #1a1a2e;
    --surface-light: #252542;
    --accent: #6c5ce7;
    --accent-soft: #a29bfe;
    --text: #eee;
    --text-dim: #8892b0;
    --bot-bg: #1f1f3a;
    --user-bg: #6c5ce7;
    --input-bg: #16162a;
    --border: #2d2d50;
    --green: #00b894;
    --yellow: #fdcb6e;
    --red: #e17055;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    height: 100vh;
    overflow: hidden;
}

.app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 800px;
    margin: 0 auto;
}

/* Header */
.header {
    padding: 16px 20px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

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

.logo-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}

.logo-icon {
    font-size: 36px;
}

.logo-text h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent-soft);
}

.subtitle {
    font-size: 13px;
    color: var(--text-dim);
}

/* Chat */
.chat {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message {
    display: flex;
    gap: 10px;
    max-width: 90%;
    animation: fadeIn 0.3s ease;
}

.message.bot {
    align-self: flex-start;
}

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    background: var(--surface-light);
}

.message.user .message-avatar {
    background: var(--accent);
    font-size: 14px;
}

.message-content {
    padding: 12px 16px;
    border-radius: 16px;
    line-height: 1.5;
    font-size: 14px;
}

.message.bot .message-content {
    background: var(--bot-bg);
    border-bottom-left-radius: 4px;
}

.message.user .message-content {
    background: var(--user-bg);
    border-bottom-right-radius: 4px;
}

.message-content p { margin-bottom: 8px; }
.message-content p:last-child { margin-bottom: 0; }
.message-content ul { margin: 8px 0; padding-left: 20px; }
.message-content li { margin-bottom: 4px; color: var(--text-dim); }

/* Score circle */
.score-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 16px auto;
    border: 4px solid;
}

.score-circle.green { border-color: var(--green); }
.score-circle.yellow { border-color: var(--yellow); }
.score-circle.red { border-color: var(--red); }

.score-number {
    font-size: 32px;
    font-weight: 800;
    line-height: 1;
}

.score-circle.green .score-number { color: var(--green); }
.score-circle.yellow .score-number { color: var(--yellow); }
.score-circle.red .score-number { color: var(--red); }

.score-label {
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 2px;
}

.report-summary {
    text-align: center;
    color: var(--text-dim);
    margin-bottom: 16px;
    font-size: 13px;
}

/* Report categories */
.report-category {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 8px;
    overflow: hidden;
}

.category-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.category-header:hover {
    background: var(--surface-light);
}

.category-title {
    flex: 1;
    font-weight: 600;
    font-size: 14px;
}

.category-score {
    font-weight: 700;
    font-size: 13px;
}

.category-score.green { color: var(--green); }
.category-score.yellow { color: var(--yellow); }
.category-score.red { color: var(--red); }

.category-chevron {
    font-size: 12px;
    color: var(--text-dim);
    transition: transform 0.2s;
}

.report-category.open .category-chevron {
    transform: rotate(180deg);
}

.category-items {
    display: none;
    border-top: 1px solid var(--border);
    padding: 8px 14px;
}

.report-category.open .category-items {
    display: block;
}

/* Check items */
.check-item {
    display: flex;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.check-item:last-child {
    border-bottom: none;
}

.check-info {
    flex: 1;
    min-width: 0;
}

.check-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--text);
}

.check-value {
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 2px;
    word-break: break-word;
}

.check-rec {
    font-size: 12px;
    color: var(--accent-soft);
    margin-top: 4px;
    padding-left: 8px;
    border-left: 2px solid var(--accent);
}

/* Status dots (traffic lights) */
.status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 3px;
}

.status-dot.green { background: var(--green); }
.status-dot.yellow { background: var(--yellow); }
.status-dot.red { background: var(--red); }

/* Top recommendations */
.top-recs {
    margin-top: 16px;
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.top-recs h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent-soft);
    margin-bottom: 8px;
}

.top-recs ol {
    padding-left: 20px;
}

.top-recs li {
    font-size: 13px;
    color: var(--text);
    margin-bottom: 6px;
    line-height: 1.4;
}

/* Loading */
.loading-text {
    font-weight: 600;
    color: var(--accent-soft);
}

.loading-text .dots::after {
    content: '';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
}

.loading-bar {
    height: 3px;
    background: var(--border);
    border-radius: 2px;
    margin: 8px 0;
    overflow: hidden;
}

.loading-bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    animation: loadProgress 90s ease-out forwards;
}

@keyframes loadProgress {
    0% { width: 0%; }
    10% { width: 10%; }
    25% { width: 25%; }
    40% { width: 40%; }
    60% { width: 60%; }
    80% { width: 75%; }
    95% { width: 88%; }
    100% { width: 95%; }
}

.loading-status {
    font-size: 12px;
    color: var(--text-dim);
}

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

/* Limit banner */
.limit-banner {
    padding: 12px 20px;
    background: var(--yellow);
    color: #1a1a2e;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.limit-timer {
    font-variant-numeric: tabular-nums;
}

/* Input area */
.input-area {
    display: flex;
    gap: 8px;
    padding: 16px 20px;
    background: var(--surface);
    border-top: 1px solid var(--border);
}

#urlInput {
    flex: 1;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 12px 20px;
    color: var(--text);
    font-size: 15px;
    font-family: var(--font);
    outline: none;
    transition: border-color 0.2s;
}

#urlInput:focus {
    border-color: var(--accent);
}

#urlInput::placeholder {
    color: var(--text-dim);
}

#sendBtn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--accent);
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s, opacity 0.15s;
}

#sendBtn:hover {
    transform: scale(1.05);
}

#sendBtn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.send-icon {
    display: inline-block;
    transform: rotate(-30deg);
}

/* Mobile */
@media (max-width: 600px) {
    .message { max-width: 95%; }
    .header { padding: 12px 16px; }
    .chat { padding: 12px; }
    .input-area { padding: 12px; }
    .score-circle { width: 80px; height: 80px; }
    .score-number { font-size: 26px; }
}
