:root {
    --bg-main: #fbf4ea;
    --bg-soft: #fffaf4;
    --card: rgba(255, 250, 244, 0.92);
    --card-strong: #fff4e3;
    --ink: #2f241d;
    --muted: #736356;
    --line: #eadac7;
    --primary: #6f8f73;
    --primary-deep: #385a42;
    --secondary: #f3b283;
    --secondary-deep: #cf8450;
    --accent: #e7c769;
    --shadow: 0 24px 60px rgba(113, 75, 40, 0.11);
    --radius-xl: 32px;
    --radius-lg: 24px;
    --radius-md: 18px;
}

html,
body {
    min-height: 100%;
}

body {
    font-family: "Nunito", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(243, 178, 131, 0.24), transparent 28%),
        radial-gradient(circle at right 12% top 18%, rgba(111, 143, 115, 0.18), transparent 22%),
        linear-gradient(180deg, #f7efe3 0%, var(--bg-main) 46%, #fffaf4 100%);
    color: var(--ink);
}

h1,
h2,
h3,
h4,
.navbar-brand strong {
    font-family: "Ovo", serif;
    letter-spacing: 0.01em;
}

a {
    color: inherit;
}

.page-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(10px);
    background: rgba(251, 244, 234, 0.8);
    border-bottom: 1px solid rgba(234, 218, 199, 0.65);
}

.brand-mark {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.brand-mark small {
    display: block;
    color: var(--muted);
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.brand-icon {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, var(--secondary) 0%, #f8d8a7 100%);
    color: #4f3426;
    font-family: "Ovo", serif;
    font-size: 22px;
    box-shadow: 0 10px 20px rgba(207, 132, 80, 0.16);
}

.nav-pillset {
    gap: 8px;
    align-items: center;
}

.nav-pillset .nav-link {
    border-radius: 999px;
    padding: 10px 16px;
    color: var(--muted);
    font-weight: 700;
}

.nav-pillset .nav-link:hover {
    background: rgba(255, 244, 227, 0.92);
    color: var(--primary-deep);
}

.navbar-toggler {
    border-radius: 16px;
    border-color: rgba(111, 143, 115, 0.3);
    background: rgba(255, 250, 244, 0.9);
}

.nav-pillset .accent-link {
    background: var(--primary-deep);
    color: #fff8ef;
}

.nav-pillset .accent-link:hover {
    background: #294836;
    color: #fff8ef;
}

.soft-alert {
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
}

.hero-card,
.warm-card,
.form-shell,
.table-shell,
.answer-shell {
    background: var(--card);
    border: 1px solid rgba(234, 218, 199, 0.9);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
}

.hero-card {
    padding: 36px;
    overflow: hidden;
    position: relative;
}

.hero-card::after {
    content: "";
    position: absolute;
    width: 280px;
    height: 280px;
    right: -70px;
    top: -70px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(243, 178, 131, 0.4) 0%, rgba(243, 178, 131, 0) 70%);
}

.eyebrow {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 244, 227, 0.95);
    color: var(--secondary-deep);
    font-weight: 800;
    letter-spacing: 0.03em;
    font-size: 13px;
}

.hero-copy {
    position: relative;
    z-index: 1;
}

.hero-copy p {
    color: var(--muted);
    font-size: 18px;
    line-height: 1.8;
}

.cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 28px;
}

