:root {
    color-scheme: light;
    --bg: #f7f4fb;
    --surface: #ffffff;
    --ink: #241a31;
    --muted: #6f637b;
    --line: #ded4e8;
    --brand: #6f3bb3;
    --brand-strong: #3f1d68;
    --brand-deep: #25103f;
    --accent: #c49a2c;
    --accent-strong: #f3c64e;
    --green: #2f6f5f;
    --focus: #7d4bc3;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.5;
}

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

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 72px;
    padding: 0 32px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 700;
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 6px;
    background: var(--brand);
    color: white;
}

.language-form select,
.auth-form input {
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 8px 10px;
    background: white;
}

.menu-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 48px;
    padding: 0 32px;
    background: var(--brand-deep);
    color: white;
}

.menu-links,
.account-menu {
    display: flex;
    align-items: center;
    gap: 8px;
}

.account-menu {
    margin-left: auto;
}

.account-menu span {
    color: rgba(255, 255, 255, 0.86);
    font-size: 14px;
    font-weight: 700;
}

.menu-bar a,
.menu-bar button,
.button,
.auth-form button {
    border: 0;
    border-radius: 6px;
    padding: 10px 14px;
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.menu-bar a:hover,
.menu-bar button:hover {
    background: rgba(255, 255, 255, 0.13);
}

.app-shell {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    min-height: calc(100vh - 168px);
}

.app-shell-public {
    display: block;
}

.left-nav {
    padding: 24px 16px;
    background: #f0e9f8;
    border-right: 1px solid var(--line);
}

.nav-heading {
    margin: 0 0 12px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

.nav-group-label {
    margin: 18px 0 6px;
    padding: 0 12px;
    color: var(--brand);
    font-size: 13px;
    font-weight: 700;
}

.left-nav a {
    display: block;
    padding: 10px 12px;
    border-radius: 6px;
    color: #344054;
    font-size: 14px;
}

.left-nav a:hover {
    background: white;
}

.main-content {
    padding: 32px;
}

.app-shell-public .main-content {
    padding: 0;
}

.hero,
.section,
.auth-panel {
    max-width: 1120px;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
    align-items: center;
    gap: 32px;
    max-width: none;
    min-height: calc(100vh - 120px);
    padding: 56px clamp(24px, 6vw, 84px);
    background:
        linear-gradient(90deg, rgba(37, 16, 63, 0.95) 0%, rgba(63, 29, 104, 0.88) 44%, rgba(63, 29, 104, 0.46) 72%, rgba(37, 16, 63, 0.30) 100%),
        url("/static/img/home-hero-theology.png");
    background-size: cover;
    background-position: center;
    color: white;
}

.hero-content {
    max-width: 760px;
}

.hero h1,
.section h1 {
    margin: 0 0 12px;
    font-size: 40px;
    line-height: 1.15;
}

.hero h1 {
    font-size: 58px;
    max-width: 820px;
}

.hero p,
.lead {
    max-width: 720px;
    color: inherit;
    font-size: 18px;
}

.hero p {
    max-width: 680px;
    color: rgba(255, 255, 255, 0.90);
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--brand);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

.hero .eyebrow {
    color: var(--accent-strong);
}

.button,
.auth-form button {
    display: inline-block;
    margin-top: 14px;
    background: var(--brand);
    color: white;
    font-weight: 700;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 22px;
}

.button-primary,
.button-offer {
    background: var(--accent-strong);
    color: #241a31;
}

.button-secondary {
    border: 1px solid rgba(255, 255, 255, 0.56);
    background: rgba(255, 255, 255, 0.10);
}

.hero-offer {
    align-self: center;
    border: 1px solid rgba(255, 255, 255, 0.26);
    border-radius: 8px;
    padding: 26px;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(10px);
}

.discount-badge {
    color: var(--accent-strong);
    font-size: 56px;
    font-weight: 800;
    line-height: 0.95;
}

.hero-offer p {
    margin: 12px 0 8px;
    color: white;
    font-size: 17px;
}

.home-message {
    padding: 22px clamp(24px, 6vw, 84px);
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.home-message div {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    max-width: 1440px;
    margin: 0 auto;
}

.home-message span {
    color: var(--green);
    font-weight: 700;
}

.home-message strong {
    color: var(--brand-strong);
    font-size: 18px;
}

.section {
    margin: 0 auto;
    padding: 42px 32px 54px;
}

.app-shell-public .section {
    max-width: none;
    padding: 42px clamp(24px, 6vw, 84px) 54px;
}

.app-shell-public .topic-group {
    max-width: 1440px;
    margin-left: auto;
    margin-right: auto;
}

.topic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.topic-group + .topic-group {
    margin-top: 40px;
}

.topic-card,
.placeholder-panel,
.auth-panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    padding: 20px;
}

.topic-card h3 {
    margin: 0 0 8px;
    font-size: 18px;
}

.topic-card p {
    margin: 0 0 12px;
    color: var(--muted);
}

.price-line {
    margin: 8px 0 4px;
    color: var(--brand-strong);
    font-size: 16px;
    font-weight: 700;
}

.discount-line {
    margin: 0 0 12px;
    color: var(--brand);
    font-size: 20px;
    font-weight: 800;
}

.topic-card span {
    color: var(--accent);
    font-size: 13px;
    font-weight: 700;
}

.topic-link:hover {
    border-color: var(--brand);
}

.article-content {
    margin-top: 28px;
    padding: 34px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.article-content h1 {
    font-size: 34px;
}

.article-content h2 {
    margin: 34px 0 12px;
    color: var(--brand-strong);
    font-size: 24px;
}

.article-content h3 {
    margin: 24px 0 10px;
    color: var(--brand);
    font-size: 20px;
}

.article-content p,
.article-content li,
.article-content blockquote {
    color: #3b3048;
    font-size: 17px;
}

.article-content blockquote {
    margin: 20px 0;
    padding: 16px 20px;
    border-left: 4px solid var(--accent);
    background: #fbf7ec;
    font-weight: 700;
}

.hebrew-page .article-content {
    direction: rtl;
    text-align: right;
}

.hebrew-page .article-content blockquote,
.commentary-content[dir="rtl"] blockquote {
    border-right: 4px solid var(--accent);
    border-left: 0;
}

.commentary-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, 380px);
    gap: 28px;
    align-items: start;
}

.commentary-intro p:last-child {
    margin-bottom: 0;
}

.commentary-picker {
    display: grid;
    gap: 14px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.commentary-field {
    display: grid;
    gap: 6px;
    font-weight: 700;
    color: var(--brand-strong);
}

.commentary-field select,
.commentary-field input {
    width: 100%;
}

.commentary-field select:disabled,
.commentary-field input:disabled {
    background: #f3f1f5;
    color: #8d8399;
    cursor: not-allowed;
    opacity: 1;
}

.commentary-field select.is-disabled {
    background: #f3f1f5;
}

.commentary-body {
    display: grid;
    gap: 18px;
}

.commentary-selection {
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: linear-gradient(180deg, #fff, #f7f2ff);
}

.commentary-selection h2 {
    margin: 0 0 8px;
    color: var(--brand-strong);
    font-size: 28px;
}

.commentary-content {
    padding: 30px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.commentary-content h3 {
    margin-top: 0;
    color: var(--brand);
}

.commentary-content[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

.auth-panel {
    max-width: 480px;
}

.auth-form {
    display: grid;
    gap: 14px;
}

.auth-form label {
    display: grid;
    gap: 6px;
    font-weight: 700;
}

.form-error {
    color: #a33b2f;
    font-weight: 700;
}

.site-footer {
    min-height: 48px;
    padding: 14px 32px;
    border-top: 1px solid var(--line);
    background: var(--surface);
    color: var(--muted);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.evaluation-dashboard-head, .workspace-header, .entry-head, .sticky-save { display:flex; align-items:center; justify-content:space-between; gap:20px; }
.title-row { display:flex; align-items:center; gap:18px; }.title-row h1 { margin:0; }.visibility-choice { display:flex; align-items:center; gap:18px; border:0; padding:0; margin:20px 0; }.visibility-choice legend { color:var(--brand-strong); font-weight:700; margin-right:8px; }.visibility-choice label { display:flex; align-items:center; gap:6px; font-weight:600; }.visibility-choice input { width:auto; }
.title-row > #run-title, .title-row > #edit-title, .title-row > .title-edit-actions { display:none; }
.evaluation-title-field { display:grid; gap:6px; min-width:min(620px,65vw); color:var(--brand-strong); font-weight:700; }
.evaluation-title-field input { width:100%; border:1px solid #cfc4da; border-radius:7px; padding:11px 12px; background:white; color:var(--ink); font:inherit; font-size:18px; font-weight:700; }
.evaluation-title-field input[readonly] { background:#f7f4fa; color:var(--muted); }
.title-edit-actions { display:inline-flex; gap:6px; }.icon-button { border:0; border-radius:50%; width:28px; height:28px; font-size:18px; cursor:pointer; }.title-accept { color:#176b42; background:#dff4e8; }.title-reject { color:#9e2c35; background:#fbe3e5; }.minimize-button { display:block; margin:12px auto; border:0; background:none; color:var(--brand); cursor:pointer; font-weight:700; }
.portal-status-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:14px; margin:28px 0 18px; }
.status-card { padding:18px; border:1px solid var(--line); border-radius:10px; background:#fff; display:grid; gap:6px; }
.status-card strong { font-size:22px; color:var(--brand-strong); }
.status-card small, .portal-next-step p { color:var(--muted); }
.portal-next-step { padding:20px; border-left:4px solid var(--brand); background:#f8f5fb; margin-bottom:34px; }
@media (max-width: 800px) { .portal-status-grid { grid-template-columns:repeat(2,1fr); } }
.evaluation-dashboard-head h2 { margin:0; font-size:30px; }
.evaluation-list { display:grid; gap:10px; margin:24px 0 38px; }
.evaluation-list-header { display:grid; grid-template-columns:12px minmax(240px,1fr) minmax(220px,.7fr) 110px; gap:16px; padding:0 20px; color:var(--muted); font-size:12px; font-weight:800; text-transform:uppercase; letter-spacing:.04em; }
.evaluation-row { display:grid; grid-template-columns:12px minmax(240px,1fr) minmax(220px,.7fr) 70px; align-items:center; gap:16px; padding:18px 20px; border:1px solid var(--line); border-radius:10px; background:white; }
.evaluation-row:hover { border-color:var(--brand); box-shadow:0 8px 24px rgba(63,29,104,.08); }
.evaluation-row small { display:block; margin-top:4px; color:var(--muted); }
.rubric-label { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.status-dot { width:10px; height:10px; border-radius:50%; background:#b7adbf; }
.status-completed { background:#2f8a68; } .status-in-progress { background:#d09a1b; }
.score { color:var(--brand-strong); font-size:22px; text-align:right; }
.empty-state { padding:42px; border:1px dashed var(--line); border-radius:10px; text-align:center; background:white; color:var(--muted); }
.portal-topics { border-top:1px solid var(--line); padding-top:24px; }
.portal-topics > summary { cursor:pointer; color:var(--brand); font-weight:700; }
.evaluation-workspace { max-width:none; width:100%; margin:0; padding:18px 0 48px; }
.workspace-header { align-items:flex-end; padding:12px 0 22px; }
.workspace-header h1 { margin:4px 0 0; font-size:34px; }
.back-link { display:inline-block; margin-bottom:20px; color:var(--brand); font-weight:700; }
.run-meta { display:flex; align-items:center; gap:10px; color:var(--muted); font-size:13px; }
.status-pill { padding:5px 10px; border-radius:20px; background:#eee7f7; color:var(--brand-strong); font-weight:700; }
.notice { margin-bottom:16px; padding:12px 16px; border-left:4px solid var(--green); background:#eaf6f1; color:#205548; }
.evaluation-form label { display:grid; gap:7px; color:var(--brand-strong); font-weight:700; }
.evaluation-form input, .evaluation-form textarea, .evaluation-form select { width:100%; border:1px solid #cfc4da; border-radius:7px; padding:11px 12px; background:white; color:var(--ink); font:inherit; line-height:1.5; }
.evaluation-form textarea { resize:vertical; font-family:ui-monospace, SFMono-Regular, Consolas, monospace; font-size:14px; }
.raw-prompt { margin:12px 0; background:#f7f4fa !important; color:#493b58 !important; white-space:pre-wrap; }
.markdown-preview { margin-top:12px; padding:20px; border:1px solid var(--line); border-radius:8px; background:#fff; line-height:1.65; overflow:auto; }
.markdown-preview h1, .markdown-preview h2, .markdown-preview h3, .markdown-preview h4 { color:var(--brand-strong); margin:1em 0 .45em; }
.markdown-preview p { margin:.65em 0; }.markdown-preview li { margin:.3em 0; }.markdown-preview code { padding:2px 5px; background:#f0ebf5; border-radius:4px; }
.markdown-preview table { width:100%; border-collapse:collapse; margin:1em 0; }.markdown-preview td { border:1px solid var(--line); padding:8px; vertical-align:top; }
.preview-empty { color:var(--muted); font-style:italic; }
.evaluation-form textarea:focus, .evaluation-form input:focus, .evaluation-form select:focus { outline:3px solid rgba(125,75,195,.18); border-color:var(--focus); }
.workflow-card[hidden] { display:none; }.stepper a.active { background:#f1eafa; color:var(--brand-strong); font-weight:700; }
.title-field { max-width:640px; margin-bottom:18px; }
.stepper { position:sticky; top:0; z-index:4; display:grid; grid-template-columns:repeat(6,1fr); margin-bottom:18px; border:1px solid var(--line); border-radius:10px; background:white; box-shadow:0 8px 20px rgba(36,26,49,.06); overflow:hidden; }
.stepper a { display:flex; align-items:center; justify-content:center; gap:7px; padding:12px 6px; color:var(--muted); font-size:12px; border-right:1px solid var(--line); }
.stepper a:last-child { border:0; }.stepper b { display:grid; place-items:center; width:22px; height:22px; border-radius:50%; background:#eee7f7; color:var(--brand); }
.workflow-card { scroll-margin-top:78px; display:grid; grid-template-columns:72px minmax(0,1fr); margin-bottom:18px; border:1px solid var(--line); border-radius:12px; background:white; overflow:hidden; }
.step-number { padding:28px 16px; background:var(--brand-deep); color:var(--accent-strong); font-size:18px; font-weight:800; text-align:center; }
.step-content { padding:28px 30px; }.step-content h2 { margin:0 0 6px; font-size:26px; }.step-content > p:not(.eyebrow) { margin-top:0; color:var(--muted); }
.step-toolbar, .result-toolbar { position:sticky; top:58px; z-index:3; display:grid; grid-template-columns:minmax(220px,.7fr) minmax(500px,1.3fr); align-items:end; gap:14px; margin:14px 0 20px; padding:14px; border:1px solid var(--line); border-radius:9px; background:rgba(255,255,255,.98); box-shadow:0 5px 14px rgba(36,26,49,.08); }
.commentary-toolbar { position:sticky; top:58px; z-index:2; display:grid; grid-template-columns:minmax(210px,.65fr) minmax(500px,1.35fr); align-items:end; gap:12px; margin:-4px -4px 16px; padding:12px; border:1px solid var(--line); border-radius:8px; background:rgba(255,255,255,.98); box-shadow:0 4px 12px rgba(36,26,49,.07); }
.step-actions, .result-toolbar { display:flex; align-items:end; gap:8px; flex-wrap:wrap; }
.step-actions .button, .result-toolbar .button { margin:0; white-space:nowrap; }
.saved-content-select { min-width:190px; flex:1; }
.result-toolbar { grid-template-columns:1fr; justify-content:flex-start; }
.overall-score-field { max-width:180px; }
.button-secondary-dark { border:1px solid var(--brand); background:white; color:var(--brand); }
.integration-note { padding:12px 14px; border-radius:7px; background:#fbf7ec; color:#695313 !important; }
.commentary-entry { margin:14px 0; padding:18px; border:1px solid var(--line); border-radius:8px; background:#faf8fc; }
.resource-lookup { display:grid; grid-template-columns:minmax(230px,.8fr) minmax(260px,1fr) auto; align-items:end; gap:12px; margin:16px 0; padding:16px; border:1px solid var(--line); border-radius:9px; background:#f7f4fa; }
.resource-lookup .button { margin:0; white-space:nowrap; }.resource-lookup [role="status"] { grid-column:1/-1; color:var(--muted); }
.entry-head { align-items:end; margin-bottom:12px; }.entry-head label { flex:1; }.text-button { border:0; background:transparent; color:#9b382f; cursor:pointer; padding:10px; }
.new-version { margin-top:14px; padding:15px; border:1px solid var(--line); border-radius:8px; }.new-version summary { cursor:pointer; color:var(--brand); font-weight:700; }.new-version label { margin-top:14px; }
.result-grid { display:grid; grid-template-columns:180px minmax(0,1fr); gap:18px; align-items:start; }
.sticky-save { position:fixed; left:280px; right:0; bottom:0; z-index:10; padding:5px 12px; border:1px solid var(--line); border-radius:0; background:rgba(255,255,255,.97); box-shadow:0 4px 16px rgba(36,26,49,.14); color:var(--muted); min-height:32px; }
.header-visibility { margin:0 14px 0 0; }.run-meta { display:flex; align-items:center; gap:12px; }
.sticky-save .button { margin:0; }

@media (max-width: 820px) {
    .site-header,
    .menu-bar {
        padding: 0 16px;
    }

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

    .account-menu {
        margin-left: 0;
    }

    .app-shell {
        grid-template-columns: 1fr;
    }

    .left-nav {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .main-content {
        padding: 20px;
    }

    .app-shell-public .main-content {
        padding: 0;
    }

    .hero {
        grid-template-columns: 1fr;
        min-height: auto;
        padding: 28px;
    }

    .hero h1,
    .section h1 {
        font-size: 32px;
    }

    .hero h1 {
        font-size: 38px;
    }

    .discount-badge {
        font-size: 42px;
    }
    .evaluation-list-header { display:none; }.evaluation-row { grid-template-columns:10px 1fr 54px; }.evaluation-row > span:nth-child(3) { display:none; }
    .workspace-header, .evaluation-dashboard-head { align-items:flex-start; flex-direction:column; }
    .stepper { overflow-x:auto; grid-template-columns:repeat(6,110px); }.stepper a { justify-content:flex-start; }
    .workflow-card { grid-template-columns:1fr; }.step-number { padding:8px 16px; text-align:left; }.step-content { padding:22px 18px; }
    .step-toolbar { top:58px; grid-template-columns:1fr; }.step-actions { align-items:stretch; }.saved-content-select { min-width:100%; }
    .commentary-toolbar { grid-template-columns:1fr; }.evaluation-title-field { min-width:0; width:100%; }.title-row { width:100%; flex-wrap:wrap; }
    .resource-lookup { grid-template-columns:1fr; }.resource-lookup [role="status"] { grid-column:1; }
    .result-grid { grid-template-columns:1fr; }.sticky-save { left:0; }.sticky-save span { display:none; }
}
