/* ============================================================================
   KING FAMILY HUB — PAGE REBUILDS (Calendar, Meals, Travel, Kids, Goals)
   Scoped under .cc so they inherit redesign tokens + dark mode.
   Load AFTER redesign.css.  Pair with redesign-pages.js.
   Reuses .cc-card / .cc-hd / .cc-bd / .pill / timeline classes from redesign.css.
   ========================================================================== */

/* ---- shared page header (matches .fin-head) ----------------------------- */
.cc .pg-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.cc .pg-head h1 { font-family: var(--font-display); font-weight: 600; letter-spacing: -.015em; font-size: clamp(22px, 2.4vw, 30px); line-height: 1.02; color: var(--ink); }
.cc .pg-head .pg-sub { font-size: 12.5px; color: var(--ink-soft); margin-top: 4px; font-weight: 500; }
.cc .pg-head .pg-spacer { flex: 1; }
.cc .pg-grid { display: grid; gap: 14px; }
.cc .pg-grid.c2 { grid-template-columns: 1fr 1fr; }
.cc .pg-link { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--accent); padding: 7px 14px; border-radius: var(--radius-pill); border: 1px solid var(--line); background: var(--surface); transition: all .14s; }
.cc .pg-link:hover { background: var(--accent-soft); border-color: transparent; }
.cc .pg-link svg { width: 13px; height: 13px; }

/* ============================ MEALS ===================================== */
.cc .meal-week { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.cc .mw-day { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 13px 13px 14px; display: flex; flex-direction: column; gap: 8px; transition: border-color .14s; }
.cc .mw-day.today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.cc .mw-dow { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint); display: flex; align-items: center; justify-content: space-between; }
.cc .mw-dow .pill { font-size: 9px; padding: 1px 6px; }
.cc .mw-emoji { font-size: 28px; line-height: 1; }
.cc .mw-name { font-family: var(--font-display); font-size: 14px; font-weight: 600; line-height: 1.3; color: var(--ink); }
.cc .mw-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: auto; }

