/* ─── WellPrint — base styles ─────────────────────────────── */
:root {
    --bg:        #f6f2ea;
    --surface:   #ffffff;
    --ink:       #2b3a2f;
    --muted:     #7a8678;
    --accent:    #4a7a5a;
    --accent-2:  #c17a3a;
    --error:     #c7442e;
    --success:   #2e7a4e;
    --border:    #d8d2c4;
    --radius:    8px;
    --shadow:    0 1px 3px rgba(0,0,0,0.06);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Public shell (landing/login) ───────────────────────── */
.site-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 24px; background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.site-header .brand { font-size: 20px; font-weight: 600; color: var(--ink); }
.brand-mark { color: var(--accent-2); }
.site-header nav { display: flex; gap: 16px; align-items: center; }
.site-main { max-width: 960px; margin: 0 auto; padding: 32px 24px; }
.site-footer { text-align: center; padding: 24px; color: var(--muted);
    border-top: 1px solid var(--border); margin-top: 48px; }

/* ─── App shell (logged-in: sidebar + content) ──────────── */
body.app-shell {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 100vh;
    background: #faf7ef;
}

.sidebar {
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 20px 0 16px;
    display: flex; flex-direction: column;
    position: sticky; top: 0; height: 100vh;
    overflow-y: auto;
}
.sidebar .brand {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 0 20px 20px; border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}
.sidebar .brand-mark { font-size: 24px; color: var(--accent-2); line-height: 1; }
.sidebar .brand-text { display: flex; flex-direction: column; }
.sidebar .brand-text strong { font-size: 18px; color: var(--ink); line-height: 1.1; }
.sidebar .brand-text small { font-size: 10px; letter-spacing: 0.1em;
    color: var(--muted); text-transform: uppercase; margin-top: 2px; }

.side-section { padding: 0 12px; margin-bottom: 20px; }
.side-label {
    font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--muted); padding: 0 8px; margin-bottom: 6px;
}
.side-link {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; border-radius: 6px;
    color: var(--ink); font-size: 14px;
    position: relative;
}
.side-link:hover { background: #f0ebdd; text-decoration: none; }
.side-link.is-active { background: #e8f0e4; color: var(--accent); font-weight: 600; }
.side-link.is-disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.side-icon { font-size: 15px; width: 18px; text-align: center; }
.side-plus {
    margin-left: auto; background: var(--accent); color: #fff;
    width: 20px; height: 20px; border-radius: 50%;
    text-align: center; font-size: 12px; line-height: 20px;
}
.side-badge {
    margin-left: auto; background: #ece7da; color: var(--muted);
    padding: 1px 8px; border-radius: 999px; font-size: 10px;
    text-transform: uppercase;
}

.side-footer {
    margin-top: auto; padding: 16px 20px 0;
    border-top: 1px solid var(--border);
}
.user-chip {
    display: flex; align-items: center; gap: 10px; margin-bottom: 8px;
}
.user-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--accent); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700;
}
.user-chip strong { display: block; font-size: 13px; }
.user-chip small { display: block; font-size: 11px; color: var(--muted); }

.app-main { padding: 0 32px 40px; min-width: 0; }
.app-topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 0 16px; border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}
.page-title { font-size: 22px; margin: 0; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.credits-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fff8e8; border: 1px solid #e8c9a0;
    padding: 5px 12px; border-radius: 999px;
    font-size: 13px; font-weight: 600; color: var(--accent-2);
}
.credits-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--accent-2);
}
.app-content { max-width: 1100px; }

/* Mobile: collapse sidebar */
@media (max-width: 720px) {
    body.app-shell { grid-template-columns: 1fr; }
    .sidebar { position: relative; height: auto; }
    .app-main { padding: 0 16px 32px; }
}

