:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --bg-color: #ffffff;
    --text-color: #1a1a1a;
    --secondary-text: #6b7280;
    --border-color: #f1f5f9;
    --card-bg: #ffffff;
    --sidebar-bg: #f8fafc;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Dark Theme Variables */
[data-theme="dark"] {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --bg-color: #0f172a;
    --text-color: #f1f5f9;
    --secondary-text: #94a3b8;
    --border-color: #1e293b;
    --card-bg: #1e293b;
    --sidebar-bg: #0f172a;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 1px 2px 0 rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
}

.theme-dark .swot-S,
.theme-dark .swot-W,
.theme-dark .swot-O,
.theme-dark .swot-T {
    background: rgba(255, 255, 255, 0.05);
}

.theme-dark .m-card {
    background: rgba(30, 41, 59, 0.6);
}

.theme-dark .m-card .icon {
    background: #1e40af;
    color: #eff6ff;
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Logo Styles */
.logo-img {
    height: 32px;
    width: auto;
    object-fit: contain;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 3rem;
    text-decoration: none;
    color: var(--text-color);
}

/* Landing Page Layout */
.landing-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 6rem 2rem;
    text-align: center;
}

.landing-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.landing-header .logo-img {
    height: 64px;
}

h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: -0.025em;
    color: var(--text-color);
}

.subtitle {
    font-size: 1.25rem;
    color: var(--secondary-text);
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    max-width: 650px;
    margin: 0 auto;
    padding: 2rem;
    background: var(--card-bg);
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

textarea {
    width: 100%;
    min-height: 160px;
    padding: 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    font-family: inherit;
    font-size: 1.1rem;
    resize: none;
    transition: all 0.2s;
    background: var(--card-bg);
    color: var(--text-color);
}

[data-theme="light"] textarea {
    background: #fcfcfd;
}

[data-theme="light"] textarea:focus {
    background: #fff;
}

textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
}

.primary-btn {
    background-color: var(--primary-color);
    color: white;
    padding: 1.25rem 2.5rem;
    border: none;
    border-radius: 16px;
    font-size: 1.125rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}

.primary-btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3);
}

.primary-btn:active {
    transform: scale(0.96);
}

/* Dashboard Layout */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: 12px;
    color: var(--secondary-text);
    text-decoration: none;
    font-weight: 600;
    margin-bottom: 0.5rem;
    transition: all 0.2s;
    cursor: pointer;
}

.material-symbols-outlined {
    font-family: 'Material Symbols Outlined';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-smoothing: antialiased;
}

.nav-item:hover,
.nav-item.active {
    background-color: var(--card-bg);
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
    transform: scale(1.02);
}

.nav-item:active {
    transform: scale(0.95);
}

.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 4rem 2rem;
    background-color: var(--bg-color);
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

#toolView {
    width: 100%;
    max-width: 1000px;
}

/* =======================================================
   DASHBOARD — Workspace look (systematic, techy)
   ======================================================= */

.dashboard-container {
    background:
        radial-gradient(circle at 25% 15%, rgba(37, 99, 235, 0.10), transparent 40%),
        radial-gradient(circle at 80% 30%, rgba(96, 165, 250, 0.10), transparent 40%);
}.theme-dark .dashboard-container {
            background:
                radial-gradient(circle at 25% 15%, rgba(37, 99, 235, 0.14), transparent 45%),
                radial-gradient(circle at 80% 30%, rgba(96, 165, 250, 0.12), transparent 45%);
}

@media (prefers-color-scheme: dark) {
    .theme-auto .dashboard-container {
            background:
                radial-gradient(circle at 25% 15%, rgba(37, 99, 235, 0.14), transparent 45%),
                radial-gradient(circle at 80% 30%, rgba(96, 165, 250, 0.12), transparent 45%);
    }
}

.main-content {
    padding: 3rem 2rem;
}

#toolView {
    max-width: 1200px;
}

.tool-shell {
    width: 100%;
}

.tool-shell-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.tool-shell-title h2 {
    font-size: 1.8rem;
    letter-spacing: -0.03em;
}

.tool-shell-hints {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.hint-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(10px);
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--secondary-text);
}.theme-dark .hint-pill {
            background: rgba(15, 23, 42, 0.35);
            border-color: rgba(148, 163, 184, 0.18);
}

@media (prefers-color-scheme: dark) {
    .theme-auto .hint-pill {
            background: rgba(15, 23, 42, 0.35);
            border-color: rgba(148, 163, 184, 0.18);
    }
}

.hint-pill .material-symbols-outlined {
    font-size: 18px;
    color: var(--primary-color);
}

.tool-shell-body {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 1.25rem;
    align-items: start;
    min-height: calc(100vh - 220px);
}

.tool-pane {
    display: flex;
    flex-direction: column;
    border-radius: 22px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    background: rgba(255, 255, 255, 0.62);
    backdrop-filter: blur(14px);
    box-shadow: 0 18px 40px rgba(2, 6, 23, 0.06);
    overflow: hidden;
}.theme-dark .tool-pane {
            background: rgba(15, 23, 42, 0.45);
            border-color: rgba(148, 163, 184, 0.18);
            box-shadow: 0 18px 40px rgba(0, 0, 0, 0.3);
}

@media (prefers-color-scheme: dark) {
    .theme-auto .tool-pane {
            background: rgba(15, 23, 42, 0.45);
            border-color: rgba(148, 163, 184, 0.18);
            box-shadow: 0 18px 40px rgba(0, 0, 0, 0.3);
    }
}

.pane-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    position: sticky;
    top: 0;
    z-index: 2;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(12px);
}.theme-dark .pane-head {
            background: rgba(15, 23, 42, 0.35);
}

@media (prefers-color-scheme: dark) {
    .theme-auto .pane-head {
            background: rgba(15, 23, 42, 0.35);
    }
}

.pane-kicker {
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--secondary-text);
}

.pane-meta {
    font-size: 0.85rem;
    color: var(--secondary-text);
    font-weight: 600;
}

.tool-pane .input-group-tech {
    margin: 1.25rem;
    padding: 1.25rem;
}

.tool-pane textarea {
    min-height: 220px;
}

.tool-pane-output {
    padding: 0;
}

.pane-body {
    padding: 0;
}

.pane-body-scroll {
    flex: 1;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

.tool-pane-input .pane-body {
    padding-bottom: 1.25rem;
}

#toolOutput {
    padding: 1.25rem 1.25rem 2rem;
}

.tool-output-empty {
    padding: 2.25rem 1.25rem;
}

.empty-output {
    border-radius: 18px;
    border: 1px dashed rgba(148, 163, 184, 0.35);
    background: rgba(148, 163, 184, 0.08);
    padding: 2rem;
    text-align: center;
}

.empty-output .material-symbols-outlined {
    font-size: 40px;
    color: var(--primary-color);
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.empty-output h3 {
    font-size: 1.15rem;
    font-weight: 800;
    margin-bottom: 0.35rem;
}

.empty-output p {
    color: var(--secondary-text);
    max-width: 520px;
    margin: 0 auto;
}

/* When analysis mounts into output, keep spacing tight */
.tool-pane-output .score-container {
    margin-bottom: 1.25rem;
}

.tool-pane-output .report-grid {
    margin-bottom: 2rem;
}

@media (max-width: 1100px) {
    .tool-shell-body {
        grid-template-columns: 1fr;
    }
}

/* Mobile Menu */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1001;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.75rem;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: all 0.2s;
}

.mobile-menu-btn:hover {
    transform: scale(1.05);
}

.mobile-menu-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.hamburger {
    width: 24px;
    height: 18px;
    position: relative;
    transform: rotate(0deg);
    transition: 0.3s ease-in-out;
}

