/* ===================== CSS Reset & Variables ===================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --font-sans: 'Plus Jakarta Sans', sans-serif;
    --font-display: 'Space Grotesk', sans-serif;
    --bg-light: #f8fafc;
    --bg-dark: #060a17;
    --card-light: #ffffff;
    --card-dark: #0f172a;
    --text-light: #1e293b;
    --text-dark: #e2e8f0;
    --border-light: #e2e8f0;
    --border-dark: #1e293b;
    --indigo-50: #f0f7ff;
    --indigo-400: #38bdf8;
    --indigo-500: #0284c7;
    --indigo-600: #0369a1;
    --violet: #6366f1;
    --violet-600: #4f46e5;
    --teal: #14b8a6;
    --amber: #f59e0b;
    --red: #ef4444;
    --green: #10b981;
    --sky: #0ea5e9;
}

html.dark {
    --bg: #060a17;
    --card: #0f172a;
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --border: #1e293b;
}

html:not(.dark) {
    --bg: #f8fafc;
    --card: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s, color 0.3s;
}

/* ===================== Utility Classes ===================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.container-sm {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 1rem;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

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

.flex-1 {
    flex: 1;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.items-center {
    align-items: center;
}

.items-end {
    align-items: flex-end;
}

.gap-1 {
    gap: 0.25rem;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 0.75rem;
}

.gap-4 {
    gap: 1rem;
}

.gap-6 {
    gap: 1.5rem;
}

.gap-8 {
    gap: 2rem;
}

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.hidden {
    display: none !important;
}

.block {
    display: block;
}

.w-full {
    width: 100%;
}

.w-fit {
    width: fit-content;
}

.relative {
    position: relative;
}

.absolute {
    position: absolute;
}

.sticky {
    position: sticky;
}

.top-0 {
    top: 0;
}

.z-50 {
    z-index: 50;
}

.border {
    border: 1px solid var(--border);
}

.border-b {
    border-bottom: 1px solid var(--border);
}

.rounded {
    border-radius: 0.5rem;
}

.rounded-lg {
    border-radius: 0.75rem;
}

.rounded-xl {
    border-radius: 1rem;
}

.rounded-2xl {
    border-radius: 1.5rem;
}

.rounded-3xl {
    border-radius: 2rem;
}

.shadow {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.shadow-lg {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.text-xs {
    font-size: 0.75rem;
}

.text-sm {
    font-size: 0.875rem;
}

.text-base {
    font-size: 1rem;
}

.text-lg {
    font-size: 1.125rem;
}

.text-xl {
    font-size: 1.25rem;
}

.text-2xl {
    font-size: 1.5rem;
}

.text-3xl {
    font-size: 1.875rem;
}

.text-4xl {
    font-size: 2.25rem;
}

.text-5xl {
    font-size: 3rem;
}

.font-bold {
    font-weight: 700;
}

.font-extrabold {
    font-weight: 800;
}

.font-semibold {
    font-weight: 600;
}

.font-display {
    font-family: var(--font-display);
}

.uppercase {
    text-transform: uppercase;
}

.tracking-wide {
    letter-spacing: 0.025em;
}

.tracking-wider {
    letter-spacing: 0.05em;
}

.tracking-widest {
    letter-spacing: 0.1em;
}

.leading-relaxed {
    line-height: 1.7;
}

.leading-tight {
    line-height: 1.25;
}

.my-1 {
    margin-top: 0.25rem;
    margin-bottom: 0.25rem;
}

.my-2 {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.my-4 {
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.my-6 {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

.my-8 {
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.mt-1 {
    margin-top: 0.25rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-3 {
    margin-top: 0.75rem;
}

.mt-4 {
    margin-top: 1rem;
}

.mt-6 {
    margin-top: 1.5rem;
}

.mt-8 {
    margin-top: 2rem;
}

.mb-1 {
    margin-bottom: 0.25rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 0.75rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.mb-8 {
    margin-bottom: 2rem;
}

.pt-4 {
    padding-top: 1rem;
}

.pt-8 {
    padding-top: 2rem;
}

.pt-12 {
    padding-top: 3rem;
}

.pb-4 {
    padding-bottom: 1rem;
}

.pb-8 {
    padding-bottom: 2rem;
}

.pb-12 {
    padding-bottom: 3rem;
}

.py-2 {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.py-3 {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.py-4 {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.py-6 {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
}

.px-2 {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.px-3 {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

.px-4 {
    padding-left: 1rem;
    padding-right: 1rem;
}

.px-6 {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

/* ===================== Header ===================== */
.app-header {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background-color: rgba(7, 11, 25, 0.85);
    border-bottom: 1px solid var(--border);
    transition: background-color 0.3s;
}