/* ─── Typography ─────────────────────────────────────────── */
h1 { font-size: 28px; margin: 0 0 12px; }
h2 { font-size: 20px; margin: 24px 0 12px; }
h3 { font-size: 16px; margin: 16px 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.big-stat { font-size: 36px; font-weight: 600; margin: 8px 0; }

/* ─── Forms + buttons ────────────────────────────────────── */
.form, .quiz { max-width: 480px; margin: 24px 0; }
.form label, .quiz label {
    display: block;
    margin: 12px 0;
    font-size: 14px;
    color: var(--ink);
}
.form input, .form select, .quiz input[type="text"], .quiz input[type="number"],
.quiz input[type="email"], .quiz input[type="password"], .quiz select {
    display: block;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 15px;
    margin-top: 4px;
    background: var(--surface);
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 15px;
    color: var(--ink);
    text-decoration: none;
    margin: 4px 2px;
}
.btn:hover { background: #ece7da; text-decoration: none; }
.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.btn-primary:hover { background: #3a6448; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

/* ─── Cards + grid ───────────────────────────────────────── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

/* ─── Stat grid (dashboard top row) ─────────────────────── */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 16px 18px;
}
.stat-label {
    font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--muted);
}
.stat-value {
    font-size: 36px; font-weight: 700; color: var(--ink);
    margin: 6px 0 4px; line-height: 1;
}
.stat-value-sm { font-size: 22px; font-weight: 600; }
.stat-meta {
    font-size: 12px; color: var(--muted);
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.stat-meta.is-good { color: var(--success); }

.chip {
    display: inline-block; padding: 2px 10px; border-radius: 999px;
    font-size: 11px; font-weight: 600;
}
.chip-green  { background: #d9ead1; color: var(--success); }
.chip-orange { background: #fde6c6; color: var(--accent-2); }
.chip-gray   { background: #ece7da; color: var(--muted); }
.chip-link   { background: transparent; color: var(--accent); padding-left: 0; }
.chip-link:hover { text-decoration: underline; }

/* ─── Two-column dash row ───────────────────────────────── */
.dash-row {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 16px;
}
@media (max-width: 920px) {
    .dash-row { grid-template-columns: 1fr; }
}

.panel {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 20px;
}
.panel-head {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 14px;
}
.panel-head h2 { margin: 0; font-size: 15px; }
.panel-chip {
    background: #fde6c6; color: var(--accent-2);
    padding: 3px 10px; border-radius: 999px;
    font-size: 11px; font-weight: 600;
}

/* ─── Pipeline (ordered list, vertical with step dots) ───── */
.pipeline { list-style: none; padding: 0; margin: 0; position: relative; }
.pipeline li {
    display: flex; gap: 14px; padding: 14px 0;
    border-bottom: 1px solid var(--border); position: relative;
}
.pipeline li:last-child { border-bottom: 0; }
.pipeline .step-dot {
    flex-shrink: 0;
    width: 28px; height: 28px; border-radius: 50%;
    background: #ece7da; color: var(--muted);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700;
}
.pipeline li.is-done .step-dot { background: var(--success); color: #fff; }
.pipeline li.is-running .step-dot { background: var(--accent-2); color: #fff; animation: pulse 1.5s infinite; }
.pipeline li strong { display: block; font-size: 14px; margin-bottom: 2px; }
.pipeline li p { margin: 0 0 6px; font-size: 13px; }

@keyframes pulse {
    0%,100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

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

/* ─── Tier panel ────────────────────────────────────────── */
.tier-panel .tier-card {
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: 16px; margin-bottom: 12px;
    background: #faf7ef;
}
.tier-panel .tier-card:last-child { margin-bottom: 0; }
.tier-panel .tier-card.is-current {
    border-color: var(--accent); background: #e8f0e4;
}
.tier-panel .tier-card-highlight { border-color: var(--accent-2); }
.tier-head {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 4px;
}
.tier-eyebrow {
    font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--muted); font-weight: 700;
}
.tier-price { font-size: 22px; font-weight: 700; margin: 2px 0 10px; color: var(--ink); }
.tier-list {
    list-style: none; padding: 0; margin: 10px 0 14px;
    font-size: 13px; color: var(--ink);
}
.tier-list li {
    padding: 3px 0 3px 18px; position: relative;
}
.tier-list li::before {
    content: '✓'; position: absolute; left: 0; color: var(--success); font-weight: 700;
}
.btn-wide { display: block; width: 100%; text-align: center; }

/* ─── Hero + auth ────────────────────────────────────────── */
.hero { text-align: center; padding: 32px 0; }
.hero h1 { font-size: 32px; line-height: 1.25; }
.lede { color: var(--muted); font-size: 17px; max-width: 540px; margin: 12px auto; }
.auth-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    max-width: 420px;
    margin: 24px auto;
    box-shadow: var(--shadow);
}
.tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tab {
    flex: 1;
    text-align: center;
    padding: 10px;
    color: var(--muted);
    border-bottom: 2px solid transparent;
}
.tab.is-active { color: var(--accent); border-color: var(--accent); }

.feature-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 48px;
}
.feature { text-align: center; padding: 16px; }

/* ─── Quiz ───────────────────────────────────────────────── */
.quiz-step {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    background: var(--surface);
    margin: 16px 0;
}
.quiz-step.is-hidden { display: none; }
.quiz-step legend { font-size: 18px; font-weight: 600; padding: 0 8px; }
.step-num {
    display: inline-block;
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    background: var(--accent);
    color: #fff;
    border-radius: 50%;
    margin-right: 8px;
    font-size: 13px;
}
.radio-grid { display: grid; gap: 10px; margin: 16px 0; }
.radio-grid label {
    display: flex;
    flex-direction: column;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
}
.radio-grid label:hover { background: #f0ebdd; }
.radio-grid input { margin-right: 8px; }
.radio-grid strong { display: block; }
.radio-grid small { color: var(--muted); font-size: 12px; margin-top: 2px; }

.disclaimer {
    margin: 20px 0;
    padding: 14px 16px;
    background: #fff8e8;
    border-left: 3px solid var(--accent-2);
    border-radius: var(--radius);
    font-size: 13px;
}
.disclaimer label { display: block; margin-top: 10px; font-weight: 600; }

/* ─── Progress ───────────────────────────────────────────── */
.progress-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin: 24px 0;
    text-align: center;
}
.progress-bar {
    height: 10px;
    background: #ece7da;
    border-radius: 999px;
    overflow: hidden;
    margin: 16px 0;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) 100%);
    transition: width 0.4s ease;
}

.day-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
    margin: 20px 0;
}
.day-tile {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    text-align: center;
}
.day-tile.is-ready { background: #e8f0e4; border-color: var(--accent); }
.day-tile.is-pending { color: var(--muted); }
.day-tile.is-ticked { background: #d9ead1; border-color: var(--success); }
.day-tile { position: relative; gap: 2px; padding: 4px; }
.day-num { font-size: 16px; font-weight: 600; }

.btn-icon {
    background: transparent; border: 0; cursor: pointer;
    font-size: 14px; color: var(--accent); padding: 2px 6px;
}
.btn-icon:hover { color: var(--accent-2); }
.btn-tick {
    position: absolute; top: 2px; right: 2px;
    background: transparent; border: 0; cursor: pointer;
    font-size: 16px; color: var(--muted); padding: 0 4px;
}
.day-tile.is-ticked .btn-tick { color: var(--success); }

.soul-card { background: linear-gradient(135deg, #faf5e8 0%, #fff 100%); }
.soul-ages {
    font-size: 24px; display: flex; align-items: center; gap: 10px;
    margin: 10px 0;
}
.soul-ages strong { font-size: 36px; color: var(--muted); }
.soul-now { font-size: 36px; font-weight: 700; color: var(--accent); }
.soul-ages .arrow { color: var(--accent-2); font-size: 24px; }
.rank-line { margin-top: 10px; color: var(--accent); font-weight: 600; }

.inline-form { display: flex; gap: 8px; align-items: flex-end; margin-top: 10px; }
.inline-form input { width: 120px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius); }

/* ─── Tables ─────────────────────────────────────────────── */
.plans-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
}
.plans-table th, .plans-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}
.plans-table th { background: #efeadb; font-size: 13px; }

.plan-list { list-style: none; padding: 0; }
.plan-list li { padding: 8px 0; border-bottom: 1px solid var(--border); }
.plan-list li:last-child { border: 0; }

.status {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12px;
    background: #ece7da;
    color: var(--muted);
}
.status-pdf_ready, .status-pdf_done { background: #d9ead1; color: var(--success); }
.status-error { background: #fadbd4; color: var(--error); }

/* ─── Pricing ────────────────────────────────────────────── */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 24px;
}
.price-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}
.price { font-size: 24px; font-weight: 600; margin: 8px 0; }
.price-card ul { padding-left: 20px; color: var(--muted); font-size: 14px; }

/* ─── Flash ──────────────────────────────────────────────── */
.flash {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin: 16px 0;
    font-size: 14px;
}
.flash-info    { background: #e4ecf2; color: #2b5a7a; }
.flash-error   { background: #fadbd4; color: var(--error); }
.flash-success { background: #d9ead1; color: var(--success); }

.is-hidden { display: none !important; }

/* ─── Community ─────────────────────────────────────────── */
.community-head { margin-bottom: 20px; }
.group-progress { max-width: 540px; }
.countdown { font-size: 14px; color: var(--accent-2); margin-top: 6px; }

.community-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 20px 0; }
.tab-btn {
    background: transparent; border: 0; padding: 10px 20px;
    font-size: 14px; cursor: pointer; color: var(--muted);
    border-bottom: 2px solid transparent;
}
.tab-btn.is-active { color: var(--accent); border-color: var(--accent); }

.feed { list-style: none; padding: 0; margin: 0; }
.feed-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 10px;
}
.feed-item .who-line { font-size: 14px; }
.feed-item .deed-line { font-size: 15px; margin: 6px 0; }
.feed-item .cheer-btn {
    background: #fff8e8; border-color: #e8c9a0; color: var(--accent-2);
}
.feed-item .cheer-btn.is-cheered {
    background: var(--accent-2); color: #fff; border-color: var(--accent-2);
}
.feed-item .cheer-btn:disabled { opacity: 0.5; }

.lb-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 16px; margin-bottom: 12px;
}
.lb-list { list-style: none; padding: 0; margin: 10px 0 0; }
.lb-list li {
    display: grid; grid-template-columns: 40px 1fr auto;
    padding: 6px 0; border-bottom: 1px solid var(--border); gap: 10px;
}
.lb-list li:last-child { border: 0; }
.lb-list .rank { font-weight: 600; color: var(--muted); }
.lb-list .score { color: var(--accent); font-weight: 600; }

/* ─── PLR ───────────────────────────────────────────────── */
.plr-head { margin-bottom: 24px; }
.plr-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin: 16px 0;
}
.plr-grid .card { margin: 0; }
.plr-grid code { font-size: 12px; background: #ece7da; padding: 2px 4px; border-radius: 3px; }

.style-picker {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin: 16px 0;
    background: #faf7ef;
}
.style-picker legend { padding: 0 6px; font-weight: 600; }
.style-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 8px;
    margin-top: 10px;
}
.style-grid label {
    display: flex; flex-direction: column; align-items: flex-start;
    padding: 10px; border: 1px solid var(--border); border-radius: var(--radius);
    cursor: pointer; background: var(--surface);
}
.style-grid label:hover { background: #f0ebdd; }
.style-grid input { margin-bottom: 6px; }
.style-grid strong { font-size: 14px; }
.style-grid small { color: var(--muted); font-size: 11px; }
.swatch { display: inline-block; width: 100%; height: 24px; border-radius: 4px; margin: 4px 0; }
.swatch-natural { background: linear-gradient(90deg, #f4f0e8 0%, #a2b89a 100%); }
.swatch-warm    { background: linear-gradient(90deg, #fdf4e8 0%, #c25a2a 100%); }
.swatch-elegant { background: linear-gradient(90deg, #faf7fb 0%, #6e5a8a 100%); }
.swatch-serene  { background: linear-gradient(90deg, #f0f6f8 0%, #4a9cbc 100%); }

.lang-row {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}
.lang-buttons { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.lang-buttons .btn:disabled { opacity: 0.5; cursor: not-allowed; }
#lang-downloads { margin-top: 12px; }
#lang-downloads .btn { margin-top: 6px; }
