/* Jinjerli Journal: client dashboard. Everything is scoped to .jj-app so it cannot leak into the theme. */

.jj-app {
	--jj-navy: #2a3157;
	--jj-maroon: var(--e-global-color-bf59160, #8c2f2f);
	--jj-maroon-dark: color-mix(in srgb, var(--e-global-color-bf59160, #8c2f2f) 82%, #000);
	--jj-cream: #f6efe6;
	--jj-paper: #fffdfa;
	--jj-line: #e4d9cc;
	--jj-field: #cbbfb0;
	--jj-muted: #5d6385;
	--jj-ok: #2f6f55;
	--jj-ok-bg: #e3f0e8;
	--jj-part-bg: #efd9d4;
	--jj-radius: 14px;

	box-sizing: border-box;
	width: 100%;
	max-width: 1060px;
	margin: 0 auto;
	container: jj / inline-size;
	--jj-sticky-top: 24px;
	padding: 0 0 48px;
	color: var(--jj-navy);
	font-family: inherit;
	font-size: 1rem;
	line-height: 1.55;
	text-align: left;
}
.jj-app *, .jj-app *::before, .jj-app *::after { box-sizing: border-box; }
.jj-app h2, .jj-app h3, .jj-app h4 { color: var(--jj-navy); font-family: var(--jj-heading-font, inherit); line-height: 1.25; margin: 0 0 .5em; }
.jj-app h2 { font-size: 1.6rem; }
.jj-app h3 { font-size: 1.2rem; }
.jj-app h4 { font-size: 1rem; margin-top: 1.1em; }
.jj-app p { margin: 0 0 .8em; }
.jj-app ul { margin: 0; padding: 0; }
.jj-app a { color: var(--jj-maroon); }
.jj-app :focus-visible { outline: 3px solid var(--jj-navy); outline-offset: 2px; }
.jj-app [hidden] { display: none !important; }
.jj-visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.jj-muted { color: var(--jj-muted); }
.jj-eyebrow { font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; color: var(--jj-maroon); margin: 0 0 .25em; }

.jj-loading { color: var(--jj-muted); }

/* ---------- header ---------- */
.jj-head { margin-bottom: 14px; }
.jj-head__top { display: flex; align-items: baseline; justify-content: flex-end; gap: 12px; flex-wrap: wrap; }
.jj-head__title { margin: 0; }
.jj-saved { font-size: .85rem; color: var(--jj-muted); }
.jj-saved--error { color: var(--jj-maroon-dark); font-weight: 600; }
.jj-daynav { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.jj-daynav__label { display: flex; flex-direction: column; min-width: 150px; line-height: 1.25; }
.jj-daynav__label span { font-size: .9rem; color: var(--jj-muted); }
.jj-iconbtn {
	width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--jj-field); background: var(--jj-paper);
	color: var(--jj-navy); font-size: 1.5rem; line-height: 1; cursor: pointer; padding: 0;
}
.jj-iconbtn:hover:not(:disabled) { background: var(--jj-cream); }
.jj-iconbtn:disabled { opacity: .35; cursor: default; }

/* ---------- tabs ---------- */
.jj-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 4px 2px 10px; margin: 0 -2px 6px; scrollbar-width: thin; }
.jj-tab {
	flex: 0 0 auto; min-height: 44px; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--jj-line);
	background: var(--jj-paper); color: var(--jj-navy); font: inherit; font-size: .95rem; cursor: pointer; white-space: nowrap;
}
.jj-tab:hover { background: var(--jj-cream); }
.jj-tab.is-active { background: var(--jj-navy); border-color: var(--jj-navy); color: #fff; }
.jj-tab__tick { margin-left: 6px; color: var(--jj-ok); font-weight: 700; }
.jj-tab.is-active .jj-tab__tick { color: #bfe6cf; }

/* ---------- cards ---------- */
.jj-panel { outline: none; }
.jj-card {
	background: var(--jj-paper); border: 1px solid var(--jj-line); border-radius: var(--jj-radius);
	padding: 18px; margin: 0 0 14px;
}
.jj-card--hero { background: var(--jj-navy); border-color: var(--jj-navy); color: #fff; }
.jj-card--hero h2, .jj-card--hero h3, .jj-card--hero .jj-bigday { color: #fff; }
.jj-card--hero .jj-eyebrow { color: #f1d6b8; }
.jj-card--hero .jj-muted { color: #d6d9ea; }
.jj-card--hero a { color: #fff; }
.jj-card--soft { background: var(--jj-cream); border-color: var(--jj-cream); }
.jj-card--note { background: var(--jj-cream); border-color: var(--jj-line); }
.jj-card--meal h3 { margin-bottom: .75em; }
.jj-bigday { font-size: 2.2rem; margin: 0 0 .3em; }
.jj-bigday span { font-size: 1.1rem; font-weight: 400; opacity: .85; }
.jj-bar { height: 10px; border-radius: 999px; background: rgba(255,255,255,.22); overflow: hidden; margin: 6px 0 12px; }
.jj-bar__fill { height: 100%; background: #f1d6b8; border-radius: 999px; }

.jj-quote {
	margin: 0 0 14px; padding: 16px 18px; background: var(--jj-cream); border-left: 4px solid var(--jj-maroon);
	border-radius: 0 var(--jj-radius) var(--jj-radius) 0; font-size: 1.05rem; font-style: italic;
}
.jj-quote p { margin: 0; }
.jj-quote cite { display: block; margin-top: .4em; font-size: .9rem; font-style: normal; color: var(--jj-muted); }
.jj-reminder { font-size: 1.05rem; margin: 0; }
.jj-celebrate { margin: .8em 0 0; color: var(--jj-ok); font-weight: 600; }

/* ---------- overview checklist ---------- */
.jj-checks { list-style: none; display: grid; gap: 8px; }
.jj-checkrow {
	display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 10px 14px; text-align: left;
	background: var(--jj-paper); border: 1px solid var(--jj-line); border-radius: 12px; font: inherit; color: var(--jj-navy); cursor: pointer;
}
.jj-checkrow:hover { background: var(--jj-cream); }
.jj-checkrow__icon {
	flex: 0 0 26px; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--jj-field);
	display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: #fff;
}
.jj-checkrow__name { flex: 1; font-weight: 600; }
.jj-checkrow__status { font-size: .9rem; color: var(--jj-muted); }
.jj-checkrow--done { background: var(--jj-ok-bg); border-color: #b9d8c6; }
.jj-checkrow--done .jj-checkrow__icon { background: var(--jj-ok); border-color: var(--jj-ok); }
.jj-checkrow--done .jj-checkrow__status { color: var(--jj-ok); font-weight: 600; }
.jj-checkrow--started .jj-checkrow__icon { border-color: var(--jj-maroon); background: linear-gradient(90deg, var(--jj-maroon) 50%, transparent 50%); }

/* ---------- stats ---------- */
.jj-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }
.jj-stat { background: var(--jj-cream); border-radius: 12px; padding: 10px 12px; }
.jj-stat__label { display: block; font-size: .8rem; color: var(--jj-muted); }
.jj-stat__value { display: block; font-weight: 700; font-size: 1.05rem; }

/* ---------- goals ---------- */
.jj-goals, .jj-bullets { padding-left: 1.2em; }
.jj-goals li, .jj-bullets li { margin: .3em 0; }
.jj-bullets--soft li::marker { color: var(--jj-maroon); }
.jj-details summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
.jj-details.jj-card { padding: 10px 18px; }
.jj-history { padding: 8px 0; border-top: 1px solid var(--jj-line); }
.jj-history h4 { margin: 0 0 .3em; }

/* ---------- 91 day grid ---------- */
.jj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(34px, 1fr)); gap: 5px; margin: 10px 0; }
.jj-day {
	min-height: 34px; border-radius: 8px; border: 1px solid var(--jj-line); background: var(--jj-paper); color: var(--jj-navy);
	font: inherit; font-size: .78rem; cursor: pointer; padding: 0;
}
.jj-day--part { background: var(--jj-part-bg); border-color: #dcbab2; }
.jj-day--full { background: var(--jj-ok); border-color: var(--jj-ok); color: #fff; }
.jj-day--future { opacity: .4; cursor: default; }
.jj-day--current { outline: 3px solid var(--jj-navy); outline-offset: 1px; }
.jj-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .85rem; color: var(--jj-muted); margin-top: 6px; }
.jj-legend li { display: inline-flex; align-items: center; gap: 6px; }
.jj-swatch { width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--jj-line); display: inline-block; }
.jj-swatch.jj-day--none { background: var(--jj-paper); }
.jj-swatch--a { background: var(--jj-maroon); border-color: var(--jj-maroon); border-radius: 50%; }
.jj-swatch--b { background: var(--jj-navy); border-color: var(--jj-navy); border-radius: 50%; }

/* ---------- charts ---------- */
.jj-chart { display: block; width: 100%; max-width: 560px; height: auto; margin: 6px 0; overflow: visible; }
.jj-chart__grid { stroke: var(--jj-line); stroke-width: 1; }
.jj-chart__text { fill: var(--jj-muted); font-size: 11px; font-family: inherit; }
.jj-chart__line { stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.jj-chart__line.jj-s-a { stroke: var(--jj-maroon); }
.jj-chart__line.jj-s-b { stroke: var(--jj-navy); }
.jj-chart__dot.jj-s-a { fill: var(--jj-maroon); }
.jj-chart__dot.jj-s-b { fill: var(--jj-navy); }

/* ---------- forms ---------- */
.jj-field { margin: 0 0 14px; min-width: 0; }
.jj-field label, .jj-label { display: block; font-weight: 600; margin-bottom: 4px; font-size: .95rem; }
.jj-app input[type="text"], .jj-app input[type="number"], .jj-app input[type="time"], .jj-app textarea {
	display: block; width: 100%; min-height: 46px; padding: 10px 12px; font: inherit; font-size: 16px; color: var(--jj-navy);
	background: #fff; border: 1px solid var(--jj-field); border-radius: 10px; box-shadow: none;
}
.jj-app textarea { resize: vertical; min-height: 70px; }
.jj-app input:focus, .jj-app textarea:focus { border-color: var(--jj-navy); }
.jj-hint { font-size: .85rem; color: var(--jj-muted); margin: 4px 0 0; }
.jj-static { margin: 0; padding: 10px 0; }
.jj-twocol, .jj-grid2 { display: grid; grid-template-columns: 1fr; gap: 0 14px; }
.jj-check-field { display: flex; align-items: center; gap: 10px; min-height: 44px; margin: 4px 0 10px; }
.jj-check-field input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--jj-maroon); flex: 0 0 auto; margin: 0; }
.jj-check-field label { font-weight: 600; margin: 0; }

/* 1 to 10 rating */
.jj-rating { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
.jj-rating legend { font-weight: 600; padding: 0; margin-bottom: 6px; }
.jj-rating__row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.jj-rating__opt { position: relative; }
.jj-rating__opt input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.jj-rating__opt label {
	display: flex; align-items: center; justify-content: center; min-height: 46px; margin: 0; border-radius: 10px;
	border: 1px solid var(--jj-field); background: #fff; font-weight: 600; cursor: pointer;
}
.jj-rating__opt input:checked + label { background: var(--jj-navy); border-color: var(--jj-navy); color: #fff; }
.jj-rating__opt input:focus-visible + label { outline: 3px solid var(--jj-maroon); outline-offset: 2px; }
.jj-rating__ends { display: flex; justify-content: space-between; font-size: .85rem; color: var(--jj-muted); margin: 6px 0 0; }

/* ---------- buttons ---------- */
.jj-btn {
	display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 10px 22px; border-radius: 999px;
	border: 2px solid var(--jj-maroon); background: var(--jj-maroon); color: #fff !important; font: inherit; font-weight: 600;
	text-decoration: none; cursor: pointer; line-height: 1.2;
}
.jj-btn:hover:not(:disabled) { background: var(--jj-maroon-dark); border-color: var(--jj-maroon-dark); }
.jj-btn:disabled { opacity: .6; cursor: default; }
.jj-btn--ghost { background: transparent; color: var(--jj-maroon) !important; }
.jj-btn--ghost:hover:not(:disabled) { background: var(--jj-cream); color: var(--jj-maroon-dark) !important; }
.jj-btn--small { min-height: 40px; padding: 6px 16px; font-size: .9rem; }
.jj-btn--block { display: flex; width: 100%; }
.jj-linkbtn { background: none; border: 0; padding: 8px 4px; font: inherit; color: var(--jj-maroon); text-decoration: underline; cursor: pointer; min-height: 40px; }
.jj-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 0; }
.jj-link { color: var(--jj-maroon); }

/* Complete block */
.jj-complete { margin: 6px 0 18px; }
.jj-complete .jj-btn { font-size: 1.05rem; min-height: 54px; }
.jj-complete__done { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; background: var(--jj-ok-bg); border: 1px solid #b9d8c6; border-radius: var(--jj-radius); }
.jj-complete__badge { color: var(--jj-ok); font-weight: 700; }
.jj-complete__msg { margin: 10px 0 0; color: var(--jj-ok); }
.jj-complete__msg--error { color: var(--jj-maroon-dark); }

/* ---------- photos ---------- */
.jj-photos__list { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }
.jj-photos__item { position: relative; width: 92px; height: 92px; }
.jj-photos__item img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; border: 1px solid var(--jj-line); display: block; }
.jj-photos__remove {
	position: absolute; top: -8px; right: -8px; width: 30px; height: 30px; border-radius: 50%; border: 2px solid #fff;
	background: var(--jj-navy); color: #fff; font-size: 1.1rem; line-height: 1; cursor: pointer; padding: 0;
}
.jj-photos__msg { color: var(--jj-maroon-dark); font-size: .9rem; margin: 6px 0 0; }

/* ---------- footer, gate ---------- */
.jj-foot { margin-top: 24px; padding-top: 14px; border-top: 1px solid var(--jj-line); font-size: .9rem; color: var(--jj-muted); }
.jj-foot p { margin: 0 0 .4em; }
.jj-gate { text-align: center; padding: 28px 18px; background: var(--jj-paper); border: 1px solid var(--jj-line); border-radius: var(--jj-radius); }
.jj-richtext p { margin: 0 0 .8em; }
.jj-richtext ul, .jj-richtext ol { padding-left: 1.2em; margin: 0 0 .8em; }

@media (min-width: 560px) {
	.jj-twocol, .jj-grid2 { grid-template-columns: 1fr 1fr; }
	.jj-rating__row { grid-template-columns: repeat(10, 1fr); }
	.jj-card { padding: 22px; }
}
@media (prefers-reduced-motion: no-preference) {
	.jj-btn, .jj-tab, .jj-checkrow, .jj-day { transition: background-color .15s ease, border-color .15s ease; }
}

/* collapsible meal cards */
.jj-meal { padding: 0; }
.jj-meal > summary {
	display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 12px 18px; cursor: pointer; list-style: none;
}
.jj-meal > summary::-webkit-details-marker { display: none; }
.jj-meal > summary::after { content: "\25BE"; margin-left: auto; color: var(--jj-muted); transition: transform .15s ease; }
.jj-meal[open] > summary::after { transform: rotate(180deg); }
.jj-meal__name { font-weight: 700; font-size: 1.1rem; flex: 0 0 auto; }
.jj-meal__preview { color: var(--jj-muted); font-size: .9rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jj-meal__body { padding: 0 18px 8px; }
@media (min-width: 560px) { .jj-meal > summary { padding: 12px 22px; } .jj-meal__body { padding: 0 22px 8px; } }

/* ---------- desktop: tabs down the left side ---------- */
@container jj (min-width: 820px) {
	.jj-shell {
		display: grid;
		grid-template-columns: 220px minmax(0, 1fr);
		grid-template-areas: "head head" "tabs body" "tabs foot";
		column-gap: 32px;
		align-items: start;
	}
	.jj-head { grid-area: head; }
	.jj-tabs {
		grid-area: tabs; flex-direction: column; gap: 6px; overflow: visible; margin: 0; padding: 0;
		position: sticky; top: var(--jj-sticky-top);
	}
	.jj-tab {
		display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 48px;
		border-radius: 12px; padding: 10px 16px; font-size: 1rem; text-align: left;
	}
	.jj-tab__tick { margin-left: auto; padding-left: 8px; }
	.jj-body { grid-area: body; min-width: 0; }
	.jj-foot { grid-area: foot; }
	.jj-shell > .jj-card, .jj-shell > .jj-gate { grid-column: 1 / -1; }
}

.jj-gate #loginform { max-width: 320px; margin: 0 auto 12px; text-align: left; }
.jj-gate #loginform p { margin: 0 0 12px; }
.jj-gate #loginform label { display: block; font-weight: 600; margin-bottom: 4px; }
.jj-gate #loginform input[type=text], .jj-gate #loginform input[type=password] { width: 100%; box-sizing: border-box; padding: 10px; border: 1px solid var(--jj-line); border-radius: 6px; font-size: 16px; }
.jj-gate #loginform .login-remember label { font-weight: 400; }
.jj-gate #loginform input[type=submit] { background: var(--jj-navy); color: #fff; border: 0; border-radius: 6px; padding: 10px 18px; font-size: 16px; cursor: pointer; }

/* ---------- dark (navy) cards: force readable text, links, labels and buttons, even if the theme restyles them ---------- */
.jj-app .jj-card--hero,
.jj-app .jj-card--hero p,
.jj-app .jj-card--hero label,
.jj-app .jj-card--hero span,
.jj-app .jj-card--hero li,
.jj-app .jj-card--hero h2,
.jj-app .jj-card--hero h3 { color: #fff !important; }
.jj-app .jj-card--hero .jj-eyebrow { color: #f1d6b8 !important; }
.jj-app .jj-card--hero .jj-muted { color: #e3e6f3 !important; }
.jj-app .jj-card--hero a,
.jj-app .jj-card--hero a:visited { color: #f1d6b8 !important; text-decoration: underline; text-underline-offset: 2px; }
.jj-app .jj-card--hero a:hover,
.jj-app .jj-card--hero a:focus { color: #fff !important; }
.jj-app .jj-card--hero label { font-weight: 600; text-transform: none; background: transparent !important; }
.jj-app .jj-card--hero label::first-letter { color: #fff !important; }
.jj-app .jj-card--hero ::selection { background: #f1d6b8; color: #2a3157; }
.jj-app .jj-card--hero :focus-visible { outline-color: #f1d6b8; }
/* buttons on navy: cream button, navy text */
.jj-app .jj-card--hero .jj-btn,
.jj-app .jj-card--hero button.jj-btn { background: #f6efe6 !important; border-color: #f6efe6 !important; color: #2a3157 !important; opacity: 1; }
.jj-app .jj-card--hero .jj-btn:hover:not(:disabled) { background: #fff !important; border-color: #fff !important; color: #2a3157 !important; }
.jj-app .jj-card--hero .jj-btn:disabled { opacity: .55; }
.jj-app .jj-card--hero .jj-btn--ghost { background: transparent !important; color: #f6efe6 !important; border-color: #f6efe6 !important; }
.jj-app .jj-complete__msg--error { color: var(--jj-maroon-dark); }
.jj-app .jj-card--hero .jj-complete__msg--error { color: #ffd9d9 !important; }
.jj-app .jj-tab.is-active, .jj-app .jj-tab.is-active span, .jj-app .jj-rating__opt input:checked + label { color: #fff !important; }
.jj-app .jj-tab.is-active { background: #2a3157 !important; }
.jj-app .jj-plan__title { margin: 1em 0 .2em; font-size: 1rem; color: var(--jj-maroon); }

/* Overview: progress photos and send-to-coach */
.jj-pp { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 8px 0; }
.jj-pp figure { margin: 0; }
.jj-pp img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 10px; border: 1px solid var(--jj-line); display: block; }
.jj-pp figcaption { font-size: .9rem; color: var(--jj-muted); margin-top: 4px; }
.jj-send__warn { margin: 10px 0; padding: 12px 14px; background: var(--jj-cream); border-left: 4px solid var(--jj-maroon); border-radius: 6px; }
.jj-send__row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
