:root {
    --bg: #f7f4ef;
    --text: #1f1e1b;
    --muted: #6b665f;
    --border: #e2ddd4;
    --ink: #111;
    --accent: #1a8917;
    --card: #fffdfa;
}

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
    border-radius: 8px;
}

.container {
    width: min(1200px, 92vw);
    margin: 0 auto;
}

/* Navigation */
.masthead {
    background: #fff;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.nav-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 0;
    position: relative;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    font-family: "Georgia", "Times New Roman", serif;
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: inherit;
}

.brand-mark {
    width: 3.25rem;
    height: 3.25rem;
    display: block;
    border-radius: 1.5rem;
    box-shadow: 0 12px 25px rgba(15, 23, 42, 0.25);
}

.brand-text {
    display: inline-block;
    font-size: 1.5rem;
    line-height: 1.2;
}

.brand.flair {
    animation: brandPulse 6s ease-in-out infinite;
    transform-origin: center;
}

.brand-slogan {
    font-size: 1.1rem;
    font-weight: 600;
    background: linear-gradient(120deg, #1a8917, #ff6b6b, #1f1e1b);
    -webkit-background-clip: text;
    color: transparent;
    animation: hueShift 8s linear infinite;
}

@keyframes brandPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
        letter-spacing: -0.01em;
    }
    100% {
        transform: scale(1);
    }
}

@keyframes hueShift {
    0% {
        filter: hue-rotate(0deg);
    }
    100% {
        filter: hue-rotate(360deg);
    }
}

.nav-links {
    display: flex;
    gap: 0.75rem;
    font-size: 0.95rem;
    color: var(--muted);
    align-items: center;
}

.nav-links a {
    padding: 0.3rem 0.4rem;
    border-radius: 4px;
}

.nav-links a:hover {
    color: var(--text);
    background: rgba(0, 0, 0, 0.04);
    text-decoration: none;
}

.nav-shell {
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: flex-end;
    flex: 1;
}

.nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: #fff;
    cursor: pointer;
    padding: 0.5rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.nav-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--ink);
    border-radius: 999px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

.nav-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.nav-pill {
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.35rem 1rem;
    font-size: 0.9rem;
    background: #fff;
}

.nav-pill.ghost {
    background: transparent;
    color: var(--muted);
}

/* Flash messages */
.flash {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}

.flash li {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #fff;
    margin-bottom: 0.5rem;
}

.flash li.error {
    border-color: #f87171;
    color: #b91c1c;
}

.flash li.success {
    border-color: #34d399;
    color: #047857;
}

/* Homepage */
.hero {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin: 2.5rem 0;
    align-items: flex-start;
}

.hero-feature {
    background: #fff;
    border-radius: 24px;
    padding: 2rem;
    border: 1px solid var(--border);
}

.hero-feature .kicker {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.8rem;
    color: var(--accent);
}

.hero-feature h1 {
    font-family: "Georgia", "Times New Roman", serif;
    font-size: clamp(2rem, 4vw, 3rem);
    margin: 0.4rem 0 1rem;
}

.hero-feature img {
    width: 100%;
    max-height: 460px;
    object-fit: cover;
    border-radius: 18px;
    margin: 1rem 0 0;
    display: block;
}

.hero-feature p.summary {
    color: var(--muted);
    font-size: 1.05rem;
}

.hero-list {
    background: #fff;
    border-radius: 24px;
    border: 1px solid var(--border);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-self: flex-start;
}

.hero-list > p {
    margin: 0;
}

