:root {
    --bg: #0a0f1a;
    --bg-elevated: #111827;
    --panel: #151d2e;
    --border: rgba(255, 255, 255, 0.08);
    --text: #f1f5f9;
    --muted: #94a3b8;
    --primary: #8b5cf6;
    --primary-hover: #7c3aed;
    --accent: #22d3ee;
    --success: #34d399;
    --warning: #fbbf24;
    --danger: #f87171;
    --shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
    --radius: 16px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(139, 92, 246, 0.2), transparent 35%),
        radial-gradient(circle at bottom right, rgba(34, 211, 238, 0.12), transparent 30%),
        var(--bg);
    color: var(--text);
    line-height: 1.5;
}

a {
    color: var(--accent);
}

code {
    font-size: 0.85em;
    background: rgba(255, 255, 255, 0.06);
    padding: 0.15em 0.4em;
    border-radius: 6px;
}

.auth-page {
    display: grid;
    place-items: center;
    padding: 24px;
}

.auth-card {
    width: min(100%, 440px);
    background: rgba(21, 29, 46, 0.95);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 32px;
}

.brand {
    text-align: center;
    margin-bottom: 28px;
}

.brand-icon {
    display: inline-grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.35), rgba(34, 211, 238, 0.2));
    font-size: 1.5rem;
    margin-bottom: 12px;
}

.brand h1,
.hero h1,
.panel-header h2 {
    margin: 0 0 8px;
}

.brand p,
.muted,
.subtitle,
.section-desc {
    color: var(--muted);
}

.auth-footnote {
    margin-top: 20px;
    font-size: 0.85rem;
    text-align: center;
}

.login-form label {
    display: block;
    margin-bottom: 16px;
}

.login-form span {
    display: block;
    margin-bottom: 6px;
    font-size: 0.9rem;
    color: var(--muted);
}

.login-form input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 1rem;
}

.topbar {
    border-bottom: 1px solid var(--border);
    background: rgba(10, 15, 26, 0.85);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.topbar-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

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

.topbar-brand strong {
    display: block;
}

.subtitle {
    font-size: 0.85rem;
}

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

.user-pill {
    font-size: 0.85rem;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--muted);
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 20px 48px;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
}

.hero h1 {
    font-size: 1.5rem;
}

.hero strong {
    color: var(--accent);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.panel h3 {
    margin: 0 0 4px;
    font-size: 1.1rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 10px;
    border: none;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
}

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
}

.btn-ghost {
    background: transparent;
    color: var(--muted);
    text-decoration: none;
    padding: 8px 12px;
}

.btn-block {
    width: 100%;
}

.alert {
    padding: 12px 16px;
    border-radius: 10px;
    margin-top: 16px;
    font-size: 0.95rem;
}

.alert-error {
    background: rgba(248, 113, 113, 0.15);
    border: 1px solid rgba(248, 113, 113, 0.35);
    color: #fecaca;
}

.alert-success {
    background: rgba(52, 211, 153, 0.12);
    border: 1px solid rgba(52, 211, 153, 0.3);
    color: #a7f3d0;
}

.alert-info {
    background: rgba(34, 211, 238, 0.1);
    border: 1px solid rgba(34, 211, 238, 0.25);
    color: #a5f3fc;
}

.hidden {
    display: none !important;
}

.upload-zone .drop-area {
    border: 2px dashed rgba(139, 92, 246, 0.45);
    border-radius: var(--radius);
    padding: 32px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.upload-zone .drop-area.dragover {
    border-color: var(--accent);
    background: rgba(34, 211, 238, 0.06);
}

.drop-title {
    font-size: 1.1rem;
    margin: 0 0 8px;
}

.preview-canvas {
    max-width: 100%;
    max-height: 220px;
    border-radius: 10px;
    margin-bottom: 12px;
}

.upload-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.panel-wide {
    grid-column: 1 / -1;
}

.summary-text {
    font-size: 1.05rem;
    margin: 0;
}

.cursor-export-panel .panel-header {
    margin-bottom: 12px;
}

.cursor-summary {
    width: 100%;
    min-height: 280px;
    padding: 14px 16px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.8rem;
    line-height: 1.45;
    resize: vertical;
    tab-size: 2;
}

.cursor-summary:focus {
    outline: 2px solid rgba(139, 92, 246, 0.5);
    outline-offset: 2px;
}

.manual-notes {
    min-height: 140px;
}

.hero .badge {
    display: inline-block;
    margin-left: 6px;
    vertical-align: middle;
}

.result-block {
    margin-top: 12px;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-right: 6px;
    margin-bottom: 6px;
}

.badge-high {
    background: rgba(52, 211, 153, 0.2);
    color: #6ee7b7;
}

.badge-medium {
    background: rgba(251, 191, 36, 0.2);
    color: #fcd34d;
}

.badge-low {
    background: rgba(148, 163, 184, 0.2);
    color: #cbd5e1;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
}

.tag-list li {
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.3);
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.85rem;
}

.prompt-box {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
    margin-top: 12px;
    position: relative;
}

.prompt-box h4 {
    margin: 0 0 8px;
    font-size: 0.9rem;
    color: var(--muted);
}

.prompt-box pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.85rem;
}

.copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 10px;
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    border-radius: 6px;
    color: var(--muted);
    cursor: pointer;
}

.copy-btn:hover {
    color: var(--text);
}

.tool-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    margin-top: 10px;
}

.tool-card strong {
    color: var(--accent);
}

.link-list {
    margin: 12px 0 0;
    padding-left: 18px;
}

.link-list a {
    color: var(--accent);
}

.limitations-list {
    margin: 0;
    padding-left: 20px;
    color: var(--muted);
}

.color-swatch {
    display: inline-block;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid var(--border);
    margin-right: 8px;
    vertical-align: middle;
}

@media (max-width: 768px) {
    .results-grid {
        grid-template-columns: 1fr;
    }

    .panel-wide {
        grid-column: auto;
    }
}