.btn-warm-primary,
.btn-warm-secondary {
    border-radius: 999px;
    padding: 12px 20px;
    font-weight: 800;
    border: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-warm-primary {
    background: var(--primary-deep);
    color: #fff8ef;
    box-shadow: 0 14px 30px rgba(56, 90, 66, 0.2);
}

.btn-warm-primary:disabled,
.btn-warm-primary.is-loading {
    opacity: 0.88;
    cursor: wait;
}

.btn-warm-primary.is-loading::before {
    content: "";
    width: 16px;
    height: 16px;
    margin-right: 10px;
    border-radius: 50%;
    border: 2px solid rgba(255, 248, 239, 0.4);
    border-top-color: #fff8ef;
    animation: spin 0.8s linear infinite;
}

.btn-warm-secondary {
    background: rgba(255, 245, 232, 0.95);
    color: var(--ink);
    border: 1px solid var(--line);
}

.hero-stack {
    display: grid;
    gap: 16px;
    position: relative;
    z-index: 1;
}

.mock-card,
.stat-panel,
.mini-card,
.feature-card,
.timeline-card {
    border-radius: var(--radius-lg);
    border: 1px solid rgba(234, 218, 199, 0.9);
}

.mock-card {
    background: linear-gradient(180deg, #fff8ef 0%, #fff3df 100%);
    padding: 22px;
}

.mock-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.chip {
    display: inline-flex;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    background: rgba(111, 143, 115, 0.15);
    color: var(--primary-deep);
}

.pet-avatar {
    width: 72px;
    height: 72px;
    border-radius: 24px;
    background: linear-gradient(145deg, #f5c299, #f8e2b7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Ovo", serif;
    font-size: 28px;
    color: #69422b;
}

.avatar-thumb,
.table-thumb,
.detail-hero-image {
    object-fit: cover;
    border: 1px solid rgba(234, 218, 199, 0.9);
}

.avatar-thumb {
    width: 56px;
    height: 56px;
    border-radius: 18px;
}

.avatar-thumb-lg {
    width: 72px;
    height: 72px;
    border-radius: 22px;
}

.table-thumb {
    width: 56px;
    height: 56px;
    border-radius: 14px;
}

.detail-hero-image {
    width: 100%;
    max-width: 360px;
    height: 240px;
    border-radius: 24px;
    display: block;
}

.mock-row {
    display: flex;
    gap: 14px;
    align-items: center;
    margin-bottom: 18px;
}

.mock-note {
    color: var(--muted);
    margin-bottom: 0;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.mini-card {
    background: #fffaf4;
    padding: 14px 16px;
}

.mini-card span {
    display: block;
    color: var(--muted);
    font-size: 13px;
}

.mini-card strong {
    display: block;
    margin-top: 6px;
    font-size: 18px;
}

.stat-panel {
    background: linear-gradient(150deg, #32513d 0%, #6f8f73 100%);
    padding: 24px;
    color: #fff6ee;
}

.stat-item + .stat-item {
    margin-top: 18px;
}

.stat-label {
    display: block;
    opacity: 0.72;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.stat-value {
    font-size: 34px;
    font-weight: 800;
}

.small-value {
    font-size: 19px;
}

.section-heading {
    margin: 48px 0 22px;
}

.section-heading p {
    color: var(--muted);
    margin-bottom: 0;
}

.feature-card,
.timeline-card,
.warm-card,
.form-shell,
.answer-shell {
    padding: 24px;
}

.feature-card {
    background: rgba(255, 250, 244, 0.95);
    height: 100%;
}

.feature-card .icon-badge {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(243, 178, 131, 0.2);
    color: var(--secondary-deep);
    font-weight: 800;
    margin-bottom: 14px;
}

.feature-card p,
.muted-copy,
.form-hint {
    color: var(--muted);
}

.timeline-card {
    background: linear-gradient(180deg, rgba(255, 248, 239, 0.96) 0%, rgba(255, 243, 223, 0.94) 100%);
    height: 100%;
}

.timeline-list {
    display: grid;
    gap: 14px;
    margin-top: 16px;
}

.timeline-list li {
    list-style: none;
    padding-left: 18px;
    position: relative;
    color: var(--muted);
}

.timeline-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 10px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--secondary-deep);
}

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

.page-header p {
    color: var(--muted);
    margin: 6px 0 0;
}

.table-shell {
    overflow: hidden;
}

.table-shell .table {
    margin-bottom: 0;
}

.table-shell th {
    background: #fff4e5;
    color: #5b4638;
    border-bottom-width: 0;
}

.table-shell td,
.table-shell th {
    padding: 16px;
    vertical-align: middle;
}

.form-shell .form-control,
.form-shell .form-select,
.answer-shell .form-control,
.answer-shell .form-select {
    border-radius: 16px;
    border-color: var(--line);
    min-height: 48px;
    padding: 12px 14px;
    background: rgba(255, 251, 246, 0.95);
}

.form-shell textarea.form-control,
.answer-shell textarea.form-control {
    min-height: auto;
}

.form-shell .form-label,
.answer-shell .form-label {
    font-weight: 700;
    color: #59473b;
}

.answer-shell {
    height: 100%;
}

.ai-answer {
    white-space: normal;
    line-height: 1.95;
    font-size: 15px;
    color: var(--ink);
}

.prompt-list {
    padding-left: 18px;
    color: var(--muted);
}

.loading-hint {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 14px;
    background: rgba(111, 143, 115, 0.12);
    color: var(--primary-deep);
    font-weight: 700;
    font-size: 14px;
}

.site-footer {
    margin-top: auto;
    border-top: 1px solid rgba(234, 218, 199, 0.8);
    background: rgba(255, 249, 242, 0.88);
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 18px;
    padding: 24px 0 30px;
}

.footer-title {
    font-family: "Ovo", serif;
    font-size: 22px;
}

.footer-text {
    color: var(--muted);
    max-width: 560px;
    margin: 6px 0 0;
}

.footer-badge {
    align-self: center;
    border-radius: 999px;
    padding: 10px 14px;
    background: #fff0db;
    color: #8d623d;
    font-weight: 700;
}

.empty-state {
    color: var(--muted);
    text-align: center;
    padding: 32px;
}

.card-action-row,
.inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.card-action-row form,
.inline-actions form {
    margin: 0;
}

.btn-danger-soft,
.link-danger-button {
    border: 0;
    background: none;
    color: #b85d46;
    font-weight: 700;
    padding: 0;
}

.btn-danger-soft {
    border-radius: 999px;
    padding: 12px 18px;
    background: #fff1ea;
    border: 1px solid #f2cfbf;
}

.timeline-feed {
    display: grid;
    gap: 18px;
}

.timeline-feed-item {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 18px;
    align-items: start;
}

.timeline-feed-date {
    font-weight: 800;
    color: #8d623d;
    padding-top: 8px;
}

.timeline-feed-body {
    padding: 18px;
    border-radius: 22px;
    background: rgba(255, 250, 244, 0.95);
    border: 1px solid rgba(234, 218, 199, 0.9);
}

.ocr-preview {
    margin-top: 8px;
    padding: 10px 12px;
    background: #fff8ef;
    border: 1px solid #eadac7;
    border-radius: 12px;
    color: #6a5748;
    white-space: pre-wrap;
    max-width: 320px;
}

.ocr-block {
    padding: 18px 20px;
    border-radius: 20px;
    background: rgba(255, 248, 239, 0.9);
    border: 1px solid rgba(234, 218, 199, 0.95);
}

.structured-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.attachment-preview {
    width: 100%;
    max-width: 420px;
    border-radius: 22px;
    border: 1px solid rgba(234, 218, 199, 0.9);
    object-fit: cover;
}

.detail-copy {
    white-space: pre-wrap;
    line-height: 1.9;
}

.subtle-label {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 6px 12px;
    background: rgba(111, 143, 115, 0.12);
    color: var(--primary-deep);
    font-weight: 800;
    font-size: 13px;
}

.ocr-structured {
    margin-top: 10px;
    padding: 10px 12px;
    background: #f8f3ea;
    border: 1px solid #e6d6bf;
    border-radius: 12px;
}

.ocr-structured pre {
    margin: 8px 0 0;
    white-space: pre-wrap;
    color: #6a5748;
    font-size: 13px;
}

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

@media (max-width: 991.98px) {
    .hero-card {
        padding: 28px;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

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

    .structured-grid {
        grid-template-columns: 1fr;
    }

    .timeline-feed-item {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .footer-inner {
        padding-bottom: 24px;
    }
}
