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

:root {
    /* PREMIUM FINTECH PALETTE */
    --bg: #f8fafc;
    --bg-blue: #eff6ff;
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    --bg-soft: #f1f5f9;
    --bg-dark: #0f172a;
    --bg-dark-card: #1e293b;
    --bg-dashboard: #1e3a5f;
    --bg-input: #f8fafc;

    --text: #0f172a;
    --text-body: #334155;
    --text-muted: #64748b;
    --text-dim: #94a3b8;
    --text-faint: #cbd5e1;
    --text-inverse: #f8fafc;

    --royal: #1e40af;
    --royal-hover: #1e3a8a;
    --royal-soft: rgba(30, 64, 175, 0.08);
    --royal-glow: rgba(30, 64, 175, 0.15);

    --emerald: #059669;
    --emerald-hover: #047857;
    --emerald-soft: rgba(5, 150, 105, 0.08);
    --emerald-glow: rgba(5, 150, 105, 0.15);

    --gold: #ca8a04;
    --gold-hover: #a16207;
    --gold-soft: rgba(202, 138, 4, 0.08);
    --gold-glow: rgba(202, 138, 4, 0.15);

    --crimson: #dc2626;
    --crimson-soft: rgba(220, 38, 38, 0.08);

    --sky: #0284c7;
    --sky-soft: rgba(2, 132, 199, 0.08);

    --violet: #7c3aed;
    --violet-soft: rgba(124, 58, 237, 0.08);

    --teal: #0d9488;
    --teal-soft: rgba(13, 148, 136, 0.08);

    --rose: #e11d48;
    --rose-soft: rgba(225, 29, 72, 0.08);

    --indigo: #4338ca;
    --indigo-soft: rgba(67, 56, 202, 0.08);

    --orange: #ea580c;
    --orange-soft: rgba(234, 88, 12, 0.08);

    --border: #e2e8f0;
    --border-hover: #cbd5e1;
    --border-bright: #94a3b8;

    --radius: 16px;
    --radius-sm: 12px;
    --radius-xs: 8px;
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.05);
    --shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 12px 48px rgba(15, 23, 42, 0.12);
    --max-width: 1200px;
    --max-width-tool: 900px;

    --font-display: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* SUBTLE BLUE GRADIENT MESH */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        radial-gradient(ellipse 600px 400px at 15% 0%, rgba(30, 64, 175, 0.05), transparent 60%),
        radial-gradient(ellipse 500px 350px at 85% 20%, rgba(5, 150, 105, 0.04), transparent 60%),
        radial-gradient(ellipse 700px 500px at 50% 100%, rgba(202, 138, 4, 0.03), transparent 60%);
    pointer-events: none;
    z-index: 0;
}

a { color: inherit; text-decoration: none; }
::selection { background: var(--royal-soft); color: var(--royal-hover); }

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-bright); border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ============ HEADER ============ */
header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(248, 250, 252, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 14px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    position: relative;
    z-index: 1;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    white-space: nowrap;
    color: var(--text);
}

.logo-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--royal);
    color: #fff;
    border-radius: var(--radius-xs);
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 700;
}

.logo .accent { color: var(--emerald); }

.header-search {
    flex: 1;
    max-width: 380px;
    position: relative;
}

.header-search input {
    width: 100%;
    padding: 10px 16px 10px 38px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.86rem;
    font-family: var(--font-sans);
    transition: all 0.2s;
}

.header-search input::placeholder { color: var(--text-dim); }

.header-search input:focus {
    outline: none;
    border-color: var(--royal);
    box-shadow: 0 0 0 3px var(--royal-soft);
}

.header-search svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    stroke: var(--text-dim);
    fill: none;
    stroke-width: 2;
}

.header-nav { display: flex; gap: 24px; font-size: 0.86rem; }

.header-nav a {
    color: var(--text-muted);
    transition: color 0.2s;
    font-weight: 500;
    white-space: nowrap;
}

.header-nav a:hover { color: var(--royal); }

/* ============ CONTAINER (TOOL PAGE) ============ */
.container {
    max-width: var(--max-width-tool);
    margin: 0 auto;
    padding: 32px 28px 60px;
    position: relative;
    z-index: 1;
}

