:root {
    --reader-scale: 1;
    --ink: #25231f;
    --muted: #68645c;
    --paper: #fffdf8;
    --page: #f4efe5;
    --accent: #426443;
    --accent-dark: #2f4d30;
    --border: #d8d0c2;
    --error-bg: #fff0ee;
    --error-border: #c44336;
    color-scheme: light;
}

* { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    background: var(--page);
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--page);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input { font: inherit; }

.page-shell {
    width: min(100%, 780px);
    margin: 0 auto;
    min-height: 100vh;
    background: var(--paper);
}

.home-panel {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 32px 22px max(32px, env(safe-area-inset-bottom));
}

.brand-mark {
    font-size: 3.25rem;
    line-height: 1;
    margin-bottom: 14px;
}

h1, h2 {
    font-family: Georgia, "Times New Roman", serif;
    line-height: 1.15;
}

.home-panel h1 {
    margin: 0;
    font-size: clamp(2.35rem, 10vw, 4.5rem);
}

.intro {
    margin: 14px 0 28px;
    max-width: 32rem;
    color: var(--muted);
    font-size: 1.15rem;
    line-height: 1.55;
}

form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
}

input[type="url"] {
    display: block;
    width: 100%;
    min-height: 56px;
    padding: 12px 14px;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: white;
    color: var(--ink);
    font-size: 1rem;
}

input[type="url"]:focus {
    border-color: var(--accent);
    outline: 3px solid rgba(66, 100, 67, 0.2);
}

.primary-button {
    width: 100%;
    min-height: 58px;
    margin-top: 14px;
    border: 0;
    border-radius: 12px;
    color: white;
    background: var(--accent);
    font-size: 1.15rem;
    font-weight: 800;
    cursor: pointer;
}

.primary-button:hover,
.primary-button:focus-visible { background: var(--accent-dark); }

.error-box {
    margin: 0 0 20px;
    padding: 14px;
    border-left: 5px solid var(--error-border);
    border-radius: 8px;
    background: var(--error-bg);
    line-height: 1.45;
}

.privacy-note {
    margin-top: 18px;
    color: var(--muted);
    font-size: 0.9rem;
}

.top-actions {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: max(10px, env(safe-area-inset-top)) 16px 10px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 253, 248, 0.96);
    backdrop-filter: blur(10px);
}

.back-link,
.source-footer a {
    color: var(--accent-dark);
    font-weight: 700;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

.text-controls {
    display: flex;
    gap: 8px;
}

.text-controls button,
.subtle-button {
    min-width: 48px;
    min-height: 44px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: white;
    color: var(--ink);
    font-weight: 800;
    cursor: pointer;
}

.reading-area {
    padding: 28px 20px max(48px, env(safe-area-inset-bottom));
    font-family: Georgia, "Times New Roman", serif;
    font-size: calc(1.12rem * var(--reader-scale));
    line-height: 1.65;
}

.reading-area h1 {
    margin: 4px 0 16px;
    font-size: calc(clamp(2rem, 9vw, 3.7rem) * var(--reader-scale));
}

.reading-area h2 {
    margin: 42px 0 16px;
    font-size: calc(1.65rem * var(--reader-scale));
}

.eyebrow {
    margin: 0;
    color: var(--accent-dark);
    font-family: system-ui, sans-serif;
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.description {
    color: var(--muted);
    font-style: italic;
}

.recipe-image {
    display: block;
    width: 100%;
    max-height: 420px;
    margin: 22px 0;
    border-radius: 14px;
    object-fit: cover;
}

.recipe-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 24px 0;
    font-family: system-ui, sans-serif;
}

.recipe-facts div {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
}

.recipe-facts dt {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
}

.recipe-facts dd {
    margin: 3px 0 0;
    font-weight: 750;
}

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
}

.subtle-button {
    min-height: 38px;
    padding: 6px 10px;
    font-family: system-ui, sans-serif;
    font-size: 0.82rem;
}

.ingredient-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.ingredient-list li {
    border-bottom: 1px solid var(--border);
}

.ingredient-list label {
    display: grid;
    grid-template-columns: 30px 1fr;
    gap: 10px;
    align-items: start;
    padding: 13px 2px;
    cursor: pointer;
}

.ingredient-list input {
    width: 22px;
    height: 22px;
    margin: 3px 0 0;
    accent-color: var(--accent);
}

.ingredient-list input:checked + span {
    color: var(--muted);
    text-decoration: line-through;
}

.instruction-list {
    padding-left: 1.65em;
}

.instruction-list li {
    margin: 0 0 20px;
    padding-left: 6px;
}

.instruction-list li::marker {
    color: var(--accent-dark);
    font-weight: 900;
}

.article-content a { color: var(--accent-dark); }
.article-content img, .article-content video, .article-content iframe { display: none; }

.source-footer {
    margin-top: 52px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    font-family: system-ui, sans-serif;
    font-size: 0.9rem;
    line-height: 1.5;
}

.source-footer p { margin: 0 0 8px; }

@media (min-width: 700px) {
    .home-panel { padding-inline: 64px; }
    .reading-area { padding-inline: 64px; }
    .recipe-facts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media print {
    .top-actions, .subtle-button { display: none; }
    .page-shell { width: 100%; }
    .reading-area { padding: 0; font-size: 11pt; }
    .ingredient-list input { display: none; }
    .ingredient-list label { grid-template-columns: 1fr; }
}