html:not(.dark) .app-header {
    background-color: rgba(255, 255, 255, 0.85);
}

.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0.875rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.logo-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--violet-600), var(--sky), var(--teal));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.logo-icon svg {
    width: 20px;
    height: 20px;
}

.logo-text {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text);
}

.logo-text span {
    color: var(--sky);
}

.logo-badge {
    font-size: 0.625rem;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 0.1em;
    background: rgba(99, 102, 241, 0.1);
    color: var(--violet);
    padding: 0.125rem 0.5rem;
    border-radius: 0.375rem;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.nav-desktop {
    display: none;
    align-items: center;
    background: rgba(51, 65, 85, 0.4);
    border-radius: 9999px;
    padding: 0.375rem;
    gap: 0.25rem;
    border: 1px solid rgba(51, 65, 85, 0.3);
}

html:not(.dark) .nav-desktop {
    background: rgba(241, 245, 249, 0.8);
    border-color: rgba(226, 232, 240, 0.8);
}

.nav-desktop a {
    padding: 0.375rem 0.875rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-decoration: none;
    color: var(--text-muted);
    transition: all 0.2s;
}

.nav-desktop a:hover {
    color: var(--violet);
}

.nav-desktop a.active {
    background: var(--violet-600);
    color: white;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(51, 65, 85, 0.4);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text);
}

html:not(.dark) .header-btn {
    background: rgba(241, 245, 249, 0.8);
}

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

.header-btn svg {
    width: 20px;
    height: 20px;
}

.mobile-menu {
    display: none;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    padding: 1rem;
}

.mobile-menu.open {
    display: block;
}

.mobile-menu a {
    display: block;
    padding: 0.625rem 0.875rem;
    border-radius: 12px;
    text-decoration: none;
    color: var(--text);
    font-size: 0.875rem;
    font-weight: 600;
    transition: background 0.2s;
}

.mobile-menu a:hover {
    background: rgba(99, 102, 241, 0.1);
}

/* ===================== Hero Section ===================== */
.hero {
    padding-top: 3rem;
    padding-bottom: 5rem;
    position: relative;
    overflow: hidden;
    background: var(--bg);
}

.hero::before {
    content: '';
    position: absolute;
    top: 25%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 700px;
    height: 400px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(56, 189, 248, 0.1), transparent);
    border-radius: 50%;
    filter: blur(40px);
    pointer-events: none;
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 768px;
    margin: 0 auto 2.5rem;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: var(--violet);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.375rem 0.875rem;
    border-radius: 9999px;
    margin-bottom: 1rem;
}

.hero-badge svg {
    width: 14px;
    height: 14px;
}

.hero h1 {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 1rem;
    color: var(--text);
}

@media (min-width: 640px) {
    .hero h1 {
        font-size: 3rem;
    }
}

.hero p {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.7;
    max-width: 768px;
    margin: 0 auto;
}

/* ===================== Main Calculator Card ===================== */
.calculator-card {
    background: var(--card);
    border-radius: 24px;
    border: 1px solid var(--border);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    max-width: 1024px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

@media (max-width: 640px) {
    .calculator-card {
        padding: 1.25rem;
        border-radius: 16px;
    }
}

.tabs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    background: rgba(51, 65, 85, 0.3);
    padding: 0.375rem;
    border-radius: 16px;
    margin-bottom: 2rem;
    border: 1px solid var(--border);
}

@media (min-width: 640px) {
    .tabs {
        grid-template-columns: repeat(4, 1fr);
    }
}

.tab-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn svg {
    width: 16px;
    height: 16px;
}

.tab-btn.active {
    background: var(--violet-600);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.input-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
    align-items: end;
}