.hamburger span {
    display: block;
    position: absolute;
    height: 2px;
    width: 100%;
    background: currentColor;
    border-radius: 2px;
    opacity: 1;
    left: 0;
    transform: rotate(0deg);
    transition: 0.25s ease-in-out;
}

.hamburger span:nth-child(1) {
    top: 0px;
}

.hamburger span:nth-child(2) {
    top: 8px;
}

.hamburger span:nth-child(3) {
    top: 16px;
}

.mobile-menu-btn.active .hamburger span:nth-child(1) {
    top: 8px;
    transform: rotate(135deg);
}

.mobile-menu-btn.active .hamburger span:nth-child(2) {
    opacity: 0;
    left: -60px;
}

.mobile-menu-btn.active .hamburger span:nth-child(3) {
    top: 8px;
    transform: rotate(-135deg);
}

.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Circular Score Component */
/* =======================================================
   SCORECARD — mirrors the homepage preview-card design
   ======================================================= */
.scorecard-card {
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 20px;
    padding: 1.75rem;
    box-shadow: 0 24px 60px rgba(2, 6, 23, 0.10);
    margin-bottom: 2rem;
}

.theme-dark .scorecard-card {
    background: rgba(15, 23, 42, 0.6);
    border-color: rgba(148, 163, 184, 0.16);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
}

@media (prefers-color-scheme: dark) {
    .theme-auto .scorecard-card {
        background: rgba(15, 23, 42, 0.6);
        border-color: rgba(148, 163, 184, 0.16);
        box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
    }
}

.scorecard-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 1.5rem;
}

.scorecard-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
.scorecard-dot.red { background: #ef4444; }
.scorecard-dot.yellow { background: #f59e0b; }
.scorecard-dot.green { background: #10b981; }

.scorecard-label {
    margin-left: 0.5rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--secondary-text);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.scorecard-score-row {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.scorecard-score-circle {
    position: relative;
    width: 110px;
    height: 110px;
    flex-shrink: 0;
}

.scorecard-score-circle svg {
    width: 100%;
    height: 100%;
    transform: rotate(0deg);
}

.scorecard-score-val {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 900;
    color: var(--text-color);
    letter-spacing: -0.02em;
}

.scorecard-score-val span {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--secondary-text);
    margin-left: 0.1rem;
}

.scorecard-score-meta { flex: 1; min-width: 0; }

.scorecard-score-title {
    font-size: 1.125rem;
    font-weight: 800;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
}

.scorecard-score-tier {
    display: inline-block;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
}

.scorecard-score-tier.tier-excellent {
    background: #dcfce7;
    color: #166534;
}
.theme-dark .scorecard-score-tier.tier-excellent {
    background: rgba(22, 101, 52, 0.3);
    color: #4ade80;
}
@media (prefers-color-scheme: dark) {
    .theme-auto .scorecard-score-tier.tier-excellent {
        background: rgba(22, 101, 52, 0.3);
        color: #4ade80;
    }
}

.scorecard-score-tier.tier-good {
    background: #dbeafe;
    color: #1e40af;
}
.theme-dark .scorecard-score-tier.tier-good {
    background: rgba(30, 64, 175, 0.3);
    color: #60a5fa;
}
@media (prefers-color-scheme: dark) {
    .theme-auto .scorecard-score-tier.tier-good {
        background: rgba(30, 64, 175, 0.3);
        color: #60a5fa;
    }
}

.scorecard-score-tier.tier-average {
    background: #fef3c7;
    color: #92400e;
}
.theme-dark .scorecard-score-tier.tier-average {
    background: rgba(146, 64, 14, 0.3);
    color: #fbbf24;
}
@media (prefers-color-scheme: dark) {
    .theme-auto .scorecard-score-tier.tier-average {
        background: rgba(146, 64, 14, 0.3);
        color: #fbbf24;
    }
}

.scorecard-score-tier.tier-weak {
    background: #fee2e2;
    color: #991b1b;
}
.theme-dark .scorecard-score-tier.tier-weak {
    background: rgba(153, 27, 27, 0.3);
    color: #f87171;
}
@media (prefers-color-scheme: dark) {
    .theme-auto .scorecard-score-tier.tier-weak {
        background: rgba(153, 27, 27, 0.3);
        color: #f87171;
    }
}

.scorecard-score-conf {
    font-size: 0.8rem;
    color: var(--secondary-text);
    font-weight: 600;
}

.scorecard-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.6rem;
}

.scorecard-metric {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.7rem 0.6rem;
    border-radius: 12px;
    background: rgba(148, 163, 184, 0.08);
    border: 1px solid rgba(148, 163, 184, 0.14);
}

.sm-label {
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--secondary-text);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.sm-val {
    font-size: 1rem;
    font-weight: 800;
    color: var(--primary-color);
}

.sm-val.high,
.sm-val.High { color: #16a34a; }
.theme-dark .sm-val.high,
.theme-dark .sm-val.High { color: #4ade80; }
@media (prefers-color-scheme: dark) {
    .theme-auto .sm-val.high,
    .theme-auto .sm-val.High { color: #4ade80; }
}

@media (max-width: 560px) {
    .scorecard-metrics { grid-template-columns: repeat(2, 1fr); }
    .scorecard-score-row { flex-direction: column; text-align: center; }
}

/* Analysis Sections */
.report-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.75rem;
    margin-bottom: 3rem;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
    transition: all 0.3s;
}

.card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.card h3 {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--secondary-text);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card p {
    font-size: 1rem;
    color: var(--text-color);
}

.span-2 {
    grid-column: span 2;
}

.span-3,
.span-full {
    grid-column: 1 / -1;
}

/* Settings Styles */
.settings-grid {
    display: grid;
    gap: 3rem;
    margin-bottom: 3rem;
}

.settings-section {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
}

.settings-section h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: var(--text-color);
}

.setting-item {
    margin-bottom: 2rem;
}

.setting-item:last-child {
    margin-bottom: 0;
}

.setting-item label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.setting-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-family: inherit;
    font-size: 1rem;
    background: var(--card-bg);
    color: var(--text-color);
    transition: all 0.2s;
}

.setting-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
}

.setting-desc {
    font-size: 0.875rem;
    color: var(--secondary-text);
    margin-top: 0.5rem;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-weight: 600;
}

.toggle-label input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 48px;
    height: 24px;
    background: var(--border-color);
    border-radius: 24px;
    transition: all 0.3s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: var(--text-color);
    border-radius: 50%;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    opacity: 0.5;
}

.toggle-label input:checked+.toggle-slider {
    background: var(--primary-color);
}

.toggle-label input:checked+.toggle-slider::before {
    transform: translateX(24px);
}

.setting-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.settings-footer {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.secondary-btn {
    background: var(--card-bg);
    color: var(--text-color);
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.secondary-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.theme-dark .secondary-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #475569;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.danger-btn {
    background: var(--danger-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.danger-btn:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.2);
}

/* History Styles */
.history-grid {
    display: grid;
    gap: 1.5rem;
}

.history-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.3s;
}

.history-item:hover {
    border-color: #cbd5e1;
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.history-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
    flex: 1;
}

.history-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.history-badge.rank {
    background: #eff6ff;
    color: var(--primary-color);
}

.history-badge.improve {
    background: #ecfdf5;
    color: #059669;
}

.history-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--secondary-text);
}

.history-actions {
    display: flex;
    gap: 0.75rem;
}

.view-btn {
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.view-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.delete-btn {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
    padding: 0.5rem 1rem;
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.delete-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--danger-color);
    transform: translateY(-1px);
}