/* ============ BREADCRUMB ============ */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: var(--text-dim);
    margin-bottom: 24px;
    font-family: var(--font-mono);
}

.breadcrumb a {
    color: var(--text-dim);
    transition: color 0.2s;
}

.breadcrumb a:hover {
    color: var(--royal);
}

.breadcrumb span {
    color: var(--text-faint);
}

/* ============ HERO (HOMEPAGE) ============ */
.hero {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 64px 28px 56px;
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 56px;
    align-items: center;
}

.hero-left .hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 24px;
    box-shadow: var(--shadow-xs);
}

.hero-eyebrow .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--emerald);
    box-shadow: 0 0 8px var(--emerald-glow);
    animation: ticker 2s infinite;
}

@keyframes ticker {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.6; }
}

.hero h1 {
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 5vw, 3.4rem);
    font-weight: 800;
    letter-spacing: -1.5px;
    line-height: 1.1;
    margin-bottom: 20px;
    color: var(--text);
}

.hero h1 em {
    font-style: normal;
    font-weight: 400;
    background: linear-gradient(135deg, var(--royal), var(--emerald));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    color: var(--text-body);
    font-size: 1.08rem;
    max-width: 480px;
    margin-bottom: 28px;
    line-height: 1.7;
}

.hero-stats {
    display: flex;
    gap: 36px;
    flex-wrap: wrap;
}

.hero-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hero-stat-num {
    font-family: var(--font-mono);
    font-size: 1.6rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--royal), var(--emerald));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.hero-stat-label {
    font-size: 0.72rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

/* ============ DASHBOARD CARD ============ */
.dashboard-card {
    background: var(--bg-dashboard);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    position: relative;
    border: 1px solid #2a4a6b;
}

.dashboard-header {
    padding: 18px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.dashboard-title {
    font-family: var(--font-display);
    font-size: 0.86rem;
    font-weight: 600;
    color: rgba(255,255,255,0.7);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.dashboard-badge {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 10px;
    background: rgba(5, 150, 105, 0.2);
    color: #34d399;
    border-radius: 100px;
    border: 1px solid rgba(5, 150, 105, 0.3);
}

.dashboard-body {
    padding: 24px;
}

.dashboard-balance {
    font-family: var(--font-mono);
    font-size: 2.2rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -1px;
    margin-bottom: 4px;
}

.dashboard-balance-label {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.5);
    margin-bottom: 24px;
}

/* GROWTH CHART */
.dashboard-chart {
    height: 120px;
    position: relative;
    margin-bottom: 20px;
}

.dashboard-chart svg {
    width: 100%;
    height: 100%;
}

.chart-area {
    fill: url(#chart-gradient);
    opacity: 0.3;
}

.chart-line {
    fill: none;
    stroke: #34d399;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.chart-dot {
    fill: #34d399;
    stroke: var(--bg-dashboard);
    stroke-width: 3;
}

/* DASHBOARD STATS ROW */
.dashboard-stats {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.dashboard-stat-value {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
}

.dashboard-stat-value.green { color: #34d399; }
.dashboard-stat-value.gold { color: #fbbf24; }

.dashboard-stat-label {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

/* ============ SEARCH ============ */
.search-section {
    max-width: 640px;
    margin: 0 auto 64px;
    padding: 0 28px;
    position: relative;
    z-index: 1;
}

.search-bar {
    width: 100%;
    padding: 18px 24px 18px 56px;
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 1.05rem;
    font-family: var(--font-sans);
    transition: all 0.25s;
    box-shadow: var(--shadow-sm);
}

.search-bar::placeholder { color: var(--text-dim); }

.search-bar:focus {
    outline: none;
    border-color: var(--royal);
    box-shadow: 0 0 0 4px var(--royal-soft), var(--shadow);
}

.search-section > svg {
    position: absolute;
    left: 46px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    stroke: var(--text-dim);
    fill: none;
    stroke-width: 2;
}

.search-hint {
    position: absolute;
    right: 42px;
    top: 50%;
    transform: translateY(-50%);
    padding: 4px 12px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    font-size: 0.74rem;
    color: var(--text-dim);
    font-family: var(--font-mono);
    pointer-events: none;
}

.search-results-info {
    text-align: center;
    margin-top: 14px;
    font-size: 0.84rem;
    color: var(--text-muted);
    display: none;
}

.search-results-info.visible { display: block; }

/* ============ CATEGORIES ============ */
.categories {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 28px 80px;
    position: relative;
    z-index: 1;
}

.category {
    margin-bottom: 56px;
    scroll-margin-top: 80px;
}

.category-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}

.category-icon-wrap {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 1.3rem;
    flex-shrink: 0;
}

.category-header h2 {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text);
}

.category-desc {
    font-size: 0.84rem;
    color: var(--text-dim);
    font-weight: 500;
}

.category-count {
    margin-left: auto;
    font-size: 0.74rem;
    color: var(--text-muted);
    background: var(--bg-card);
    padding: 4px 14px;
    border-radius: 100px;
    border: 1px solid var(--border);
    font-weight: 600;
    font-family: var(--font-mono);
    box-shadow: var(--shadow-xs);
}

/* ============ CARD GRID ============ */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.tool-card.featured {
    grid-column: span 2;
    grid-row: span 2;
}

.tool-card.wide {
    grid-column: span 2;
}

.tool-card {
    display: flex;
    flex-direction: column;
    padding: 22px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-xs);
}

/* TOP ACCENT BAR */
.tool-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--card-accent, var(--royal)), transparent 80%);
    opacity: 0;
    transition: opacity 0.3s;
    border-radius: var(--radius) var(--radius) 0 0;
}

/* SOFT GLOW */
.tool-card::after {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle at 50% 0%, var(--card-glow, var(--royal-glow)), transparent 50%);
    opacity: 0;
    transition: opacity 0.4s;
    pointer-events: none;
}