.hero-list ol {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.hero-list li a {
    font-weight: 600;
}

.hero-list li p {
    margin: 0.2rem 0 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.front-nav {
    margin: 1rem 0 2.5rem;
    padding: 1.5rem;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: linear-gradient(135deg, #fffdfa, #f1ece5);
}

.front-nav-header {
    margin-bottom: 1rem;
}

.front-nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.nav-card {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    border-radius: 18px;
    padding: 1rem 1.25rem;
    border: 1px solid rgba(0, 0, 0, 0.06);
    background: #fff;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
}

.nav-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(30, 41, 59, 0.12);
    text-decoration: none;
}

.nav-card.primary {
    background: #111;
    color: #fff;
}

.nav-card.current {
    border-color: var(--accent);
    box-shadow: 0 15px 30px rgba(26, 137, 23, 0.15);
}

.nav-card.secondary {
    background: #fdf7f0;
}

.nav-card-label {
    font-weight: 600;
}

.nav-card-meta {
    font-size: 0.9rem;
    color: var(--muted);
}

.nav-card.primary .nav-card-meta {
    color: rgba(255, 255, 255, 0.75);
}

/* Story cards */
.story-card {
    display: grid;
    grid-template-columns: minmax(0, 0.4fr) minmax(0, 0.6fr);
    gap: 1.5rem;
    align-items: stretch;
    background: #fffdfa;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 24px;
    padding: 1.25rem;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.07);
}

.story-card + .story-card {
    margin-top: 1.5rem;
}

.story-card-thumb {
    width: 100%;
    height: 100%;
    border-radius: 18px;
    overflow: hidden;
    background: #f1ece5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Georgia", serif;
    font-size: 2.4rem;
    color: rgba(108, 95, 84, 0.9);
    letter-spacing: 0.05em;
    aspect-ratio: 4 / 3;
}

.story-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.story-card-thumb.placeholder {
    background: linear-gradient(135deg, #f7f1e7, #ece4d8);
    border: 1px dashed rgba(0, 0, 0, 0.08);
}

.story-card-thumb span {
    display: block;
    font-weight: 600;
    text-transform: uppercase;
}

.story-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    justify-content: flex-start;
}

.story-card-body h2 {
    font-family: "Georgia", serif;
    font-size: 1.8rem;
    margin: 0;
}

.story-card-body .summary {
    color: var(--muted);
    margin: 0;
}

.story-card-compact {
    box-shadow: none;
    background: transparent;
    border: none;
    padding: 0.25rem 0;
    gap: 0.75rem;
}

.story-card-compact .story-card-thumb {
    flex: 0 0 70px;
    max-width: 70px;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    font-size: 1.1rem;
}

.story-card-compact .story-card-body {
    gap: 0.2rem;
}

.story-card-compact .story-card-body a {
    font-weight: 600;
}

.story-card-compact .story-card-body p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--muted);
}

.trending-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem 0.75rem 1.75rem;
    border-radius: 18px;
    border: 1px solid rgba(15, 23, 42, 0.09);
    background: linear-gradient(120deg, rgba(255, 255, 255, 0.95), rgba(247, 244, 239, 0.92));
    line-height: 1.4;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.trending-item::before {
    content: "";
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 48px;
    border-radius: 999px;
    background: linear-gradient(180deg, #1a8917, #ff6b6b);
    opacity: 0.4;
}

.trending-item::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.5), transparent 50%);
    pointer-events: none;
}

.trending-item:hover {
    transform: translateX(6px) scale(1.01);
    border-color: rgba(26, 137, 23, 0.55);
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.15);
    background: linear-gradient(120deg, rgba(245, 255, 248, 0.98), rgba(231, 246, 236, 0.95));
    text-decoration: none;
}

.trending-item-title {
    font-weight: 600;
    font-size: 0.98rem;
    color: inherit;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    position: relative;
    z-index: 1;
    transition: transform 0.25s ease, color 0.25s ease;
}

.trending-item:hover .trending-item-title {
    transform: scale(1.03);
    color: #0f5132;
}

.hero-list li {
    margin: 0;
    list-style: none;
}

/* Loan calculator */
.loan-calculator {
    margin: 3rem 0;
}

.loan-calculator-shell {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    background: linear-gradient(135deg, #111, #1a8917);
    color: #fff;
    border-radius: 32px;
    padding: clamp(1.5rem, 4vw, 3rem);
    position: relative;
    overflow: hidden;
}

.loan-calculator-shell::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.2), transparent 60%);
    pointer-events: none;
}