/* Filter Buttons */
.filter-btn {
    background: var(--card-bg);
    color: var(--secondary-text);
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

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

/* Language Selector Styles */
.language-selector {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 1000;
}

.language-btn {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.language-btn:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: var(--shadow-sm);
}

.language-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    min-width: 150px;
    display: none;
    z-index: 1001;
}

.language-dropdown.show {
    display: block;
}

.language-option {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
    border-bottom: 1px solid #f1f5f9;
}

.language-option:last-child {
    border-bottom: none;
}

.language-option:hover {
    background: #f8fafc;
}

.language-option.active {
    background: var(--primary-color);
    color: white;
}

.language-option:first-child {
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.language-option:last-child {
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}

/* Light Theme */
body.theme-light {
    --bg-color: #ffffff;
    --text-color: #1a1a1a;
    --secondary-text: #6b7280;
    --border-color: #f1f5f9;
    --card-bg: #ffffff;
    --sidebar-bg: #f8fafc;
    background-color: var(--bg-color);
    color: var(--text-color);
}

.theme-light .card,
.theme-light .settings-section,
.theme-light .history-item {
    background: var(--card-bg);
    border-color: var(--border-color);
}

.theme-light .sidebar {
    background: var(--sidebar-bg);
    border-color: var(--border-color);
}

.theme-light textarea,
.theme-light .setting-select {
    background: #fcfcfd;
    border-color: var(--border-color);
    color: var(--text-color);
}

.theme-light textarea:focus,
.theme-light .setting-select:focus {
    background: #ffffff;
}

.theme-light .secondary-btn {
    background: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-color);
}

.theme-light .language-btn,
.theme-light .language-dropdown {
    background: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-color);
}

.theme-light .toggle-slider {
    background: #e2e8f0;
}

.theme-light .toggle-slider::before {
    background: #ffffff;
    opacity: 1;
}

/* Dark Theme Support */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #0f172a;
        --text-color: #f1f5f9;
        --secondary-text: #94a3b8;
        --border-color: #334155;
        --card-bg: #1e293b;
        --sidebar-bg: #1e293b;
    }

    body.theme-auto {
        background-color: var(--bg-color);
        color: var(--text-color);
    }

    .theme-auto .card,
    .theme-auto .settings-section,
    .theme-auto .history-item {
        background: var(--card-bg);
        border-color: var(--border-color);
    }

    .theme-auto .sidebar {
        background: var(--sidebar-bg);
        border-color: var(--border-color);
    }

    .theme-auto textarea,
    .theme-auto .setting-select {
        background: var(--card-bg);
        border-color: var(--border-color);
        color: var(--text-color);
    }

    .theme-auto .secondary-btn {
        background: var(--card-bg);
        border-color: var(--border-color);
        color: var(--text-color);
    }

    .theme-auto .language-btn,
    .theme-auto .language-dropdown {
        background: var(--card-bg);
        border-color: var(--border-color);
        color: var(--text-color);
    }
}

/* Explicit Dark Theme */
body.theme-dark {
    --bg-color: #0f172a;
    --text-color: #f1f5f9;
    --secondary-text: #94a3b8;
    --border-color: #334155;
    --card-bg: #1e293b;
    --sidebar-bg: #1e293b;
    background-color: var(--bg-color);
    color: var(--text-color);
}

.theme-dark .card,
.theme-dark .settings-section,
.theme-dark .history-item {
    background: var(--card-bg);
    border-color: var(--border-color);
}

.theme-dark .sidebar {
    background: var(--sidebar-bg);
    border-color: var(--border-color);
}

.theme-dark textarea,
.theme-dark .setting-select {
    background: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-color);
}

.theme-dark .secondary-btn {
    background: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-color);
}

.theme-dark .language-btn,
.theme-dark .language-dropdown {
    background: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-color);
}

/* Responsive Design Improvements */
@media (max-width: 1280px) {
    .market-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }

    .main-content {
        margin-left: 0;
        padding: 2rem 1rem;
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100%;
        width: 280px;
        z-index: 100;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .landing-container {
        padding: 4rem 1rem;
    }

    h1 {
        font-size: 2.5rem;
    }

    .subtitle {
        font-size: 1.125rem;
    }

    .input-group {
        padding: 1.5rem;
    }

    .marketing-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .report-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .span-2,
    .span-3,
    .span-full {
        grid-column: span 1;
    }

    .score-container {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
        padding: 1.5rem;
    }

    .market-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem;
    }

    .swot-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .share-section {
        flex-direction: column;
    }

    .sources-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .settings-footer {
        flex-direction: column;
    }

    .history-header {
        flex-direction: column;
        gap: 0.5rem;
    }

    .history-actions {
        justify-content: flex-start;
    }

    .language-selector {
        top: 1rem;
        right: 1rem;
    }
}

@media (max-width: 480px) {
    .landing-container {
        padding: 3rem 1rem;
    }

    h1 {
        font-size: 2rem;
    }

    .input-group {
        padding: 1rem;
    }

    textarea {
        min-height: 120px;
        padding: 1rem;
    }

    .primary-btn {
        padding: 1rem 2rem;
        font-size: 1rem;
    }

    .main-content {
        padding: 1.5rem 1rem;
    }

    .card {
        padding: 1.5rem;
    }

    .circular-score {
        width: 100px;
        height: 100px;
    }

    .circular-score svg {
        width: 100px;
        height: 100px;
    }

    .score-text .val {
        font-size: 1.5rem;
    }
}

/* Animation Enhancements */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.card {
    animation: slideInUp 0.6s ease-out;
}

.card:nth-child(1) {
    animation-delay: 0.1s;
}

.card:nth-child(2) {
    animation-delay: 0.2s;
}

.card:nth-child(3) {
    animation-delay: 0.3s;
}

.card:nth-child(4) {
    animation-delay: 0.4s;
}

.card:nth-child(5) {
    animation-delay: 0.5s;
}

.card:nth-child(6) {
    animation-delay: 0.6s;
}

.history-item {
    animation: fadeIn 0.5s ease-out;
}

.settings-section {
    animation: slideInUp 0.6s ease-out;
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    box-shadow: var(--shadow-lg);
    z-index: 10000;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 400px;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-info {
    background: var(--primary-color);
}

.toast-success {
    background: var(--success-color);
}

.toast-error {
    background: var(--danger-color);
}

.toast-warning {
    background: var(--warning-color);
}

@media (max-width: 768px) {
    .toast {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        max-width: none;
    }
}

/* Focus Styles */
.nav-item:focus,
.primary-btn:focus,
.secondary-btn:focus,
.danger-btn:focus,
.view-btn:focus,
.delete-btn:focus,
.filter-btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Print Styles */
@media print {

    .sidebar,
    .share-section,
    .sources-bar,
    .loading-overlay {
        display: none !important;
    }

    .main-content {
        margin-left: 0;
        padding: 0;
    }

    .card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }

    body {
        background: white;
        color: black;
    }
}

/* Market Grid (TAM/SAM/SOM) */
.market-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.market-item {
    padding: 1rem;
    background: var(--sidebar-bg);
    border-radius: 12px;
    text-align: center;
}

.market-item span {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--secondary-text);
}

.market-item strong {
    font-size: 0.9375rem;
    color: var(--primary-color);
    word-break: break-word;
    display: block;
    margin-top: 0.25rem;
    line-height: 1.35;
    font-weight: 800;
}

/* SWOT Grid */
.swot-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.swot-item {
    padding: 1.25rem;
    border-radius: 16px;
}

.swot-S {
    background: #ecfdf5;
    color: #065f46;
}

.swot-W {
    background: #fff7ed;
    color: #9a3412;
}