.tool-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.tool-card:hover::before { opacity: 1; }
.tool-card:hover::after { opacity: 1; }

.tool-card-top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

.tool-card-icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-bg-soft, var(--royal-soft));
    border-radius: var(--radius-xs);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--card-accent, var(--royal));
    line-height: 1;
    flex-shrink: 0;
    transition: transform 0.3s;
}

.tool-card:hover .tool-card-icon {
    transform: scale(1.08);
}

.tool-card-title {
    font-family: var(--font-display);
    font-size: 0.96rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
}

.tool-card-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.6;
    flex-grow: 1;
    margin-bottom: 14px;
    position: relative;
    z-index: 1;
}

.tool-card.featured .tool-card-desc {
    font-size: 0.92rem;
    line-height: 1.75;
}

.tool-card.featured .tool-card-title {
    font-size: 1.2rem;
}

.tool-card.featured .tool-card-icon {
    width: 50px;
    height: 50px;
    font-size: 1.1rem;
}

.tool-card-arrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--card-accent, var(--royal));
    text-transform: uppercase;
    letter-spacing: 0.6px;
    position: relative;
    z-index: 1;
}

.tool-card-arrow svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.5;
    transition: transform 0.2s;
}

.tool-card:hover .tool-card-arrow svg {
    transform: translateX(4px);
}

.tool-card.hidden { display: none; }

.no-results {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-dim);
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 300;
    display: none;
}

.no-results.visible { display: block; }

/* ============ FEATURED BANNER ============ */
.featured-banner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 28px 64px;
    position: relative;
    z-index: 1;
}

.featured-inner {
    background: linear-gradient(135deg, var(--bg-dashboard), #15293f);
    border-radius: var(--radius);
    padding: 44px;
    display: flex;
    align-items: center;
    gap: 40px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

/* CHART LINE WATERMARK */
.featured-inner::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 100' preserveAspectRatio='none'%3E%3Cpath d='M0,80 L100,75 L200,65 L300,60 L400,45 L500,40 L600,30 L700,25 L800,20 L900,15 L1000,10 L1100,8 L1200,5' fill='none' stroke='%2334d399' stroke-width='2' opacity='0.08'/%3E%3C/svg%3E");
    background-size: 100% 100%;
    pointer-events: none;
}

.featured-content { flex: 1; position: relative; z-index: 1; }

.featured-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    background: rgba(5, 150, 105, 0.2);
    border: 1px solid rgba(5, 150, 105, 0.4);
    color: #34d399;
    border-radius: 100px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 18px;
}

