/* ============================================================
   CalmCare — Main Stylesheet  v6
   Mobile-first. Enhance up.
   ============================================================ */

/* ── Tokens ── */
:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-soft: #f7f4ee;
  --text: #24302b;
  --muted: #5b6a63;
  --accent: #47695c;
  --accent-dark: #345145;
  --accent-soft: #dfece6;
  --line: #e5e1d8;
  --shadow: 0 18px 48px rgba(36,48,43,.08);
  --radius: 20px;
  --radius-sm: 12px;
  --touch: 44px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif; color: var(--text); background: linear-gradient(180deg,#fff 0%,#fcfbf8 100%); line-height: 1.6; font-size: 16px; }
a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: .15rem; }
h1,h2,h3,h4 { line-height: 1.15; margin: 0 0 .9rem; }
h1 { font-size: clamp(2rem, 6vw, 3.8rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.2rem); }
h3 { font-size: clamp(1.1rem, 3vw, 1.4rem); }
h4 { font-size: 1rem; }
p { margin: 0 0 .9rem; }
p:last-child { margin-bottom: 0; }
ul { margin: 0 0 .9rem; padding-left: 1.4rem; }
li { margin-bottom: .35rem; }

/* ── Forms (mobile-first, thumb-friendly) ── */
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .9rem; }
input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="time"],
select,
textarea {
  display: block;
  width: 100%;
  margin-top: .4rem;
  padding: .75rem 1rem;
  min-height: var(--touch);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  font: inherit;
  font-size: 1rem;
  color: var(--text);
  transition: border-color .15s;
  -webkit-appearance: none;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(71,105,92,.12); }
textarea { resize: vertical; }
button.button { cursor: pointer; }

/* ── Layout ── */
.page-shell { min-height: 100vh; }
.container { width: min(1120px, calc(100% - 2rem)); margin: 0 auto; }
.narrow { max-width: 760px; margin-left: auto; margin-right: auto; }
.section { padding: 1rem 0 1.4rem; }