.swot-O {
    background: #eff6ff;
    color: #1e40af;
}

.swot-T {
    background: #fef2f2;
    color: #991b1b;
}

[data-theme="dark"] .swot-S {
    background: #065f46;
    color: #ecfdf5;
}

[data-theme="dark"] .swot-W {
    background: #9a3412;
    color: #fff7ed;
}

[data-theme="dark"] .swot-O {
    background: #1e40af;
    color: #eff6ff;
}

[data-theme="dark"] .swot-T {
    background: #991b1b;
    color: #fef2f2;
}

.theme-dark .swot-S {
    background: #065f46;
    color: #ecfdf5;
}

.theme-dark .swot-W {
    background: #9a3412;
    color: #fff7ed;
}

.theme-dark .swot-O {
    background: #1e40af;
    color: #eff6ff;
}

.theme-dark .swot-T {
    background: #991b1b;
    color: #fef2f2;
}

.swot-item h4 {
    font-size: 0.75rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
}

.swot-item ul {
    list-style: none;
    font-size: 0.875rem;
}

.swot-item li {
    margin-bottom: 0.25rem;
    position: relative;
    padding-left: 1rem;
}

.swot-item li::before {
    content: "•";
    position: absolute;
    left: 0;
}

/* Sources Bar */
.sources-bar {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--sidebar-bg);
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

.sources-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--secondary-text);
    text-transform: uppercase;
}

.source-badges {
    display: flex;
    gap: 0.75rem;
}

.source-badge {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.source-badge img {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

.source-badge:hover {
    border-color: var(--primary-color);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.source-badge::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: var(--text-color);
    color: var(--bg-color);
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
}

.source-badge:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.source-badge:active {
    transform: scale(0.9);
}

/* Share Section & Buttons */
.share-section {
    display: flex;
    gap: 1rem;
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.share-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--card-bg);
    color: var(--text-color);
    padding: 1rem 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.share-btn:hover {
    background: var(--sidebar-bg);
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.share-btn .material-symbols-outlined {
    font-size: 20px;
    color: var(--primary-color);
}

.share-btn:active {
    transform: scale(0.96);
}

/* Marketing Sections */
.marketing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 6rem;
    text-align: left;
}

.m-card {
    padding: 2rem;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    transition: all 0.3s;
}

.theme-dark .m-card {
    background: rgba(30, 41, 59, 0.6);
}

.theme-auto .m-card {
    background: rgba(255, 255, 255, 0.6);
}

@media (prefers-color-scheme: dark) {
    .theme-auto .m-card {
        background: rgba(30, 41, 59, 0.6);
    }
}

.m-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.m-card .icon {
    width: 48px;
    height: 48px;
    background: #eff6ff;
    color: var(--primary-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.theme-dark .m-card .icon {
    background: #1e40af;
    color: #eff6ff;
}

.theme-auto .m-card .icon {
    background: #eff6ff;
    color: var(--primary-color);
}

@media (prefers-color-scheme: dark) {
    .theme-auto .m-card .icon {
        background: #1e40af;
        color: #eff6ff;
    }
}

.m-card h3 {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.m-card p {
    font-size: 0.875rem;
    color: var(--secondary-text);
    line-height: 1.5;
}

.landing-footer {
    margin-top: 6rem;
    padding: 3rem 0;
    border-top: 1px solid var(--border-color);
    color: var(--secondary-text);
    font-size: 0.875rem;
}

/* Shareable Card Canvas Styling */
#shareableCanvas {
    display: none;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

[data-theme="dark"] .loading-overlay {
    background: rgba(15, 23, 42, 0.95);
}

.theme-dark .loading-overlay {
    background: rgba(15, 23, 42, 0.95);
}

.theme-light .loading-overlay {
    background: rgba(255, 255, 255, 0.95);
}

/* Puzzle Animation */
.puzzle-container {
    position: relative;
    width: 80px;
    height: 80px;
    margin-bottom: 2rem;
}

.puzzle-piece {
    position: absolute;
    width: 38px;
    height: 38px;
    background: var(--primary-color);
    border-radius: 8px;
    animation: puzzle-assemble 2s infinite cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.p1 {
    top: 0;
    left: 0;
    background: #3b82f6;
    clip-path: polygon(0% 0%, 100% 0%, 100% 70%, 70% 70%, 70% 100%, 0% 100%);
}

.p2 {
    top: 0;
    right: 0;
    background: #60a5fa;
    clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 30% 100%, 30% 70%, 0% 70%);
}

.p3 {
    bottom: 0;
    left: 0;
    background: #2563eb;
    clip-path: polygon(0% 0%, 70% 0%, 70% 30%, 100% 30%, 100% 100%, 0% 100%);
}

.p4 {
    bottom: 0;
    right: 0;
    background: #1d4ed8;
    clip-path: polygon(30% 0%, 100% 0%, 100% 100%, 0% 100%, 0% 30%, 30% 30%);
}

@keyframes puzzle-assemble {
    0% {
        transform: translate(-40px, -40px) rotate(-45deg);
        opacity: 0;
    }

    20% {
        transform: translate(0, 0) rotate(0);
        opacity: 1;
    }

    80% {
        transform: translate(0, 0) rotate(0);
        opacity: 1;
    }

    100% {
        transform: translate(40px, 40px) rotate(45deg);
        opacity: 0;
    }
}

.p1 {
    animation-delay: 0s;
}

.p2 {
    animation-delay: 0.1s;
}

.p3 {
    animation-delay: 0.2s;
}

.p4 {
    animation-delay: 0.3s;
}

.loading-text {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-color);
    letter-spacing: -0.01em;
}

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

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

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

    .marketing-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .landing-container {
        padding: 3rem 1rem;
    }

    h1 {
        font-size: 2rem;
    }

    .circular-score {
        width: 100px;
        height: 100px;
    }

    .circular-score svg {
        width: 100px;
        height: 100px;
    }

    .score-text .val {
        font-size: 1.5rem;
    }

    .card {
        padding: 1.5rem;
    }

    .toast {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
    }
}

/* =======================================================
   OVERHAUL: Enhanced Analysis Result Component Styles
   ======================================================= */

/* Score Info block */
.score-info {
    flex: 1;
    min-width: 0;
}

.score-title {
    font-size: 1.625rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 0.25rem;
    color: var(--text-color);
}

.score-confidence-label {
    font-size: 0.875rem;
    color: var(--secondary-text);
    margin-bottom: 0.75rem;
}

.score-tier-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.875rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.tier-excellent {
    background: #dcfce7;
    color: #166534;
}

.tier-good {
    background: #dbeafe;
    color: #1e40af;
}

.tier-average {
    background: #fef3c7;
    color: #92400e;
}

.tier-weak {
    background: #fee2e2;
    color: #991b1b;
}

.theme-dark .tier-excellent {
    background: rgba(22, 101, 52, 0.3);
    color: #4ade80;
}

.theme-dark .tier-good {
    background: rgba(30, 64, 175, 0.3);
    color: #93c5fd;
}

.theme-dark .tier-average {
    background: rgba(146, 64, 14, 0.3);
    color: #fbbf24;
}

.theme-dark .tier-weak {
    background: rgba(153, 27, 27, 0.3);
    color: #f87171;
}

/* Card accent top-line on hover (report grid only) */
.report-grid .card {
    position: relative;
    overflow: hidden;
}

.report-grid .card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), #60a5fa);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.report-grid .card:hover::after {
    transform: scaleX(1);
}

/* Summary card text */
.card-summary-text {
    font-size: 1.0625rem;
    line-height: 1.8;
    color: var(--text-color);
}

/* Frequency Badge */
.freq-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    margin-bottom: 1rem;
}

