:root {
  --account-ink: #edf2e7;
  --account-muted: #b6c4b2;
  --account-sage: #c6dba9;
  --account-warm: #f3d5ba;
  --account-danger: #f0b9ad;
  --account-deep: #0c201a;
  --account-panel: rgba(22, 52, 39, .74);
}

.account-body {
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  background: radial-gradient(ellipse at 91% 4%, rgba(73, 111, 74, .28), transparent 37%), var(--account-deep);
  font-family: var(--sans), system-ui, sans-serif;
}
.account-body::before {
  content: '';
  position: fixed;
  z-index: -2;
  inset: 0;
  background: linear-gradient(105deg, rgba(5, 24, 17, .95), rgba(9, 32, 22, .83) 46%, rgba(11, 35, 25, .61)), url('/assets/rainforest-hero.jpg') center / cover no-repeat;
}
.account-body::after {
  content: '';
  position: fixed;
  z-index: -1;
  inset: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(8, 27, 19, .42) 63%, #0a1d16 100%);
  pointer-events: none;
}
.account-body [hidden] { display: none !important; }
.account-body button:focus-visible,
.account-body a:focus-visible,
.account-body input:focus-visible {
  outline: 2px solid var(--account-sage);
  outline-offset: 4px;
}
.account-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(1250px, calc(100% - 72px));
  margin: 0 auto;
  padding: 29px 0 12px;
}
.account-mark {
  display: grid;
  width: 43px;
  height: 43px;
  place-items: center;
  border: 1px solid rgba(198, 219, 169, .42);
  border-radius: 11px;
  color: var(--account-sage);
}
.account-mark svg { width: 38px; height: 38px; stroke-width: 1.3; }
.account-nav { display: flex; align-items: center; gap: 24px; color: #c7d3c2; font-size: 11px; }
.account-nav a { transition: color .2s ease; }
.account-nav a:hover { color: var(--account-sage); }
.account-main { width: min(1120px, calc(100% - 72px)); min-height: calc(100vh - 170px); margin: 31px auto 64px; }
.account-shell { min-height: 470px; border-radius: 26px; background: var(--account-panel); box-shadow: 0 27px 85px rgba(0, 0, 0, .2); }

#loading-view { display: grid; align-content: center; justify-items: center; padding: 52px; text-align: center; }
#loading-view .eyebrow { margin-bottom: 17px; }
#loading-view h1 { margin-bottom: 15px; font-size: clamp(38px, 5vw, 61px); }
#loading-view .account-intro { margin: 0; }
.loading-orbit { width: 37px; height: 37px; margin-bottom: 27px; border: 2px solid rgba(198, 219, 169, .2); border-top-color: var(--account-sage); border-radius: 50%; animation: account-spin .9s linear infinite; }
@keyframes account-spin { to { transform: rotate(360deg); } }

.auth-shell { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(355px, .9fr); overflow: hidden; }
.auth-copy { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; padding: 66px clamp(42px, 6vw, 78px); border-right: 1px solid rgba(222, 239, 206, .16); }
.auth-copy h1, .dashboard h1 { font-family: var(--heading), system-ui, sans-serif; font-size: clamp(41px, 5vw, 64px); font-weight: 500; line-height: 1.08; letter-spacing: -2.7px; }
.auth-copy h1 { margin-bottom: 23px; }
.auth-copy h1 em, .dashboard h1 em { font-family: var(--serif), Georgia, serif; font-weight: 400; color: var(--account-sage); }
.account-intro { max-width: 475px; color: var(--account-muted); font-size: 13px; line-height: 1.9; }
.scope-note { display: flex; gap: 12px; max-width: 480px; margin: 27px 0 24px; padding: 15px 16px; border: 1px solid rgba(198, 219, 169, .23); border-radius: 13px; background: rgba(198, 219, 169, .055); }
.scope-note svg { width: 19px; height: 19px; flex: none; margin-top: 2px; color: var(--account-sage); }
.scope-note p { margin: 0; color: #b8c6b0; font-size: 10px; line-height: 1.75; }
.scope-note strong { color: #e2e9d8; font-weight: 600; }
.sample-link { padding-bottom: 3px; border-bottom: 1px solid rgba(198, 219, 169, .5); color: var(--account-sage); font-size: 11px; }
.sample-link span { margin-left: 16px; }
.auth-panel-wrap { padding: 48px clamp(28px, 4vw, 51px); background: linear-gradient(150deg, rgba(92, 126, 79, .16), rgba(16, 44, 31, .14)); }
.auth-tabs { display: flex; gap: 0; margin-bottom: 30px; border-bottom: 1px solid rgba(222, 239, 206, .19); }
.auth-tabs button { position: relative; flex: 1; padding: 0 7px 13px; color: #9fb09d; background: transparent; font-size: 9px; letter-spacing: .3px; white-space: nowrap; }
.auth-tabs button[aria-selected="true"] { color: var(--account-sage); }
.auth-tabs button[aria-selected="true"]::after { content: ''; position: absolute; right: 7px; bottom: -1px; left: 7px; height: 2px; background: var(--account-sage); }
.auth-form-head { margin-bottom: 23px; }
.auth-form-head h2 { margin: 0 0 8px; font-size: 25px; font-weight: 500; letter-spacing: -1px; }
.auth-form-head p { margin: 0; color: #aebda9; font-size: 11px; line-height: 1.7; }
.account-form { display: grid; gap: 15px; }
.field { display: grid; gap: 7px; }
.field label, .checkbox-field span { color: #d9e4d3; font-size: 10px; font-weight: 500; }
.field input { width: 100%; min-height: 46px; padding: 11px 13px; border: 1px solid rgba(211, 231, 192, .26); border-radius: 10px; outline: none; color: var(--account-ink); background: rgba(5, 27, 18, .35); font: inherit; font-size: 12px; transition: border-color .2s, background .2s; }
.field input:hover { border-color: rgba(211, 231, 192, .47); }
.field input:focus { border-color: var(--account-sage); background: rgba(5, 27, 18, .55); }
.field input::placeholder { color: #899a88; }
.field-help { margin: -1px 0 0; color: #9daf99; font-size: 9px; line-height: 1.6; }
.checkbox-field { display: flex; align-items: flex-start; gap: 10px; margin: 2px 0 0; color: #acbba5; font-size: 9px; line-height: 1.7; }
.checkbox-field input { width: 16px; height: 16px; flex: none; margin: 1px 0 0; accent-color: #c6dba9; }
.checkbox-field span { display: inline; font-size: inherit; font-weight: inherit; color: inherit; }
.form-message { min-height: 20px; margin: 1px 0 0; color: #bfd2b0; font-size: 10px; line-height: 1.6; }
.form-message[data-kind="error"] { color: var(--account-danger); }
.form-message[data-kind="success"] { color: #d1e7b3; }
.form-message:empty { display: none; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 17px; padding-top: 4px; }
.form-actions .button { min-height: 45px; padding-inline: 19px; font-size: 10px; }
.inline-button { padding: 5px 0; background: transparent; color: var(--account-sage); font-size: 10px; text-decoration: underline; text-underline-offset: 4px; }

.dashboard { display: grid; gap: 17px; }
.dashboard-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, .45fr); gap: 30px; padding: 42px 48px; border-radius: 24px; background: linear-gradient(125deg, rgba(171, 201, 152, .16), rgba(35, 70, 50, .56)); }
.dashboard-hero .eyebrow { margin-bottom: 14px; }
.dashboard-hero h1 { margin-bottom: 15px; }
.dashboard-hero .account-intro { margin: 0; }
.account-email { color: #d8e4d0; font-size: 10px; }
.account-email span { color: #9aae9d; }
.account-lock { align-self: stretch; display: grid; align-content: center; gap: 10px; padding: 20px 23px; border: 1px solid rgba(213, 234, 190, .25); border-radius: 16px; background: rgba(9, 35, 24, .28); }
.lock-label { display: flex; align-items: center; gap: 9px; color: var(--account-sage); font-size: 9px; letter-spacing: 1.1px; }
.lock-label svg { width: 16px; height: 16px; }
.account-lock p { margin: 0; color: #b2c1ab; font-size: 10px; line-height: 1.75; }
.account-lock strong { color: #e2ebd8; font-weight: 600; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(275px, .39fr); align-items: start; gap: 17px; }
.dashboard-card { border-radius: 19px; padding: 29px 30px; background: rgba(21, 50, 37, .76); }
.library-card { min-height: 370px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 19px; }
.card-head h2, .profile-card h2 { margin: 0; font-size: 24px; font-weight: 500; letter-spacing: -1px; }
.card-head p, .profile-card > p { margin: 7px 0 0; color: #aebca9; font-size: 10px; line-height: 1.7; }
.subtle-count { flex: none; padding: 5px 8px; border: 1px solid rgba(198, 219, 169, .27); border-radius: 99px; color: var(--account-sage); font-size: 8px; letter-spacing: .6px; }
.library-empty { display: grid; justify-items: start; gap: 15px; max-width: 500px; padding: 25px 0; }
.library-empty .empty-mark { display: grid; width: 39px; height: 39px; place-items: center; border: 1px solid rgba(198, 219, 169, .34); border-radius: 50%; color: var(--account-sage); font-size: 20px; }
.library-empty h3 { margin: 0; font-family: var(--serif), Georgia, serif; font-size: 25px; font-weight: 400; }
.library-empty p { margin: 0; color: #b2c0aa; font-size: 11px; line-height: 1.8; }
.library-empty .button { margin-top: 2px; font-size: 10px; }
.preview-list { display: grid; border-top: 1px solid rgba(213, 234, 190, .15); }
.preview-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 20px; padding: 17px 0; border-bottom: 1px solid rgba(213, 234, 190, .15); }
.preview-meta { min-width: 0; }
.preview-kicker { margin: 0 0 5px; color: var(--account-sage); font-size: 8px; letter-spacing: 1px; }
.preview-meta h3 { overflow: hidden; margin: 0; color: #e1e9d8; font-size: 13px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.preview-meta p { margin: 3px 0 0; color: #9faf9b; font-size: 9px; }
.preview-actions { display: flex; align-items: center; gap: 12px; }
.preview-actions button { padding: 7px 0; border: 0; background: transparent; font-size: 9px; }
.open-preview { color: var(--account-sage); }
.delete-preview { color: #d7a89d; }
.profile-card { display: grid; gap: 15px; }
.profile-card > p { margin-top: -7px; }
.profile-card .field { gap: 7px; }
.profile-card .button { width: 100%; margin-top: 2px; font-size: 10px; }
.profile-message { min-height: 18px; margin: -6px 0 0; color: #c8dbb6; font-size: 9px; }
.profile-message[data-kind="error"] { color: var(--account-danger); }
.privacy-boundary { margin-top: 4px; padding-top: 17px; border-top: 1px solid rgba(213, 234, 190, .15); }
.privacy-boundary h3 { margin: 0 0 7px; color: #dce5d4; font-size: 12px; font-weight: 500; }
.privacy-boundary p { margin: 0; color: #aab9a4; font-size: 9px; line-height: 1.75; }
.privacy-boundary strong { color: #c9d9bd; font-weight: 600; }
.dashboard-status { min-height: 17px; margin: -4px 0 0; color: #c6d8b5; font-size: 10px; }
.dashboard-status[data-kind="error"] { color: var(--account-danger); }
.signout-button { justify-self: start; padding: 7px 0; border: 0; border-bottom: 1px solid rgba(198, 219, 169, .45); color: var(--account-sage); background: transparent; font-size: 10px; }

.report-view { display: grid; gap: 17px; }
.report-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 25px; padding: 37px 42px; border-radius: 23px; background: linear-gradient(125deg, rgba(171, 201, 152, .15), rgba(28, 64, 45, .72)); }
.report-top .eyebrow { margin-bottom: 14px; }
.report-top h1 { margin: 0 0 12px; font-family: var(--heading), system-ui, sans-serif; font-size: clamp(34px, 4vw, 51px); font-weight: 500; line-height: 1.08; letter-spacing: -2px; }
.report-top h1 em { font-family: var(--serif), Georgia, serif; font-weight: 400; color: var(--account-sage); }
.report-top p:not(.eyebrow) { max-width: 630px; margin: 0; color: #b9c8b2; font-size: 11px; line-height: 1.8; }
.back-library { flex: none; padding: 8px 0; border: 0; border-bottom: 1px solid rgba(198, 219, 169, .45); color: var(--account-sage); background: transparent; font-size: 10px; }
.report-notice { display: flex; gap: 12px; padding: 16px 19px; border-radius: 15px; color: #bfd0b6; background: rgba(198, 219, 169, .08); font-size: 10px; line-height: 1.75; }
.report-notice svg { width: 18px; height: 18px; flex: none; margin-top: 1px; color: var(--account-sage); }
.report-notice strong { color: #e4ecdc; }
.report-section-card { padding: 31px 32px; border-radius: 19px; background: rgba(20, 49, 36, .79); }
.report-section-head { display: flex; justify-content: space-between; gap: 30px; align-items: flex-end; margin-bottom: 23px; }
.report-section-head .eyebrow { margin: 0 0 8px; font-size: 8px; }
.report-section-head h2 { margin: 0; font-size: 29px; font-weight: 500; letter-spacing: -1px; }
.report-section-head > p { max-width: 375px; margin: 0; color: #b2c0ab; font-size: 10px; line-height: 1.75; }
.saved-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.saved-entry { min-width: 0; padding: 16px 14px; border: 1px solid rgba(202, 222, 182, .18); border-radius: 13px; background: rgba(198, 219, 169, .045); }
.saved-entry-day { margin: 0 0 12px; color: var(--account-sage); font-size: 8px; letter-spacing: .9px; }
.saved-meal-label { margin: 11px 0 3px; color: #91a985; font-size: 7px; letter-spacing: .9px; text-transform: uppercase; }
.saved-entry p:not(.saved-entry-day):not(.saved-meal-label) { margin: 0; color: #d7e0cf; font-size: 10px; line-height: 1.55; }
.saved-entry h3 { margin: 0 0 7px; color: #e1e9d8; font-size: 12px; font-weight: 500; }
.saved-entry .saved-duration { color: var(--account-sage); font-size: 9px; }
.saved-entry ul { margin: 12px 0 0; padding-left: 15px; color: #acbca5; font-size: 9px; line-height: 1.62; }
.saved-entry li + li { margin-top: 5px; }
.safety-entry { max-width: 100%; }
.herbs-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.herb-entry { min-height: 165px; }
.herb-entry p { margin: 0; color: #b7c7b0; font-size: 10px; line-height: 1.7; }
.herb-entry small { display: block; margin-top: 13px; padding-top: 12px; border-top: 1px solid rgba(202, 222, 182, .15); color: #95aa8c; font-size: 8px; line-height: 1.65; }
.saved-missing { margin: 0; color: #acbba5; font-size: 11px; line-height: 1.8; }
.account-footer { display: flex; justify-content: space-between; gap: 20px; width: min(1250px, calc(100% - 72px)); margin: 0 auto; padding: 21px 0 26px; border-top: 1px solid rgba(211, 231, 192, .13); color: #8fa187; font-size: 8px; }

@media (max-width: 1050px) {
  .auth-shell { grid-template-columns: 1fr 420px; }
  .auth-copy { padding-inline: 48px; }
  .saved-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 800px) {
  .account-header, .account-main, .account-footer { width: min(100% - 40px, 650px); }
  .account-header { padding-top: 20px; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-copy { padding: 43px 40px 36px; border-right: 0; border-bottom: 1px solid rgba(222, 239, 206, .16); }
  .dashboard-hero, .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-hero { padding: 36px 37px; }
  .account-lock { min-height: 125px; }
  .saved-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 540px) {
  .account-header, .account-main, .account-footer { width: calc(100% - 32px); }
  .account-header { align-items: flex-start; gap: 10px; }
  .account-header .brand { gap: 8px; }
  .account-header .brand-name { font-size: 10px; letter-spacing: 1.3px; }
  .account-header .brand-name small { font-size: 6px; letter-spacing: 1.5px; }
  .account-mark { width: 35px; height: 35px; border-radius: 9px; }
  .account-mark svg { width: 30px; height: 30px; }
  .account-nav { flex-direction: column; align-items: flex-end; gap: 8px; font-size: 9px; }
  .account-main { min-height: calc(100vh - 159px); margin-top: 20px; margin-bottom: 38px; }
  .account-shell { min-height: 0; border-radius: 19px; }
  #loading-view { min-height: 400px; padding: 35px 25px; }
  .auth-copy { padding: 34px 24px 29px; }
  .auth-copy h1, .dashboard h1 { font-size: 40px; letter-spacing: -1.9px; }
  .account-intro { font-size: 11px; }
  .scope-note { margin: 22px 0 20px; padding: 13px; }
  .scope-note p { font-size: 9px; }
  .auth-panel-wrap { padding: 28px 22px; }
  .auth-tabs { margin-bottom: 25px; }
  .auth-tabs button { padding-inline: 3px; font-size: 8px; }
  .auth-form-head h2 { font-size: 23px; }
  .checkbox-field { font-size: 8px; }
  .dashboard { gap: 13px; }
  .dashboard-hero, .dashboard-card { padding: 27px 22px; border-radius: 18px; }
  .dashboard-hero { gap: 21px; }
  .card-head { align-items: flex-start; }
  .card-head h2, .profile-card h2 { font-size: 22px; }
  .preview-row { gap: 12px; }
  .preview-actions { gap: 9px; }
  .saved-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .report-top, .report-section-card { padding: 26px 22px; border-radius: 18px; }
  .report-top { display: grid; gap: 16px; }
  .report-section-head { display: grid; gap: 12px; margin-bottom: 19px; }
  .report-section-head h2 { font-size: 25px; }
  .herbs-grid { grid-template-columns: 1fr; }
  .account-footer { flex-direction: column; gap: 5px; padding-bottom: 20px; }
}
@media (prefers-reduced-motion: reduce) { .loading-orbit { animation: none; } }

/* Separate e-book purchase status surface; it does not reuse paid health-library selectors. */
.ebook-return-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px 30px;
  padding: 25px 30px;
  border: 1px solid rgba(198, 219, 169, .26);
  border-radius: 19px;
  background: linear-gradient(115deg, rgba(171, 201, 152, .12), rgba(20, 49, 36, .79));
}
.ebook-return-kicker,
.ebook-purchases-kicker,
.ebook-purchase-state { margin: 0; color: var(--account-sage); font-size: 8px; font-weight: 600; letter-spacing: 1px; }
.ebook-return-card h2 { margin: 6px 0 8px; font-size: 24px; font-weight: 500; letter-spacing: -1px; }
.ebook-return-card > p:not(.ebook-return-kicker) { grid-column: 1; max-width: 650px; margin: -3px 0 0; color: #b8c7b1; font-size: 10px; line-height: 1.75; }
.ebook-return-card .button { grid-column: 2; grid-row: 1 / span 2; min-height: 41px; font-size: 10px; }
.ebook-purchases { display: grid; gap: 15px; }
.ebook-purchases-head,
.ebook-purchases-note,
.ebook-purchases-status,
.ebook-purchases-empty {
  border: 1px solid rgba(213, 234, 190, .15);
  border-radius: 19px;
  background: rgba(20, 49, 36, .79);
}
.ebook-purchases-head { padding: 28px 31px; background: linear-gradient(125deg, rgba(171, 201, 152, .15), rgba(28, 64, 45, .72)); }
.ebook-purchases-head h2 { margin: 8px 0 9px; font-size: clamp(27px, 4vw, 40px); font-weight: 500; letter-spacing: -1.35px; line-height: 1.12; }
.ebook-purchases-intro { max-width: 675px; margin: 0; color: #b8c7b1; font-size: 11px; line-height: 1.75; }
.ebook-purchases-note,
.ebook-purchases-status { margin: 0; padding: 14px 16px; color: #c2d1ba; background: rgba(198, 219, 169, .07); font-size: 10px; line-height: 1.75; }
.ebook-purchases-status.is-error { color: var(--account-danger); border-color: rgba(240, 185, 173, .3); }
.ebook-purchases-empty { display: grid; justify-items: start; gap: 9px; min-height: 150px; align-content: center; padding: 23px 27px; }
.ebook-purchases-empty h3 { margin: 0; font-family: var(--serif), Georgia, serif; font-size: 24px; font-weight: 400; }
.ebook-purchases-empty p { max-width: 580px; margin: 0; color: #b8c7b1; font-size: 10px; line-height: 1.75; }
.ebook-purchase-list { display: grid; border-top: 1px solid rgba(213, 234, 190, .15); }
.ebook-purchase-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 20px; padding: 19px 3px; border-bottom: 1px solid rgba(213, 234, 190, .15); }
.ebook-purchase-meta { min-width: 0; }
.ebook-purchase-meta h3 { overflow: hidden; margin: 6px 0 4px; color: #e1e9d8; font-size: 15px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.ebook-purchase-meta > p:last-child { max-width: 640px; margin: 0; color: #aebda7; font-size: 10px; line-height: 1.7; }
.ebook-purchase-amount { color: #d6e8c1; font-family: var(--serif), Georgia, serif; font-size: 20px; font-weight: 400; white-space: nowrap; }
.ebook-purchase-row.is-paid .ebook-purchase-state { color: #d5ebae; }
.ebook-purchase-row.is-revoked .ebook-purchase-state { color: #e8b6ab; }
.ebook-purchase-row.is-unknown .ebook-purchase-state { color: #d9c78f; }
.ebook-purchases-retry { justify-self: start; min-height: 38px; padding: 9px 13px; border: 1px solid rgba(198, 219, 169, .4); border-radius: 9px; color: var(--account-sage); background: rgba(198, 219, 169, .05); font: inherit; font-size: 10px; cursor: pointer; }
.ebook-purchases-retry:hover { background: rgba(198, 219, 169, .15); }
@media (max-width: 650px) {
  .ebook-return-card { grid-template-columns: 1fr; padding: 23px 22px; }
  .ebook-return-card > p:not(.ebook-return-kicker),
  .ebook-return-card .button { grid-column: auto; grid-row: auto; }
  .ebook-return-card .button { width: 100%; }
  .ebook-purchases-head { padding: 25px 21px; border-radius: 17px; }
  .ebook-purchase-row { grid-template-columns: 1fr; gap: 9px; padding: 17px 2px; }
  .ebook-purchase-amount { font-size: 18px; }
}