@media (min-width: 768px) {
    .input-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.input-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.input-group input[type="time"] {
    width: 100%;
    background: rgba(51, 65, 85, 0.4);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 0.875rem 1rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    outline: none;
    transition: border-color 0.2s;
}

html:not(.dark) .input-group input[type="time"] {
    background: rgba(241, 245, 249, 0.8);
}

.input-group input[type="time"]:focus {
    border-color: var(--violet-600);
}

.latency-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.latency-value {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--violet);
    background: rgba(99, 102, 241, 0.1);
    padding: 0.125rem 0.5rem;
    border-radius: 6px;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.latency-range {
    width: 100%;
    accent-color: var(--violet-600);
    cursor: pointer;
}

.latency-legend {
    display: flex;
    justify-content: space-between;
    font-size: 0.6875rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.calc-btn {
    width: 100%;
    padding: 1rem;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--violet-600), var(--sky));
    border: none;
    color: white;
    font-weight: 700;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

.calc-btn:hover {
    transform: scale(0.98);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.calc-btn svg {
    width: 16px;
    height: 16px;
}

/* ===================== Results Area ===================== */
.results-area {
    border-top: 1px solid var(--border);
    padding-top: 2rem;
    margin-top: 0;
}

.results-header {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 640px) {
    .results-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.results-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.results-title svg {
    width: 20px;
    height: 20px;
    color: var(--amber);
}

.results-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.results-info {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    background: rgba(99, 102, 241, 0.05);
    padding: 0.375rem 0.75rem;
    border-radius: 0.5rem;
}

.results-info svg {
    width: 14px;
    height: 14px;
    color: var(--violet);
}

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

@media (min-width: 640px) {
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .cards-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.result-card {
    background: rgba(51, 65, 85, 0.3);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s, border-color 0.2s;
    position: relative;
}

html:not(.dark) .result-card {
    background: rgba(241, 245, 249, 0.8);
}

.result-card:hover {
    transform: scale(1.02);
    border-color: rgba(99, 102, 241, 0.5);
}

.result-card.highlight {
    border-color: var(--violet-600);
    background: rgba(99, 102, 241, 0.08);
}

.result-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.result-cycles {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--violet);
}

.suggested-badge {
    font-size: 0.5625rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    background: var(--violet-600);
    color: white;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
}

.result-action {
    font-size: 0.6875rem;
    color: var(--text-muted);
}

.result-time {
    font-family: var(--font-display);
    font-size: 1.875rem;
    font-weight: 800;
    color: var(--text);
    margin: 0.25rem 0;
}

.result-time-ampm {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
}

.result-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.result-tag {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.6875rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.result-tag svg {
    width: 14px;
    height: 14px;
    color: var(--green);
}

.result-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.result-action-btn {
    padding: 0.5rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    transition: all 0.2s;
    text-decoration: none;
}

.result-action-btn svg {
    width: 14px;
    height: 14px;
}

.result-action-btn.copy {
    background: rgba(51, 65, 85, 0.3);
    color: var(--text);
}

html:not(.dark) .result-action-btn.copy {
    background: rgba(226, 232, 240, 0.8);
}

.result-action-btn.copy:hover {
    background: rgba(51, 65, 85, 0.5);
}

.result-action-btn.cal {
    background: rgba(99, 102, 241, 0.1);
    color: var(--violet);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.result-action-btn.cal:hover {
    background: rgba(99, 102, 241, 0.2);
}

/* ===================== Quick Tools Section ===================== */
.quick-tools {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-top: 2rem;
    max-width: 1024px;
    margin-left: auto;
    margin-right: auto;
}

@media (min-width: 768px) {
    .quick-tools {
        grid-template-columns: 1fr 2fr;
    }
}

.tool-card {
    background: var(--card);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid var(--border);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.tool-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.tool-icon {
    padding: 0.625rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tool-icon svg {
    width: 20px;
    height: 20px;
}

.tool-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text);
}

.tool-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.tool-btn {
    width: 100%;
    padding: 0.625rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(51, 65, 85, 0.3);
    color: var(--text);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

html:not(.dark) .tool-btn {
    background: rgba(241, 245, 249, 0.8);
}

.tool-btn:hover {
    background: rgba(245, 158, 11, 0.1);
}

.tool-btn svg {
    width: 16px;
    height: 16px;
    color: var(--amber);
}

.sound-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.625rem;
    margin-top: 1rem;
}

.sound-btn {
    padding: 0.625rem 0.75rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(51, 65, 85, 0.3);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

html:not(.dark) .sound-btn {
    background: rgba(241, 245, 249, 0.8);
}

.sound-btn:hover {
    border-color: var(--violet-600);
}

.sound-btn.active {
    border-color: var(--violet-600);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3);
    background: rgba(99, 102, 241, 0.1);
}

.sound-btn svg {
    width: 16px;
    height: 16px;
}

.sound-status {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    background: rgba(51, 65, 85, 0.3);
}

html:not(.dark) .sound-status {
    background: rgba(226, 232, 240, 0.8);
}

.sound-note {
    font-size: 0.6875rem;
    color: var(--text-muted);
    margin-top: 0.75rem;
    line-height: 1.5;
}

/* ===================== Sleep Debt Widget ===================== */
.sleep-debt-section {
    margin-top: 2rem;
    max-width: 1024px;
    margin-left: auto;
    margin-right: auto;
    background: linear-gradient(135deg, rgba(30, 27, 75, 0.4), rgba(15, 23, 42, 0.9), rgba(30, 27, 75, 0.4));
    border-radius: 24px;
    padding: 2rem;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.debt-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: var(--violet);
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    margin-bottom: 0.75rem;
}

.debt-badge svg {
    width: 14px;
    height: 14px;
}

.debt-section-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.5rem;
}

.debt-section-desc {
    font-size: 0.875rem;
    color: rgba(226, 232, 240, 0.8);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.debt-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    .debt-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.debt-field label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(226, 232, 240, 0.8);
    margin-bottom: 0.375rem;
}

.debt-field select {
    width: 100%;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(51, 65, 85, 0.8);
    border-radius: 12px;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    color: white;
    outline: none;
}

.debt-submit {
    width: 100%;
    padding: 0.625rem 1rem;
    border-radius: 12px;
    background: var(--violet-600);
    color: white;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: background 0.2s;
}

.debt-submit:hover {
    background: var(--violet);
}

.debt-submit svg {
    width: 16px;
    height: 16px;
}

.debt-result {
    display: none;
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(99, 102, 241, 0.3);
    font-size: 0.75rem;
    color: rgba(226, 232, 240, 0.9);
    line-height: 1.6;
}

.debt-result.visible {
    display: block;
}

.debt-result-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.debt-result-title svg {
    width: 16px;
    height: 16px;
}

.debt-result-box {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: rgba(15, 23, 42, 0.6);
    border-radius: 12px;
    font-size: 0.6875rem;
    color: rgba(203, 213, 225, 0.8);
    line-height: 1.6;
}

.debt-result-box strong {
    color: var(--violet);
}

/* ===================== Article Section ===================== */
.article-section {
    padding: 4rem 0;
    border-top: 1px solid var(--border);
    background: rgba(51, 65, 85, 0.05);
}

html:not(.dark) .article-section {
    background: rgba(241, 245, 249, 0.5);
}

.article-container {
    max-width: 896px;
    margin: 0 auto;
    padding: 0 1rem;
    color: var(--text);
    line-height: 1.7;
}

.article-header {
    margin-bottom: 2rem;
}

.article-category {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--violet);
    display: block;
    margin-bottom: 0.5rem;
}

.article-title {
    font-family: var(--font-display);
    font-size: 1.875rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--text);
}

.article-intro {
    font-size: 1.125rem;
    color: var(--text-muted);
    line-height: 1.7;
}

.article-section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text);
}