.freq-high {
    background: #dcfce7;
    color: #166534;
}

.freq-medium {
    background: #fef3c7;
    color: #92400e;
}

.freq-low {
    background: #fee2e2;
    color: #991b1b;
}

.theme-dark .freq-high {
    background: rgba(22, 101, 52, 0.3);
    color: #4ade80;
}

.theme-dark .freq-medium {
    background: rgba(146, 64, 14, 0.3);
    color: #fbbf24;
}

.theme-dark .freq-low {
    background: rgba(153, 27, 27, 0.3);
    color: #f87171;
}

/* Demand Card internals */
.demand-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.demand-description {
    font-size: 0.9375rem;
    color: var(--secondary-text);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.demand-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.demand-meta-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.meta-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--secondary-text);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    min-width: 50px;
    padding-top: 0.15rem;
    flex-shrink: 0;
}

.meta-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-color);
    line-height: 1.4;
}

/* Landscape Badge (Competition) */
.landscape-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.875rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
}

.landscape-crowded {
    background: #fee2e2;
    color: #991b1b;
}

.landscape-emerging {
    background: #dcfce7;
    color: #166534;
}

.landscape-blue-ocean {
    background: #dbeafe;
    color: #1e40af;
}

.theme-dark .landscape-crowded {
    background: rgba(153, 27, 27, 0.3);
    color: #f87171;
}

.theme-dark .landscape-emerging {
    background: rgba(22, 101, 52, 0.3);
    color: #4ade80;
}

.theme-dark .landscape-blue-ocean {
    background: rgba(30, 64, 175, 0.3);
    color: #93c5fd;
}

/* Competitor Tags */
.competitor-section {
    margin-bottom: 1rem;
}

.competitor-section:last-child {
    margin-bottom: 0;
}

.competitor-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--secondary-text);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.competitor-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.competitor-tag {
    padding: 0.2rem 0.625rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.2s;
}

.competitor-tag.direct {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.competitor-tag.indirect {
    background: #f8fafc;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.theme-dark .competitor-tag.direct {
    background: rgba(29, 78, 216, 0.2);
    color: #93c5fd;
    border-color: rgba(29, 78, 216, 0.4);
}

.theme-dark .competitor-tag.indirect {
    background: rgba(100, 116, 139, 0.15);
    color: #94a3b8;
    border-color: rgba(100, 116, 139, 0.3);
}

/* Roadmap Steps */
.roadmap-steps {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.roadmap-step {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--sidebar-bg);
    border-radius: 12px;
    border-left: 3px solid var(--primary-color);
    font-size: 0.9375rem;
    color: var(--text-color);
    line-height: 1.5;
}

.roadmap-num {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 800;
    margin-top: 0.1rem;
}

/* Styled bullet list (weaknesses, etc.) */
.styled-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.styled-list li {
    position: relative;
    padding-left: 1.25rem;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--text-color);
}

.styled-list li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: 700;
}

/* Landing page subtle background gradient */
body.landing-page {
    background: linear-gradient(145deg, #eef2ff 0%, #ffffff 45%, #ecf7ff 100%);
}

body.landing-page.theme-dark {
    background: linear-gradient(145deg, #0c1520 0%, #0f172a 45%, #091825 100%);
}

@media (prefers-color-scheme: dark) {
    body.landing-page.theme-auto {
        background: linear-gradient(145deg, #0c1520 0%, #0f172a 45%, #091825 100%);
    }
}

/* =======================================================
   LANDING V2 — Clean, focused, premium
   ======================================================= */

body.landing-page {
    overflow-x: hidden;
    background: linear-gradient(160deg, #f8fafc 0%, #ffffff 50%, #eff6ff 100%);
    color: var(--text-color);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

body.landing-page.theme-dark {
    background: linear-gradient(160deg, #0b1220 0%, #0f172a 50%, #0c1525 100%);
}

@media (prefers-color-scheme: dark) {
    body.landing-page.theme-auto {
        background: linear-gradient(160deg, #0b1220 0%, #0f172a 50%, #0c1525 100%);
    }
}

body.landing-page .landing-v2 {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Background layers */
body.landing-page .landing-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

body.landing-page .landing-grid {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 18% 12%, rgba(37, 99, 235, 0.14), transparent 40%),
        radial-gradient(circle at 82% 22%, rgba(96, 165, 250, 0.10), transparent 38%);
}

body.landing-page .landing-grid::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(148, 163, 184, 0.10) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.10) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(circle at 50% 20%, rgba(0,0,0,1), rgba(0,0,0,0) 70%);
    opacity: 0.4;
}

body.landing-page .landing-glow {
    position: absolute;
    width: 520px;
    height: 520px;
    filter: blur(60px);
    opacity: 0.45;
}

body.landing-page .landing-glow-a {
    left: -180px;
    top: -160px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.55), transparent 60%);
}

body.landing-page .landing-glow-b {
    right: -180px;
    top: 80px;
    background: radial-gradient(circle, rgba(96, 165, 250, 0.45), transparent 60%);
}

body.landing-page .landing-noise {
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='.2'/%3E%3C/svg%3E");
    opacity: 0.04;
    mix-blend-mode: overlay;
}

/* Topbar */
body.landing-page .landing-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 2rem;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}body.landing-page.theme-dark .landing-topbar {
            background: rgba(15, 23, 42, 0.72);
            border-bottom-color: rgba(148, 163, 184, 0.12);
}

@media (prefers-color-scheme: dark) {
    body.landing-page.theme-auto .landing-topbar {
            background: rgba(15, 23, 42, 0.72);
            border-bottom-color: rgba(148, 163, 184, 0.12);
    }
}

body.landing-page .brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: var(--text-color);
    font-weight: 900;
    letter-spacing: -0.03em;
}

body.landing-page .brand .logo-img { height: 26px; }
body.landing-page .brand-name { font-size: 1.05rem; }

body.landing-page .brand-badge {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    border: 1px solid rgba(37, 99, 235, 0.25);
    color: var(--primary-color);
    background: rgba(37, 99, 235, 0.08);
}

body.landing-page .landing-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

body.landing-page .nav-link {
    color: var(--secondary-text);
    font-weight: 600;
    text-decoration: none;
    font-size: 0.9375rem;
    transition: color 0.2s ease;
}

body.landing-page .nav-link:hover { color: var(--text-color); }

body.landing-page .landing-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Topbar icon button (theme toggle, language) */
body.landing-page .topbar-icon-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.55rem 0.7rem;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(255, 255, 255, 0.6);
    color: var(--text-color);
    cursor: pointer;
    font-weight: 700;
    font-size: 0.8rem;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

body.landing-page .topbar-icon-btn:hover {
    border-color: rgba(37, 99, 235, 0.4);
    color: var(--primary-color);
    transform: translateY(-1px);
}

body.landing-page .topbar-icon-btn .material-symbols-outlined { font-size: 18px; }body.landing-page.theme-dark .topbar-icon-btn {
            background: rgba(15, 23, 42, 0.5);
            border-color: rgba(148, 163, 184, 0.18);
}

@media (prefers-color-scheme: dark) {
    body.landing-page.theme-auto .topbar-icon-btn {
            background: rgba(15, 23, 42, 0.5);
            border-color: rgba(148, 163, 184, 0.18);
    }
}

/* Language dropdown */
body.landing-page .topbar-lang-wrap { position: relative; }

body.landing-page .topbar-lang-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 160px;
    display: none;
    flex-direction: column;
    padding: 0.4rem;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
    box-shadow: 0 12px 32px rgba(2, 6, 23, 0.12);
    z-index: 30;
}