.featured-content h3 {
    font-family: var(--font-display);
    font-size: 1.7rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.featured-content p {
    color: rgba(255,255,255,0.7);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 24px;
    max-width: 520px;
}

.featured-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: var(--emerald);
    color: #fff;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.88rem;
    font-weight: 600;
    transition: all 0.2s;
    box-shadow: 0 4px 16px var(--emerald-glow);
}

.featured-link:hover {
    background: var(--emerald-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--emerald-glow);
}

/* FEATURED STAT CARDS */
.featured-stats {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    z-index: 1;
}

.featured-stat-card {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-sm);
    padding: 18px 24px;
    min-width: 200px;
}

.featured-stat-label {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 6px;
}

.featured-stat-value {
    font-family: var(--font-mono);
    font-size: 1.4rem;
    font-weight: 700;
    color: #34d399;
}

.featured-stat-sub {
    font-size: 0.76rem;
    color: rgba(255,255,255,0.4);
    margin-top: 2px;
}

/* ============ SEO CONTENT (HOMEPAGE) ============ */
.seo-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 80px 28px;
    position: relative;
    z-index: 1;
}

.seo-content h2 {
    font-family: var(--font-display);
    font-size: 1.65rem;
    font-weight: 800;
    margin-bottom: 20px;
    letter-spacing: -0.5px;
    color: var(--text);
}

.seo-content h3 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    margin: 36px 0 14px;
    color: var(--text);
}

.seo-content p {
    color: var(--text-body);
    margin-bottom: 18px;
    font-size: 0.96rem;
    line-height: 1.85;
}

.seo-content strong { color: var(--text); font-weight: 600; }

.seo-content a {
    color: var(--royal);
    text-decoration: underline;
    text-decoration-color: var(--royal-soft);
    text-underline-offset: 2px;
}

.seo-content a:hover { text-decoration-color: var(--royal); }

.seo-content ul {
    margin: 14px 0 22px 20px;
    color: var(--text-body);
}

.seo-content li {
    margin-bottom: 10px;
    font-size: 0.93rem;
    line-height: 1.7;
}

.seo-content code {
    background: var(--royal-soft);
    color: var(--royal-hover);
    padding: 2px 7px;
    border-radius: var(--radius-xs);
    font-family: var(--font-mono);
    font-size: 0.85em;
}

/* ============ TOOL BOX (TOOL PAGES) ============ */
.tool-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 36px;
    margin-bottom: 48px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.tool-box::before {
    content: '';
    position: absolute;
    top: -100px; right: -100px;
    width: 300px; height: 300px;
    background: radial-gradient(circle, var(--royal-glow), transparent 70%);
    opacity: 0.5;
    pointer-events: none;
}

.tool-header { margin-bottom: 28px; position: relative; z-index: 1; }

.tool-header h1 {
    font-family: var(--font-display);
    font-size: 2rem; font-weight: 800; letter-spacing: -0.8px;
    line-height: 1.15; margin-bottom: 8px;
}

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

.tool-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }

.tool-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 12px; background: var(--bg-soft); border: 1px solid var(--border);
    border-radius: 100px; font-size: 0.76rem; color: var(--text-muted);
}

.tool-badge .dot { width: 7px; height: 7px; border-radius: 50%; }

/* INPUT FIELDS */
.input-row {
    display: flex; gap: 16px; flex-wrap: wrap;
    margin-bottom: 24px; position: relative; z-index: 1;
}

.input-group { flex: 1; min-width: 160px; display: flex; flex-direction: column; gap: 6px; }

.input-group label {
    font-size: 0.76rem; font-weight: 600; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.5px;
}

.input-wrap { position: relative; display: flex; align-items: center; }

