:root {
    --bg: #f7f3ec;
    --fg: #132218;
    --accent: #2f6b4f;
    --accent-soft: #e3f0e7;
    --muted: #59655c;
    --border: #d7d0c5;
    --shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
    --font-body: "Inter", "Source Sans Pro", system-ui, -apple-system, sans-serif;
    --font-title: "Cormorant Garamond", Georgia, serif;
    --panel: #ffffff;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: var(--font-body);
    background: radial-gradient(circle at 20% 20%, rgba(47, 107, 79, 0.08), transparent 35%), var(--bg);
    color: var(--fg);
    direction: ltr;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: none; }
header {
    padding: 1.5rem 1.5rem 1rem;
    background: linear-gradient(135deg, #1f3d2b, #2f6b4f);
    color: #f8f5f0;
    position: relative;
    overflow: hidden;
}
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    max-width: 1180px;
    margin: 0 auto;
}
.brand {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    color: #fff;
    text-decoration: none;
}
.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(255,255,255,0.12);
    display: grid;
    place-items: center;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.brand-title {
    font-family: var(--font-title);
    font-weight: 600;
    font-size: 1.4rem;
    margin: 0;
}
.brand-sub {
    margin: 0.15rem 0 0;
    color: rgba(255,255,255,0.85);
    font-size: 0.95rem;
}
.lang-switch {
    text-align: right;
    min-width: 220px;
}
.lang-switch label {
    display: block;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.8);
    margin-bottom: 0.4rem;
}
.lang-switch select {
    width: 100%;
    padding: 0.55rem 2.2rem 0.55rem 0.75rem;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.5);
    background-color: rgba(255,255,255,0.9);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23132218' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 7l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
    background-size: 12px;
    color: var(--fg);
    font-weight: 600;
    appearance: none;
}
body[dir="rtl"] .lang-switch select {
    padding: 0.55rem 0.75rem 0.55rem 2.2rem;
    background-position: left 0.7rem center;
}
.lang-switch select:focus {
    outline: 2px solid rgba(255,255,255,0.85);
    box-shadow: 0 0 0 2px rgba(47, 107, 79, 0.35);
}
main {
    max-width: 1180px;
    margin: 12px auto 0;
    padding: 0 1.5rem 2.5rem;
    width: 100%;
    flex: 1;
}
.page-shell {
    background: var(--panel, #fff);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.75rem;
    box-shadow: var(--shadow);
}
.page-title {
    margin: 0 0 0.35rem;
    font-family: var(--font-title);
    font-weight: 600;
    color: var(--accent);
}
.page-subtitle {
    margin: 0 0 1rem;
    color: var(--muted);
    font-size: 0.95rem;
}
h2 {
    margin: 0 0 0.5rem;
    font-family: var(--font-title);
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 0.3px;
}
p { line-height: 1.65; color: var(--muted); margin: 0.4rem 0; }
.lead { color: #365842; margin-bottom: 1rem; }
.pill-row {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    align-items: center;
    margin: 0.8rem 0 1.2rem;
}
.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--fg);
    font-weight: 600;
    font-size: 0.95rem;
}
.pill.accent {
    background: var(--accent-soft);
    border-color: #c7e3d1;
    color: #1f3d2b;
}
.section-title {
    margin: 1.2rem 0 0.4rem;
    font-size: 1em;
    font-weight: 700;
    color: #1f3d2b;
}
.ai-disclosure {
    font-size: 0.88rem;
    font-style: italic;
    color: var(--muted);
    border-left: 3px solid var(--border);
    padding-left: 0.75rem;
    margin: 1rem 0 1.4rem;
}
body[dir="rtl"] .ai-disclosure { border-left: none; border-right: 3px solid var(--border); padding-left: 0; padding-right: 0.75rem; }
.day-nav {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin: 1.6rem 0 0.4rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    font-weight: 600;
}
body[dir="rtl"] .day-nav { flex-direction: row-reverse; }
.muted-date { color: var(--muted); font-size: 0.9em; }
.jump-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin: 0.4rem 0 1.2rem;
    font-size: 0.9rem;
}
.jump-nav a { color: var(--accent); }
.lang-note {
    margin: 0.5rem 0 0;
    font-size: 0.82rem;
    color: rgba(255,255,255,0.75);
    text-align: inherit;
}
pre {
    background: #e6efe9;
    border-radius: 12px;
    padding: 1rem 1.1rem;
    border: 1px solid #c9d9cf;
    line-height: 1.55;
    font-family: "Source Serif Pro", "Georgia", serif;
    white-space: pre-wrap;
    direction: inherit;
    text-align: start;
}
.muted-box {
    border: 1px dashed var(--border);
    border-radius: 12px;
    padding: 1rem;
    color: var(--muted);
    background: #faf7f2;
}
footer {
    border-top: 1px solid var(--border);
    margin-top: 2rem;
    padding: 1.4rem 1.5rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    color: var(--muted);
    font-size: 0.95rem;
}
.footer-links {
    display: flex;
    gap: 1.2rem;
    flex-wrap: wrap;
}
select option { color: var(--fg); background: #fff; }
body[dir="rtl"] .topbar { flex-direction: row-reverse; }
body[dir="rtl"] .brand { flex-direction: row-reverse; }
body[dir="rtl"] footer { flex-direction: row-reverse; text-align: right; }
.rich-text { font-family: "Source Serif Pro", "Georgia", serif; color: var(--fg); line-height: 1.65; }
.rich-text h1, .rich-text h2, .rich-text h3 { margin: 0.8rem 0 0.45rem; color: var(--accent); font-family: var(--font-title); }
.rich-text p { margin: 0.35rem 0; }
.rich-text ul { padding-left: 1.3rem; margin: 0.5rem 0 0.5rem 1rem; }
.rich-text li { margin: 0.25rem 0; line-height: 1.55; }
.rich-text code { background: #eef4ef; padding: 0.1rem 0.25rem; border-radius: 4px; font-size: 0.92em; }
.rich-text img { max-width: 220px; width: 100%; height: auto; display: block; margin: 0.8rem 0; }
.signature-line {
    margin-top: 1.2rem;
    font-weight: 600;
    color: #1f3d2b;
    font-family: var(--font-title);
}
.section-card {
    background: #e6efe9;
    border: 1px solid #c9d9cf;
    border-radius: 12px;
    padding: 1.1rem 1.25rem;
    margin: 1rem 0;
}
.interpretation-card { padding: 0.6rem 0.8rem; }
details.interpretation-toggle {
    margin: 0;
}
details.interpretation-toggle summary {
    cursor: pointer;
    font-weight: 700;
    color: var(--fg);
    padding: 0.4rem 0.2rem;
    border-radius: 6px;
    background: transparent;
    border: none;
    transition: color 0.15s ease;
    list-style: none;
}
details.interpretation-toggle summary::marker,
details.interpretation-toggle summary::-webkit-details-marker {
    display: none;
}
details.interpretation-toggle summary::after {
    content: '▾';
    float: right;
    color: var(--muted);
    transition: transform 0.15s ease;
}
details.interpretation-toggle[open] summary::after {
    transform: rotate(180deg);
}
details.interpretation-toggle summary:hover {
    background: #e4efe7;
}
.reflection-card {
    border-left: 6px solid #2f6b4f;
    padding-left: 1.25rem;
}
.chatgpt-cta {
    margin-top: 2rem;
    padding: 1rem 1.25rem;
    border: 1px dashed var(--border);
    border-radius: 12px;
    background: #f3f8f4;
}
.chatgpt-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: var(--accent);
    color: #fff;
    padding: 0.65rem 1rem;
    border-radius: 10px;
    font-weight: 700;
    box-shadow: 0 6px 18px rgba(47, 107, 79, 0.25);
}
.chatgpt-btn:hover { filter: brightness(0.95); }
.chatgpt-btn.is-disabled {
    background: #9fb5a8;
    cursor: not-allowed;
    box-shadow: none;
}
.chatgpt-subtext { margin: 0.35rem 0 0.15rem; color: var(--fg); }
.chatgpt-privacy { margin: 0; color: var(--muted); font-size: 0.95rem; }
.chatgpt-note { margin: 0.4rem 0; color: #8a5b00; font-weight: 600; }
.chatgpt-fallback {
    margin-top: 0.75rem;
    border: 1px solid #e0cbb0;
    background: #fff7ec;
    padding: 0.75rem;
    border-radius: 10px;
}
.chatgpt-fallback textarea {
    width: 100%;
    min-height: 160px;
    border-radius: 8px;
    border: 1px solid #e0cbb0;
    padding: 0.75rem;
    font-family: "Source Serif Pro", "Georgia", serif;
    resize: vertical;
    background: #fff;
}
.chatgpt-copy-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 0.6rem;
}
.chatgpt-copy-btn {
    background: #f3a34d;
    color: #2d1b06;
    border: none;
    padding: 0.5rem 0.85rem;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
}
.chatgpt-copy-btn:hover { filter: brightness(0.97); }
.chatgpt-copy-state { color: #1f3d2b; font-weight: 600; }
.hidden { display: none !important; }
input[type="date"] {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.35rem 0.5rem;
    background: #fff;
    color: var(--fg);
    font-weight: 600;
}
input[type="date"]:focus {
    outline: 2px solid #c7e3d1;
    box-shadow: 0 0 0 2px rgba(47,107,79,0.25);
}
@media (max-width: 640px) {
    header { padding: 1.1rem 1rem 0.75rem; }
    .topbar { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
    .lang-switch { width: 100%; min-width: auto; text-align: left; }
    .lang-switch select { width: 100%; }
    main { padding: 0 0.75rem 1.5rem; margin-top: 8px; }
    .page-shell { padding: 1.25rem; }
    .pill-row { flex-direction: column; align-items: stretch; gap: 0.5rem; }
    .pill { width: 100%; justify-content: space-between; }
    h2 { font-size: 1.35rem; }
    pre { font-size: 0.95rem; line-height: 1.5; }
    .rich-text { font-size: 0.97rem; line-height: 1.55; }
    footer { flex-direction: column; align-items: flex-start; padding: 1rem; gap: 0.5rem; }
    .footer-links { gap: 0.75rem; }
}