body.landing-page .topbar-lang-dropdown.show { display: flex; }body.landing-page.theme-dark .topbar-lang-dropdown {
            background: rgba(15, 23, 42, 0.96);
            border-color: rgba(148, 163, 184, 0.16);
}

@media (prefers-color-scheme: dark) {
    body.landing-page.theme-auto .topbar-lang-dropdown {
            background: rgba(15, 23, 42, 0.96);
            border-color: rgba(148, 163, 184, 0.16);
    }
}

body.landing-page .lang-option {
    text-align: left;
    padding: 0.55rem 0.75rem;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-color);
    font-weight: 600;
    transition: background 0.15s ease;
}

body.landing-page .lang-option:hover { background: rgba(37, 99, 235, 0.08); }

/* Topbar CTA */
body.landing-page .topbar-cta-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.6rem 1.1rem;
    border-radius: 12px;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

body.landing-page .topbar-cta-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

/* Container */
body.landing-page .landing-container {
    position: relative;
    z-index: 1;
    max-width: 1120px;
    width: 100%;
    margin: 0 auto;
    padding: 3rem 2rem 0;
    flex: 1;
}

/* Hero */
body.landing-page .hero {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 3rem;
    align-items: center;
    padding: 2rem 0 1rem;
}

body.landing-page .hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 800;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

body.landing-page .hero-title {
    font-size: clamp(2.2rem, 5vw, 3.4rem);
    line-height: 1.05;
    letter-spacing: -0.04em;
    margin-bottom: 1rem;
    color: var(--text-color);
    font-weight: 900;
}

body.landing-page .hero-title-accent {
    background: linear-gradient(90deg, var(--primary-color), #60a5fa);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

body.landing-page .hero-sub {
    font-size: 1.0625rem;
    line-height: 1.6;
    color: var(--secondary-text);
    margin-bottom: 1.75rem;
    max-width: 520px;
}

/* Hero input card */
body.landing-page .hero-input-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 18px;
    padding: 1.25rem;
    box-shadow: 0 12px 32px rgba(2, 6, 23, 0.06);
    margin-bottom: 1.5rem;
}body.landing-page.theme-dark .hero-input-card {
            background: rgba(15, 23, 42, 0.55);
            border-color: rgba(148, 163, 184, 0.16);
            box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

@media (prefers-color-scheme: dark) {
    body.landing-page.theme-auto .hero-input-card {
            background: rgba(15, 23, 42, 0.55);
            border-color: rgba(148, 163, 184, 0.16);
            box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
    }
}

body.landing-page .hero-textarea {
    width: 100%;
    border: none;
    background: transparent;
    color: var(--text-color);
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.5;
    resize: vertical;
    outline: none;
    padding: 0.25rem;
}

body.landing-page .hero-textarea::placeholder { color: var(--secondary-text); opacity: 0.7; }

body.landing-page .hero-input-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(148, 163, 184, 0.18);
}

body.landing-page .hero-tip {
    font-size: 0.78rem;
    color: var(--secondary-text);
    font-weight: 600;
}

body.landing-page .hero-analyze-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.7rem 1.25rem;
    border-radius: 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

body.landing-page .hero-analyze-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

body.landing-page .hero-analyze-btn .material-symbols-outlined { font-size: 18px; }

/* Trust pills */
body.landing-page .trust-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

body.landing-page .trust-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(10px);
    color: var(--secondary-text);
    font-weight: 700;
    font-size: 0.8rem;
}

body.landing-page .trust-pill .material-symbols-outlined {
    font-size: 16px;
    color: var(--primary-color);
}body.landing-page.theme-dark .trust-pill {
            background: rgba(15, 23, 42, 0.4);
}

@media (prefers-color-scheme: dark) {
    body.landing-page.theme-auto .trust-pill {
            background: rgba(15, 23, 42, 0.4);
    }
}

/* Hero preview (right side) */
body.landing-page .hero-preview {
    position: relative;
}

body.landing-page .preview-card {
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 24px 60px rgba(2, 6, 23, 0.10);
    animation: floatCard 6s ease-in-out infinite;
}body.landing-page.theme-dark .preview-card {
            background: rgba(15, 23, 42, 0.6);
            border-color: rgba(148, 163, 184, 0.16);
            box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
}

@media (prefers-color-scheme: dark) {
    body.landing-page.theme-auto .preview-card {
            background: rgba(15, 23, 42, 0.6);
            border-color: rgba(148, 163, 184, 0.16);
            box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
    }
}

@keyframes floatCard {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

body.landing-page .preview-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 1.25rem;
}

body.landing-page .preview-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
body.landing-page .preview-dot.red { background: #ef4444; }
body.landing-page .preview-dot.yellow { background: #f59e0b; }
body.landing-page .preview-dot.green { background: #10b981; }

body.landing-page .preview-label {
    margin-left: 0.5rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--secondary-text);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

body.landing-page .preview-score-row {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

body.landing-page .preview-score-circle {
    position: relative;
    width: 96px;
    height: 96px;
    flex-shrink: 0;
}

body.landing-page .preview-score-circle svg {
    width: 100%;
    height: 100%;
}

body.landing-page .preview-score-val {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--text-color);
    letter-spacing: -0.02em;
}

body.landing-page .preview-score-val span {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--secondary-text);
    margin-left: 0.1rem;
}

body.landing-page .preview-score-meta { flex: 1; min-width: 0; }

body.landing-page .preview-score-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-color);
    margin-bottom: 0.4rem;
    letter-spacing: -0.01em;
}

body.landing-page .preview-score-tier {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

body.landing-page .preview-score-tier.excellent {
    background: #dcfce7;
    color: #166534;
}body.landing-page.theme-dark .preview-score-tier.excellent {
            background: rgba(22, 101, 52, 0.3);
            color: #4ade80;
}

@media (prefers-color-scheme: dark) {
    body.landing-page.theme-auto .preview-score-tier.excellent {
            background: rgba(22, 101, 52, 0.3);
            color: #4ade80;
    }
}

body.landing-page .preview-score-conf {
    font-size: 0.75rem;
    color: var(--secondary-text);
    font-weight: 600;
}

body.landing-page .preview-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
}

body.landing-page .preview-metric {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.6rem 0.5rem;
    border-radius: 10px;
    background: rgba(148, 163, 184, 0.08);
    border: 1px solid rgba(148, 163, 184, 0.14);
}