/* ── Grids — mobile-first ── */
.grid { display: grid; gap: 1rem; }
.two-up { grid-template-columns: 1fr; }
.three-up { grid-template-columns: 1fr; }
@media (min-width: 640px) {
  .two-up { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (min-width: 860px) {
  .three-up { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .section { padding: 1.2rem 0 1.6rem; }
}

/* ── Cards ── */
.card, .statement-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; }
.statement-card { padding: 1.5rem; }
.floating-panel { box-shadow: var(--shadow); }
.accent-edge { background: linear-gradient(180deg,#fff 0%,#f6f8f5 100%); }
.accent-tint { background: linear-gradient(180deg,#fff 0%,#f5f9f6 100%); }
.soft-card  { background: linear-gradient(180deg,#fff 0%,#f7f6f2 100%); }
@media (min-width: 640px) {
  .card { padding: 1.5rem; }
  .statement-card { padding: 2rem; }
}

/* ── Hero ── */
.hero-wrap { padding: .75rem 0 .5rem; }
.inner-hero-wrap { padding-bottom: 0; }
.page-hero { background: radial-gradient(circle at top right,rgba(71,105,92,.12),transparent 30%), linear-gradient(180deg,#faf7f1 0%,#f7f4ee 100%); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; margin-top: .5rem; }
@media (min-width: 640px) { .page-hero { padding: 2.4rem; } }
.eyebrow { display: inline-block; border-radius: 999px; margin-bottom: .9rem; padding: .38rem .8rem; background: var(--accent-soft); color: var(--accent-dark); font-size: .78rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.subhead { max-width: 840px; font-size: 1rem; color: var(--muted); margin-top: -.25rem; }
@media (min-width: 640px) { .subhead { font-size: 1.1rem; } }

/* ── Panel labels / tags ── */
.panel-label { display: inline-block; margin-bottom: .7rem; font-size: .73rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-dark); }
.mini-tag { display: inline-block; border-radius: 999px; padding: .32rem .65rem; background: var(--accent-soft); color: var(--accent-dark); font-size: .75rem; font-weight: 600; }
.meta-row { display: flex; gap: .4rem; flex-wrap: wrap; margin: .75rem 0 .9rem; }
.link-row { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1rem; }

/* ── Buttons ── */
.button {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .75rem 1.2rem; min-height: var(--touch);
  border-radius: 999px; font-weight: 600; font-size: .9rem;
  border: 1.5px solid var(--line); background: #fff;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
  -webkit-tap-highlight-color: transparent;
}
.button:hover { text-decoration: none; border-color: var(--accent); }
.button-primary, .button-cta { background: var(--accent); color: #fff; border-color: var(--accent-dark); }
.button-primary:hover, .button-cta:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.button-secondary { color: var(--accent-dark); }
.button-secondary:hover { background: var(--accent-soft); }

/* ── Nav — top bar ── */
.site-nav { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; padding: .75rem 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: .5rem; }
.brand-mark { font-weight: 800; font-size: 1.05rem; letter-spacing: -.01em; color: var(--accent-dark); white-space: nowrap; }
.nav-links { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; }
.nav-links a { font-size: .88rem; font-weight: 600; color: var(--muted); }
.nav-links a:hover, .nav-links a.is-active { color: var(--accent-dark); text-decoration: underline; text-underline-offset: .15rem; }

/* ── Nav — member top bar ── */
.member-top-nav { display: flex; align-items: center; gap: .6rem; }
.member-top-nav .nav-links { flex: 1; }
.nav-member-pill { display: flex; align-items: center; gap: .5rem; background: var(--accent-soft); border-radius: 999px; padding: .3rem .65rem .3rem .8rem; flex-shrink: 0; }
.nav-member-name { font-size: .8rem; font-weight: 700; color: var(--accent-dark); white-space: nowrap; max-width: 90px; overflow: hidden; text-overflow: ellipsis; }
.nav-icon-link { font-size: 1rem; color: var(--accent-dark); line-height: 1; text-decoration: none; opacity: .7; min-width: var(--touch); min-height: var(--touch); display: flex; align-items: center; justify-content: center; }
.nav-icon-link:hover, .nav-icon-link.is-active { opacity: 1; text-decoration: none; }

/* ── Nav — member subnav ── */
.member-subnav { padding: .4rem .75rem; margin-bottom: .6rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.member-subnav::-webkit-scrollbar { display: none; }
.member-subnav-links { display: flex; gap: .1rem; align-items: center; white-space: nowrap; min-width: max-content; }
.member-subnav-links a { font-size: .82rem; font-weight: 600; color: var(--muted); padding: .45rem .8rem; border-radius: 999px; min-height: var(--touch); display: inline-flex; align-items: center; transition: background .15s, color .15s; text-decoration: none; }
.member-subnav-links a:hover { background: var(--accent-soft); color: var(--accent-dark); text-decoration: none; }
.member-subnav-links a.is-active { background: var(--accent-soft); color: var(--accent-dark); }

/* ── Footer ── */
.site-footer { padding: 0 0 2rem; margin-top: .5rem; }
.footer-card p { color: var(--muted); font-size: .88rem; }

/* ── Progress wheel ── */
.progress-wheel { display: flex; align-items: center; justify-content: center; margin: 1rem 0; }
.progress-wheel-inner { text-align: center; background: var(--accent-soft); border-radius: 999px; width: 100px; height: 100px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.progress-wheel-inner strong { font-size: 1.5rem; font-weight: 800; color: var(--accent-dark); line-height: 1; }
.progress-wheel-inner span { font-size: .72rem; color: var(--muted); font-weight: 600; margin-top: .2rem; }

/* ── Callout ── */
.callout { background: var(--accent-soft); border-left: 3px solid var(--accent); border-radius: var(--radius-sm); padding: .85rem 1rem; font-size: .9rem; margin: .9rem 0; }
.callout strong { color: var(--accent-dark); }

/* ── Flash messages ── */
.flash-success { background: #e8f5e9; border: 1.5px solid #a5d6a7; color: #1b5e20; border-radius: var(--radius-sm); padding: .75rem 1rem; margin-bottom: 1rem; font-weight: 600; font-size: .9rem; }
.flash-error { background: #fce4ec; border: 1.5px solid #f48fb1; color: #880e4f; border-radius: var(--radius-sm); padding: .75rem 1rem; margin-bottom: 1rem; font-weight: 600; font-size: .9rem; }

/* ── Muted helper ── */
.muted { color: var(--muted); }

/* ── Price tag ── */
.price-tag { font-size: 1.8rem; font-weight: 800; color: var(--text); display: block; margin: .5rem 0; }
.featured-tier { outline: 2px solid rgba(71,105,92,.25); }

/* ── Saved library item cards ── */
.saved-item-card { padding: .75rem .9rem; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-soft); margin-bottom: .6rem; transition: border-color .15s, background .15s; }
.saved-item-card:last-child { margin-bottom: 0; }
a.saved-item-card:hover { border-color: var(--accent); background: var(--accent-soft); text-decoration: none; }
.saved-item-no-link { opacity: .75; }
.saved-item-meta { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: .25rem; }
.saved-item-title { font-size: .92rem; font-weight: 600; color: var(--text); display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
a.saved-item-card:hover .saved-item-title { color: var(--accent-dark); }
.saved-item-arrow { font-size: .9rem; color: var(--accent-dark); flex-shrink: 0; opacity: .6; transition: opacity .15s, transform .15s; }
a.saved-item-card:hover .saved-item-arrow { opacity: 1; transform: translateX(3px); }
.saved-item-preview { font-size: .82rem; color: var(--muted); margin-top: .2rem; line-height: 1.45; }

/* ── Save / Saved buttons ── */
.btn-save { color: var(--accent-dark); border-color: var(--accent-soft); font-size: .82rem; padding: .5rem .85rem; min-height: 36px; }
.btn-save:hover { background: var(--accent-soft); border-color: var(--accent); }
.btn-saved { background: var(--accent-soft); color: var(--accent-dark); border-color: var(--accent); font-size: .82rem; padding: .5rem .85rem; min-height: 36px; }
.btn-saved:hover { background: #fce4ec; border-color: #f06292; color: #880e4f; }

/* ── Template block (examples) ── */
.template-block + .template-block { margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }

/* ============================================================
   TEMPLATE WORKSHEET — shared by all template-detail.php pages
   ============================================================ */

/* Outer sheet */
.template-sheet { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; }
@media (min-width: 640px) { .template-sheet { padding: 2rem 2.25rem; } }

/* Header */
.template-sheet-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding-bottom: 1rem; margin-bottom: 1.5rem; border-bottom: 2px solid var(--text); flex-wrap: wrap; }
.sheet-kicker { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: .3rem; }
.sheet-summary { color: var(--muted); font-size: .88rem; margin-top: .3rem; max-width: 480px; }
.sheet-meta { display: flex; flex-direction: column; gap: .45rem; flex-shrink: 0; }
.sheet-meta-row { display: flex; align-items: center; gap: .5rem; font-size: .85rem; }
.sheet-meta-row span:first-child { font-weight: 600; white-space: nowrap; min-width: 48px; }
.sheet-line { flex: 1; min-width: 120px; border-bottom: 1.5px solid var(--text); height: 18px; }

/* Intro panel */
.template-sheet-panel { background: var(--surface-soft); border-radius: var(--radius-sm); padding: .9rem 1.1rem; margin-bottom: 1.5rem; }
.sheet-panel-label { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--accent-dark); margin-bottom: .35rem; }
.sheet-first-move { background: var(--accent-soft); border-left: 3px solid var(--accent); border-radius: 8px; padding: .7rem .95rem; margin-top: .75rem; font-size: .87rem; line-height: 1.5; }

/* Worksheet sections */
.worksheet-section { margin-bottom: 1.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--line); }
.worksheet-section:last-of-type { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.worksheet-header { display: flex; gap: .7rem; align-items: flex-start; margin-bottom: .85rem; }
.worksheet-number { width: 22px; height: 22px; background: var(--accent); color: #fff; border-radius: 999px; display: flex; align-items: center; justify-content: center; font-size: .7rem; font-weight: 800; flex-shrink: 0; margin-top: .15rem; }
.worksheet-header h3 { margin: 0 0 .2rem; font-size: 1rem; }
.worksheet-subtitle { font-size: .82rem; color: var(--muted); margin: 0; }

/* Fields */
.worksheet-fields { display: flex; flex-direction: column; gap: .85rem; }
.worksheet-field { }
.worksheet-field-label { font-size: .75rem; font-weight: 700; color: var(--muted); text-transform: capitalize; letter-spacing: .02em; margin-bottom: .35rem; }
/* Screen: styled fill zones */
.worksheet-answer-lines { background: var(--surface-soft); border: 1.5px dashed var(--line); border-radius: 8px; padding: .65rem .85rem; min-height: 52px; display: flex; flex-direction: column; gap: 0; }
.worksheet-answer-lines span { display: block; border-bottom: 1px solid rgba(0,0,0,.08); height: 24px; }

/* Block cards (for templates with grouped sub-sections) */
.worksheet-blocks { display: grid; gap: .75rem; }
@media (min-width: 640px) { .worksheet-blocks { grid-template-columns: repeat(2, 1fr); } }
.worksheet-block-card { background: var(--surface-soft); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 1rem; }
.worksheet-block-card h4 { font-size: .9rem; margin: 0 0 .3rem; }
.worksheet-block-note { font-size: .8rem; color: var(--muted); margin: 0 0 .65rem; }

/* Table templates */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.template-table, .worksheet-table { width: 100%; border-collapse: collapse; font-size: .85rem; min-width: 480px; }
.template-table th, .worksheet-table th { background: var(--text); color: #fff; padding: .55rem .7rem; text-align: left; font-size: .78rem; font-weight: 700; }
.template-table td, .worksheet-table td { padding: .55rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.template-table tr:nth-child(even) td, .worksheet-table tr:nth-child(even) td { background: var(--surface-soft); }
.worksheet-table-wrap { margin-top: .75rem; }

/* Print overrides */
@media print {
  .site-nav, .member-subnav, .hero-wrap, .site-footer,
  .link-row, .meta-row, .no-print, .card.floating-panel:not(.template-sheet) { display: none !important; }
  .worksheet-answer-lines { background: #fff; border: none; padding: 0; min-height: 0; border-radius: 0; }
  .worksheet-answer-lines span { border-bottom: 1px solid #ccc; height: 22px; margin-bottom: 2px; }
  .template-sheet { border: none; padding: 0; box-shadow: none; }
  body { font-size: 10pt; }
}

/* ============================================================
   ASSESSMENT FORM
   ============================================================ */
.quiz-form { padding: 1.5rem; }
@media (min-width: 640px) { .quiz-form { padding: 2rem; } }

.checkbox-group { border: none; margin: 0 0 1.25rem; padding: 0; }
.checkbox-group legend { font-size: 1rem; font-weight: 700; color: var(--text); margin-bottom: .75rem; display: block; width: 100%; }
.field-hint { font-size: .78rem; font-weight: 400; color: var(--muted); margin-left: .4rem; }
.checkbox-grid { display: grid; gap: .5rem; grid-template-columns: 1fr; }
@media (min-width: 540px) { .checkbox-grid.two-up { grid-template-columns: repeat(2, 1fr); } }

.check-option {
  display: flex; align-items: center; gap: .7rem;
  padding: .75rem 1rem; min-height: var(--touch);
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; cursor: pointer; font-weight: 500; font-size: .9rem;
  transition: border-color .15s, background .15s;
  -webkit-tap-highlight-color: transparent;
}
.check-option:hover { border-color: var(--accent); background: var(--accent-soft); }
.check-option input[type="checkbox"] { width: 1.1rem; height: 1.1rem; flex-shrink: 0; accent-color: var(--accent); cursor: pointer; }
.check-option input[type="checkbox"]:checked + span, .check-option:has(input:checked) { color: var(--accent-dark); }
.check-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }

.hero-actions { margin-top: 1.5rem; }
.assessment-submit-button { background: var(--accent); color: #fff; border-color: var(--accent-dark); font-size: 1rem; padding: .9rem 2rem; min-height: var(--touch); }
.assessment-submit-button:hover { background: var(--accent-dark); }

/* ── Assessment result card ── */
.quiz-result { margin-top: 2rem; }
.quiz-result-card { padding: 1.5rem; }
@media (min-width: 640px) { .quiz-result-card { padding: 2rem; } }

.result-path-badge { display: inline-flex; align-items: center; gap: .5rem; background: var(--accent); color: #fff; border-radius: 999px; padding: .45rem 1rem; font-size: .82rem; font-weight: 700; margin-bottom: 1rem; }
.result-score-bars { margin: 1.25rem 0; display: flex; flex-direction: column; gap: .6rem; }
.result-score-bar { display: flex; align-items: center; gap: .75rem; }
.result-score-label { font-size: .78rem; font-weight: 600; color: var(--muted); width: 110px; flex-shrink: 0; text-transform: capitalize; }
.result-score-track { flex: 1; height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.result-score-fill { height: 100%; background: var(--accent); border-radius: 999px; transition: width .6s ease; }
.result-score-fill.secondary { background: var(--accent-soft); border: 1.5px solid var(--accent); }
.result-links { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1.25rem; }
.secondary-pattern { font-size: .88rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: .75rem; margin-top: .75rem; }

/* ============================================================
   DASHBOARD — THIS WEEK PATH
   ============================================================ */
.priority-path { display: grid; gap: 1.1rem; margin-top: 1rem; }
@media (min-width: 640px) { .priority-path { grid-template-columns: repeat(3, 1fr); } }
.priority-step { display: flex; gap: .85rem; align-items: flex-start; }
.priority-step-num { flex-shrink: 0; width: 2rem; height: 2rem; background: var(--accent); color: #fff; border-radius: 999px; display: flex; align-items: center; justify-content: center; font-size: .82rem; font-weight: 800; margin-top: .1rem; }
.priority-step-body h4 { margin: 0 0 .3rem; font-size: .93rem; font-weight: 700; }
.priority-step-body p { margin: 0 0 .5rem; font-size: .85rem; color: var(--muted); line-height: 1.45; }

/* ── Calendar responsive show/hide ── */
.wcal-desktop { display: none; }
.wcal-mobile  { display: block; }
@media (min-width: 768px) {
  .wcal-desktop { display: block; }
  .wcal-mobile  { display: none; }
}

/* ── Tooltip on desktop calendar events ── */
/* Note: .wcal-ev keeps position:absolute from the WCAL section — don't add position here */
.wcal-ev { overflow: visible !important; }
.wcal-tip { display: none; position: absolute; left: calc(100% + 6px); top: 0; z-index: 200;
            background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: .65rem .85rem;
            box-shadow: var(--shadow); width: 210px; font-size: .76rem; line-height: 1.45;
            pointer-events: none; white-space: normal;
            /* Override inherited color from parent event (e.g. white text on shift blocks) */
            color: var(--text) !important; }
.wcal-ev:hover .wcal-tip { display: block; }
.wcal-day:nth-last-child(-n+3) .wcal-tip { left: auto; right: calc(100% + 6px); }
.wcal-tip-row { display: flex; flex-direction: column; margin-bottom: .4rem; }
.wcal-tip-row:last-child { margin-bottom: 0; }
.wcal-tip-label { font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
                  color: var(--muted) !important; margin-bottom: .08rem; }
.wcal-tip span { color: var(--text) !important; font-weight: 500; }

/* ── Mobile calendar ── */
.wcal-m-tabs { display: grid; grid-template-columns: repeat(7,1fr); gap: .25rem; margin-bottom: .85rem; }
.wcal-m-tab { background: var(--surface-soft); border: 1.5px solid var(--line); border-radius: 10px; padding: .35rem .15rem; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .08rem; min-height: 58px; -webkit-tap-highlight-color: transparent; }
.wcal-m-tab.wm-active { background: var(--accent-soft); border-color: var(--accent); }
.wcal-m-tab-name { font-size: .58rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.wcal-m-tab.wm-active .wcal-m-tab-name { color: var(--accent-dark); }
.wcal-m-tab-num { font-size: 1.1rem; font-weight: 800; line-height: 1.1; color: var(--text); }
.wcal-m-tab.wm-today .wcal-m-tab-num { background: var(--accent); color: #fff; border-radius: 999px; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; font-size: .95rem; }
.wcal-m-tab.wm-active.wm-today .wcal-m-tab-num { background: var(--accent-dark); }
.wcal-m-dot { width: 5px; height: 5px; border-radius: 999px; background: var(--accent); }
.wcal-m-tab.wm-off .wcal-m-dot { background: transparent; }
.wcal-m-panel { display: none; }
.wcal-m-panel.wm-active { display: block; }
.wcal-m-day-head { font-size: .82rem; font-weight: 700; color: var(--muted); margin-bottom: .7rem; text-transform: uppercase; letter-spacing: .05em; }
.wcal-m-rest { padding: 1.25rem; text-align: center; background: var(--surface-soft); border-radius: var(--radius-sm); color: var(--muted); font-size: .88rem; }
.wcal-m-shift { background: linear-gradient(160deg, var(--accent) 0%, var(--accent-dark) 100%); color: #fff; border-radius: var(--radius-sm); padding: .75rem 1rem; margin-bottom: .5rem; }
.wcal-m-shift-label { font-size: .6rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; opacity: .75; }
.wcal-m-shift-time { font-size: 1.05rem; font-weight: 800; margin-top: .12rem; }
.wcal-m-shift-hours { font-size: .72rem; opacity: .8; }
.wcal-m-handoff { border-radius: 10px; padding: .55rem .7rem; margin-bottom: .4rem; }
.wcal-m-receive { background: #e8f5e9; border: 1.5px solid #66bb6a; }
.wcal-m-deliver { background: #e8eaf6; border: 1.5px solid #7986cb; }
.wcal-m-hf-label { font-size: .6rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; margin-bottom: .18rem; }
.wcal-m-receive .wcal-m-hf-label { color: #2e7d32; }
.wcal-m-deliver .wcal-m-hf-label { color: #283593; }
.wcal-m-hf-person { font-size: .88rem; font-weight: 700; color: var(--text); }
.wcal-m-hf-time { font-size: .75rem; color: var(--muted); }
.wcal-m-detail { font-size: .78rem; color: var(--muted); margin-top: .2rem; }
.wcal-m-mid { background: #fff8e1; border: 1.5px solid #ffd54f; border-radius: 10px; padding: .48rem .65rem; margin-bottom: .4rem; font-size: .8rem; }
.wcal-m-notes { background: var(--surface-soft); border-radius: 10px; padding: .55rem .7rem; margin-top: .35rem; }
.wcal-m-notes-label { font-size: .6rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: .15rem; }
.wcal-m-notes-text { font-size: .8rem; color: var(--text); }

/* ============================================================
   WEEK CALENDAR — TIMELINE VIEW (like Google Calendar / iPhone)
   ============================================================ */

/* Outer card */
.wcal-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }

/* Scroll wrapper — horizontal scroll on mobile */
.wcal-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.wcal-scroll::-webkit-scrollbar { height: 4px; }
.wcal-scroll::-webkit-scrollbar-thumb { background: var(--line); border-radius: 999px; }

/* Inner flex: time column + days */
.wcal-inner { display: flex; min-width: 480px; }

/* Time label column */
.wcal-times { flex-shrink: 0; width: 38px; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: var(--surface-soft); }
.wcal-times-header { height: 52px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.wcal-hour-label { height: 48px; flex-shrink: 0; display: flex; align-items: flex-start; padding-top: .2rem; justify-content: flex-end; padding-right: .4rem; }
.wcal-hour-label span { font-size: .58rem; font-weight: 600; color: var(--muted); white-space: nowrap; line-height: 1; }

/* Days grid */
.wcal-days { display: grid; grid-template-columns: repeat(7, minmax(52px, 1fr)); flex: 1; min-width: 0; }

/* Individual day */
.wcal-day { display: flex; flex-direction: column; border-left: 1px solid var(--line); }
.wcal-day:first-child { border-left: none; }

/* Day header */
.wcal-day-head { height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--surface-soft); border-bottom: 1px solid var(--line); flex-shrink: 0; padding: .3rem; gap: .1rem; }
.wcal-day.wcal-today .wcal-day-head { background: var(--accent-soft); }
.wcal-day-name { font-size: .6rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); line-height: 1; }
.wcal-day.wcal-today .wcal-day-name { color: var(--accent); }
.wcal-day-num-wrap { width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; border-radius: 999px; }
.wcal-day.wcal-today .wcal-day-num-wrap { background: var(--accent); }
.wcal-day-num { font-size: 1rem; font-weight: 800; line-height: 1; color: var(--text); }
.wcal-day.wcal-today .wcal-day-num { color: #fff; }

/* Day body — the timed area */
.wcal-day-body { position: relative; flex: 1; }

/* Hour grid lines (always visible) */
.wcal-grid { position: absolute; inset: 0; pointer-events: none; }
.wcal-hour-line { height: 48px; border-top: 1px solid var(--line); box-sizing: border-box; }
.wcal-hour-line:nth-child(even) { background: rgba(0,0,0,.012); }
.wcal-half-line { position: absolute; width: 100%; border-top: 1px dashed rgba(0,0,0,.06); }

/* Events layer */
.wcal-events { position: absolute; inset: 0; }

/* Shift block */
.wcal-ev { position: absolute; left: 3px; right: 3px; border-radius: 7px; padding: .25rem .35rem; font-size: .67rem; font-weight: 600; line-height: 1.3; overflow: hidden; cursor: default; }
.wcal-ev-shift { background: linear-gradient(180deg, var(--accent) 0%, var(--accent-dark) 100%); color: #fff; }
.wcal-ev-shift .wcal-ev-title { font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; opacity: .8; }
.wcal-ev-shift .wcal-ev-time { font-size: .65rem; opacity: .85; margin-top: .1rem; }
.wcal-ev-shift .wcal-ev-body { font-weight: 600; font-size: .63rem; opacity: .75; }

/* Receive handoff event */
.wcal-ev-receive { background: #e8f5e9; border: 1.5px solid #66bb6a; color: #1b5e20; z-index: 2; }
.wcal-ev-receive .wcal-ev-label { font-size: .58rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #388e3c; }

/* Deliver handoff event */
.wcal-ev-deliver { background: #e8eaf6; border: 1.5px solid #7986cb; color: #283593; z-index: 2; }
.wcal-ev-deliver .wcal-ev-label { font-size: .58rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #3949ab; }

/* Mid-shift event */
.wcal-ev-midshift { background: #fff8e1; border: 1.5px solid #ffd54f; color: #e65100; z-index: 2; }
.wcal-ev-midshift .wcal-ev-label { font-size: .58rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #f57c00; }

/* Current time indicator */
.wcal-now-line { position: absolute; left: 0; right: 0; height: 2px; background: #e53935; z-index: 10; pointer-events: none; }
.wcal-now-dot { position: absolute; left: -4px; top: -4px; width: 10px; height: 10px; background: #e53935; border-radius: 999px; }

/* ============================================================
   WEEKLY RHYTHM — DAY DETAIL CARDS
   ============================================================ */
.rhythm-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .rhythm-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .rhythm-grid { grid-template-columns: repeat(3, 1fr); } }
.rhythm-time-list { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: .75rem; }
.rhythm-time-chip { background: var(--accent-soft); color: var(--accent-dark); padding: .28rem .65rem; border-radius: 999px; font-size: .8rem; font-weight: 600; }
.rhythm-field-group { display: flex; flex-direction: column; gap: .15rem; }
.rhythm-section-label { font-size: .67rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--accent-dark); margin: .9rem 0 .4rem; padding-bottom: .3rem; border-bottom: 1px solid var(--accent-soft); }
.rhythm-two { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
@media (max-width: 400px) { .rhythm-two { grid-template-columns: 1fr; } }

/* ============================================================
   UPDATE LOG
   ============================================================ */
.log-entry { padding: .9rem 1.1rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-soft); margin-bottom: .65rem; }
.log-entry:last-child { margin-bottom: 0; }
.log-entry-date { font-size: .73rem; font-weight: 700; color: var(--accent-dark); letter-spacing: .04em; text-transform: uppercase; margin-bottom: .28rem; }
.log-entry-highlight { font-size: .9rem; font-weight: 600; margin-bottom: .18rem; }
.log-entry-note { font-size: .85rem; color: var(--muted); }

/* ============================================================
   WEEKLY SUMMARY
   ============================================================ */
.summary-preview { background: var(--surface-soft); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 1.4rem; }
.summary-preview h4 { margin: 0 0 .6rem; font-size: 1rem; font-weight: 700; }
.summary-preview p { margin: 0 0 .65rem; font-size: .9rem; line-height: 1.6; }

/* ============================================================
   CARE PLAN — FOUR-PHASE CYCLE
   ============================================================ */
.care-cycle { display: grid; gap: 1rem; margin-top: 1.1rem; }
@media (min-width: 640px) { .care-cycle { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 860px) { .care-cycle { grid-template-columns: repeat(4, 1fr); } }

.care-phase { position: relative; padding: 1.4rem 1.2rem 1.2rem; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.care-phase-num { position: absolute; top: -14px; left: 1.2rem; width: 28px; height: 28px; background: var(--accent); color: #fff; border-radius: 999px; display: flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 800; }
.care-phase h4 { font-size: .95rem; font-weight: 700; margin: .3rem 0 .5rem; color: var(--accent-dark); }
.care-phase p { font-size: .85rem; color: var(--muted); margin: 0 0 .75rem; line-height: 1.5; }
.care-phase-connector { display: none; }
@media (min-width: 860px) {
  .care-phase-connector { display: block; position: absolute; right: -14px; top: 50%; width: 28px; height: 2px; background: var(--accent-soft); z-index: 1; transform: translateY(-50%); }
}

/* ============================================================
   TEMPLATE NOTES (save panel)
   ============================================================ */
.template-notes-panel { border-top: 2px solid var(--accent-soft); margin-top: 2rem; padding-top: 1.5rem; }
.template-notes-panel h3 { font-size: 1.1rem; margin-bottom: .35rem; }
.template-notes-saved { background: var(--accent-soft); border-radius: var(--radius-sm); padding: 1rem 1.1rem; margin-bottom: 1rem; font-size: .9rem; line-height: 1.6; white-space: pre-wrap; }
.template-notes-saved-date { font-size: .73rem; font-weight: 700; color: var(--accent-dark); text-transform: uppercase; letter-spacing: .04em; margin-bottom: .35rem; }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-shell { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1.5rem 1rem; background: linear-gradient(180deg,#fff 0%,#f7f4ee 100%); }
.login-card { width: min(440px, 100%); }
.login-brand { text-align: center; font-size: 1.25rem; font-weight: 800; color: var(--accent-dark); margin-bottom: 1.25rem; }
.login-card .button-submit { width: 100%; justify-content: center; margin-top: .25rem; background: var(--accent); color: #fff; border-color: var(--accent-dark); font-size: 1rem; padding: .95rem; }
.login-card .button-submit:hover { background: var(--accent-dark); }
.login-footer { text-align: center; font-size: .85rem; color: var(--muted); margin-top: 1.1rem; }
.login-footer a { color: var(--accent-dark); font-weight: 600; }
