/* =============================================
   Better Every Day — Personal Growth Workbook
   ============================================= */

:root {
    --primary:    #20354a;
    --primary-lt: #2c4f6e;
    --secondary:  #42715e;
    --sec-pale:   #e6eee9;
    --sec-mid:    #c2d8cb;
    --accent:     #b28a4a;
    --accent-pale:#f5eddc;
    --paper:      #faf8f2;
    --paper-alt:  #f1eee6;
    --surface:    #ffffff;
    --soft-blue:  #e8eef2;
    --soft-green: #e6eee9;
    --text-dark:  #252b30;
    --text-body:  #2e3338;
    --text-muted: #697178;
    --border:     #dcded9;
    --border-dk:  #b8bab4;
    --notice:     #7c5548;
    --notice-pale:#f7f0ee;
    --shadow:     0 2px 10px rgba(32,53,74,0.07);
    --radius:     7px;
    --radius-lg:  13px;
}

/* ---- Base ---- */
html { scroll-behavior: smooth; }
body {
    background: var(--paper);
    color: var(--text-body);
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    font-size: 1rem;
    line-height: 1.75;
}
section[id], article[id] { scroll-margin-top: 90px; }

h1,h2,h3,h4,h5,h6 {
    color: var(--text-dark);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.02em;
}
h1 { font-size: clamp(1.85rem,4vw,2.65rem); }
h2 { font-size: clamp(1.3rem,3vw,1.8rem); }
h3 { font-size: clamp(1.1rem,2vw,1.3rem); }

a { color: var(--primary); }
a:hover { color: var(--primary-lt); }

/* ---- Navbar ---- */
.site-nav {
    background: var(--surface);
    border-bottom: 2px solid var(--border);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1040;
}
.site-nav .navbar-brand {
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--primary) !important;
    letter-spacing: -0.03em;
}
.site-nav .navbar-brand .tagline {
    display: block;
    font-size: 0.66rem;
    font-weight: 400;
    color: var(--text-muted);
    line-height: 1;
    letter-spacing: 0;
}
.site-nav .nav-link {
    font-weight: 600;
    font-size: 0.86rem;
    color: var(--text-dark) !important;
    padding: 0.38rem 0.65rem !important;
    border-radius: var(--radius);
    transition: background 0.13s, color 0.13s;
}
.site-nav .nav-link:hover,
.site-nav .nav-link.active {
    background: var(--soft-green);
    color: var(--secondary) !important;
}
.site-nav .nav-link.active { font-weight: 700; }

/* ---- Breadcrumb ---- */
.breadcrumb-bar {
    background: var(--paper-alt);
    border-bottom: 1px solid var(--border);
    padding: 0.33rem 0;
    font-size: 0.78rem;
}
.breadcrumb-bar .breadcrumb { margin:0; background:none; padding:0; }
.breadcrumb-item a { color: var(--primary); text-decoration: none; font-weight: 500; }
.breadcrumb-item.active { color: var(--text-muted); }
.breadcrumb-item + .breadcrumb-item::before { color: var(--text-muted); }

/* ---- Hero ---- */
.hero-section {
    background: var(--surface);
    border-bottom: 2px solid var(--border);
    padding: 3.5rem 0 2.5rem;
}
.growth-dashboard {
    background: var(--paper);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.35rem;
    box-shadow: var(--shadow);
}
.dash-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--text-muted);
    margin-bottom: 0.6rem;
    display: block;
}
.dash-row {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.55rem 0.7rem;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 0.45rem;
    font-size: 0.82rem;
}
.dash-row:last-child { margin-bottom: 0; }
.dash-row .bi { font-size: 1rem; margin-top: 0.05rem; flex-shrink: 0; }
.dash-row strong { display: block; font-size: 0.78rem; font-weight: 700; color: var(--text-dark); margin-bottom: 0.1rem; }
.dash-row span { color: var(--text-muted); font-size: 0.78rem; }
.dash-row.priority  .bi { color: var(--primary); }
.dash-row.action    .bi { color: var(--secondary); }
.dash-row.focus     .bi { color: var(--accent); }
.dash-row.reflect   .bi { color: #7c60b8; }
.dash-row.challenge .bi { color: var(--notice); }

/* ---- Topic Strip ---- */
.topic-strip {
    background: var(--primary);
    padding: 0.6rem 0;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.topic-strip::-webkit-scrollbar { display: none; }
.topic-strip .container { display: flex; gap: 0.45rem; }
.topic-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.32rem 0.9rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255,255,255,0.78);
    background: rgba(255,255,255,0.08);
    border: 1.5px solid rgba(255,255,255,0.15);
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.13s;
    flex-shrink: 0;
}
.topic-chip:hover, .topic-chip.active {
    background: var(--secondary);
    border-color: var(--secondary);
    color: #fff;
}