body.landing-page .pm-label {
    font-size: 0.62rem;
    font-weight: 800;
    color: var(--secondary-text);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

body.landing-page .pm-val {
    font-size: 0.92rem;
    font-weight: 800;
    color: var(--primary-color);
}

body.landing-page .pm-val.high { color: #16a34a; }

body.landing-page .preview-swot {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

body.landing-page .preview-swot-item {
    font-size: 0.78rem;
    line-height: 1.4;
    color: var(--text-color);
    padding: 0.5rem 0.7rem;
    border-radius: 8px;
    background: rgba(148, 163, 184, 0.06);
    border-left: 3px solid var(--primary-color);
}

body.landing-page .preview-swot-item.w { border-left-color: #f59e0b; }
body.landing-page .preview-swot-item.o { border-left-color: #10b981; }
body.landing-page .preview-swot-item.t { border-left-color: #ef4444; }

/* Sections */
body.landing-page .section {
    padding: 5rem 0 0;
}

body.landing-page .section-head {
    max-width: 640px;
    margin-bottom: 2rem;
}

body.landing-page .section-title {
    font-size: clamp(1.6rem, 3.5vw, 2.1rem);
    line-height: 1.15;
    letter-spacing: -0.03em;
    margin-bottom: 0.6rem;
    color: var(--text-color);
    font-weight: 900;
}

body.landing-page .section-subtitle {
    color: var(--secondary-text);
    font-size: 1.05rem;
    line-height: 1.5;
}

/* Tool grid */
body.landing-page .tool-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

body.landing-page .tool-card {
    padding: 1.75rem;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

body.landing-page .tool-card:hover {
    transform: translateY(-4px);
    border-color: rgba(37, 99, 235, 0.35);
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.10);
}body.landing-page.theme-dark .tool-card {
            background: rgba(15, 23, 42, 0.4);
            border-color: rgba(148, 163, 184, 0.16);
}

@media (prefers-color-scheme: dark) {
    body.landing-page.theme-auto .tool-card {
            background: rgba(15, 23, 42, 0.4);
            border-color: rgba(148, 163, 184, 0.16);
    }
}

body.landing-page .tool-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(37, 99, 235, 0.12);
    color: var(--primary-color);
    margin-bottom: 1rem;
}

body.landing-page .tool-icon .material-symbols-outlined { font-size: 24px; }

body.landing-page .tool-card h3 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

body.landing-page .tool-card p {
    color: var(--secondary-text);
    font-size: 0.9375rem;
    line-height: 1.6;
    margin-bottom: 1.25rem;
}

body.landing-page .tool-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 800;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
}

body.landing-page .tool-link .material-symbols-outlined { font-size: 18px; }

/* Steps */
body.landing-page .steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

body.landing-page .step {
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 1.5rem;
    display: flex;
    gap: 1rem;
}body.landing-page.theme-dark .step {
            background: rgba(15, 23, 42, 0.4);
            border-color: rgba(148, 163, 184, 0.16);
}

@media (prefers-color-scheme: dark) {
    body.landing-page.theme-auto .step {
            background: rgba(15, 23, 42, 0.4);
            border-color: rgba(148, 163, 184, 0.16);
    }
}

body.landing-page .step-num {
    font-weight: 900;
    letter-spacing: -0.02em;
    color: var(--primary-color);
    font-size: 1.1rem;
}

body.landing-page .step-body h3 {
    font-size: 1.05rem;
    margin-bottom: 0.35rem;
    color: var(--text-color);
}

body.landing-page .step-body p {
    color: var(--secondary-text);
    font-size: 0.9375rem;
    line-height: 1.6;
}

/* Footer */
body.landing-page .landing-footer {
    margin-top: 5rem;
    padding: 2.5rem 0 3rem;
    border-top: 1px solid rgba(148, 163, 184, 0.18);
}

body.landing-page .footer-inner {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    align-items: flex-start;
    flex-wrap: wrap;
}

body.landing-page .footer-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
}

body.landing-page .footer-brand .logo-img { height: 22px; }

body.landing-page .footer-name {
    font-weight: 900;
    letter-spacing: -0.03em;
    color: var(--text-color);
}

body.landing-page .footer-tagline {
    color: var(--secondary-text);
    font-size: 0.875rem;
}

body.landing-page .footer-right {
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
    align-items: center;
}

body.landing-page .footer-link {
    color: var(--secondary-text);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

body.landing-page .footer-link:hover { color: var(--text-color); }

/* Scroll reveal */
body.landing-page .reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

body.landing-page .reveal.in {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    body.landing-page .reveal,
    body.landing-page .preview-card {
        opacity: 1;
        transform: none;
        animation: none;
        transition: none;
    }
}

/* Responsive */
@media (max-width: 1024px) {
    body.landing-page .hero {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    body.landing-page .tool-grid,
    body.landing-page .steps {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    body.landing-page .landing-topbar {
        padding: 0.875rem 1rem;
    }
    body.landing-page .landing-nav { display: none; }
    body.landing-page .landing-container { padding: 2rem 1rem 0; }
    body.landing-page .brand-badge { display: none; }
    body.landing-page .topbar-cta-btn {
        padding: 0.55rem 0.9rem;
        font-size: 0.85rem;
    }
    body.landing-page .topbar-icon-btn {
        padding: 0.5rem 0.55rem;
    }
    body.landing-page .preview-metrics {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 560px) {
    body.landing-page .hero-preview { display: none; }
    body.landing-page .hero-input-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 0.6rem;
    }
    body.landing-page .hero-analyze-btn { justify-content: center; }
    body.landing-page .hero-tip { text-align: center; }
}

/* =======================================================
   HISTORY & SETTINGS — Redesigned Components
   ======================================================= */

/* Shared tool-page header */
.tool-header {
    margin-bottom: 1.75rem;
}

.tool-subtitle {
    color: var(--secondary-text);
    font-size: 0.9375rem;
    margin-top: 0.375rem;
    line-height: 1.5;
}

/* Filter pills (History) */
.filter-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
}

.filter-pill {
    padding: 0.45rem 1.125rem;
    border-radius: 20px;
    font-size: 0.8125rem;
    font-weight: 600;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--secondary-text);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.filter-pill:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.filter-pill.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

/* History List */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.history-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 1.375rem 1.75rem;
    transition: all 0.25s;
    animation: fadeIn 0.4s ease-out;
}

.history-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.hc-score-wrap {
    flex-shrink: 0;
}

.hc-score {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 2.5px solid currentColor;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.0625rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.hc-body {
    flex: 1;
    min-width: 0;
}

.hc-top {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.625rem;
}

.hc-summary {
    flex: 1;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-color);
    line-height: 1.45;
    min-width: 0;
}

.hc-type-badge {
    flex-shrink: 0;
    padding: 0.2rem 0.75rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.hc-type-badge.rank {
    background: #eff6ff;
    color: var(--primary-color);
}

.hc-type-badge.improve {
    background: #ecfdf5;
    color: #059669;
}

.hc-type-badge.problem {
    background: #fef3c7;
    color: #92400e;
}

.theme-dark .hc-type-badge.rank {
    background: rgba(37, 99, 235, 0.2);
    color: #93c5fd;
}

.theme-dark .hc-type-badge.improve {
    background: rgba(5, 150, 105, 0.2);
    color: #34d399;
}

.theme-dark .hc-type-badge.problem {
    background: rgba(146, 64, 14, 0.2);
    color: #fbbf24;
}

.hc-meta {
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.hc-meta-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8125rem;
    color: var(--secondary-text);
    font-weight: 500;
}

.hc-meta-item .material-symbols-outlined {
    font-size: 14px;
}

.hc-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.hc-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
    white-space: nowrap;
}

.hc-btn .material-symbols-outlined {
    font-size: 16px;
}

.hc-view {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.hc-view:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.25);
    transform: translateY(-1px);
}

.hc-delete {
    background: transparent;
    color: var(--secondary-text);
    border-color: var(--border-color);
    padding: 0.5rem;
}

.hc-delete:hover {
    background: #fee2e2;
    color: var(--danger-color);
    border-color: rgba(239, 68, 68, 0.3);
}

.theme-dark .hc-delete:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5rem 2rem;
    text-align: center;
    gap: 1rem;
}

.empty-state .material-symbols-outlined {
    font-size: 3rem;
    color: var(--secondary-text);
    opacity: 0.4;
}

.empty-state h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-color);
}

.empty-state p {
    color: var(--secondary-text);
    font-size: 0.9375rem;
    max-width: 320px;
    line-height: 1.6;
}

/* ── Settings Redesign ── */
.settings-stack {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-bottom: 2rem;
    max-width: 800px;
}

.settings-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 1.75rem 2rem;
    transition: border-color 0.2s;
}

.settings-card:hover {
    border-color: #cbd5e1;
}

.theme-dark .settings-card:hover {
    border-color: #475569;
}