.loan-calculator-copy {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.loan-calculator-copy h2 {
    font-family: "Georgia", serif;
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    margin: 0;
}

.loan-calculator-copy p {
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
}

.loan-calculator-form {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.loan-calculator-form label {
    display: flex;
    flex-direction: column;
    font-weight: 600;
    font-size: 0.85rem;
    gap: 0.35rem;
}

.loan-calculator-form input,
.loan-calculator-form select {
    border: none;
    border-radius: 16px;
    padding: 0.85rem;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.9);
}

.loan-calculator-form .button {
    margin-top: auto;
    border: none;
    border-radius: 16px;
    background: #fff;
    color: #0f172a;
}

.loan-calculator-results {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
}

.loan-calculator-results div {
    padding: 1rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(6px);
}

.loan-calculator-results .label {
    margin: 0;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.7);
}

.loan-calculator-results strong {
    display: block;
    font-size: 1.4rem;
    margin: 0.35rem 0;
}

.loan-calculator-results small {
    color: rgba(255, 255, 255, 0.85);
}

.breadcrumbs {
    margin: 1.5rem 0 0.5rem;
    font-size: 0.9rem;
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.breadcrumbs a {
    color: inherit;
    text-decoration: none;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

.loan-cta {
    margin: 3rem 0;
}

.loan-cta-shell {
    border-radius: 28px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    padding: clamp(1.5rem, 4vw, 2.5rem);
    background: linear-gradient(135deg, #fffdfa, #f4eee4);
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
}

.loan-cta-shell h2 {
    margin: 0.3rem 0;
    font-family: "Georgia", serif;
}

.loan-cta-shell p {
    margin: 0;
    color: var(--muted);
}

.loan-cta-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.loan-schedule {
    margin: 3rem 0 4rem;
}

.loan-schedule-card {
    background: #fff;
    border-radius: 24px;
    border: 1px solid var(--border);
    padding: 1.5rem;
    box-shadow: 0 15px 45px rgba(15, 23, 42, 0.08);
}

.loan-schedule-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 1rem;
}

.loan-schedule-table-wrapper {
    overflow-x: auto;
}

.loan-schedule-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.loan-schedule-table th,
.loan-schedule-table td {
    padding: 0.55rem 0.65rem;
    border-bottom: 1px solid var(--border);
    text-align: right;
}

.loan-schedule-table th:first-child,
.loan-schedule-table td:first-child,
.loan-schedule-table th:nth-child(2),
.loan-schedule-table td:nth-child(2) {
    text-align: left;
}

.loan-schedule-table tbody tr:last-child td {
    border-bottom: none;
}


.feed-stack {
    margin: 3rem 0 4rem;
}

.feed-main {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.feed-main article {
    border: none;
    padding: 0;
}

.feed-main article:last-child {
    margin-bottom: 0;
}

.feed-main h2 {
    font-family: "Georgia", serif;
    font-size: 1.7rem;
    margin: 0.3rem 0;
}

.feed-main .summary {
    color: var(--muted);
}

.hero-list li {
    margin: 0;
}

.card {
    background: #fff;
    border-radius: 20px;
    border: 1px solid var(--border);
    padding: 1.5rem;
    margin-bottom: 1.2rem;
}

.read-more-inline {
    font-weight: 600;
    color: var(--accent);
    margin-left: 0.35rem;
    white-space: nowrap;
    font-size: 0.9rem;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    background: linear-gradient(120deg, rgba(26, 137, 23, 0.1), rgba(255, 107, 107, 0.15));
    transition: background 0.2s ease, color 0.2s ease;
}

.read-more-inline:hover {
    text-decoration: none;
    color: #fff;
    background: linear-gradient(120deg, #1a8917, #ff6b6b);
}

/* Category */
.category-header {
    background: #fff;
    border-radius: 24px;
    border: 1px solid var(--border);
    padding: 2.5rem;
    margin: 2rem 0;
}

.category-header h1 {
    font-family: "Georgia", serif;
    font-size: 2.4rem;
    margin: 0.5rem 0;
}

.category-feed {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.category-feed article {
    border: none;
    padding: 0;
}

.category-feed article:last-child {
    margin-bottom: 0;
}

/* Article detail */
.article-hero {
    background: #fff;
    border-radius: 24px;
    border: 1px solid var(--border);
    padding: 2.5rem;
    margin: 2rem 0;
}

.article-hero .kicker {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    font-size: 0.8rem;
}

.article-hero h1 {
    font-family: "Georgia", serif;
    font-size: clamp(2.2rem, 4vw, 3.1rem);
    margin: 0.7rem 0 1.2rem;
}

.article-hero.has-media {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 2rem;
    align-items: flex-start;
}

.article-hero-text {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.article-hero-media {
    margin-top: 1.5rem;
    border-radius: 24px;
    overflow: hidden;
    background: #f4eee4;
    aspect-ratio: 4 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
}

.article-hero-media img {
    max-width: 100%;
    max-height: 100%;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
}

.article-hero.has-media .article-hero-media {
    margin-top: 0;
}

.article-meta {
    display: flex;
    gap: 0.6rem;
    color: var(--muted);
    font-size: 0.95rem;
}

.author-link {
    color: var(--accent);
    font-weight: 600;
}

.article-body {
    background: #fff;
    border-radius: 24px;
    border: 1px solid var(--border);
    padding: 2rem;
    line-height: 1.8;
    font-size: 1.08rem;
    margin-bottom: 2rem;
}

.article-body p {
    margin-bottom: 1.2rem;
}

.article-next {
    background: #fff;
    border-radius: 24px;
    border: 1px solid var(--border);
    padding: 1.8rem;
    margin-bottom: 3rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.article-next h2 {
    margin: 0;
    font-size: 1.6rem;
}

.article-next .read-more-inline {
    align-self: flex-start;
}

.creator-profile {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 2rem;
    margin: 2rem 0;
}

.creator-profile .bio {
    color: var(--muted);
    max-width: 60ch;
}

.profile-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.creator-articles {
    margin: 2rem 0;
}

/* Forms */
.form-panel {
    background: #fff;
    border-radius: 24px;
    border: 1px solid var(--border);
    padding: 2rem;
    margin: 2rem 0;
}

.seo-fields {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin: 1rem 0 1.5rem;
}

.seo-table {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.seo-row {
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1.25rem;
    background: #fffdfa;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.seo-row label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-weight: 600;
}

.seo-row input,
.seo-row textarea {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 0.75rem;
    font-size: 1rem;
    background: #fff;
}

.seo-row-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.form-panel.full-editor-panel {
    max-width: 960px;
    margin-left: auto;
    margin-right: auto;
}

.form-panel .editor-note {
    margin-bottom: 1rem;
}

.form-panel label {
    display: block;
    font-weight: 600;
    margin: 1rem 0 0.4rem;
}

.form-panel .form-hint {
    display: block;
    font-weight: 400;
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: 0.25rem;
}

.form-panel input,
.form-panel textarea,
.form-panel select {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.8rem;
    font-size: 1rem;
}

.form-field {
    margin: 1.5rem 0 0;
}

.form-field > label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.rich-editor-wrapper {
    position: relative;
}

.quill-editor-shell {
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fff;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.quill-editor-shell textarea {
    width: 100%;
    min-height: 520px;
    padding: 1rem;
    border: 0;
    font-size: 1rem;
    line-height: 1.6;
    font-family: "Georgia", serif;
    resize: vertical;
}

.quill-editor-shell.is-ready textarea {
    display: none;
}

.quill-editor-shell:not(.is-ready) .ql-container {
    display: none;
}

.quill-editor-shell .ql-container {
    border: none;
    min-height: 520px;
}

.quill-editor-shell .ql-toolbar {
    border: none;
    border-bottom: 1px solid var(--border);
}

.quill-editor-shell .ql-editor {
    min-height: 460px;
    font-size: 1rem;
    line-height: 1.6;
    font-family: "Georgia", serif;
}

.upload-dropzone {
    border: 2px dashed var(--border);
    border-radius: 18px;
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.03);
    color: var(--muted);
    cursor: pointer;
    position: relative;
}

.upload-dropzone:hover {
    border-color: var(--ink);
    color: var(--ink);
}

.upload-dropzone input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.settings-form .settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1rem;
}

.settings-form label {
    margin-top: 1.25rem;
}

.code-textarea {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    min-height: 120px;
}

.auto-post-block {
    margin-top: 2rem;
    padding: 1.5rem;
    border-radius: 18px;
    border: 1px dashed var(--border);
    background: rgba(14, 165, 233, 0.05);
}

.custom-snippets {
    margin-top: 2rem;
}

.branding-block {
    margin-top: 2rem;
    padding: 1.5rem;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: #fff;
}

.email-settings {
    margin-top: 2rem;
    padding: 1.5rem;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: #fffefa;
}

.email-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.branding-preview {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.branding-preview img {
    max-height: 70px;
    border-radius: 16px;
    background: #fff;
    padding: 0.3rem;
    border: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.checkbox-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    margin-top: 1rem;
}

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

.panel-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.search-form {
    display: flex;
    gap: 0.4rem;
}

.search-form input[type="search"] {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 0.6rem 0.8rem;
}

.drafts-dashboard {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
    gap: 2rem;
    margin: 2rem 0;
}

.drafts-hero {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.drafts-hero-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.draft-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.stat-pill {
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 1.3rem;
    background: #fff;
}

.stat-pill .stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0.2rem 0;
}

.stat-pill .stat-note {
    color: var(--muted);
    font-size: 0.9rem;
}

.draft-queue .queue-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.draft-card {
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 1.2rem;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.draft-card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--muted);
}

.draft-card-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.drafts-sidebar {
    position: sticky;
    top: 5.5rem;
    align-self: start;
}

.floating-panel {
    box-shadow: 0 15px 45px rgba(15, 23, 42, 0.08);
}

.muted {
    color: var(--muted);
    margin: 0.3rem 0;
}

.button.full {
    width: 100%;
    justify-content: center;
}

.empty-state {
    padding: 2rem;
    text-align: center;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 16px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 999px;
    padding: 0.65rem 1.4rem;
    font-size: 0.95rem;
    cursor: pointer;
    background: var(--ink);
    color: #fff;
}

.button.ghost {
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--border);
}

.button.danger {
    background: #b91c1c;
}

/* Researcher/Admin sections */
.publisher-desk,
.analytics-desk,
.admin-desk {
    background: #fff;
    border-radius: 24px;
    border: 1px solid var(--border);
    padding: 2rem;
    margin: 2rem 0;
}

.publisher-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.publisher-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.publisher-profile-note {
    margin: 1rem 0;
    padding: 0.75rem 1rem;
    background: rgba(26, 137, 23, 0.08);
    border-radius: 12px;
    font-size: 0.95rem;
}

.list {
    margin-top: 1rem;
}

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
}

.analytics-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.analytics-card header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    flex-wrap: wrap;
}

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

.data-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.data-list li {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.95rem;
    color: var(--muted);
}

.data-list span:first-child {
    color: var(--ink);
    font-weight: 600;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

.table-scroll {
    width: 100%;
    overflow-x: auto;
}

.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.table-actions form {
    margin: 0;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.1rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-left: 0.5rem;
    background: rgba(14, 165, 233, 0.1);
    color: #0369a1;
    font-weight: 600;
}

.status-badge.draft {
    background: rgba(251, 191, 36, 0.2);
    color: #b45309;
}

.card-actions {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-top: 0.8rem;
}

.category-card label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
}

.category-card label span {
    display: block;
    margin-bottom: 0.3rem;
    color: var(--muted);
}

.category-card input,
.category-card select {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.75rem;
    font-size: 0.95rem;
}

.meta.warning {
    color: #b45309;
    font-size: 0.85rem;
    margin: 0.4rem 0 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.stat-card {
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 1.3rem;
    background: var(--card);
}

.stat-value {
    font-size: 2rem;
    font-weight: 600;
    margin: 0.3rem 0;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.data-table th,
.data-table td {
    border-bottom: 1px solid var(--border);
    padding: 0.75rem;
    text-align: left;
}

/* Static pages */
.static-hero {
    background: #fff;
    border-radius: 24px;
    border: 1px solid var(--border);
    padding: 2.5rem;
    margin: 2.5rem 0 2rem;
}

.static-hero h1 {
    font-family: "Georgia", "Times New Roman", serif;
    font-size: clamp(2rem, 4vw, 3rem);
    margin: 0.5rem 0 1rem;
}

.static-hero p {
    max-width: 720px;
    color: var(--muted);
}

.static-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.static-grid.two-column {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.static-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 1.75rem;
}

.static-card h2,
.static-card h3 {
    margin-top: 0;
}

.simple-list {
    padding-left: 1.2rem;
}

.simple-list li {
    margin-bottom: 0.4rem;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
    align-items: start;
}

.contact-form-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 2rem;
}

.contact-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.8rem;
    font-size: 1rem;
    margin-bottom: 1rem;
    background: #fffdfa;
}

.contact-form textarea {
    resize: vertical;
}

.captcha-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 0.5rem;
}

.captcha-question {
    font-weight: 600;
    background: #111;
    color: #fff;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
}

.captcha-row input {
    flex: 1;
    margin-bottom: 0;
}

.captcha-note {
    font-size: 0.85rem;
    color: var(--muted);
    margin: -0.2rem 0 0.8rem;
}

.auth-shell {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 32px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
    align-items: flex-start;
    gap: 2rem;
    padding: 2.5rem;
    margin: 2.5rem auto;
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.08);
    width: min(960px, 92vw);
}

.auth-shell.signup {
    border-image: linear-gradient(120deg, #1a8917, #ff6b6b) 1;
}

.auth-panel h2 {
    margin: 0.6rem 0 0.3rem;
    font-size: 2rem;
}

.auth-lede {
    color: var(--muted);
    max-width: 45ch;
}

.auth-form {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-form label {
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.auth-form input {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.85rem;
    font-size: 1rem;
    background: #fffdfa;
}

.auth-submit {
    margin-top: 0.5rem;
    align-self: flex-start;
}

.auth-switch {
    margin-top: 1rem;
    color: var(--muted);
}

.auth-switch a {
    color: var(--accent);
    font-weight: 600;
}

.auth-aside {
    background: #fffdfa;
    border: 1px dashed var(--border);
    border-radius: 20px;
    padding: 1.5rem;
}

.auth-perks {
    display: block;
}

.auth-perks summary {
    font-weight: 700;
    cursor: pointer;
    list-style: none;
    margin-bottom: 0.4rem;
}

.auth-perks[open] summary {
    margin-bottom: 0.6rem;
}

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

.auth-perks ul {
    margin: 0;
    padding-left: 1.1rem;
    color: var(--muted);
}

.auth-meta {
    font-size: 0.9rem;
    color: var(--muted);
}

.auth-meta a {
    color: var(--accent);
    font-weight: 600;
}

.auth-shell .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.auth-perks {
    width: 100%;
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 3rem 0;
    background: #fff;
}

.footer-shell {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
}

.footer-grid ul {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0;
}

.footer-grid li {
    margin-bottom: 0.4rem;
}

.footer-title {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--accent);
    margin: 0;
}

.footer-grid a {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 600;
    color: var(--ink);
    transition: color 150ms ease, transform 150ms ease;
}

.footer-grid a::after {
    content: "›";
    font-size: 0.9em;
    color: rgba(17, 17, 17, 0.3);
    transition: color 150ms ease, transform 150ms ease;
}

.footer-grid a:hover {
    color: var(--accent);
    text-decoration: none;
    transform: translateY(-1px);
}

.footer-grid a:hover::after {
    color: var(--accent);
    transform: translateX(2px);
}

.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 1rem;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.8rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.footer-bottom-links {
    display: flex;
    gap: 1rem;
}

body.nav-open {
    overflow: hidden;
}

/* Responsive */
@media (max-width: 960px) {
    .auth-shell {
        grid-template-columns: 1fr;
        padding: 1.75rem;
        gap: 1.25rem;
    }

    .auth-shell > * {
        width: 100%;
    }

    .auth-panel {
        order: 1;
    }

    .auth-aside {
        order: 2;
        padding: 1.25rem;
        width: 100%;
    }

    .hero,
    .feed-split {
        grid-template-columns: 1fr;
    }

    .drafts-dashboard {
        grid-template-columns: 1fr;
    }

    .drafts-sidebar {
        position: static;
    }

    .feed-side {
        position: static;
    }

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

    .brand {
        font-size: 2.6rem;
    }

    .brand-text {
        font-size: 1.3rem;
    }

    .nav-shell {
        position: absolute;
        inset: calc(100% + 0.5rem) 0 auto;
        padding: 0.9rem;
        border: 1px solid var(--border);
        border-radius: 16px;
        background: #fff;
        box-shadow: 0 22px 70px rgba(15, 23, 42, 0.14);
        flex-direction: column;
        gap: 0.75rem;
        display: none;
        z-index: 9;
        max-height: 70vh;
        overflow-y: auto;
    }

    .nav-shell.is-open {
        display: flex;
    }

    .nav-toggle {
        display: inline-flex;
    }

    .nav-links {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 0.35rem;
    }

    .nav-links a {
        padding: 0.55rem 0.7rem;
        border-radius: 12px;
        border: 1px solid transparent;
    }

    .nav-links a:hover {
        background: rgba(0, 0, 0, 0.04);
        border-color: rgba(0, 0, 0, 0.05);
    }

    .nav-actions {
        width: 100%;
        justify-content: stretch;
        flex-direction: column;
        align-items: stretch;
        gap: 0.35rem;
    }

    .nav-pill {
        width: 100%;
        text-align: center;
        padding: 0.55rem 0.9rem;
    }

    .contact-grid,
    .footer-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }

    .story-card {
        grid-template-columns: 1fr;
    }

    .story-card-thumb {
        aspect-ratio: 16 / 9;
    }

    .article-hero.has-media {
        display: block;
    }

    .article-hero.has-media .article-hero-media {
        margin-top: 1.5rem;
    }
}

@media (max-width: 720px) {
    .hero {
        margin: 1.75rem 0;
        gap: 1.25rem;
    }

    .hero-feature,
    .hero-list {
        width: 100%;
    }

    .hero-list {
        order: 2;
    }

    .hero-feature {
        order: 1;
    }

    .loan-cta-shell {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.85rem;
    }

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

    .data-list li {
        flex-direction: column;
        align-items: flex-start;
    }

    .table-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .table-actions .button,
    .table-actions button {
        width: 100%;
        justify-content: center;
    }

    .nav-shell {
        padding: 0.75rem;
        gap: 0.65rem;
    }

    .nav-links a {
        font-size: 0.98rem;
    }

    .auth-shell {
        grid-template-columns: 1fr;
        padding: 1.5rem;
        gap: 1rem;
    }

    .auth-aside {
        padding: 1.2rem;
        order: 2;
        width: 100%;
    }

    .hero-feature,
    .hero-list,
    .form-panel,
    .publisher-desk,
    .analytics-desk,
    .admin-desk,
    .article-hero,
    .article-body,
    .card,
    .static-hero,
    .static-card,
    .contact-form-card {
        padding: 1.4rem;
        border-radius: 18px;
    }

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

    .captcha-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .captcha-question {
        width: 100%;
        text-align: center;
    }

    .captcha-row input {
        width: 100%;
    }

    .hero-feature h1,
    .article-hero h1 {
        font-size: clamp(1.8rem, 6vw, 2.4rem);
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .data-table {
        display: block;
        overflow-x: auto;
    }

    .story-card {
        padding: 1rem;
    }

    .trending-item {
        padding: 0.7rem 0.85rem 0.7rem 1.25rem;
    }

    .article-hero-media {
        border-radius: 18px;
    }
}

@media (max-width: 540px) {
    .nav-row {
        gap: 0.75rem;
    }

    .brand {
        font-size: 2.2rem;
    }

    .brand-text {
        font-size: 1.1rem;
    }

    .hero-list ol {
        gap: 1rem;
    }

    .auth-shell {
        padding: 1.25rem;
        border-radius: 24px;
    }

    .story-card-compact {
        align-items: center;
    }

    .story-card-compact .story-card-thumb {
        flex: 0 0 56px;
        max-width: 56px;
    }

    .trending-item {
        padding: 0.65rem 0.8rem 0.65rem 1.1rem;
    }

    .trending-item-title {
        -webkit-line-clamp: 3;
    }

    .article-hero-media {
        aspect-ratio: auto;
        max-height: 320px;
    }

    .article-meta {
        flex-direction: column;
        gap: 0.3rem;
    }

    .footer-bottom {
        flex-direction: column;
        align-items: flex-start;
    }

    .footer-social {
        width: 100%;
    }

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

    .card-actions,
    .publisher-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .button,
    .nav-pill {
        padding: 0.6rem 1rem;
    }
}