.article-section-title svg {
    width: 24px;
    height: 24px;
    color: var(--sky);
}

.article-text {
    margin-bottom: 1rem;
    line-height: 1.8;
}

.article-text strong {
    color: var(--text);
}

.cycle-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin: 1.5rem 0;
}

@media (min-width: 768px) {
    .cycle-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.cycle-card {
    padding: 1.25rem;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: rgba(51, 65, 85, 0.3);
}

html:not(.dark) .cycle-card {
    background: rgba(241, 245, 249, 0.6);
}

.cycle-card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.cycle-card-header svg {
    width: 18px;
    height: 18px;
}

.cycle-card-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.formula-box {
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 16px;
    padding: 1.25rem;
    margin: 1rem 0;
    font-family: monospace;
    font-size: 0.875rem;
    color: rgba(226, 232, 240, 0.9);
    line-height: 1.6;
}

html:not(.dark) .formula-box {
    background: rgba(99, 102, 241, 0.05);
    color: var(--text);
}

.formula-box strong {
    color: var(--sky);
}

.formula-note {
    font-size: 0.6875rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.table-wrap {
    overflow-x: auto;
    margin: 1rem 0;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    text-align: left;
}

.comparison-table th {
    background: rgba(51, 65, 85, 0.4);
    padding: 0.875rem;
    font-weight: 700;
    border-bottom: 1px solid var(--border);
}

html:not(.dark) .comparison-table th {
    background: rgba(241, 245, 249, 0.6);
}

.comparison-table td {
    padding: 0.875rem;
    border-bottom: 1px solid var(--border);
}

.comparison-table tr:last-child td {
    border-bottom: none;
}

.comparison-table td:first-child {
    font-weight: 600;
}

.comparison-table .highlight {
    color: var(--violet);
    font-weight: 700;
}

.tip-list {
    list-style: none;
    padding: 0;
}

.tip-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 12px;
    background: rgba(51, 65, 85, 0.2);
    border: 1px solid var(--border);
    margin-bottom: 0.75rem;
}

html:not(.dark) .tip-list li {
    background: rgba(241, 245, 249, 0.6);
}

.tip-list li svg {
    width: 20px;
    height: 20px;
    color: var(--teal);
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.tip-list strong {
    color: var(--text);
}

/* FAQ Accordion */
.faq-list {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.faq-item {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
}

.faq-item summary {
    padding: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 700;
    color: var(--text);
    font-size: 1rem;
    list-style: none;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary:focus-visible {
    outline: 2px solid var(--violet-600);
    outline-offset: 2px;
}

.faq-item summary .chevron {
    width: 20px;
    height: 20px;
    transition: transform 0.2s;
    color: var(--text-muted);
    flex-shrink: 0;
}

.faq-item[open] summary .chevron {
    transform: rotate(180deg);
}

.faq-answer {
    padding: 0 1.25rem 1.25rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.7;
}

/* ===================== Modals ===================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: var(--card);
    border-radius: 24px;
    max-width: 640px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 2rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--border);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text);
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--text);
}

.modal-body {
    font-size: 0.875rem;
    line-height: 1.7;
    color: var(--text-muted);
}

.modal-body h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.modal-body p {
    margin-bottom: 0.75rem;
}

/* ===================== Footer ===================== */
.app-footer {
    background: rgba(15, 23, 42, 0.9);
    color: rgba(148, 163, 184, 0.8);
    font-size: 0.75rem;
    border-top: 1px solid var(--border);
    padding: 3rem 0 1rem;
    margin-top: auto;
}

html:not(.dark) .app-footer {
    background: rgba(30, 41, 59, 0.9);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

@media (min-width: 768px) {
    .footer-grid {
        grid-template-columns: 2fr 1fr 1fr 1fr;
    }
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 0.75rem;
}

.footer-brand .logo-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

.footer-brand-text {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    color: white;
}

.footer-brand-text span {
    color: var(--sky);
}

.footer-desc {
    font-size: 0.6875rem;
    line-height: 1.6;
    color: rgba(148, 163, 184, 0.8);
    max-width: 280px;
}

.footer-column h5 {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: white;
    margin-bottom: 0.75rem;
}

.footer-column ul {
    list-style: none;
}

.footer-column li {
    margin-bottom: 0.5rem;
}

.footer-column a {
    color: rgba(148, 163, 184, 0.8);
    text-decoration: none;
    transition: color 0.2s;
    font-size: 0.75rem;
}

.footer-column a:hover {
    color: white;
}

.footer-column .coming-soon {
    color: rgba(100, 116, 139, 0.6);
    font-size: 0.6875rem;
}

.footer-column .coming-soon span {
    background: rgba(51, 65, 85, 0.5);
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-size: 0.5625rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-left: 0.25rem;
}

.footer-bottom {
    border-top: 1px solid rgba(51, 65, 85, 0.5);
    padding-top: 1rem;
    font-size: 0.6875rem;
    color: rgba(100, 116, 139, 0.7);
    line-height: 1.6;
}

/* ===================== Responsive ===================== */
@media (min-width: 768px) {
    .nav-desktop {
        display: flex;
    }

    .mobile-menu-btn {
        display: none;
    }
}

/* Accessibility focus */
.focus-visible:focus-visible {
    outline: 2px solid var(--violet-600);
    outline-offset: 2px;
}

