@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Source+Sans+3:wght@400;500;600&display=swap');

:root {
    --owf-ink: #0f172a;
    --owf-slate: #475569;
    --owf-muted: #475569;
    --owf-accent: #0f766e;
    --owf-accent-strong: #0a5c53;
    --owf-warm: #f59f00;
    --owf-bg: #f8fafc;
    --owf-card: #ffffff;
    --owf-border: #e2e8f0;
    --owf-hero: #0b1422;
    --owf-today: #6c757d;
}

body {
    font-family: 'Source Sans 3', sans-serif;
    color: var(--owf-ink);
    background:
        radial-gradient(900px circle at 10% 10%, rgba(15, 118, 110, 0.15), transparent 60%),
        radial-gradient(700px circle at 90% 5%, rgba(245, 159, 0, 0.18), transparent 65%),
        linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
    min-height: 100vh;
}

h1, h2, h3, h4, h5, .navbar-brand {
    font-family: 'Space Grotesk', sans-serif;
}

.text-muted {
    color: var(--owf-muted) !important;
}

.small, .form-text {
    color: #475569;
}

.navbar-owf {
    background: linear-gradient(120deg, #0b1422, #12263a 60%, #1b3a2f);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.18);
}

.navbar-owf .nav-link {
    color: rgba(255, 255, 255, 0.85);
}

.navbar-owf .nav-link:hover {
    color: #ffffff;
}

.btn-owf {
    background: var(--owf-accent);
    border-color: var(--owf-accent);
    color: #ffffff;
    box-shadow: 0 10px 20px rgba(15, 118, 110, 0.2);
}

.btn-owf:hover {
    background: var(--owf-accent-strong);
    border-color: var(--owf-accent-strong);
    color: #ffffff;
}

.btn-owf-outline {
    border: 1px solid var(--owf-accent);
    color: var(--owf-accent);
    background: transparent;
}

.btn-owf-outline:hover {
    background: var(--owf-accent);
    color: #ffffff;
}

.owf-info {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid var(--owf-border);
    background: #ffffff;
    color: var(--owf-slate);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    padding: 0;
}

.owf-info:hover,
.owf-info:focus {
    background: var(--owf-accent);
    border-color: var(--owf-accent);
    color: #ffffff;
    text-decoration: none;
}

.owf-info:focus-visible {
    outline: 2px solid var(--owf-accent);
    outline-offset: 2px;
}

.navbar-owf .btn-owf-outline {
    border-color: rgba(255, 255, 255, 0.7);
    color: #ffffff;
}

.navbar-owf .btn-owf-outline:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

.owf-hero {
    padding: 3rem 0 2rem;
    animation: fadeUp 0.7s ease;
}

.hero-card {
    background: var(--owf-hero);
    color: #ffffff;
    border-radius: 24px;
    box-shadow: 0 30px 50px rgba(15, 23, 42, 0.4);
    position: relative;
    overflow: hidden;
}

.hero-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(400px circle at 80% 0%, rgba(245, 159, 0, 0.2), transparent 60%);
    pointer-events: none;
}

.hero-card .text-muted {
    color: rgba(255, 255, 255, 0.8) !important;
}

.hero-card .small {
    color: rgba(255, 255, 255, 0.75);
}

.badge-hero {
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.text-owf {
    color: var(--owf-accent);
}

.hero-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    color: var(--owf-muted);
    font-size: 0.95rem;
}

.hero-meta span {
    padding-right: 1rem;
    border-right: 1px solid rgba(100, 116, 139, 0.3);
}

.hero-meta span:last-child {
    border-right: none;
}

.status-dot {
    position: relative;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 16px rgba(34, 197, 94, 0.6);
    animation: statusPulse 1.6s ease-in-out infinite;
}

@keyframes statusPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.65);
        opacity: 1;
    }
    70% {
        box-shadow: 0 0 0 12px rgba(34, 197, 94, 0);
        opacity: 0.85;
    }
    100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .status-dot {
        animation: none;
    }
}

.stat-card {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: 16px;
}

.feature-card {
    background: var(--owf-card);
    border: 1px solid var(--owf-border);
    border-radius: 18px;
    padding: 1.5rem;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
    animation: fadeUp 0.6s ease;
}

.feature-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.check-item {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
}

.check-item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.45rem;
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 4px;
    background: #22c55e;
}

.owf-card {
    border: 1px solid var(--owf-border);
    border-radius: 18px;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.06);
}

.terms-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1050;
    background: #0b1422;
    color: #f8fafc;
    padding: 0.75rem 0;
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.35);
}

.terms-banner .btn {
    font-weight: 600;
}

.link-muted {
    color: #94a3b8;
}

.link-muted:hover,
.link-muted:focus {
    color: #e2e8f0;
}

@media (max-width: 768px) {
    .terms-banner .container {
        flex-direction: column;
        align-items: flex-start;
    }
}

.code-block {
    background: #0f172a;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 12px;
}

.code-block code {
    color: #e2e8f0;
}

.change-card {
    background: #f8fafc;
    border: 1px dashed var(--owf-border);
    border-radius: 14px;
    padding: 1rem;
    height: 100%;
}

.owf-calendar-today {
    background: var(--owf-today);
}

.diff-view {
    background: #0b1422;
    color: #e2e8f0;
    border-radius: 12px;
    padding: 1rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.85rem;
    line-height: 1.4;
}

.diff-line {
    white-space: pre-wrap;
    word-break: break-word;
    padding: 0.05rem 0.4rem;
    border-radius: 6px;
}

.diff-add {
    background: rgba(34, 197, 94, 0.2);
    color: #dcfce7;
    border-left: 3px solid #22c55e;
}

