/* Home, Cases and Herbs landings, Progress and primary navigation.
   Three levels: illustrated destinations (paths, banners), compact functional
   cards, then flat rows and links. Lime marks the action that starts practice;
   violet marks progress and XP. Loaded after the other sheets; the inline
   <style> in app.html follows it, so overrides here are scoped by id. */

:root{
  --hub-forest:#123d2a;--hub-forest-2:#1f5236;--hub-ink:#1c2e26;--hub-muted:#5b6660;
  --hub-sage:#e3efe2;--hub-line:rgba(32,62,52,.09);
  --hub-lime:#b8ee4b;--hub-lime-hover:#a8e03a;--hub-lime-edge:#8fc22a;--hub-lime-ink:#183a2c;
  --hub-violet:#6332c4;--hub-violet-soft:#b9a4f3;
  --hub-card:var(--surface-primary,#fffcf5);
  --hub-shadow:0 1px 2px rgba(32,62,52,.05),0 8px 22px rgba(32,62,52,.06);
  --hub-serif:'DM Serif Display',Georgia,serif;
}

/* -- Shared pieces --------------------------------------------------------- */
.hub-card{background:var(--hub-card);border:1px solid var(--hub-line);border-radius:20px;padding:16px;box-shadow:var(--hub-shadow)}
.hub-card-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px}
.hub-card-title{margin:0 0 10px;font:700 17px/1.3 'Inter',sans-serif;letter-spacing:-.01em;color:var(--hub-ink)}
.hub-card-head .hub-card-title{margin:0}
.hub-eyebrow{display:block;margin-bottom:2px;font:700 10.5px/1.4 'DM Mono',monospace;letter-spacing:.07em;text-transform:uppercase;color:var(--action-hover,#175f40)}
.hub-link{appearance:none;display:inline-flex;align-items:center;gap:4px;min-height:36px;padding:6px 0;border:0;background:none;color:var(--hub-violet);font:600 13.5px/1.2 'Inter',sans-serif;cursor:pointer;white-space:nowrap}
.hub-link .ui-icon{width:14px;height:14px;vertical-align:0}
.hub-link:hover{text-decoration:underline;text-underline-offset:3px}
.hub-go-btn,.case-custom-start{appearance:none;display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:48px;padding:11px 20px;border:0;border-bottom:3px solid var(--hub-lime-edge);border-radius:14px;background:var(--hub-lime);color:var(--hub-lime-ink);font:700 15px/1.2 'Inter',sans-serif;cursor:pointer;transition:background .16s,transform .12s,border-width .12s}
.hub-go-btn .ui-icon,.case-custom-start .ui-icon{width:17px;height:17px;stroke-width:2.2;vertical-align:0}
.hub-go-btn:hover,.case-custom-start:hover{background:var(--hub-lime-hover)}
.hub-go-btn:active,.case-custom-start:active{transform:translateY(2px);border-bottom-width:1px}
:is(.hub-go-btn,.case-custom-start,.hub-link,.hub-row,.hub-path,.hub-goal button,.progress-tabs button,.herb-hub-cats button,.herb-hub-garden button,.progress-garden button,.progress-cases button,#s-tcm-home .case-customize>summary,.case-customize-close):focus-visible{outline:3px solid var(--focus-ring,#0b6fc2);outline-offset:3px}

/* A row that continues something: art, what it is, where you are, a chevron. */
.hub-row{appearance:none;display:grid;grid-template-columns:56px minmax(0,1fr) 36px;align-items:center;gap:14px;width:100%;padding:0;border:0;background:none;color:inherit;font:inherit;text-align:left;cursor:pointer;border-radius:14px}
.hub-row-media{display:flex;align-items:center;justify-content:center;width:56px;height:56px;border-radius:16px;background:linear-gradient(145deg,#f6efe4,#efe7da);overflow:hidden}
.hub-row-art{display:block;width:88%;height:88%;object-fit:contain}
.hub-row-icon{display:flex;align-items:center;justify-content:center;width:100%;height:100%;background:#ecf6dc;color:var(--hub-forest-2)}
.hub-row-icon .ui-icon{width:24px;height:24px}
.hub-row-copy{display:flex;flex-direction:column;gap:2px;min-width:0}
.hub-row-title{font:650 16px/1.3 'Inter',sans-serif;color:var(--hub-ink)}
.hub-row-title small{margin-left:6px;font-size:12.5px;font-weight:500;color:var(--hub-muted)}
.hub-row-meta{font-size:13px;line-height:1.4;color:var(--hub-muted)}
.hub-row-go{display:flex;align-items:center;justify-content:center;width:36px;height:36px;border:1px solid var(--hub-line);border-radius:50%;background:#fff;color:var(--hub-ink)}
.hub-row-go .ui-icon{width:16px;height:16px;stroke-width:2.2}
.hub-row:hover .hub-row-go{border-color:var(--hub-forest-2)}
.hub-meter{display:flex;align-items:center;gap:10px;margin-top:6px}
.hub-meter b{font:600 12.5px/1 'Inter',sans-serif;color:var(--hub-ink);font-variant-numeric:tabular-nums}
.hub-meter-track{position:relative;flex:1;height:7px;border-radius:99px;background:var(--progress-purple-track,#eee7f8);overflow:hidden}
.hub-meter-track>span{display:block;height:100%;border-radius:inherit;background:var(--progress-gradient,linear-gradient(90deg,#a58ade,#6332c4));animation:hubFill .8s cubic-bezier(.2,.7,.2,1) both}
.hub-next{display:grid;grid-template-columns:56px minmax(0,1fr);align-items:center;gap:8px 14px}
.hub-next .hub-go-btn{grid-column:1/-1;margin-top:6px;width:100%}

/* -- Navigation ---------------------------------------------------------------- */
.mob-nav{height:calc(66px + env(safe-area-inset-bottom,0px));padding:6px 10px calc(6px + env(safe-area-inset-bottom,0px));gap:4px;background:rgba(255,252,245,.97);border-top:1px solid var(--hub-line);box-shadow:0 -8px 24px rgba(20,40,30,.08)}
.mob-nav-btn{flex:1 1 0;gap:3px;border-radius:14px;color:#5d6a63;font:600 11px/1.1 'Inter',sans-serif;letter-spacing:0;text-transform:none}
.mob-nav-btn::before{display:none}
.mob-nav-btn.on{background:var(--hub-sage);color:var(--hub-forest);box-shadow:none}
.mob-nav-btn:focus-visible{outline:3px solid var(--focus-ring,#0b6fc2);outline-offset:-3px}
.sb-account-user:focus-visible{outline:2px solid rgba(242,209,120,.9);outline-offset:2px;border-radius:10px}
/* Home's hero runs under the header on phones. */
body.hub-active .mob-header{position:absolute;top:0;left:0;right:0;background:transparent;box-shadow:none}
body.hub-active .mob-account-pill{background:rgba(255,255,255,.18)}

/* -- Home ---------------------------------------------------------------------- */
.hub-hero{position:relative;isolation:isolate;overflow:hidden;margin:-.75rem -.9rem 0;padding:calc(var(--mob-header-offset,56px) + 16px) 16px 22px;color:#fff;background:#0f2a20}
.hub-hero-art{position:absolute;inset:0;z-index:-2;width:100%;height:100%;object-fit:cover;object-position:70% 32%}
.hub-hero::before{content:'';position:absolute;inset:0;z-index:-1;background:linear-gradient(180deg,rgba(7,20,14,.66) 0%,rgba(7,20,14,.3) 26%,rgba(7,20,14,.34) 58%,rgba(9,24,17,.72) 82%,var(--canvas,#f4f0e8) 100%)}
.hub-greeting{margin:0;font:400 clamp(28px,7.6vw,36px)/1.08 var(--hub-serif);letter-spacing:-.01em;color:#fff;text-shadow:0 2px 14px rgba(0,0,0,.35)}
.hub-sub{margin:6px 0 0;font-size:15px;line-height:1.45;color:rgba(255,255,255,.9);text-shadow:0 1px 8px rgba(0,0,0,.35)}
.hub-paths{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:18px}
.hub-path{appearance:none;position:relative;isolation:isolate;display:flex;align-items:flex-end;min-height:208px;aspect-ratio:.74;padding:14px;border:1.5px solid rgba(255,255,255,.62);border-radius:22px;overflow:hidden;background:linear-gradient(160deg,#2f6b4a,#123d2a);color:#fff;font:inherit;text-align:left;cursor:pointer;box-shadow:0 16px 32px rgba(0,0,0,.34);transition:transform .2s ease,box-shadow .2s ease}
.hub-path-art{position:absolute;inset:0;z-index:-2;width:100%;height:100%;object-fit:cover;object-position:50% 30%;transition:transform .7s cubic-bezier(.2,.7,.2,1)}
.hub-path::after{content:'';position:absolute;inset:0;z-index:-1;background:linear-gradient(180deg,rgba(8,26,18,0) 34%,rgba(8,26,18,.6) 62%,rgba(8,28,19,.95) 100%)}
.hub-path-copy{display:flex;flex-direction:column;gap:6px;padding-right:38px}
.hub-path-title{font:400 clamp(24px,6.6vw,30px)/1 var(--hub-serif);letter-spacing:-.01em;text-shadow:0 2px 10px rgba(0,0,0,.4)}
.hub-path-title span{display:block}
.hub-path-desc{font-size:12.5px;line-height:1.35;color:rgba(255,255,255,.9)}
.hub-path-go{position:absolute;right:12px;bottom:14px;display:flex;align-items:center;justify-content:center;width:34px;height:34px;border-radius:50%;background:#e9f8c8;color:var(--hub-lime-ink);box-shadow:0 4px 12px rgba(0,0,0,.25)}
.hub-path-go .ui-icon{width:17px;height:17px;stroke-width:2.3}
.hub-path:hover .hub-path-art{transform:scale(1.05)}
.hub-path:active{transform:scale(.985)}
.hub-body{display:grid;grid-template-columns:minmax(0,1fr);gap:12px;margin-top:14px}
#s-hub.active .hub-body>section{animation:hubRise .45s cubic-bezier(.2,.7,.2,1) both}
#s-hub.active .hub-body>section:nth-child(2){animation-delay:.05s}
#s-hub.active .hub-body>section:nth-child(3){animation-delay:.1s}
.hub-continue>.hub-card-title{margin-bottom:12px}

.hub-streak{display:inline-flex;align-items:center;gap:5px;color:#c2571a;font:600 13.5px/1 'Inter',sans-serif;white-space:nowrap}
.hub-streak .ui-icon{width:18px;height:18px;fill:#f59a3b;stroke:#d9621f;stroke-width:1.4}
.hub-goals{display:grid;gap:2px;margin:0;padding:0;list-style:none}
.hub-goal button{appearance:none;display:grid;grid-template-columns:26px minmax(0,1fr) auto;align-items:center;gap:12px;width:100%;min-height:44px;padding:4px 2px;border:0;border-radius:10px;background:none;color:var(--hub-ink);font:500 14.5px/1.35 'Inter',sans-serif;text-align:left;cursor:pointer}
.hub-goal button:hover{background:rgba(32,62,52,.04)}
.hub-goal-mark{display:flex;align-items:center;justify-content:center;width:24px;height:24px;border:2px solid #b7c2bb;border-radius:50%;color:#fff}
.hub-goal-mark .ui-icon{width:14px;height:14px;stroke-width:3}
.hub-goal.is-done .hub-goal-mark{border-color:var(--hub-forest-2);background:var(--hub-forest-2)}
.hub-goal-count{font-size:13px;color:var(--hub-muted);font-variant-numeric:tabular-nums}

.hub-garden-list{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));margin:0 -4px;padding:0;list-style:none}
.hub-element{position:relative;display:flex;flex-direction:column;align-items:center;gap:1px;padding:4px 3px;text-align:center}
.hub-element+.hub-element::before{content:'';position:absolute;left:0;top:14%;bottom:14%;width:1px;background:var(--hub-line)}
.hub-element-art{display:block;width:100%;max-width:70px;height:auto;aspect-ratio:1;margin-bottom:4px;object-fit:contain;filter:drop-shadow(0 4px 6px rgba(40,30,10,.14))}
#s-hub.active .hub-element-art{animation:hubGrow .6s cubic-bezier(.2,.8,.2,1) both}
.hub-element:nth-child(2) .hub-element-art{animation-delay:.05s}
.hub-element:nth-child(3) .hub-element-art{animation-delay:.1s}
.hub-element:nth-child(4) .hub-element-art{animation-delay:.15s}
.hub-element:nth-child(5) .hub-element-art{animation-delay:.2s}
.hub-element-name{font:500 13px/1.25 'Inter',sans-serif;color:var(--hub-ink)}
.hub-element-xp{font-size:12px;color:var(--hub-muted);font-variant-numeric:tabular-nums}
.hub-element.is-lead .hub-element-name,.hub-element.is-lead .hub-element-xp{color:var(--hub-forest);font-weight:700}
.is-dormant .hub-element-art{filter:saturate(.3) opacity(.7)}
/* With Element XP the ranked medal (.reward-badge in app.html) replaces the plain art. */
.hub-element .reward-badge{display:block;width:100%!important;max-width:72px;height:auto!important;aspect-ratio:1;margin:0 auto 4px}
#s-hub.active .hub-element .reward-badge{animation:hubGrow .6s cubic-bezier(.2,.8,.2,1) both}
.hub-element:nth-child(2) .reward-badge{animation-delay:.05s}
.hub-element:nth-child(3) .reward-badge{animation-delay:.1s}
.hub-element:nth-child(4) .reward-badge{animation-delay:.15s}
.hub-element:nth-child(5) .reward-badge{animation-delay:.2s}
.hub-element-rank{font:700 10.5px/1.3 'Inter',sans-serif;letter-spacing:.07em;text-transform:uppercase;color:var(--hub-muted)}
.hub-element-rank.bronze{color:#8c5a2c}.hub-element-rank.silver{color:#66717a}.hub-element-rank.gold{color:#966c10}.hub-element-rank.platinum{color:#6d58c4}
.hub-garden-note{margin:10px 0 0;font-size:13px;line-height:1.45;color:var(--hub-muted)}
.hub-garden-note[hidden]{display:none}

/* -- Cases ---------------------------------------------------------------------- */
#s-tcm-home .case-practice-page{padding-top:0}
#s-tcm-home .cases-banner{position:relative;isolation:isolate;overflow:hidden;display:flex;flex-direction:row;align-items:flex-end;justify-content:space-between;gap:1rem;min-height:196px;margin:-.75rem -.9rem 16px;padding:28px 18px 22px;background:#163826;color:#fff}
.cases-banner-art{position:absolute;inset:0;z-index:-2;width:100%;height:100%;object-fit:cover;object-position:50% 40%}
.cases-banner::before{content:'';position:absolute;inset:0;z-index:-1;background:linear-gradient(180deg,rgba(8,24,17,.2) 0%,rgba(8,24,17,.5) 45%,rgba(8,24,17,.9) 100%)}
#s-tcm-home .cases-banner .case-practice-eyebrow{color:#d8f5a3;margin-bottom:4px}
#s-tcm-home .cases-banner h1{margin:0 0 6px;font:400 34px/1.05 var(--hub-serif);letter-spacing:-.01em;color:#fff}
#s-tcm-home .cases-banner p{display:block;max-width:420px;margin:0;font-size:14.5px;line-height:1.45;color:rgba(255,255,255,.9)}
#s-tcm-home .cases-banner .case-private-mode-entry{background:rgba(255,255,255,.14);border-color:rgba(255,255,255,.4);color:#fff}
.cases-continue{margin:0 0 16px;background:var(--hub-card);border:1px solid var(--hub-line);border-radius:20px;padding:16px;box-shadow:var(--hub-shadow)}
.cases-continue[hidden]{display:none}
.cases-section-title{margin:4px 2px 10px;font:700 18px/1.3 'Inter',sans-serif;letter-spacing:-.01em;color:var(--hub-ink)}
#s-tcm-home .case-setup-card{display:block;margin:0 0 18px;padding:0;background:none;border:0;border-radius:0;box-shadow:none}
#s-tcm-home .case-setup-card[hidden]{display:none}
#s-tcm-home .case-setup-heading{display:flex;align-items:center;gap:16px;margin:0 0 12px;padding:14px 16px;border:1px solid rgba(31,82,54,.1);border-radius:18px;background:linear-gradient(135deg,#eef4e6,#f7f3ea)}
#s-tcm-home .case-setup-heading>div:first-child{flex:1;min-width:0}
#s-tcm-home .case-setup-heading .case-practice-eyebrow{margin-bottom:3px}
#s-tcm-home #tcm-setup-title{margin:0 0 4px;font:400 22px/1.2 var(--hub-serif);letter-spacing:-.005em;color:var(--hub-ink)}
#s-tcm-home #tcm-setup-copy{margin:0;font-size:14px;line-height:1.5;color:var(--hub-muted)}
#s-tcm-home .case-invitation-art{flex:0 0 auto;width:110px;align-self:center}
#s-tcm-home .case-invitation-art img{max-height:110px}
#s-tcm-home .case-patient-teaser{margin:0 0 12px}
.case-start-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;align-items:stretch}
.case-start-grid:has(>.case-customize[hidden]){grid-template-columns:1fr}
.case-quick-tile,#s-tcm-home .case-customize>summary{display:flex;flex-direction:column;align-items:flex-start;gap:5px;height:100%;min-height:190px;padding:16px 14px 14px;border:1px solid var(--hub-line);border-radius:18px;background:var(--hub-card);box-shadow:var(--hub-shadow)}
.case-tile-icon{display:flex;align-items:center;justify-content:center;width:44px;height:44px;margin-bottom:4px;border-radius:14px;background:#ecf8d4;color:var(--hub-forest-2)}
.case-tile-icon .ui-icon{width:22px;height:22px}
#s-tcm-home .case-customize .case-tile-icon{background:#edf0ea}
.case-tile-title{font:700 16px/1.25 'Inter',sans-serif;color:var(--hub-ink)}
#s-tcm-home .case-quick-tile .case-start-summary{margin:0 0 8px}
#s-tcm-home .case-quick-tile .case-start-summary>span{display:none}
#s-tcm-home .case-quick-tile .case-start-summary strong{font:500 13px/1.4 'Inter',sans-serif;color:var(--hub-muted)}
#s-tcm-home .case-quick-tile .case-gen-primary{margin-top:auto;min-height:46px;padding:10px 14px;border:0;border-bottom:3px solid var(--hub-lime-edge);border-radius:14px;background:var(--hub-lime);color:var(--hub-lime-ink);font:700 15px/1.2 'Inter',sans-serif;box-shadow:none}
#s-tcm-home .case-quick-tile .case-gen-primary:hover{background:var(--hub-lime-hover)}
#s-tcm-home .case-quick-tile .case-free-allowance{align-self:center;margin:.4rem 0 0}
#s-tcm-home .case-customize{grid-column:auto;margin:0;border:0}
#s-tcm-home .case-customize>summary{justify-content:flex-start;color:var(--hub-ink);font-family:'Inter',sans-serif;cursor:pointer;list-style:none;transition:border-color .16s}
#s-tcm-home .case-customize>summary:hover{border-color:rgba(31,82,54,.3)}
#s-tcm-home .case-customize>summary span::after{content:none}
#s-tcm-home .case-customize>summary small{font:500 13px/1.4 'Inter',sans-serif;color:var(--hub-muted)}
.case-tile-cta{display:inline-flex;align-items:center;justify-content:center;gap:6px;width:100%;min-height:46px;margin-top:auto;border:1.5px solid #c9d5cc;border-radius:14px;background:#fff;color:var(--hub-forest);font:700 14.5px/1.2 'Inter',sans-serif;font-style:normal}
.case-tile-cta .ui-icon{width:16px;height:16px;stroke-width:2.2;vertical-align:0}
#s-tcm-home .case-invitation-journey{justify-content:center;margin-top:14px}
#s-tcm-home .case-feedback-promise{justify-content:center;text-align:center}
#s-tcm-home #tcm-starter-review-link{display:block;margin:10px auto 0}
#s-tcm-home #tcm-starter-review-link[hidden]{display:none}

/* Custom case sheet: bottom sheet on phones, centred dialog on wide screens. */
.case-customize-backdrop{position:fixed;inset:0;z-index:310;width:100%;border:0;background:rgba(10,22,16,.48);cursor:default;animation:hubFade .2s ease both}
.case-customize-sheet{position:fixed;left:0;right:0;bottom:0;z-index:320;max-height:88vh;overflow:auto;padding:12px 18px calc(18px + env(safe-area-inset-bottom,0px));border-radius:24px 24px 0 0;background:var(--hub-card);box-shadow:0 -18px 50px rgba(10,30,20,.25);color:var(--hub-ink);animation:hubSheetIn .28s cubic-bezier(.2,.8,.2,1) both}
.case-customize-sheet::before{content:'';display:block;width:40px;height:4px;margin:0 auto 12px;border-radius:99px;background:#d3d8d1}
.case-customize-head{display:flex;align-items:center;justify-content:space-between;gap:12px}
.case-customize-head h3{margin:0;font:400 24px/1.2 var(--hub-serif);color:var(--hub-ink)}
.case-customize-close{appearance:none;min-width:44px;min-height:44px;padding:8px 4px;border:0;background:none;color:var(--hub-forest-2);font:600 14px 'Inter',sans-serif;cursor:pointer}
.case-customize-copy{margin:2px 0 0;font-size:14px;line-height:1.5;color:var(--hub-muted)}
#s-tcm-home .case-customize-sheet .case-setup-grid{grid-template-columns:1fr;gap:18px;margin:14px 0 18px;padding:0;background:none}
.case-custom-start{width:100%;min-height:52px}
body.case-sheet-open{overflow:hidden}

/* -- Herbs ------------------------------------------------------------------------ */
#s-herbs .mm-page{padding-top:0}
#s-herbs .mm-page-header{position:relative;isolation:isolate;overflow:hidden;display:flex;flex-direction:column;align-items:stretch;gap:12px;margin:-.75rem -.9rem 16px;padding:28px 16px 16px;border-radius:0 0 24px 24px;background:#1d3b2b;color:#fff}
.mm-page-banner-art{position:absolute;inset:0;z-index:-2;width:100%;height:100%;object-fit:cover;object-position:50% 26%}
#s-herbs .mm-page-header::before{content:'';position:absolute;inset:0;z-index:-1;background:linear-gradient(180deg,rgba(10,24,18,.28) 0%,rgba(10,24,18,.55) 48%,rgba(10,24,18,.9) 100%)}
.mm-page-eyebrow{font:700 11px/1.4 'DM Mono',monospace;letter-spacing:.075em;text-transform:uppercase;color:#d8f5a3}
#s-herbs .mm-page-heading h1{margin:2px 0 0;font:400 36px/1.05 var(--hub-serif);color:#fff}
#s-herbs .mm-page-header .mm-garden,#s-herbs .mm-page-header .mm-garden-label,#s-herbs .mm-page-header .mm-garden-count{color:#fff}
#s-herbs .mm-page-header .mm-garden-empty{color:rgba(255,255,255,.82)}
/* Recognition's line under the title, in the garden line's place and size. */
#s-herbs .mm-page-heading>.mm-page-lede{max-width:none;margin:12px 0 0;font-size:13px;line-height:1.4;color:rgba(255,255,255,.86)}
.mm-page-lede[hidden]{display:none}
#s-herbs .mm-page-header .mm-search-wrap{border:0;background:rgba(255,252,245,.97)}
/* Library | Recognition | Formulas: equal thirds that never wrap, down to
   a 320px screen. */
#s-herbs .mm-page-header .mm-primary-nav{display:flex;width:100%;padding:4px;border:1px solid rgba(255,255,255,.24);border-radius:14px;background:rgba(255,255,255,.12)}
#s-herbs .mm-page-header .mm-mode-btn{flex:1 1 0;min-width:0;min-height:40px;padding-inline:6px;border:0;border-radius:10px;color:#fff;white-space:nowrap}
#s-herbs .mm-page-header .mm-mode-btn.active{background:var(--hub-card);color:var(--hub-forest)}
#s-herbs .mm-page-header .mm-mode-btn:not(.active):hover{background:rgba(255,255,255,.14);color:#fff}
/* Tracks are minmax(0,1fr) so a long garden row scrolls inside its card
   instead of widening the page past the screen. */
.herb-hub{display:grid;grid-template-columns:minmax(0,1fr);gap:18px;margin:0 0 20px}
.herb-hub[hidden]{display:none}
.herb-hub-top{display:grid;grid-template-columns:minmax(0,1fr);gap:12px}
.herb-hub-card{background:var(--hub-card);border:1px solid var(--hub-line);border-radius:20px;padding:16px;box-shadow:var(--hub-shadow)}
.herb-hub-primary{display:grid;grid-template-columns:76px minmax(0,1fr);align-items:center;gap:14px;background:linear-gradient(135deg,#fffcf5 40%,#f1ecfb)}
.herb-hub-flower{display:flex;align-items:center;justify-content:center;width:76px;height:76px;border-radius:50%;background:radial-gradient(circle,#fff 30%,#efe9fb 100%)}
.herb-hub-copy h2{margin:0 0 4px;font:700 18px/1.25 'Inter',sans-serif;color:var(--hub-ink)}
.herb-hub-copy p{margin:0 0 6px;font-size:13.5px;line-height:1.45;color:var(--hub-muted)}
.herb-hub-copy .herb-hub-next{font-size:13px}
.herb-hub-copy .herb-hub-next strong{color:var(--hub-ink)}
.herb-hub-copy .hub-go-btn{margin-top:6px;width:100%}
.herb-hub-cats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:0;padding:0;list-style:none}
.herb-hub-cats button{appearance:none;display:flex;flex-direction:column;align-items:center;gap:6px;width:100%;height:100%;min-height:104px;padding:12px 6px;border:1px solid var(--hub-line);border-radius:16px;background:var(--hub-card);color:var(--hub-ink);font:inherit;text-align:center;cursor:pointer;transition:border-color .16s,transform .16s}
.herb-hub-cats button:hover{border-color:color-mix(in srgb,var(--cat) 45%,transparent);transform:translateY(-1px)}
.herb-hub-cat-mark{display:flex;align-items:center;justify-content:center;width:38px;height:38px;border-radius:50%;background:color-mix(in srgb,var(--cat) 13%,#fff);color:var(--cat)}
.herb-hub-cat-mark .ui-icon{width:20px;height:20px}
.herb-hub-cat-name{font:600 13px/1.25 'Inter',sans-serif}
.herb-hub-cat-count{font-size:11.5px;line-height:1.3;color:var(--hub-muted)}
.herb-hub-garden{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(96px,1fr);gap:8px;margin:0;padding:0 0 4px;list-style:none;overflow-x:auto;scroll-snap-type:x proximity;scrollbar-width:none}
.herb-hub-garden::-webkit-scrollbar{display:none}
.herb-hub-garden li{scroll-snap-align:start}
.herb-hub-garden button{appearance:none;display:flex;flex-direction:column;align-items:center;gap:3px;width:100%;min-height:104px;padding:10px 6px;border:1px solid var(--hub-line);border-radius:16px;background:var(--hub-card);color:var(--hub-ink);font:inherit;cursor:pointer}
.herb-hub-garden strong{font:600 12.5px/1.25 'Inter',sans-serif;text-align:center}
.herb-hub-garden small{font-size:11.5px;color:var(--hub-muted)}

/* -- Progress --------------------------------------------------------------------- */
.progress-hero{position:relative;isolation:isolate;overflow:hidden;margin:-.75rem -.9rem 0;padding:26px 16px 18px;background:#10281d;color:#fff}
.progress-hero-art{position:absolute;inset:0;z-index:-2;width:100%;height:100%;object-fit:cover;object-position:62% 40%}
.progress-hero::before{content:'';position:absolute;inset:0;z-index:-1;background:linear-gradient(180deg,rgba(7,20,14,.45),rgba(7,20,14,.35) 40%,rgba(7,20,14,.86) 100%)}
.progress-hero-copy h1{margin:0;font:400 34px/1.05 var(--hub-serif);color:#fff}
.progress-hero-copy p{margin:6px 0 0;font-size:15px;color:rgba(255,255,255,.9)}
.progress-feature{display:grid;grid-template-columns:88px minmax(0,1fr);align-items:center;gap:14px;margin-top:22px;padding:14px;border:1px solid rgba(255,255,255,.16);border-radius:20px;background:rgba(10,28,19,.74)}
.progress-feature-art{display:flex;align-items:center;justify-content:center;width:88px;height:88px;border-radius:50%;background:radial-gradient(circle at 50% 40%,#3c6f50,#15321f)}
.progress-feature-img{display:block;width:80px;height:80px;object-fit:contain}
.progress-feature-art.is-dormant .progress-feature-img{filter:saturate(.3) opacity(.75)}
.progress-feature-art:has(.reward-badge){background:none}
.progress-feature-art .reward-badge{width:100%!important;height:100%!important}
.progress-feature-copy{min-width:0}
.progress-feature-copy h2{margin:0;font:700 18px/1.25 'Inter',sans-serif;color:#fff}
.progress-feature-copy p{margin:6px 0 0;font-size:13.5px;line-height:1.45;color:rgba(255,255,255,.86)}
.progress-feature-copy .progress-feature-xp{margin:2px 0 6px;font:700 24px/1.1 'Inter',sans-serif;color:var(--hub-violet-soft);font-variant-numeric:tabular-nums}
.progress-feature-bar{background:rgba(255,255,255,.18)}
.progress-feature-copy .hub-go-btn{margin-top:12px}
.progress-garden{margin:12px 0 0;padding:10px 4px;border:1px solid var(--hub-line);border-radius:20px;background:var(--hub-card);box-shadow:var(--hub-shadow)}
.progress-garden button{appearance:none;position:relative;display:flex;flex-direction:column;align-items:center;gap:1px;width:100%;padding:2px 0 8px;border:0;border-radius:12px;background:none;color:inherit;font:inherit;cursor:pointer}
.progress-garden .is-lead button::after{content:'';position:absolute;left:20%;right:20%;bottom:0;height:3px;border-radius:99px;background:var(--hub-forest-2)}
.progress-tabs{display:flex;gap:4px;margin:16px 0 14px;padding:4px;border-radius:14px;background:#ebe6dc;overflow-x:auto;scrollbar-width:none}
.progress-tabs button{appearance:none;flex:1 0 auto;min-height:40px;padding:8px 12px;border:0;border-radius:10px;background:transparent;color:var(--hub-muted);font:600 13.5px/1.2 'Inter',sans-serif;cursor:pointer}
.progress-tabs button[aria-selected="true"]{background:var(--hub-forest-2);color:#fff}
.progress-panel{display:grid;grid-template-columns:minmax(0,1fr);gap:18px}
.progress-panel[hidden]{display:none}
.progress-panel>section,.progress-panel>.progress-stats,.progress-panel>.progress-cases{min-width:0}
.progress-badges{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:0;padding:0;list-style:none}
.progress-badges li{display:flex;flex-direction:column;align-items:center;gap:6px;padding:12px 6px;border:1px solid var(--hub-line);border-radius:16px;background:var(--hub-card);text-align:center}
.progress-badges strong{font:600 12.5px/1.25 'Inter',sans-serif;color:var(--hub-ink)}
.progress-badges small{font-size:11.5px;color:var(--hub-muted)}
.progress-activity,.progress-cases{margin:0;padding:0;list-style:none}
.progress-activity li{display:grid;grid-template-columns:40px minmax(0,1fr) auto;align-items:center;gap:12px;padding:10px 0;border-bottom:1px solid var(--hub-line)}
.progress-activity-art{display:flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:12px;background:#f3ede3;color:var(--hub-forest-2)}
.progress-activity-copy,.progress-cases button{display:flex;flex-direction:column;min-width:0}
.progress-activity-copy strong,.progress-cases strong{font:600 14.5px/1.3 'Inter',sans-serif;color:var(--hub-ink)}
.progress-activity-copy small,.progress-cases small{font-size:12.5px;color:var(--hub-muted)}
.progress-activity b{font:700 13.5px 'Inter',sans-serif;color:var(--hub-violet)}
.progress-cases button{appearance:none;display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:auto auto;column-gap:12px;width:100%;padding:11px 2px;border:0;border-bottom:1px solid var(--hub-line);background:none;font:inherit;text-align:left;cursor:pointer}
.progress-cases button b{grid-column:2;grid-row:1/span 2;align-self:center;font:700 14px 'Inter',sans-serif;color:var(--hub-ink)}
.progress-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.progress-stat{display:flex;flex-direction:column;gap:2px;padding:12px;border:1px solid var(--hub-line);border-radius:16px;background:var(--hub-card)}
.progress-stat strong{font:700 22px/1.1 'Inter',sans-serif;color:var(--hub-ink);font-variant-numeric:tabular-nums}
.progress-stat span{font-size:12px;line-height:1.3;color:var(--hub-muted)}
.progress-ladder{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:6px;margin:0 0 6px;padding:10px 4px;border:1px solid var(--hub-line);border-radius:18px;background:var(--hub-card);list-style:none}
.progress-ladder li{display:flex;flex-direction:column;align-items:center;gap:2px;text-align:center}
.progress-ladder li.is-empty{opacity:.45}
.progress-ladder strong{font:700 16px/1.1 'Inter',sans-serif;color:var(--hub-ink)}
.progress-ladder small{font-size:11px;color:var(--hub-muted)}
.progress-panel-lead{margin:0 0 8px;font-size:13.5px;color:var(--hub-muted)}
.progress-actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px 16px}
.progress-empty{margin:0;padding:6px 0;font-size:13.5px;line-height:1.5;color:var(--hub-muted)}

/* -- Motion ------------------------------------------------------------------------ */
@keyframes hubRise{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}
@keyframes hubGrow{from{opacity:0;transform:translateY(6px) scale(.86)}to{opacity:1;transform:none}}
@keyframes hubFill{from{width:0}}
@keyframes hubFade{from{opacity:0}}
@keyframes hubSheetIn{from{transform:translateY(24px);opacity:0}}
@keyframes hubDialogIn{from{transform:translate(-50%,-46%);opacity:0}}

/* -- Small phones ------------------------------------------------------------------ */
@media(max-width:380px){
  .hub-paths{gap:10px}
  .hub-path{min-height:196px;padding:12px}
  .hub-path-copy{padding-right:30px}
  .hub-path-go{width:30px;height:30px;right:10px;bottom:12px}
  .hub-path-desc{font-size:12px}
  .hub-card{padding:14px}
  .case-quick-tile,#s-tcm-home .case-customize>summary{padding:14px 12px 12px}
  .case-tile-cta,#s-tcm-home .case-quick-tile .case-gen-primary{font-size:14px}
  .herb-hub-cats{grid-template-columns:repeat(2,minmax(0,1fr))}
  .progress-stats{grid-template-columns:repeat(2,minmax(0,1fr))}
  .progress-feature{grid-template-columns:72px minmax(0,1fr)}
  .progress-feature-art{width:72px;height:72px}
  .progress-feature-img{width:64px;height:64px}
}

/* -- Tablet portrait: the phone layout with more room ------------------------------- */
@media(min-width:600px) and (max-width:900px){
  .hub-hero{padding-left:28px;padding-right:28px}
  .hub-paths{gap:16px}
  .hub-path{aspect-ratio:1.05}
  .hub-body{grid-template-columns:repeat(2,minmax(0,1fr))}
  .hub-garden{grid-column:1/-1}
  .herb-hub-top{grid-template-columns:repeat(2,minmax(0,1fr))}
  .herb-hub-cats{grid-template-columns:repeat(6,minmax(0,1fr))}
}

/* -- Desktop: a wider study space, not a stretched phone --------------------------- */
@media(min-width:901px){
  #s-hub,#s-progress{padding-top:0}
  .hub-hero{margin:0 -2.5rem;padding:56px 2.5rem 44px}
  .hub-hero::before{background:linear-gradient(180deg,rgba(7,20,14,.62) 0%,rgba(7,20,14,.26) 34%,rgba(7,20,14,.36) 62%,rgba(9,24,17,.7) 84%,var(--canvas,#f4f0e8) 100%)}
  .hub-hero-inner,.hub-body{width:min(1040px,100%);margin-left:auto;margin-right:auto}
  .hub-greeting{font-size:48px}
  .hub-sub{font-size:17px}
  .hub-paths{gap:22px;margin-top:30px}
  .hub-path{aspect-ratio:16/10;min-height:260px;padding:26px;border-radius:26px}
  .hub-path-copy{padding-right:60px;gap:8px}
  .hub-path-title{font-size:40px}
  .hub-path-title span{display:inline}
  .hub-path-desc{font-size:15px}
  .hub-path-go{right:22px;bottom:24px;width:46px;height:46px}
  .hub-path-go .ui-icon{width:20px;height:20px}
  .hub-path:hover{transform:translateY(-2px);box-shadow:0 22px 40px rgba(0,0,0,.36)}
  .hub-body{grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;margin-top:22px}
  .hub-card{padding:20px 22px}
  .hub-garden{grid-column:1/-1}
  .hub-element-art,.hub-element .reward-badge{max-width:104px}
  .hub-element-name{font-size:14px}

  #s-tcm-home .case-practice-page{width:min(1040px,100%);margin:0 auto}
  #s-tcm-home .cases-banner{margin:0 0 20px;padding:40px 40px 32px;min-height:240px;border-radius:26px}
  #s-tcm-home .cases-banner h1{font-size:46px}
  #s-tcm-home .cases-banner p{font-size:16px}
  .cases-continue{padding:20px 22px}
  .case-start-grid{gap:14px}
  .case-quick-tile,#s-tcm-home .case-customize>summary{min-height:200px;padding:20px}
  #s-tcm-home #tcm-setup-title{font-size:26px}
  /* A guest has Quick case only: one row, not a stretched tile. */
  .case-start-grid:has(>.case-customize[hidden]) .case-quick-tile{display:grid;grid-template-columns:44px minmax(0,1fr) minmax(220px,300px);align-items:center;column-gap:16px;row-gap:2px;min-height:0}
  .case-start-grid:has(>.case-customize[hidden]) .case-tile-icon{grid-row:1/span 2;margin:0}
  .case-start-grid:has(>.case-customize[hidden]) .case-tile-title{grid-column:2}
  #s-tcm-home .case-start-grid:has(>.case-customize[hidden]) .case-start-summary{grid-column:2;margin:0}
  #s-tcm-home .case-start-grid:has(>.case-customize[hidden]) .case-gen-primary{grid-column:3;grid-row:1/span 2;margin:0}
  #s-tcm-home .case-start-grid:has(>.case-customize[hidden]) .case-free-allowance{grid-column:3}
  .case-customize-sheet{left:50%;right:auto;top:50%;bottom:auto;width:min(620px,calc(100vw - 48px));max-height:calc(100vh - 64px);padding:22px 26px 26px;border-radius:24px;transform:translate(-50%,-50%);animation-name:hubDialogIn}
  .case-customize-sheet::before{display:none}
  #s-tcm-home .case-customize-sheet .case-setup-grid{grid-template-columns:repeat(2,minmax(0,1fr))}

  #s-herbs .mm-page-header{margin:0 0 20px;padding:36px 36px 22px;border-radius:26px;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:end}
  #s-herbs .mm-page-heading h1{font-size:46px}
  #s-herbs .mm-page-header .mm-primary-nav{width:auto}
  .herb-hub-top{grid-template-columns:minmax(0,1.25fr) minmax(0,1fr)}
  .herb-hub-cats{grid-template-columns:repeat(6,minmax(0,1fr))}
  .herb-hub-garden{grid-auto-flow:row;grid-template-columns:repeat(8,minmax(0,1fr));overflow:visible}

  .progress-hero{margin:0 -2.5rem;padding:48px 2.5rem 36px}
  .progress-hero-copy,.progress-feature{width:min(1040px,100%);margin-left:auto;margin-right:auto}
  .progress-hero-copy h1{font-size:48px}
  .progress-feature{grid-template-columns:120px minmax(0,1fr);max-width:1040px;padding:20px 24px}
  .progress-feature-art{width:120px;height:120px}
  .progress-feature-img{width:108px;height:108px}
  #s-progress>.progress-tabs,#s-progress>.progress-panel{width:min(1040px,100%);margin-left:auto;margin-right:auto}
  #s-progress>.progress-tabs{width:max-content;max-width:100%;margin-left:max(0px,calc((100% - 1040px)/2))}
  .progress-stats{grid-template-columns:repeat(3,minmax(0,1fr))}
}

@media(prefers-reduced-motion:reduce){
  .hub-path,.hub-path-art,.hub-go-btn,.case-custom-start,.herb-hub-cats button{transition:none}
  .hub-path:hover .hub-path-art{transform:none}
  #s-hub.active .hub-body>section,#s-hub.active .hub-element-art,#s-hub.active .hub-element .reward-badge,.hub-meter-track>span,.case-customize-sheet,.case-customize-backdrop{animation:none}
}

/* Unified learning loop, phase A: Recognition beside practice, and a row for
   herbs that need another look. */
.herb-hub-side{display:grid;grid-template-columns:minmax(0,1fr);gap:12px;align-content:start}
.herb-hub-recog{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:12px}
.herb-hub-recog-art{display:flex}
.herb-hub-recog-art img{width:44px;height:44px;margin-left:-14px;object-fit:contain;border-radius:50%;background:radial-gradient(circle,#fff 40%,#f2ebdf 100%);box-shadow:0 0 0 2px var(--hub-card,#fffcf5)}
.herb-hub-recog-art img:first-child{margin-left:0}
.herb-hub-recog-copy .hub-card-title{margin:0 0 2px}
.herb-hub-recog-copy p{margin:0;font-size:13px;line-height:1.4;color:var(--hub-muted)}
.hub-row-recog{margin-top:12px;padding-top:12px;border-top:1px solid var(--hub-line);border-radius:0}
@media(max-width:420px){.herb-hub-recog{grid-template-columns:minmax(0,1fr) auto}.herb-hub-recog-art{display:none}}

/* Progress led by the herb collection: the hero card holds the collection
   (one ring in front, two behind), and Five Elements sits in its own tab,
   compact until Element XP is earned. */
.progress-collection-art{position:relative;display:flex;align-items:center;justify-content:center;width:88px;height:88px;border-radius:50%;background:radial-gradient(circle at 50% 40%,#3c6f50,#15321f)}
.progress-collection-herb{display:flex;line-height:0}
.progress-collection-art.is-cluster .progress-collection-herb:nth-child(1){position:relative;z-index:1}
.progress-collection-art .progress-collection-herb:nth-child(2),.progress-collection-art .progress-collection-herb:nth-child(3){position:absolute;bottom:-6px;filter:drop-shadow(0 3px 5px rgba(0,0,0,.3))}
.progress-collection-art .progress-collection-herb:nth-child(2){left:-10px}
.progress-collection-art .progress-collection-herb:nth-child(3){right:-10px}
.progress-collection-herb.is-preview{opacity:.8}
.progress-collection .progress-collection-count{margin:2px 0 4px}
.progress-collection .progress-collection-levels{margin:0;font:600 13px/1.4 'Inter',sans-serif;color:var(--hub-violet-soft,#d8c9f7)}
.progress-collection .progress-collection-today{margin-top:8px}
.progress-element-feature{display:grid;grid-template-columns:88px minmax(0,1fr);align-items:center;gap:14px;padding:14px;border:1px solid var(--hub-line);border-radius:20px;background:var(--hub-card);box-shadow:var(--hub-shadow)}
.progress-element-feature .progress-feature-copy h2{color:var(--hub-ink)}
.progress-element-feature .progress-feature-copy p{color:var(--hub-muted)}
.progress-element-feature .progress-feature-copy .progress-feature-xp{color:var(--hub-violet,#6332c4)}
.progress-element-feature .progress-feature-bar{background:var(--progress-purple-track,#eee7f8)}
.progress-panel>.progress-garden{margin:0}
.progress-elements-dormant{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:14px;padding:14px 16px;border:1px solid var(--hub-line);border-radius:20px;background:var(--hub-card)}
.progress-elements-mini{display:flex;margin:0;padding:0;list-style:none}
.progress-elements-mini li{margin-left:-12px}
.progress-elements-mini li:first-child{margin-left:0}
.progress-elements-mini-art{display:block;width:44px;height:44px;object-fit:contain;filter:saturate(.3) opacity(.7)}
.progress-elements-copy .hub-card-title{margin:0 0 2px}
.progress-elements-copy .progress-empty{padding:0 0 4px}
@media(max-width:420px){.progress-elements-dormant{grid-template-columns:minmax(0,1fr)}.progress-elements-mini-art{width:36px;height:36px}}
@media(min-width:901px){
  .progress-collection-art{width:120px;height:120px}
  .progress-element-feature{grid-template-columns:120px minmax(0,1fr);padding:20px 24px}
}

/* Phase D: until Element XP is earned, Home shows the Five Element garden as
   one small row of pictures with its note, not five large locked medals. */
.hub-garden.is-compact .hub-garden-list{display:flex;margin:4px 0 0;padding:0}
.hub-garden.is-compact .hub-element{flex:none;margin-left:-10px;padding:0}
.hub-garden.is-compact .hub-element:first-child{margin-left:0}
.hub-garden.is-compact .hub-element-art{width:40px;max-width:40px;margin:0;animation:none!important}
.hub-garden.is-compact :is(.hub-element-name,.hub-element-rank,.hub-element-xp){position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.hub-garden.is-compact .hub-garden-note{margin-top:8px}
.hub-garden.is-compact .hub-element .reward-badge{width:40px!important;max-width:40px;margin:0;animation:none!important}

/* Phase D: shorter banners on phones, so the first card sits higher. The
   page titles stay; the Cases tagline and the Herbs eyebrow give way. */
@media(max-width:600px){
  #s-tcm-home .cases-banner{min-height:0;padding:18px 16px 16px}
  #s-tcm-home .cases-banner h1{margin-bottom:0;font-size:30px}
  #s-tcm-home .cases-banner p{display:none}
  #s-herbs .mm-page-header{gap:10px;padding:16px 14px 14px}
  #s-herbs .mm-page-header .mm-page-eyebrow{display:none}
  #s-herbs .mm-page-heading h1{font-size:32px}
  .progress-hero{padding:18px 16px 16px}
  .progress-hero-copy h1{font-size:30px}
  .progress-hero-copy p{font-size:14px}
  .progress-hero .progress-feature{margin-top:14px}
}


/* Formula study follows the herb collection and uses its existing controls. */
.formula-hub-options{margin:16px 0 24px;padding:20px;border:1px solid var(--border);border-radius:16px;background:var(--surface)}
.formula-hub-options h3{margin:0 0 8px;font-size:18px}
.formula-hub-options p,.formula-hub-ready small{color:var(--text-muted);font-size:14px;line-height:1.5}
.formula-hub-ready{list-style:none;padding:0;margin:12px 0 18px;display:grid;gap:12px}
.formula-hub-ready li{display:grid;gap:4px}
.formula-hub-ready .hub-link{text-align:left;justify-content:flex-start}
.formula-hub-options .account-pref{margin-top:20px}
.formula-hub-readiness{font-size:14px}