.settings-card-header {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.settings-card-header .material-symbols-outlined {
    font-size: 18px;
    color: var(--primary-color);
    background: #eff6ff;
    padding: 0.5rem;
    border-radius: 10px;
    line-height: 1;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.theme-dark .settings-card-header .material-symbols-outlined {
    background: rgba(59, 130, 246, 0.15);
}

.settings-card-header h3 {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0;
    text-transform: none;
    letter-spacing: 0;
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.settings-row+.settings-row {
    margin-top: 1.25rem;
}

.settings-row-info {
    flex: 1;
}

.settings-row-info label {
    display: block;
    font-weight: 600;
    font-size: 0.9375rem;
    margin-bottom: 0.25rem;
    color: var(--text-color);
    cursor: default;
}

.settings-row-control {
    flex-shrink: 0;
    min-width: 200px;
}

.settings-row-toggle .settings-row-control {
    min-width: auto;
}

.settings-row-divider {
    height: 1px;
    background: var(--border-color);
    margin: 1.25rem 0;
}

/* Align settings-footer with stack width */
.settings-footer {
    max-width: 800px;
}

/* Responsive */
@media (max-width: 640px) {
    .settings-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .settings-row-control {
        min-width: unset;
        width: 100%;
    }

    .history-card {
        flex-wrap: wrap;
    }

    .hc-score-wrap {
        display: none;
    }

    .hc-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .hc-view {
        flex: 1;
        justify-content: center;
    }
}

/* Market Grid — vertical row layout to prevent value wrapping */
.market-grid {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.market-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--sidebar-bg);
    border-radius: 10px;
    text-align: left;
}

.market-item span {
    display: block;
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--secondary-text);
    letter-spacing: 0.07em;
    flex-shrink: 0;
}

.market-item strong {
    font-size: 0.875rem;
    color: var(--primary-color);
    word-break: break-word;
    display: block;
    margin-top: 0;
    line-height: 1.4;
    font-weight: 700;
    text-align: right;
    flex: 1;
}
/* =======================================================
   SKELETON LOADING — premium inline shimmer
   ======================================================= */
@keyframes skel-shimmer {
    0% { background-position: -680px 0; }
    100% { background-position: 680px 0; }
}

.skeleton-wrap {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 0.25rem;
}

.skel {
    border-radius: 18px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    padding: 1.5rem;
}

.skel-line {
    height: 14px;
    border-radius: 7px;
    margin-bottom: 0.75rem;
    background: linear-gradient(90deg, rgba(148,163,184,0.14) 0%, rgba(148,163,184,0.28) 50%, rgba(148,163,184,0.14) 100%);
    background-size: 1360px 100%;
    animation: skel-shimmer 1.4s infinite linear;
}

.skel-line:last-child { margin-bottom: 0; }
.skel-line-lg { height: 26px; width: 70%; }
.skel-line-sm { height: 12px; width: 45%; }
.skel-line-xs { height: 12px; width: 28%; }

.skel-score {
    display: flex;
    align-items: center;
    gap: 1.75rem;
    padding: 1.75rem 2rem;
}

.skel-circle {
    width: 108px;
    height: 108px;
    border-radius: 50%;
    flex-shrink: 0;
    background: linear-gradient(90deg, rgba(148,163,184,0.14) 0%, rgba(148,163,184,0.28) 50%, rgba(148,163,184,0.14) 100%);
    background-size: 220px 220px;
    animation: skel-shimmer 1.4s infinite linear;
}

.skel-lines {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.skel-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

.skel-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1.5rem;
}

.skel-card-wide {
    grid-column: 1 / -1;
}

.skel-bar {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.5rem;
}

.skel-pills {
    display: flex;
    gap: 0.75rem;
}

.skel-pill {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(90deg, rgba(148,163,184,0.14) 0%, rgba(148,163,184,0.28) 50%, rgba(148,163,184,0.14) 100%);
    background-size: 88px 88px;
    animation: skel-shimmer 1.4s infinite linear;
}

#toolOutput.is-loading,
#toolView.is-loading { min-height: 320px; }

/* Back button (history detail) */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 1.5rem;
    padding: 0.6rem 1rem;
    font-size: 0.875rem;
}

.back-btn .material-symbols-outlined {
    font-size: 18px;
}

/* =======================================================
   PREMIUM POLISH & MOBILE REFINEMENTS
   ======================================================= */

/* Smooth scrolling */
html { scroll-behavior: smooth; }

/* Better focus-visible across the app */
a:focus-visible,
button:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    border-radius: 8px;
}

/* Premium card hover lift with subtle gradient border glow */
.report-grid .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.08), var(--shadow-md);
}

/* Sidebar active nav indicator */
.nav-item.active {
    position: relative;
}
.nav-item.active::before {
    content: '';
    position: absolute;
    left: -1.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 22px;
    border-radius: 0 3px 3px 0;
    background: var(--primary-color);
}

/* Tool pane sticky head refinement */
.pane-head {
    padding: 0.875rem 1.25rem;
}

/* Score number micro-interaction */
.score-text .val {
    transition: transform 0.3s ease;
}
.score-container:hover .score-text .val {
    transform: scale(1.06);
}

/* Landing hero title responsive clamp */
body.landing-page .hero-title {
    font-size: clamp(2.1rem, 5vw, 3.25rem);
}
body.landing-page .section-title {
    font-size: clamp(1.5rem, 3.5vw, 2rem);
}

/* Landing topbar mobile compact */
@media (max-width: 768px) {
    body.landing-page .landing-topbar {
        padding: 0.875rem 1rem;
    }
    body.landing-page .brand-name { font-size: 0.95rem; }
    body.landing-page .brand-badge { display: none; }
    body.landing-page .ghost-btn {
        padding: 0.6rem 0.875rem;
        font-size: 0.85rem;
    }
    body.landing-page .primary-btn.compact {
        padding: 0.7rem 0.875rem;
        font-size: 0.85rem;
    }
}

/* Mobile dashboard: tighter padding, full-width tool panes */
@media (max-width: 768px) {
    .main-content {
        padding: 4.5rem 1rem 2rem;
    }
    .tool-shell-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    .tool-shell-hints {
        justify-content: flex-start;
    }
    .tool-pane .input-group-tech {
        margin: 1rem;
        padding: 1rem;
    }
    .tool-pane textarea {
        min-height: 160px;
        font-size: 1rem;
    }
    #toolOutput {
        padding: 1rem 1rem 1.5rem;
    }
    .score-container {
        padding: 1.5rem 1.25rem;
        gap: 1.5rem;
    }
    .circular-score {
        width: 96px;
        height: 96px;
    }
    .report-grid {
        gap: 1rem;
        margin-bottom: 2rem;
    }
    .card {
        padding: 1.25rem;
    }
}

/* Skeleton grid collapses on mobile */
@media (max-width: 768px) {
    .skel-grid { grid-template-columns: 1fr; }
    .skel-card-wide { grid-column: auto; }
    .skel-score {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding: 1.25rem;
    }
    .skel-circle { width: 84px; height: 84px; }
}

/* Landing hero workspace hidden on small screens for clarity */
@media (max-width: 560px) {
    body.landing-page .hero-workspace { display: none; }
    body.landing-page .hero { padding: 1.5rem 0 0.5rem; }
    body.landing-page .hero-cta { flex-direction: column; align-items: stretch; gap: 0.6rem; }
    body.landing-page .hero-secondary { justify-content: center; }
    body.landing-page .link-btn { justify-content: center; }
}

/* Hide the legacy puzzle animation (no longer used) */
.puzzle-container,
.puzzle-piece { display: none !important; }