/* ---- Roadmap ---- */
.roadmap { position: relative; padding-left: 2.6rem; }
.roadmap::before {
    content: '';
    position: absolute;
    left: 0.9rem;
    top: 0; bottom: 0;
    width: 2px;
    background: var(--border);
}
.roadmap-step { position: relative; margin-bottom: 1.85rem; }
.roadmap-step:last-child { margin-bottom: 0; }
.roadmap-marker {
    position: absolute;
    left: -2.6rem;
    top: 0.1rem;
    width: 1.8rem;
    height: 1.8rem;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid var(--surface);
    box-shadow: 0 0 0 2px var(--primary);
}
.roadmap-step.done .roadmap-marker { background: var(--secondary); box-shadow: 0 0 0 2px var(--secondary); }
.roadmap-step h3, .roadmap-step h4 { margin-bottom: 0.25rem; }

/* ---- Workbook Sections ---- */
.workbook-section {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
    position: relative;
}
.workbook-section.alt { background: var(--soft-green); }
.workbook-section.paper { background: var(--paper-alt); }
.workbook-section::before {
    content: '';
    display: block;
    height: 4px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    position: absolute;
    top: 0; left: 0; right: 0;
}

/* ---- Callout Panels ---- */
.callout {
    border-radius: var(--radius);
    padding: 0.9rem 1.1rem;
    margin: 0.75rem 0;
    border-left: 4px solid;
    font-size: 0.9rem;
}
.callout-try     { background: var(--sec-pale); border-color: var(--secondary); }
.callout-stuck   { background: var(--soft-blue); border-color: #5a7fa0; }
.callout-avoid   { background: var(--notice-pale); border-color: var(--notice); }
.callout-reflect { background: #f0ecf8; border-color: #8c6cbe; }
.callout-note    { background: var(--paper-alt); border-color: var(--border-dk); }
.callout-warn    { background: var(--accent-pale); border-color: var(--accent); }
.callout-action  { background: var(--soft-green); border-color: var(--secondary); }

.callout h5, .callout h6 {
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.3rem;
}
.callout-try     h5, .callout-try     h6 { color: var(--secondary); }
.callout-stuck   h5, .callout-stuck   h6 { color: #3a6080; }
.callout-avoid   h5, .callout-avoid   h6 { color: var(--notice); }
.callout-reflect h5, .callout-reflect h6 { color: #6048a0; }
.callout-warn    h5, .callout-warn    h6 { color: #8a6210; }

/* ---- Numbered Steps ---- */
.steps-ol { list-style: none; padding: 0; margin: 0; }
.steps-ol li {
    display: flex;
    gap: 0.8rem;
    align-items: flex-start;
    margin-bottom: 0.85rem;
}
.step-num {
    min-width: 1.7rem;
    height: 1.7rem;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 0.76rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 0.13rem;
}

/* ---- Labels ---- */
.label-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.71rem;
    font-weight: 700;
    padding: 0.16rem 0.55rem;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.lp-mindset  { background: var(--soft-blue);  color: #2a5070; border: 1px solid #b8cede; }
.lp-goals    { background: var(--accent-pale); color: #7a5a20; border: 1px solid #dcc890; }
.lp-habits   { background: var(--sec-pale);    color: var(--secondary); border: 1px solid var(--sec-mid); }
.lp-disc     { background: var(--paper-alt);   color: var(--text-muted); border: 1px solid var(--border); }
.lp-prod     { background: #e8f0ff;            color: #2a3880; border: 1px solid #b0c0e8; }
.lp-conf     { background: #f5e8f5;            color: #7a3888; border: 1px solid #d8b8d8; }
.lp-comm     { background: #fff0e0;            color: #804820; border: 1px solid #e8c890; }
.lp-learn    { background: #e0f5ee;            color: #206040; border: 1px solid #90d8b8; }
.lp-focus    { background: #f0e8ff;            color: #5030a0; border: 1px solid #c8b0f0; }
.lp-decision { background: #fff8e0;            color: #705010; border: 1px solid #e8d880; }
.lp-default  { background: var(--paper-alt);   color: var(--text-muted); border: 1px solid var(--border); }

/* ---- Filter Bar ---- */
.filter-bar {
    background: var(--surface);
    border-bottom: 2px solid var(--border);
    padding: 0.6rem 0;
    position: sticky;
    top: 62px;
    z-index: 900;
    box-shadow: 0 2px 8px rgba(32,53,74,0.05);
}
.filter-chips {
    display: flex;
    gap: 0.32rem;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.filter-chips::-webkit-scrollbar { display: none; }
.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.26rem 0.75rem;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
    border: 1.5px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.13s;
}
.filter-chip:hover, .filter-chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* ---- Section header ---- */
.section-eyebrow {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
}
.section-rule {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.section-rule h2 { margin: 0; }
.section-rule::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ---- Growth Areas Grid ---- */
.growth-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}
.growth-card {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    transition: transform 0.13s, box-shadow 0.13s;
}
.growth-card:hover { transform: translateY(-2px); box-shadow: 0 5px 18px rgba(32,53,74,0.1); }
.growth-card .bi { font-size: 1.6rem; margin-bottom: 0.5rem; display: block; }
.growth-card h3 { font-size: 0.95rem; margin-bottom: 0.3rem; }
.growth-card p  { font-size: 0.82rem; color: var(--text-muted); margin: 0; }

/* ---- Habit Ladder ---- */
.habit-ladder {
    position: relative;
    padding-left: 2.2rem;
}
.habit-ladder::before {
    content: '';
    position: absolute;
    left: 0.75rem;
    top: 0; bottom: 0;
    width: 2px;
    background: var(--sec-mid);
}
.habit-rung {
    position: relative;
    margin-bottom: 1.5rem;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
    box-shadow: var(--shadow);
}
.habit-rung::before {
    content: '';
    position: absolute;
    left: -2.2rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: var(--secondary);
    border: 3px solid var(--paper);
    box-shadow: 0 0 0 2px var(--secondary);
}
.habit-rung h4 { font-size: 0.9rem; margin-bottom: 0.3rem; }
.habit-rung p  { font-size: 0.85rem; margin: 0; }

/* ---- Worksheet ---- */
.worksheet {
    background: var(--paper-alt);
    border: 2px dashed var(--border-dk);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin: 1rem 0;
}
.worksheet-row {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}
.worksheet-row:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.worksheet-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
    display: block;
}
.worksheet-line {
    border: none;
    border-bottom: 1.5px solid var(--border-dk);
    background: transparent;
    width: 100%;
    padding: 0.3rem 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* ---- Reflection Panel ---- */
.reflection-panel {
    background: #f0ecf8;
    border: 1.5px solid #c4b0e0;
    border-radius: var(--radius);
    padding: 1rem 1.2rem;
}
.reflection-panel .rp-q {
    font-size: 0.9rem;
    font-style: italic;
    color: #4a3870;
    padding: 0.35rem 0;
    border-bottom: 1px dashed #c4b0e0;
}
.reflection-panel .rp-q:last-child { border-bottom: none; }

/* ---- Weekly Challenge ---- */
.challenge-strip {
    background: var(--primary);
    color: #fff;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin: 1rem 0;
}
.challenge-strip h3 { color: #fff; }
.challenge-strip p { color: rgba(255,255,255,0.82); font-size: 0.88rem; }
.challenge-day {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: var(--radius);
    padding: 0.55rem 0.75rem;
    margin-bottom: 0.4rem;
    font-size: 0.82rem;
    color: rgba(255,255,255,0.88);
}
.challenge-day strong { color: #fff; display: block; font-size: 0.75rem; }

/* ---- Guide entry (filterable) ---- */
.guide-entry.hidden { display: none; }

/* ---- Notice bar ---- */
.notice-bar {
    background: var(--notice-pale);
    border: 1.5px solid #d4b8b0;
    border-radius: var(--radius);
    padding: 0.8rem 1.1rem;
    font-size: 0.83rem;
    color: #5a3028;
}
.notice-bar a { color: #7c4030; font-weight: 600; }

/* ---- Search ---- */
.search-wrap { position: relative; max-width: 300px; }
.search-wrap .bi { position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
#guideSearch { padding-left: 2.2rem; border-radius: 20px; border: 1.5px solid var(--border); background: var(--paper); font-size: 0.85rem; }

/* ---- Ad Placeholder ---- */
.ad-placeholder {
    background: var(--paper-alt);
    border: 1px dashed var(--border-dk);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.72rem;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---- About card ---- */
.about-card {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.6rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow);
}

/* ---- Footer ---- */
.site-footer {
    background: var(--primary);
    color: #a0b0c0;
    padding: 2.75rem 0 1.25rem;
    margin-top: 4rem;
    border-top: 3px solid var(--secondary);
}
.site-footer h5 {
    color: #fff;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    margin-bottom: 0.8rem;
}
.site-footer a {
    color: #a0b0c0;
    text-decoration: none;
    font-size: 0.84rem;
    display: block;
    padding: 0.14rem 0;
    transition: color 0.13s;
}
.site-footer a:hover { color: #fff; }
.site-footer .footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 1rem;
    margin-top: 1.75rem;
    font-size: 0.75rem;
    color: #607080;
}

/* ---- Back to Top ---- */
#backToTop {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1rem;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2000;
    box-shadow: var(--shadow);
    transition: background 0.13s;
}
#backToTop:hover { background: var(--secondary); }
#backToTop.visible { display: flex; }

/* ---- Policy pages ---- */
.policy-section { padding: 1.25rem 0; border-bottom: 1px solid var(--border); }
.policy-section:last-child { border-bottom: none; }

/* ---- Progress path ---- */
.progress-path {
    display: flex;
    align-items: center;
    gap: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin: 1.25rem 0;
}
.progress-path::-webkit-scrollbar { display: none; }
.path-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 90px;
    position: relative;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
}
.path-step::after {
    content: '';
    position: absolute;
    top: 0.75rem;
    right: -50%;
    width: 100%;
    height: 2px;
    background: var(--border);
    z-index: 0;
}
.path-step:last-child::after { display: none; }
.path-dot {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: var(--surface);
    border: 2px solid var(--border);
    z-index: 1;
    margin-bottom: 0.35rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
}
.path-step.active .path-dot {
    background: var(--secondary);
    border-color: var(--secondary);
    color: #fff;
}

/* ---- Checklist ---- */
.check-list { list-style: none; padding: 0; margin: 0; }
.check-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.28rem 0;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border);
}
.check-list li:last-child { border-bottom: none; }
.check-list li .bi { color: var(--secondary); margin-top: 0.15rem; flex-shrink: 0; }

/* ---- Print ---- */
@media print {
    .site-nav, .filter-bar, .topic-strip, .site-footer,
    #backToTop, .ad-placeholder, .no-print { display: none !important; }
    body { background: #fff; font-size: 11pt; }
    .workbook-section { box-shadow: none; border: 1px solid #ccc; }
    .workbook-section::before { display: none; }
    a { color: #000; }
}

/* ---- Responsive ---- */
@media (max-width: 767px) {
    .hero-section { padding: 2rem 0 1.5rem; }
    .growth-grid { grid-template-columns: 1fr 1fr; }
    .roadmap { padding-left: 2rem; }
    .roadmap::before { left: 0.65rem; }
    .roadmap-marker { left: -2rem; }
}
@media (max-width: 479px) {
    .growth-grid { grid-template-columns: 1fr; }
}

/* ---- Accessibility ---- */
:focus-visible { outline: 3px solid var(--secondary); outline-offset: 2px; border-radius: 3px; }