.input-wrap input {
    width: 100%; padding: 14px 16px;
    background: var(--bg-input); border: 1.5px solid var(--border);
    border-radius: var(--radius-sm); color: var(--text);
    font-size: 1.1rem; font-family: var(--font-mono); font-weight: 500;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-wrap input:focus { outline: none; border-color: var(--royal); box-shadow: 0 0 0 3px var(--royal-soft); }

.input-prefix {
    position: absolute; left: 14px;
    font-size: 1.1rem; color: var(--text-dim);
    font-family: var(--font-mono); font-weight: 500;
    pointer-events: none;
}

.input-wrap input.with-prefix { padding-left: 32px; }

.input-suffix {
    position: absolute; right: 14px;
    font-size: 0.85rem; color: var(--text-dim);
    font-family: var(--font-sans); font-weight: 500;
    pointer-events: none;
}

/* RESULT CARDS */
.result-grid {
    display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px;
    margin-bottom: 24px; position: relative; z-index: 1;
}

.result-card {
    background: var(--bg-soft); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 20px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.result-card:hover { border-color: var(--border-hover); box-shadow: var(--shadow-sm); }
.result-card.primary { background: var(--royal-soft); border-color: rgba(30, 64, 175, 0.15); }

.result-card-label {
    font-size: 0.72rem; color: var(--text-muted); font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px;
}

.result-card-value {
    font-family: var(--font-mono); font-size: 1.8rem; font-weight: 700;
    color: var(--text); letter-spacing: -0.5px; line-height: 1.2;
}

.result-card.primary .result-card-value { color: var(--royal); }
.result-card-sub { font-size: 0.76rem; color: var(--text-dim); margin-top: 4px; }

/* PAYMENT COMPOSITION BAR */
.composition-bar {
    background: var(--bg-soft); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 20px;
    margin-bottom: 24px; position: relative; z-index: 1;
}

.composition-label {
    font-size: 0.76rem; font-weight: 600; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px;
    display: flex; justify-content: space-between;
}

.composition-label .legend { display: flex; gap: 16px; font-weight: 500; text-transform: none; letter-spacing: 0; }

.legend-item { display: flex; align-items: center; gap: 6px; font-size: 0.78rem; color: var(--text-body); }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; }
.legend-dot.principal { background: var(--royal); }
.legend-dot.interest { background: var(--gold); }
.legend-dot.tax-insurance { background: var(--emerald); }

.composition-track {
    height: 24px; border-radius: var(--radius-xs); overflow: hidden;
    display: flex; background: var(--border);
}

.completion-principal { background: var(--royal); transition: width 0.5s ease; }
.completion-interest { background: var(--gold); transition: width 0.5s ease; }
.completion-tax-insurance { background: var(--emerald); transition: width 0.5s ease; }

.composition-pct {
    display: flex; justify-content: space-between; margin-top: 8px;
    font-family: var(--font-mono); font-size: 0.82rem; color: var(--text-muted);
}

/* AMORTIZATION SCHEDULE */
.amortization-section {
    position: relative; z-index: 1; margin-bottom: 24px;
}

.amortization-label {
    font-size: 0.76rem; font-weight: 600; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px;
    display: flex; align-items: center; justify-content: space-between;
}

.amortization-toggle {
    display: inline-flex; gap: 4px;
    background: var(--bg-soft); border: 1px solid var(--border);
    border-radius: 100px; padding: 3px;
}

.amort-btn {
    padding: 5px 14px; background: transparent; border: none;
    border-radius: 100px; color: var(--text-muted); font-size: 0.76rem;
    font-weight: 600; cursor: pointer; transition: all 0.2s;
    font-family: var(--font-sans);
}

.amort-btn:hover { color: var(--text); }
.amort-btn.active { background: var(--royal); color: #fff; }

.amort-table-wrap {
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    overflow: hidden; max-height: 400px; overflow-y: auto;
}

.amort-table {
    width: 100%; border-collapse: collapse; font-size: 0.84rem;
}

.amort-table th {
    position: sticky; top: 0; z-index: 1;
    padding: 10px 14px; text-align: right;
    background: var(--bg-soft); border-bottom: 1px solid var(--border);
    font-family: var(--font-display); font-size: 0.74rem; font-weight: 700;
    color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px;
}

.amort-table th:first-child { text-align: left; }

.amort-table td {
    padding: 8px 14px; border-bottom: 1px solid var(--border);
    font-family: var(--font-mono); text-align: right; color: var(--text-body);
}

.amort-table td:first-child { text-align: left; font-weight: 600; color: var(--text); }
.amort-table tr:hover td { background: var(--bg-soft); }
.amort-table .col-principal { color: var(--royal); }
.amort-table .col-interest { color: var(--gold); }
.amort-table .col-balance { color: var(--text); font-weight: 600; }
.amort-table .year-row td { background: var(--bg-blue); font-weight: 700; border-top: 2px solid var(--border); }

/* BUTTONS */
.tool-buttons { display: flex; gap: 10px; position: relative; z-index: 1; flex-wrap: wrap; }

.btn {
    padding: 12px 24px; border: none; border-radius: var(--radius-sm);
    font-size: 0.88rem; font-weight: 600; cursor: pointer; transition: all 0.2s;
    display: flex; align-items: center; gap: 6px; font-family: var(--font-sans);
}

.btn-primary { background: var(--royal); color: #fff; box-shadow: 0 4px 16px var(--royal-glow); }
.btn-primary:hover { background: var(--royal-hover); transform: translateY(-1px); box-shadow: 0 8px 24px var(--royal-glow); }

.btn-secondary { background: var(--bg-soft); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg-card-hover); border-color: var(--border-hover); }

.btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }

/* ARTICLE */
.article {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 44px;
    box-shadow: var(--shadow-sm);
    position: relative; z-index: 1;
}

.article h2 {
    font-family: var(--font-display); font-size: 1.55rem; font-weight: 800;
    margin: 40px 0 16px; letter-spacing: -0.5px; color: var(--text);
    scroll-margin-top: 80px;
}

.article h2:first-child { margin-top: 0; }

.article h3 { font-family: var(--font-sans); font-size: 1.1rem; font-weight: 700; margin: 28px 0 12px; color: var(--text); }
.article p { color: var(--text-body); margin-bottom: 16px; line-height: 1.8; font-size: 0.96rem; }
.article p strong { color: var(--text); font-weight: 600; }
.article p em { font-style: italic; color: var(--text); }

.article code {
    background: var(--royal-soft); color: var(--royal-hover);
    padding: 2px 7px; border-radius: var(--radius-xs);
    font-family: var(--font-mono); font-size: 0.85em;
}

.article pre {
    background: var(--bg-dark); border-radius: var(--radius-sm);
    padding: 20px 24px; margin: 16px 0; overflow-x: auto;
}

.article pre code { background: none; color: #e2e8f0; padding: 0; font-size: 0.88rem; line-height: 1.7; font-family: var(--font-mono); }
.article pre code .comment { color: #64748b; font-style: italic; }
.article pre code .key { color: #93c5fd; }
.article pre code .string { color: #86efac; }
.article pre code .number { color: #fbbf24; }
.article pre code .func { color: #c084fc; }

.article blockquote {
    border-left: 4px solid var(--gold);
    background: var(--gold-soft);
    padding: 14px 20px; margin: 16px 0;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.article blockquote p { margin: 0; color: var(--text); }
.article blockquote strong { color: var(--gold-hover); }



/* Responsive table container styles inside articles */
.article table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 0.9rem;
}

.article th, .article td {
    border: 1px solid var(--border);
    padding: 10px 14px;
    text-align: left;
}

@media (max-width: 768px) {
    .article table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap; /* Prevent headers and content from collapsing */
    }
    .article th, .article td {
        min-width: 120px;
    }
    .article th:first-child, .article td:first-child {
        min-width: 150px; /* Give more space to features column */
    }
}

.article th { background: var(--bg-soft); font-weight: 700; color: var(--text); font-family: var(--font-display); }
.article td { color: var(--text-body); }

.article ul { margin: 12px 0 20px 20px; color: var(--text-body); }
.article li { margin-bottom: 8px; font-size: 0.93rem; line-height: 1.65; }

.article a { color: var(--royal); text-decoration: underline; text-decoration-color: var(--royal-soft); text-underline-offset: 2px; }
.article a:hover { text-decoration-color: var(--royal); }

.article .toc {
    background: var(--bg-soft); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 20px 24px; margin-bottom: 32px;
}

.article .toc-title { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; margin-bottom: 10px; color: var(--text); }
.article .toc ol { margin: 0; padding-left: 20px; }
.article .toc li { margin-bottom: 6px; }
.article .toc a { color: var(--text-body); text-decoration: none; }
.article .toc a:hover { color: var(--royal); }

.article .meta-block { background: var(--bg-dark); border-radius: var(--radius-sm); padding: 20px; margin-top: 36px; }
.article .meta-block code { background: none; color: #e2e8f0; font-size: 0.82rem; line-height: 1.8; font-family: var(--font-mono); }

/* ============ FINANCIAL DISCLAIMER ============ */
.financial-disclaimer {
    background: var(--bg-blue); border: 1px solid #bfdbfe;
    border-left: 4px solid var(--royal);
    border-radius: var(--radius-sm); padding: 20px 24px; margin: 32px 0;
}

.financial-disclaimer strong {
    color: var(--royal-hover); font-family: var(--font-display);
    font-size: 1rem; display: block; margin-bottom: 8px;
}

.financial-disclaimer p { font-size: 0.88rem; color: var(--text-muted); margin: 0; line-height: 1.7; }

/* ============ FOOTER ============ */
footer { background: var(--bg-dark); padding: 64px 28px 36px; position: relative; z-index: 1; }

.footer-inner { max-width: var(--max-width); margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; }

.footer-brand .logo { margin-bottom: 16px; font-size: 1.2rem; color: var(--text-inverse); }
.footer-brand .logo .accent { color: var(--emerald); }
.footer-brand p { color: var(--text-dim); font-size: 0.86rem; line-height: 1.7; max-width: 280px; }

.footer-col h4 { font-family: var(--font-display); font-size: 0.76rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px; color: var(--text-dim); margin-bottom: 16px; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 10px; }

.footer-col a { color: var(--text-faint); font-size: 0.86rem; transition: color 0.2s; }
.footer-col a:hover { color: var(--emerald); }

.footer-bottom { max-width: var(--max-width); margin: 40px auto 0; padding-top: 28px; border-top: 1px solid var(--bg-dark-card); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.footer-bottom p { color: var(--text-dim); font-size: 0.78rem; font-family: var(--font-mono); }

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
    .tool-grid { grid-template-columns: repeat(3, 1fr); }
    .tool-card.featured { grid-column: span 2; grid-row: span 1; }
    .tool-card.wide { grid-column: span 2; }
    .hero { grid-template-columns: 1fr; gap: 40px; }
    .featured-inner { flex-direction: column; text-align: center; padding: 36px; }
    .featured-content p { margin: 0 auto 24px; }
    .featured-stats { flex-direction: row; }
}

@media (max-width: 768px) {
    .header-nav { display: none; }
    .footer-inner { grid-template-columns: 1fr 1fr; }
    .tool-grid { grid-template-columns: repeat(2, 1fr); }
    .tool-card.featured, .tool-card.wide { grid-column: span 2; }
    .hero-stats { gap: 24px; }
    .search-hint { display: none; }
    .featured-stats { flex-direction: column; }
    .tool-box { padding: 24px 20px; }
    .tool-header h1 { font-size: 1.5rem; }
    .article { padding: 28px 20px; }
    .article h2 { font-size: 1.3rem; }
    .result-grid { grid-template-columns: 1fr; }
    .input-row { flex-direction: column; }
    .result-card-value { font-size: 1.5rem; }
}

@media (max-width: 480px) {
    .header-inner { padding: 12px 16px; gap: 10px; }
    .header-search { max-width: 120px; }
    .hero { padding: 48px 16px 32px; }
    .hero h1 { font-size: 2rem; }
    .hero p { font-size: 0.95rem; }
    .search-section { padding: 0 16px; margin-bottom: 40px; }
    .categories { padding: 0 16px 40px; }
    .tool-grid { grid-template-columns: 1fr; }
    .tool-card.featured, .tool-card.wide { grid-column: span 1; }
    .footer-inner { grid-template-columns: 1fr; gap: 28px; }
    .seo-content { padding: 48px 16px; }
    .featured-banner { padding: 0 16px 32px; }
    .featured-inner { padding: 28px 20px; }
    .dashboard-stats { grid-template-columns: 1fr; gap: 8px; }
    .amort-table { font-size: 0.76rem; }
    .amort-table th, .amort-table td { padding: 6px 8px; }
}


/* ============ RESPONSIVE TABLE OVERRIDES ============ */
.amort-table-wrap {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    max-height: 400px;
    overflow-y: auto;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Force visible horizontal scrollbar on mobile/touch devices */
.amort-table-wrap::-webkit-scrollbar {
    height: 6px;
    display: block;
}
.amort-table-wrap::-webkit-scrollbar-track {
    background: var(--bg-soft);
    border-radius: 10px;
}
.amort-table-wrap::-webkit-scrollbar-thumb {
    background: var(--border-bright);
    border-radius: 10px;
}
.amort-table-wrap::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.amort-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.84rem;
    min-width: 580px; /* Prevent column squishing on mobile */
}

/* ============ HAMBURGER MENU & MOBILE DRAWER ============ */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 22px;
    height: 16px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1100;
    padding: 0;
}

.hamburger-btn span {
    width: 100%;
    height: 2px;
    background-color: var(--text);
    border-radius: 4px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: left center;
}

/* Toggle Animation to X */
.hamburger-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(0px, -1px);
}
.hamburger-btn.active span:nth-child(2) {
    width: 0%;
    opacity: 0;
}
.hamburger-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(0px, 1px);
}

.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100vh;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    transition: opacity 0.3s ease;
    opacity: 0;
    pointer-events: none;
}

.mobile-menu.active {
    right: 0;
    opacity: 1;
    pointer-events: auto;
}

.mobile-menu-inner {
    position: absolute;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100%;
    background: var(--bg-card);
    border-left: 1px solid var(--border);
    padding: 24px 28px;
    display: flex;
    flex-direction: column;
    gap: 32px;
    box-shadow: var(--shadow-lg);
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu.active .mobile-menu-inner {
    right: 0;
}

.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mobile-menu-header .close-btn {
    background: transparent;
    border: none;
    font-size: 2rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.mobile-menu-header .close-btn:hover {
    color: var(--text);
}

.mobile-nav {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.mobile-nav a {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-body);
    transition: color 0.2s, transform 0.2s;
    display: inline-block;
}

.mobile-nav a:hover {
    color: var(--royal);
    transform: translateX(4px);
}

.menu-divider {
    border: 0;
    height: 1px;
    background: var(--border);
    margin: 8px 0;
}

/* Responsive Show Hamburger Menu */
@media (max-width: 768px) {
    .header-nav { display: none !important; }
    .hamburger-btn { display: flex !important; }
}

/* ============ TOOL-SPECIFIC ADDITIONS ============ */

.currency-switch {
            display: inline-flex;
            gap: 2px;
            background: var(--bg-soft);
            border: 1px solid var(--border);
            border-radius: 100px;
            padding: 2px;
            align-self: center;
        }

.currency-btn {
            padding: 4px 12px;
            background: transparent;
            border: none;
            border-radius: 100px;
            color: var(--text-muted);
            font-size: 0.74rem;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.2s;
            font-family: var(--font-sans);
        }

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

.currency-btn.active {
            background: var(--royal);
            color: #fff;
        }

.amort-table th {
            position: sticky;
            top: 0;
            z-index: 1;
            padding: 10px 14px;
            text-align: right;
            background: var(--bg-soft);
            border-bottom: 1px solid var(--border);
            font-family: var(--font-display);
            font-size: 0.74rem;
            font-weight: 700;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

.amort-table th:first-child {
            text-align: left;
        }

.amort-table td {
            padding: 8px 14px;
            border-bottom: 1px solid var(--border);
            font-family: var(--font-mono);
            text-align: right;
            color: var(--text-body);
        }

.amort-table td:first-child {
            text-align: left;
            font-weight: 600;
            color: var(--text);
        }

.amort-table tr:hover td {
            background: var(--bg-soft);
        }

.amort-table .col-principal {
            color: var(--royal);
        }

.amort-table .col-interest {
            color: var(--gold);
        }

.amort-table .col-balance {
            color: var(--text);
            font-weight: 600;
        }

.amort-table .year-row td {
            background: var(--bg-blue);
            font-weight: 700;
            border-top: 2px solid var(--border);
        }