.diff-del {
    background: rgba(239, 68, 68, 0.2);
    color: #fee2e2;
    border-left: 3px solid #ef4444;
}

.ai-details {
    font-size: 0.9rem;
}

.ai-details summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--owf-ink);
    list-style: none;
}

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

.ai-sticky-stack {
    position: sticky;
    top: 1.5rem;
    align-self: flex-start;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.ai-preview {
    max-height: 7.5rem;
    overflow: hidden;
}

.ai-message-structured {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-top: 0.35rem;
}

.ai-heading {
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.35;
}

.ai-heading-level-3 {
    font-size: 1.12rem;
    text-transform: uppercase;
}

.ai-heading-level-2 {
    font-size: 1rem;
}

.ai-heading-level-1 {
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--owf-accent);
}

.ai-subtitle {
    font-weight: 600;
    font-size: 0.97rem;
    color: var(--owf-ink);
}

.ai-message-paragraph {
    margin: 0;
    color: var(--owf-slate);
}

.ai-message-list {
    margin: 0;
    padding-left: 1.2rem;
    color: var(--owf-slate);
    line-height: 1.4;
}

.ai-message-list li {
    margin-bottom: 0.35rem;
}

.ai-report {
    border: 1px solid var(--owf-border);
    border-radius: 14px;
    padding: 0.85rem 1rem;
    background: #fff;
}

.ai-report-header {
    justify-content: space-between;
}

.ai-report-date {
    color: var(--owf-slate);
    letter-spacing: 0.08em;
}

.ai-summary-toggle {
    width: 100%;
    text-align: left;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 12px;
    background: var(--owf-bg);
    padding: 0.6rem 0.9rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.95rem;
}

.ai-summary-toggle:focus-visible {
    outline: 2px solid var(--owf-accent);
    outline-offset: 2px;
}

.ai-summary-text {
    flex: 1;
}

.ai-summary-action {
    color: var(--owf-accent);
    font-weight: 600;
    font-size: 0.9rem;
}

.ai-summary-static {
    border: 1px dashed rgba(15, 23, 42, 0.1);
    border-radius: 12px;
    padding: 0.6rem 0.9rem;
    background: #f8fafc;
}

.ai-details-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.ai-report-expanded .ai-details-panel {
    max-height: 1000px;
}

.ai-report-expanded .ai-summary-action {
    color: #0b1422;
}


.ai-recommendations-list {
    padding-left: 1.1rem;
    margin: 0;
    margin-bottom: 0.35rem;
    color: var(--owf-slate);
}

.ai-recommendations-list li {
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

.ai-severity {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 0.75rem;
    margin-bottom: 0.5rem;
}

.ai-severity-high {
    background: rgba(239, 68, 68, 0.15);
    color: #b91c1c;
}

.ai-severity-medium {
    background: rgba(245, 158, 11, 0.15);
    color: #c2410c;
}

.ai-severity-low {
    background: rgba(22, 163, 74, 0.15);
    color: #166534;
}

.ai-insight-list {
    padding-left: 1rem;
    margin-bottom: 0;
    margin-top: 0.5rem;
}

.ai-insight-list li {
    margin-bottom: 0.35rem;
}

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

.form-control::placeholder {
    color: #6b7280;
}

.form-control, .form-select {
    color: var(--owf-ink);
}

.owf-quickbar {
    border: 1px solid var(--owf-border);
    border-radius: 18px;
    background: linear-gradient(120deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
    padding: 1rem 1.1rem;
}

.owf-quickbar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.owf-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
}

.owf-kpi-card {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    text-decoration: none;
    border: 1px solid var(--owf-border);
    border-radius: 12px;
    background: #ffffff;
    padding: 0.65rem 0.75rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.owf-kpi-card:hover,
.owf-kpi-card:focus {
    transform: translateY(-2px);
    border-color: rgba(15, 118, 110, 0.45);
    box-shadow: 0 8px 20px rgba(15, 118, 110, 0.14);
}

.owf-kpi-label {
    color: var(--owf-slate);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.owf-kpi-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--owf-ink);
}

.owf-section-nav {
    position: sticky;
    top: 0.8rem;
    z-index: 20;
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 12px;
    background: rgba(248, 250, 252, 0.94);
    backdrop-filter: blur(6px);
    padding: 0.5rem;
}

.owf-section-link {
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 0.35rem 0.7rem;
    text-decoration: none;
    font-size: 0.86rem;
    color: var(--owf-slate);
    background: #ffffff;
}

.owf-section-link:hover,
.owf-section-link:focus {
    color: var(--owf-accent);
    border-color: rgba(15, 118, 110, 0.35);
}

.owf-section-anchor {
    scroll-margin-top: 6rem;
}

.owf-section-panel {
    border: 1px dashed var(--owf-border);
    border-radius: 14px;
    background: rgba(248, 250, 252, 0.82);
    padding: 0.9rem;
}

.owf-section-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.8rem;
}

.owf-list-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    border: 1px solid var(--owf-border);
    border-radius: 12px;
    background: #f8fafc;
    padding: 0.65rem 0.9rem;
}

.owf-list-toolbar .form-select {
    width: auto;
}

.owf-selectable-row {
    border-bottom: 1px dashed var(--owf-border);
    padding-bottom: 0.65rem;
}

.owf-selectable-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

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

@media (max-width: 991px) {
    .ai-sticky-stack {
        position: static;
    }
    .hero-card {
        margin-top: 2rem;
    }
    .owf-section-nav {
        position: static;
    }
    .owf-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .owf-quickbar-head {
        align-items: flex-start;
        flex-direction: column;
    }
    .owf-section-panel-header {
        flex-direction: column;
    }
}

@media (max-width: 576px) {
    .owf-kpi-grid {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }
}