.cc .recipe { margin-bottom: 14px; }
.cc .recipe .rc-name { font-family: var(--font-display); font-size: 17px; font-weight: 600; color: var(--ink); margin-bottom: 12px; line-height: 1.25; }
.cc .macros { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.cc .macro { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 14px; text-align: center; min-width: 62px; }
.cc .macro .mv { font-family: var(--font-mono); font-size: 14px; font-weight: 700; color: var(--c, var(--ink)); white-space: nowrap; }
.cc .macro .ml { font-size: 9px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-faint); margin-top: 3px; }
.cc .recipe-cols { display: grid; grid-template-columns: 1fr 1.2fr; gap: 24px; }
.cc .rc-subhead { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 10px; display: flex; align-items: center; gap: 7px; }
.cc .ingr-group { margin-bottom: 12px; }
.cc .ingr-cat { font-size: 9.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-ink); margin-bottom: 4px; }
.cc .ingr-item { font-size: 12.5px; color: var(--ink-soft); padding: 3px 0 3px 14px; position: relative; line-height: 1.45; }
.cc .ingr-item::before { content: ""; position: absolute; left: 2px; top: 11px; width: 4px; height: 4px; border-radius: 50%; background: var(--line-strong); }
.cc .step { display: flex; gap: 11px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 12.5px; line-height: 1.5; color: var(--ink-soft); }
.cc .step .step-n { min-width: 22px; height: 22px; background: var(--accent); color: #fff; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-mono); font-size: 11px; font-weight: 700; flex-shrink: 0; margin-top: 1px; }
.cc .meal-tip-box { margin-top: 14px; background: var(--light-yellow); border: 1px solid var(--line); border-left: 4px solid var(--yellow); border-radius: var(--radius-sm); padding: 10px 14px; font-size: 12.5px; color: var(--ink-soft); line-height: 1.5; }
.cc .meal-tip-box b { color: var(--ink); }

.cc .grocery { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 22px; }
.cc .gcol-h { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding-bottom: 7px; border-bottom: 2px solid var(--c, var(--line)); margin-bottom: 8px; color: var(--c, var(--ink)); }
.cc .gitem { display: flex; gap: 9px; align-items: flex-start; font-size: 12.5px; padding: 5px 0; border-bottom: 1px dashed var(--line); color: var(--ink-soft); line-height: 1.35; cursor: pointer; }
.cc .gitem .gcheck { width: 16px; height: 16px; border-radius: 4px; border: 2px solid var(--line-strong); flex-shrink: 0; margin-top: 1px; display: grid; place-items: center; color: transparent; transition: all .12s; }
.cc .gitem .gcheck svg { width: 10px; height: 10px; }
.cc .gitem.done .gcheck { background: var(--green); border-color: var(--green); color: #fff; }
.cc .gitem.done .gtext { text-decoration: line-through; color: var(--ink-faint); }
.cc .order-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.cc .order-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: var(--radius-sm); font-weight: 700; font-size: 13px; color: #fff; text-decoration: none; }

/* ============================ GOALS ===================================== */
.cc .goal-cat-icon { background: var(--c, var(--accent)) !important; color: #fff !important; }
.cc .goal { padding: 14px 0; border-bottom: 1px solid var(--line); }
.cc .goal:last-child { border-bottom: none; }
.cc .goal .g-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 4px; }
.cc .goal .g-title { font-size: 14px; font-weight: 700; color: var(--ink); }
.cc .goal .g-target { font-size: 11px; color: var(--ink-faint); white-space: nowrap; font-weight: 500; }
.cc .goal .g-meta { font-size: 11px; color: var(--ink-soft); margin-bottom: 8px; }
.cc .goal .g-track { height: 9px; background: var(--bg-2); border-radius: 99px; overflow: hidden; }
.cc .goal .g-fill { height: 100%; border-radius: 99px; background: var(--c, var(--accent)); transition: width .6s cubic-bezier(.4,0,.2,1); }
.cc .goal .g-pctrow { display: flex; justify-content: space-between; align-items: center; margin-top: 5px; }
.cc .goal .g-pct { font-family: var(--font-mono); font-size: 11px; font-weight: 700; color: var(--ink-soft); }
.cc .goal .g-status { font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 2px 8px; border-radius: var(--radius-pill); white-space: nowrap; }
.cc .goal .g-status.in_progress { background: var(--light-blue); color: var(--accent-ink); }
.cc .goal .g-status.not_started { background: var(--bg-2); color: var(--ink-faint); }
.cc .goal .g-status.done { background: var(--light-green); color: var(--green); }
.cc .goal .g-notes { font-size: 11.5px; color: var(--ink-soft); margin-top: 8px; line-height: 1.5; font-style: italic; }
.cc .goal .g-miles { margin-top: 10px; display: flex; flex-direction: column; gap: 5px; }
.cc .mile { display: flex; align-items: center; gap: 9px; font-size: 12px; color: var(--ink-soft); }
.cc .mile .m-box { width: 16px; height: 16px; border-radius: 4px; border: 2px solid var(--line-strong); flex-shrink: 0; display: grid; place-items: center; color: transparent; }
.cc .mile .m-box svg { width: 10px; height: 10px; }
.cc .mile.done .m-box { background: var(--green); border-color: var(--green); color: #fff; }
.cc .mile.done span { text-decoration: line-through; color: var(--ink-faint); }

/* ============================ KIDS ====================================== */
.cc .kid-snap { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.cc .ks { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 13px; text-align: center; }
.cc .ks .ks-ico { font-size: 20px; margin-bottom: 6px; }
.cc .ks .ks-label { font-size: 9px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 5px; }
.cc .ks .ks-val { font-size: 12px; font-weight: 700; color: var(--c, var(--ink)); line-height: 1.35; }
.cc .sport-group { margin-bottom: 14px; }
.cc .sport-h { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 7px; }
.cc .sport-links { display: flex; gap: 7px; flex-wrap: wrap; }
.cc .sport-link { padding: 5px 13px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-pill); font-size: 11.5px; font-weight: 600; color: var(--accent); text-decoration: none; transition: all .12s; }
.cc .sport-link:hover { background: var(--accent); color: #fff; border-color: transparent; }
.cc .kid-divider { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint); margin: 20px 0 10px; display: flex; align-items: center; gap: 8px; }
.cc .kid-divider .kd-rule { flex: 1; height: 1px; background: var(--line); }
.cc .grade-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.cc .grade-table th { text-align: center; padding: 6px 4px; font-size: 10px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--ink-faint); border-bottom: 2px solid var(--line); }
.cc .grade-table th:first-child { text-align: left; }
.cc .grade-table td { padding: 8px 4px; border-bottom: 1px solid var(--line); text-align: center; }
.cc .grade-table td:first-child { text-align: left; }
.cc .grade-table .subj { font-weight: 600; color: var(--ink); }
.cc .grade-g { font-family: var(--font-mono); font-size: 14px; font-weight: 700; }
.cc .grade-pct { font-size: 10px; color: var(--ink-faint); }
.cc .krow { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.cc .krow .kr-main { flex: 1; min-width: 0; }
.cc .krow .kr-title { font-size: 12.5px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc .krow .kr-sub { font-size: 10.5px; color: var(--ink-faint); margin-top: 1px; }
.cc .krow .kr-right { text-align: right; flex-shrink: 0; font-size: 11px; }
.cc .krow.overdue { border-bottom-color: color-mix(in oklab, var(--red) 30%, transparent); }
.cc .ksched { display: flex; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.cc .ksched .ks-day { min-width: 120px; font-weight: 700; font-size: 11px; color: var(--accent-ink); flex-shrink: 0; }
.cc .ksched .ks-act { color: var(--ink-soft); } .cc .ksched .ks-act b { color: var(--ink); }

/* ============================ TRAVEL ==================================== */
.cc .trip-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.cc .tchip { display: flex; gap: 11px; align-items: flex-start; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 13px; }
.cc .tchip .tc-emoji { font-size: 24px; line-height: 1; }
.cc .tchip .tc-title { font-size: 13px; font-weight: 700; color: var(--ink); line-height: 1.25; }
.cc .tchip .tc-meta { font-size: 11px; color: var(--ink-faint); margin-top: 3px; }
.cc .trip-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.cc .trip-thumb { width: 100%; height: 150px; object-fit: cover; border-radius: var(--radius-sm); margin-bottom: 12px; border: 1px solid var(--line); }
.cc .trip-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 4px; }
.cc .trip-meta .tm-text { font-size: 11.5px; color: var(--ink-soft); display: inline-flex; align-items: center; gap: 4px; }
.cc .itin-day { margin-top: 12px; }
.cc .itin-daylabel { font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-faint); margin: 10px 0 4px; }
.cc .itin { display: flex; gap: 10px; padding: 6px 0; align-items: flex-start; }
.cc .itin .it-time { font-family: var(--font-mono); font-size: 11px; font-weight: 600; color: var(--ink-soft); min-width: 64px; flex-shrink: 0; padding-top: 1px; }
.cc .itin .it-desc { font-size: 12.5px; color: var(--ink); line-height: 1.4; }
.cc .pack-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 18px; }
.cc .pack-item { display: flex; gap: 9px; align-items: flex-start; font-size: 12px; padding: 4px 0; color: var(--ink-soft); cursor: pointer; line-height: 1.35; }
.cc .pack-item .pk-box { width: 15px; height: 15px; border-radius: 4px; border: 2px solid var(--line-strong); flex-shrink: 0; margin-top: 1px; display: grid; place-items: center; color: transparent; transition: all .12s; }
.cc .pack-item .pk-box svg { width: 9px; height: 9px; }
.cc .pack-item.done .pk-box { background: var(--green); border-color: var(--green); color: #fff; }
.cc .pack-item.done .pk-text { text-decoration: line-through; color: var(--ink-faint); }
.cc .progress-mini { height: 6px; background: var(--bg-2); border-radius: 99px; overflow: hidden; margin: 4px 0 10px; }
.cc .progress-mini > div { height: 100%; background: var(--green); border-radius: 99px; transition: width .3s; }
.cc .trip-actions { display: flex; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.cc .tbtn { font-size: 12px; font-weight: 600; padding: 7px 14px; border-radius: var(--radius-pill); border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft); cursor: pointer; transition: all .14s; }
.cc .tbtn:hover { border-color: var(--line-strong); color: var(--ink); }
.cc .tbtn.confirm { background: var(--green); border-color: transparent; color: #fff; }
.cc .tbtn.confirmed { background: var(--light-green); border-color: transparent; color: var(--green); }
.cc .tbtn.remove:hover { border-color: var(--red); color: var(--red); }

/* ---- responsive --------------------------------------------------------- */
@media (max-width: 980px) {
  .cc .pg-grid.c2, .cc .trip-cards, .cc .recipe-cols { grid-template-columns: 1fr; }
  .cc .meal-week { grid-template-columns: repeat(3, 1fr); }
  .cc .kid-snap { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .cc .meal-week { grid-template-columns: repeat(2, 1fr); }
  .cc .pack-grid { grid-template-columns: 1fr; }
}
