.billing-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-block: 16px; }
#settings-screen[data-preview-theme] .panel { color: var(--text); background: var(--surface); border-color: var(--border); }
#settings-screen[data-preview-theme] :is(label, h2, .theme-label) { color: var(--text); }
#settings-screen[data-preview-theme] :is(input, select, textarea, #themeChoices button) { color: var(--text); background: var(--surface-lift); border-color: var(--border); }
#settings-screen[data-preview-theme] .primary-button { background: var(--green); color: var(--bg); border-color: var(--green); }
#settings-screen[data-preview-theme] :is(.eyebrow, .panel-heading p) { color: var(--muted); }
.member-main .member-header-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.member-card .member-main .member-header-actions .member-edit-icon { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; min-width: 32px; padding: 7px; border: 1px solid color-mix(in srgb, var(--green) 25%, var(--border)); border-radius: 7px; color: color-mix(in srgb, var(--green) 75%, var(--text)); background: color-mix(in srgb, var(--green) 10%, var(--surface)); box-shadow: none; }
#settings-screen .theme-field { display: grid; gap: 10px; }
#themeSelect[hidden] { display: none; }
#themeChoices { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 8px; }
#themeChoices button { min-height: 44px; padding: 10px 12px; border-radius: 6px; border: 1px solid var(--border); color: var(--text); background: var(--surface); text-align: left; font-size: 14px; line-height: 1.4; white-space: normal; }
#themeChoices button[aria-pressed="true"] { outline: 2px solid currentColor; outline-offset: -3px; }
#checkoutLoader { padding: 20px; margin: auto; border: 0; background: transparent; color: #20232b; overflow: visible; width: 190px; max-width: calc(100vw - 32px); }
#checkoutLoader::backdrop { background: rgb(245 243 246 / 80%); backdrop-filter: blur(7px); }
.workout-loader { display: grid; justify-items: center; gap: 14px; font-size: 14px; font-weight: 600; text-align: center; }
.workout-motion { position: relative; width: 66px; height: 66px; }
.workout-motion .workout-arm { position: absolute; bottom: 0; left: 0; width: 54px; height: 54px; animation: workout-flex 1.1s ease-in-out infinite; transform-origin: 75% 90%; }
.workout-motion .workout-weight { position: absolute; top: 0; left: 2px; width: 28px; height: 28px; animation: workout-lift 1.1s ease-in-out infinite; }
@keyframes workout-lift { 0%, 100% { transform: translateY(7px) rotate(-20deg); } 50% { transform: translateY(-7px) rotate(12deg); } }
@keyframes workout-flex { 0%, 100% { transform: rotate(-9deg); } 50% { transform: rotate(3deg); } }
@media (prefers-reduced-motion: reduce) { .workout-motion .workout-arm, .workout-motion .workout-weight { animation: none; } }
@media (min-width: 900px) { #themeChoices button { color: #20232b; background: #fffaf7; border-color: #e0d7d1; } }
.member-editor { width: min(440px, calc(100vw - 32px)); max-height: calc(100dvh - 40px); margin: auto; padding: 24px; overflow-y: auto; border: 1px solid #d7d9df; border-radius: 8px; background: #fffaf7; color: #20232b; }
.member-editor::backdrop { background: rgb(0 0 0 / 45%); }
.member-editor form, .member-editor label { display: grid; gap: 8px; }
.member-editor form { gap: 16px; }
#memberEditForm { grid-template-columns: minmax(0, 1fr); }
#memberEditForm > * { grid-column: 1 / -1; }
[data-edit-member] { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
[data-edit-member] svg, [data-member-lock] svg { width: 18px; height: 18px; flex-shrink: 0; }
#memberList.member-preview, #attentionList.member-preview { grid-template-columns: minmax(0, 1fr); }
.member-editor header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.member-editor h2 { font-size: 22px; margin: 0; }
.member-editor label { color: #20232b; font-size: 14px; }
.member-editor input { box-sizing: border-box; width: 100%; min-width: 0; color: #20232b; background: #fff; border: 1px solid #c6c9d0; border-radius: 6px; padding: 12px; color-scheme: light; }
.member-editor .primary-button { background: #292a31; color: #fff; border-radius: 6px; }
#closeMemberEditor { flex: 0 0 36px; width: 36px; height: 36px; padding: 0; background: #eeeef0; color: #20232b; font-size: 24px; }
#memberEditError { margin: 0; color: #a5122d; font-size: 14px; }
.member-locked-card { position: relative; min-height: 170px; border: 1px solid #d7d9df; border-radius: 8px; padding: 24px; background: #f6f3f8; overflow: hidden; }
.member-blurred-placeholder { filter: blur(5px); user-select: none; pointer-events: none; color: #525969; }
.member-locked-card button { position: absolute; inset: 0; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 20px; background: rgb(255 255 255 / 65%); color: #20232b; font-size: 16px; border: 0; border-radius: 8px; }
.billing-note { color: var(--muted); font-size: 14px; line-height: 1.5; }
#subscriptionStatus { margin-top: 16px; color: var(--text); }
:root {
  color-scheme: dark;
  --bg: #080b09;
  --surface: #0d110f;
  --surface-soft: #121714;
  --surface-lift: #171c19;
  --border: #222a25;
  --strong-border: #2d3831;
  --text: #f4f7f5;
  --muted: #a2aca6;
  --quiet: #68716b;
  --red: #ef4444;
  --red-soft: rgba(239, 68, 68, 0.13);
  --orange: #f59e0b;
  --orange-soft: rgba(245, 158, 11, 0.13);
  --green: #22c55e;
  --green-hover: #16a34a;
  --green-soft: rgba(34, 197, 94, 0.1);
  --neutral-soft: rgba(154, 161, 150, 0.14);
  --feature-start: rgba(34, 197, 94, 0.2);
  --feature-mid: rgba(34, 197, 94, 0.08);
  --feature-end: rgba(18, 23, 20, 0.9);
  --feature-text: var(--text);
  --app-texture: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.045) 1px, transparent 1.2px);
  --metric-due-bg:
    radial-gradient(circle at 92% 8%, var(--feature-start), transparent 7rem),
    linear-gradient(135deg, var(--feature-mid), transparent 56%),
    var(--surface);
  --metric-expired-bg: linear-gradient(135deg, rgba(239, 68, 68, 0.18), var(--surface-soft) 68%);
  --metric-soon-bg: linear-gradient(135deg, rgba(245, 158, 11, 0.18), var(--surface-soft) 68%);
  --metric-paid-bg: linear-gradient(135deg, rgba(34, 197, 94, 0.18), var(--surface-soft) 68%);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.18), 0 12px 34px rgba(0, 0, 0, 0.14);
  --soft-shadow: 0 1px 2px rgba(0, 0, 0, 0.16), 0 8px 24px rgba(0, 0, 0, 0.1);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(34, 197, 94, 0.08), transparent 28rem),
    linear-gradient(180deg, #070907 0%, var(--bg) 48%);
  color: var(--text);
}

body.light-theme {
  color-scheme: light;
  --outside-bg: #f3f6f4;
  --bg: #f6f8f7;
  --surface: #ffffff;
  --surface-soft: #ffffff;
  --surface-lift: #fafbfa;
  --border: #dde4e0;
  --strong-border: #c8d1cb;
  --text: #17211b;
  --muted: #5f6d65;
  --quiet: #8a9690;
  --red-soft: #fff0f0;
  --orange-soft: #fff7e6;
  --green-soft: #eaf8ef;
  --neutral-soft: #eef2ef;
  --feature-start: rgba(34, 197, 94, 0.18);
  --feature-mid: rgba(234, 248, 239, 0.78);
  --feature-end: rgba(255, 255, 255, 0.96);
  --feature-text: #17211b;
  --app-texture: radial-gradient(circle at 1px 1px, rgba(23, 33, 27, 0.055) 1px, transparent 1.2px);
  --metric-due-bg: linear-gradient(135deg, #eaf8ef, #ffffff);
  --metric-expired-bg: linear-gradient(135deg, #fff0f0, #ffffff 70%);
  --metric-soon-bg: linear-gradient(135deg, #fff7e6, #ffffff 70%);
  --metric-paid-bg: linear-gradient(135deg, #eaf8ef, #ffffff 70%);
  --shadow: 0 1px 2px rgba(15, 23, 18, 0.03), 0 6px 18px rgba(15, 23, 18, 0.035);
  --soft-shadow: 0 1px 2px rgba(15, 23, 18, 0.035), 0 12px 30px rgba(15, 23, 18, 0.055);
  background: var(--outside-bg);
}

body[data-theme="violet-peach"] {
  color-scheme: dark;
  --outside-bg: #e8dfd2;
  --bg: #4c4274;
  --surface: #564b7d;
  --surface-soft: #433b68;
  --surface-lift: #665990;
  --border: rgba(246, 213, 176, 0.18);
  --strong-border: rgba(250, 201, 135, 0.5);
  --text: #fff7ef;
  --muted: #eadbcf;
  --quiet: #cbbbd5;
  --red: #ff8d92;
  --orange: #fac987;
  --green: #fac987;
  --green-hover: #f2b86d;
  --red-soft: rgba(255, 141, 146, 0.18);
  --orange-soft: rgba(250, 201, 135, 0.18);
  --green-soft: rgba(250, 201, 135, 0.2);
  --neutral-soft: rgba(35, 28, 62, 0.22);
  --feature-start: rgba(250, 201, 135, 0.5);
  --feature-mid: rgba(250, 201, 135, 0.24);
  --feature-end: rgba(86, 75, 125, 0.92);
  --feature-text: #2d2449;
  --app-texture: radial-gradient(circle at 1px 1px, rgba(250, 201, 135, 0.12) 1px, transparent 1.25px);
  --metric-due-bg: linear-gradient(135deg, #ffd59a 0%, #f5bd78 100%);
  --metric-expired-bg: linear-gradient(135deg, rgba(255, 141, 146, 0.34), rgba(67, 59, 104, 0.82));
  --metric-soon-bg: linear-gradient(135deg, rgba(250, 201, 135, 0.32), rgba(67, 59, 104, 0.82));
  --metric-paid-bg: linear-gradient(135deg, rgba(185, 168, 255, 0.32), rgba(67, 59, 104, 0.82));
  --shadow: 0 1px 2px rgba(35, 28, 62, 0.22), 0 16px 44px rgba(35, 28, 62, 0.24);
  --soft-shadow: 0 1px 2px rgba(35, 28, 62, 0.18), 0 12px 34px rgba(35, 28, 62, 0.18);
  background:
    radial-gradient(circle at 50% 0%, rgba(250, 201, 135, 0.28), transparent 24rem),
    var(--outside-bg);
}

body[data-theme="pastel-health"] {
  color-scheme: light;
  --outside-bg: #e3e7f5;
  --bg: #f8f8f5;
  --surface: #ffffff;
  --surface-soft: #ffffff;
  --surface-lift: #fbfbff;
  --border: #e5e7ef;
  --strong-border: #d4d8ea;
  --text: #171823;
  --muted: #626575;
  --quiet: #9a9eaa;
  --red: #f6818b;
  --orange: #f0bd79;
  --green: #7b75e6;
  --green-hover: #6660d6;
  --red-soft: #ffe2e4;
  --orange-soft: #fff1d9;
  --green-soft: #e8e5ff;
  --neutral-soft: #f1f3fa;
  --feature-start: rgba(123, 117, 230, 0.22);
  --feature-mid: rgba(232, 229, 255, 0.92);
  --feature-end: rgba(255, 255, 255, 0.98);
  --feature-text: #202148;
  --app-texture: radial-gradient(circle at 1px 1px, rgba(85, 83, 130, 0.065) 1px, transparent 1.2px);
  --metric-due-bg: linear-gradient(135deg, #d9d6ff 0%, #c7c9ff 100%);
  --metric-expired-bg: linear-gradient(135deg, #ffd6da 0%, #ffe9eb 100%);
  --metric-soon-bg: linear-gradient(135deg, #ffe1b8 0%, #fff4df 100%);
  --metric-paid-bg: linear-gradient(135deg, #c9f4ec 0%, #edfdf9 100%);
  --shadow: 0 1px 2px rgba(25, 26, 40, 0.04), 0 12px 30px rgba(25, 26, 40, 0.07);
  --soft-shadow: 0 1px 2px rgba(25, 26, 40, 0.035), 0 14px 34px rgba(25, 26, 40, 0.075);
  background: var(--outside-bg);
}

body[data-theme="charcoal-champagne"] {
  color-scheme: dark;
  --outside-bg: #101010;
  --bg: #151515;
  --surface: #1e1e1e;
  --surface-soft: #1e1e1e;
  --surface-lift: #272522;
  --border: #34312b;
  --strong-border: #534838;
  --text: #f5f2eb;
  --muted: #d0c7b8;
  --quiet: #978e80;
  --green: #c6a15b;
  --green-hover: #b28b43;
  --green-soft: rgba(198, 161, 91, 0.16);
  --neutral-soft: rgba(208, 199, 184, 0.13);
  --feature-start: rgba(198, 161, 91, 0.28);
  --feature-mid: rgba(198, 161, 91, 0.1);
  --feature-end: rgba(30, 30, 30, 0.98);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.24), 0 10px 34px rgba(0, 0, 0, 0.18);
  background: var(--outside-bg);
}

body[data-theme="ivory-espresso"] {
  color-scheme: light;
  --outside-bg: #eee8df;
  --bg: #f7f4ee;
  --surface: #ffffff;
  --surface-soft: #ffffff;
  --surface-lift: #fbf8f3;
  --border: #e1d8cc;
  --strong-border: #cab8a5;
  --text: #28231f;
  --muted: #665b51;
  --quiet: #9a8f84;
  --green: #795548;
  --green-hover: #5d4037;
  --green-soft: #efe4dc;
  --neutral-soft: #f0ece6;
  --feature-start: rgba(121, 85, 72, 0.16);
  --feature-mid: rgba(239, 228, 220, 0.86);
  --feature-end: rgba(255, 255, 255, 0.98);
  --feature-text: #28231f;
  --app-texture: radial-gradient(circle at 1px 1px, rgba(40, 35, 31, 0.065) 1px, transparent 1.2px);
  --metric-due-bg: linear-gradient(135deg, #efe4dc 0%, #ffffff 100%);
  --metric-expired-bg: linear-gradient(135deg, #f6ded8 0%, #ffffff 74%);
  --metric-soon-bg: linear-gradient(135deg, #f7ead5 0%, #ffffff 74%);
  --metric-paid-bg: linear-gradient(135deg, #eaded4 0%, #ffffff 74%);
  --shadow: 0 1px 2px rgba(40, 35, 31, 0.03), 0 8px 24px rgba(40, 35, 31, 0.05);
  background: var(--outside-bg);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.app-shell {
  position: relative;
  width: min(100%, 540px);
  max-width: 100%;
  min-height: 100vh;
  margin: 0 auto;
  background:
    var(--app-texture),
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 12%, var(--bg)), var(--bg) 18rem);
  background-size: 18px 18px, auto;
  border-inline: 1px solid rgba(255, 255, 255, 0.04);
  overflow-x: hidden;
}

body.light-theme .app-shell {
  background:
    var(--app-texture),
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 60%, var(--bg)), var(--bg) 18rem);
  background-size: 18px 18px, auto;
  border-inline-color: var(--border);
}

.topbar {
  position: sticky;
  top: 0.65rem;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin: 0.65rem 0.85rem 0;
  padding: 0.78rem 0.82rem;
  border: 1px solid color-mix(in srgb, var(--border) 72%, transparent);
  border-radius: 26px;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(18px);
}

body.light-theme .topbar {
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 34px rgba(15, 23, 18, 0.09), inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

body[data-theme="violet-peach"] .topbar,
body[data-theme="violet-peach"] .mobile-menu {
  background: rgba(76, 66, 116, 0.88);
}

body[data-theme="violet-peach"] .bottom-nav {
  background: rgba(58, 49, 92, 0.9);
  border-color: rgba(250, 201, 135, 0.18);
}

body[data-theme="violet-peach"] .brand-mark {
  color: #2d2449;
  background: var(--green);
}

body[data-theme="pastel-health"] .brand-mark {
  color: #ffffff;
  background: var(--green);
}

body[data-theme="pastel-health"] .topbar,
body[data-theme="pastel-health"] .bottom-nav {
  background: rgba(255, 255, 255, 0.9);
}

body.auth-mode .topbar .ghost-button {
  display: none;
}

.menu-button,
.ghost-button,
.filter-button {
  min-width: 2.55rem;
  min-height: 2.55rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  background: color-mix(in srgb, var(--surface-soft) 88%, var(--surface-lift));
}

.menu-button {
  display: grid;
  place-content: center;
  gap: 0.28rem;
}

.menu-button span {
  display: block;
  width: 1.15rem;
  height: 0.12rem;
  border-radius: 999px;
  background: var(--text);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex: 1;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 18px;
  background: var(--text);
  color: #050606;
  font-size: 1rem;
  font-weight: 700;
}

body.light-theme .brand-mark {
  background: #17201b;
  color: #ffffff;
}

.brand-mark.large {
  width: 3.4rem;
  height: 3.4rem;
  margin-bottom: 0.8rem;
  font-size: 1rem;
}

.brand p,
.brand small,
.eyebrow,
.metrics p,
.member-card p,
.plan-card p {
  margin: 0;
}

.brand p {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.15;
}

.brand small {
  display: none;
}

.ghost-button,
.filter-button {
  padding: 0 0.9rem;
  min-width: auto;
  font-size: 0.9rem;
  font-weight: 600;
}

.icon-action {
  width: 2.55rem;
  padding: 0;
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1;
}

.install-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-width: 6.8rem;
  min-height: 2.85rem;
  padding: 0 0.85rem;
  border-radius: 999px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--green), color-mix(in srgb, var(--green) 68%, #0b2448));
  border-color: color-mix(in srgb, var(--green) 55%, transparent);
  box-shadow: 0 10px 22px color-mix(in srgb, var(--green) 24%, transparent);
}

.install-action.installed {
  background: color-mix(in srgb, var(--green-soft) 72%, var(--surface-lift));
  color: var(--green);
  border-color: color-mix(in srgb, var(--green) 42%, var(--border));
}

.install-status-icon {
  display: grid;
  place-items: center;
  width: 1.55rem;
  height: 1.55rem;
  flex: 0 0 auto;
  border-radius: 999px;
  color: var(--surface);
  background: #ffffff;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1;
}

.install-action.installed .install-status-icon {
  color: #ffffff;
  background: var(--green);
}

.install-status-text {
  font-size: 0.9rem;
  font-weight: 800;
  white-space: nowrap;
}

.mobile-menu {
  position: sticky;
  top: 5rem;
  z-index: 25;
  display: none;
  grid-template-columns: 1fr;
  gap: 0.55rem;
  padding: 0.8rem 1rem 1rem;
  background: rgba(8, 11, 9, 0.97);
  border-bottom: 1px solid var(--border);
}

body.light-theme .mobile-menu {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 8px 20px rgba(15, 23, 18, 0.04);
}

.mobile-menu.open {
  display: grid;
}

.menu-link {
  min-height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 0 0.9rem;
  color: var(--text);
  background: var(--surface-soft);
  font-weight: 600;
  text-align: left;
}

.menu-link::after {
  content: ">";
  color: var(--quiet);
  font-weight: 500;
}

.menu-link:hover {
  border-color: var(--strong-border);
  background: var(--surface-lift);
}

.menu-link.active {
  color: var(--green);
  background: var(--green-soft);
  border-color: var(--strong-border);
}

.menu-link.danger {
  color: #ffd6d3;
}

body.light-theme .menu-link.danger {
  color: #b91c1c;
}

.auth-screen {
  display: grid;
  min-height: calc(100vh - 4.4rem);
  align-items: center;
  padding: 1.25rem 1rem 2rem;
}

.auth-card {
  width: 100%;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 22px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-lift) 54%, transparent), transparent 58%),
    var(--surface);
  box-shadow: var(--soft-shadow);
}

.auth-card .brand-mark.large {
  margin-bottom: 0.85rem;
}

.auth-card h1 {
  max-width: 16.5rem;
  font-size: 1.65rem;
  line-height: 1.08;
}

.auth-copy,
.auth-note {
  color: var(--muted);
  line-height: 1.5;
}

.auth-copy {
  max-width: 18.5rem;
  margin: 0.85rem 0 1rem;
  font-size: 0.98rem;
}

.auth-card .primary-button {
  width: 100%;
  min-height: 3.25rem;
  margin-top: 0.2rem;
}

.auth-note {
  min-height: 1.4rem;
  margin: 0.8rem 0 0;
  font-size: 0.88rem;
  font-weight: 500;
}

.ghost-wide {
  width: 100%;
  min-height: 3.1rem;
  margin-top: 0.7rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  background: var(--surface-lift);
  font-weight: 600;
}

main {
  min-width: 0;
  padding: 0.9rem 1rem 6.7rem;
}

.screen {
  display: none;
  min-width: 0;
  gap: 0.8rem;
  animation: screenIn 180ms ease;
}

.screen.active {
  display: grid;
}

.legal-document {
  display: grid;
  gap: 0;
  width: 100%;
  padding: clamp(1.15rem, 3vw, 2.4rem);
  color: var(--text);
  overflow: visible;
}

.legal-screen {
  width: 100%;
}

.legal-heading {
  padding-bottom: 1.35rem;
  border-bottom: 1px solid var(--border);
}

.legal-heading h1 {
  margin: 0.25rem 0 0.55rem;
  font-size: clamp(1.65rem, 4vw, 2.35rem);
  line-height: 1.12;
  letter-spacing: 0;
}

.legal-heading > p:last-child,
.legal-document section > p,
.legal-document li {
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.72;
}

.legal-heading > p:last-child {
  margin: 0;
}

.legal-document section {
  padding: 1.35rem 0;
  border-bottom: 1px solid var(--border);
}

.legal-document section:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.legal-document h2 {
  margin: 0 0 0.65rem;
  color: var(--text);
  font-size: 1.08rem;
  line-height: 1.35;
  letter-spacing: 0;
}

.legal-document p {
  margin: 0.65rem 0 0;
}

.legal-document ul {
  display: grid;
  gap: 0.55rem;
  margin: 0.75rem 0 0;
  padding-left: 1.3rem;
}

.legal-document a {
  color: var(--text);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

@keyframes screenIn {
  from {
    opacity: 0;
    transform: translateY(0.35rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(0.45rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.screen.active > * {
  animation: cardIn 220ms ease both;
}

.screen.active > *:nth-child(2) {
  animation-delay: 35ms;
}

.screen.active > *:nth-child(3) {
  animation-delay: 70ms;
}

.hero-strip,
.panel {
  min-width: 0;
  max-width: 100%;
  border: 1px solid color-mix(in srgb, var(--border) 78%, transparent);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--soft-shadow);
}

.panel {
  overflow: hidden;
}

.hero-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 9.8rem;
  padding: 1.05rem;
  overflow: hidden;
  position: relative;
  background:
    radial-gradient(circle at 86% 20%, var(--feature-start), transparent 11rem),
    linear-gradient(135deg, var(--feature-mid), transparent 52%),
    linear-gradient(180deg, var(--feature-end), var(--surface) 74%),
    var(--surface);
}

.hero-strip.all-clear {
  background:
    radial-gradient(circle at 86% 20%, color-mix(in srgb, var(--green) 20%, transparent), transparent 10rem),
    linear-gradient(135deg, var(--feature-mid), transparent 54%),
    linear-gradient(180deg, var(--feature-end), var(--surface) 76%),
    var(--surface);
}

.hero-copy {
  min-width: 0;
}

.hero-copy small {
  display: block;
  margin-top: 0.45rem;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 550;
}

.hero-balance {
  flex: 0 0 auto;
  display: grid;
  gap: 0.18rem;
  padding: 0.85rem;
  position: relative;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--green) 28%, var(--border));
  border-radius: 18px;
  background: color-mix(in srgb, var(--green-soft) 72%, var(--surface-lift));
  text-align: right;
}

.hero-balance::after {
  content: "";
  position: absolute;
  right: 0.72rem;
  top: -1.15rem;
  width: 3.1rem;
  height: 3.1rem;
  border: 0.58rem solid color-mix(in srgb, var(--green) 28%, transparent);
  border-left-color: transparent;
  border-radius: 999px;
  opacity: 0.65;
  transform: rotate(-24deg);
}

.hero-balance span,
.hero-balance strong {
  position: relative;
  z-index: 1;
}

.hero-balance span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
}

.hero-balance strong {
  color: var(--text);
  font-size: 1.3rem;
  line-height: 1;
  white-space: nowrap;
}

.hero-action {
  min-height: 2.65rem;
  padding: 0 0.85rem;
  border: 1px solid var(--green);
  border-radius: 14px;
  color: #ffffff;
  background: var(--green);
  font-size: 0.9rem;
  font-weight: 650;
  white-space: nowrap;
}

.hero-action:hover,
.primary-button:hover,
.member-actions a:hover {
  background: var(--green-hover);
}

.eyebrow {
  color: var(--green);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0.25rem 0 0;
  letter-spacing: 0;
}

h1 {
  max-width: 18rem;
  font-size: 1.72rem;
  font-weight: 700;
  line-height: 1.08;
}

h2 {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.15;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem;
}

.metric-card[data-filter="due"] {
  grid-column: 1 / -1;
  min-height: 5.25rem;
  padding: 0.88rem 0.9rem;
  color: var(--feature-text);
  background: var(--metric-due-bg);
}

.metric-card[data-filter="due"] strong {
  font-size: 1.5rem;
  color: var(--feature-text);
}

.metric-card[data-filter="due"] p,
.metric-card[data-filter="due"] small {
  color: color-mix(in srgb, var(--feature-text) 72%, transparent);
}

.metric-card[data-filter="due"] .dot {
  background: var(--feature-text);
}

.metric-card[data-filter="expired"] {
  background: var(--metric-expired-bg);
}

.metric-card[data-filter="due-soon"] {
  background: var(--metric-soon-bg);
}

.metric-card[data-filter="paid"] {
  background: var(--metric-paid-bg);
}

#home-screen.home-searching .metrics {
  display: none;
}

#members-screen.member-searching .filter-row {
  display: none;
}

.metric-card {
  min-width: 0;
  min-height: 4.15rem;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.52rem;
  padding: 0.72rem 0.78rem;
  border: 1px solid color-mix(in srgb, var(--border) 82%, transparent);
  border-radius: 16px;
  color: var(--text);
  background: color-mix(in srgb, var(--surface) 82%, var(--surface-lift));
  text-align: left;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.metric-card:hover,
.filter-chip:hover,
.nav-item:hover {
  border-color: var(--strong-border);
  box-shadow: 0 10px 26px color-mix(in srgb, var(--text) 5%, transparent);
}

.metric-card:active,
.nav-item:active,
.filter-chip:active {
  transform: scale(0.98);
}

.metric-card.active {
  border-color: var(--strong-border);
  background: color-mix(in srgb, var(--green-soft) 58%, var(--surface));
}

.metric-card[data-filter="due"].active {
  background: var(--metric-due-bg);
}

.metric-card[data-filter="expired"].active {
  border-color: rgba(239, 68, 68, 0.5);
  background: var(--metric-expired-bg);
}

.metric-card[data-filter="due-soon"].active {
  border-color: rgba(245, 158, 11, 0.5);
  background: var(--metric-soon-bg);
}

.metric-card[data-filter="paid"].active {
  border-color: rgba(34, 197, 94, 0.5);
  background: var(--metric-paid-bg);
}

body.light-theme .metric-card.active {
  border-color: var(--strong-border);
  background: var(--metric-due-bg);
}

body.light-theme .metric-card[data-filter="expired"].active {
  border-color: #ffd5d5;
  background: var(--metric-expired-bg);
}

body.light-theme .metric-card[data-filter="due-soon"].active {
  border-color: #fde8b6;
  background: var(--metric-soon-bg);
}

body.light-theme .metric-card[data-filter="paid"].active {
  background: var(--metric-paid-bg);
}

.metrics p {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.2;
}

.metric-copy {
  display: grid;
  min-width: 0;
  gap: 0.08rem;
}

.metric-copy small {
  color: var(--quiet);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.15;
}

.metrics strong {
  justify-self: end;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.1;
  text-align: right;
  white-space: nowrap;
}

.dot {
  align-self: start;
  margin-top: 0.32rem;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
}

.white {
  background: var(--text);
}

.red {
  background: var(--red);
}

.orange {
  background: var(--orange);
}

.green {
  background: var(--green);
}

.panel {
  padding: 0.9rem;
}

.notice {
  padding: 0.9rem 1rem;
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: 16px;
  color: #ffe1ad;
  background: var(--orange-soft);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.45;
}

body.light-theme .notice {
  color: #7a4b00;
}

.settings-message {
  margin-bottom: 0.9rem;
}

.toast-message {
  position: fixed;
  left: 50%;
  top: 5.35rem;
  z-index: 44;
  width: min(calc(100% - 1.5rem), 488px);
  transform: translateX(-50%);
  padding: 0.85rem 1rem;
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: 16px;
  color: #ffe1ad;
  background: rgba(36, 25, 5, 0.96);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.3);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.45;
}

body.light-theme .toast-message {
  color: #7a4b00;
  background: rgba(255, 247, 230, 0.98);
  box-shadow: 0 14px 36px rgba(15, 23, 18, 0.12);
}

.section-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.section-title > div {
  min-width: 0;
}

.section-title span {
  color: var(--muted);
  font-size: 0.82rem;
  text-align: right;
}

.section-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.analytics-tools {
  max-width: 100%;
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.search-box {
  position: relative;
  margin-bottom: 0.45rem;
}

.search-box::after {
  content: "⌕";
  position: absolute;
  left: 0.85rem;
  bottom: 0.68rem;
  color: var(--quiet);
  font-size: 1rem;
  pointer-events: none;
}

.home-search {
  margin-bottom: 0.8rem;
}

.article-search-results {
  display: grid;
  gap: 0.72rem;
  margin: -0.15rem 0 0.85rem;
}

.article-result-card {
  border-radius: 18px;
}

.search-count {
  margin: 0 0 0.7rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
}

form,
.settings-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

label {
  display: grid;
  gap: 0.32rem;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 550;
}

.theme-field {
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-soft);
}

.theme-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.palette-icon {
  position: relative;
  width: 1.15rem;
  height: 1.15rem;
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: conic-gradient(var(--green), var(--orange), var(--red), var(--green));
  box-shadow: inset 0 0 0 0.18rem var(--surface-soft);
}

.palette-icon::after {
  content: "";
  position: absolute;
  right: 0.05rem;
  bottom: 0.05rem;
  width: 0.34rem;
  height: 0.34rem;
  border-radius: 999px;
  background: var(--surface-soft);
}

label:first-child,
.full-width,
.primary-button {
  grid-column: 1 / -1;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid color-mix(in srgb, var(--border) 86%, transparent);
  border-radius: 14px;
  padding: 0 0.85rem;
  color: var(--text);
  background: var(--surface-lift);
  outline: none;
  font-weight: 500;
}

input,
select {
  min-height: 2.75rem;
  font-size: 0.96rem;
}

.search-box input {
  padding-left: 2.35rem;
  border-radius: 18px;
}

textarea {
  min-height: 5.25rem;
  padding-block: 0.72rem;
  resize: vertical;
  position: relative;
  z-index: 1;
  cursor: text;
}

textarea[readonly] {
  cursor: default;
  opacity: 0.88;
}

input::placeholder,
textarea::placeholder {
  color: var(--quiet);
  font-weight: 400;
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--strong-border);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.12);
}

.primary-button {
  min-height: 2.85rem;
  border: 0;
  border-radius: 14px;
  color: #ffffff;
  background: var(--green);
  font-weight: 650;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--green) 22%, transparent);
}

.secondary-action {
  width: 100%;
  margin-top: 0.8rem;
}

.filter-row {
  display: flex;
  width: 100%;
  max-width: 100%;
  gap: 0.5rem;
  padding-bottom: 0.85rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.filter-row::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  min-height: 2.25rem;
  flex: 0 0 auto;
  padding: 0 0.85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  background: color-mix(in srgb, var(--surface-soft) 78%, var(--surface-lift));
  font-size: 0.85rem;
  font-weight: 600;
}

.filter-chip.active {
  color: #ffffff;
  background: var(--green);
  border-color: var(--green);
}

body.light-theme .filter-chip.active {
  color: var(--green);
  background: var(--green-soft);
  border-color: var(--strong-border);
}

.member-list {
  display: grid;
  min-width: 0;
  gap: 0.8rem;
}

.member-list.compact .member-card:nth-child(n + 4) {
  display: none;
}

.empty-state {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  color: var(--muted);
  background: var(--surface-soft);
  font-weight: 500;
  line-height: 1.45;
}

.member-card {
  display: grid;
  min-width: 0;
  max-width: 100%;
  gap: 0.78rem;
  padding: 0.9rem;
  border: 1px solid color-mix(in srgb, var(--border) 84%, transparent);
  border-left-width: 0.28rem;
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface-soft) 76%, var(--surface-lift));
  box-shadow: 0 1px 0 color-mix(in srgb, var(--text) 5%, transparent) inset;
}

.member-card.expired {
  border-left-color: var(--red);
  background: linear-gradient(100deg, var(--red-soft), var(--surface-soft) 38%);
}

.member-card.due-soon {
  border-left-color: var(--orange);
  background: linear-gradient(100deg, var(--orange-soft), var(--surface-soft) 38%);
}

.member-card.paid {
  border-left-color: var(--green);
  background: linear-gradient(100deg, var(--green-soft), var(--surface-soft) 38%);
}

.member-card.active {
  border-left-color: #78827a;
}

.member-card.inactive {
  border-left-color: var(--quiet);
  background: var(--surface-soft);
  opacity: 0.88;
}

.member-main {
  display: flex;
  min-width: 0;
  justify-content: space-between;
  gap: 0.85rem;
}

.member-main > div {
  min-width: 0;
}

.member-main h3 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 650;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.member-card p {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 400;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.status-badge {
  flex: 0 0 auto;
  align-self: start;
  max-width: 8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0.42rem 0.62rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
}

.status-badge.expired {
  color: #ffd6d3;
  background: var(--red-soft);
  border: 1px solid rgba(239, 68, 68, 0.36);
}

.status-badge.due-soon {
  color: #ffe1ad;
  background: var(--orange-soft);
  border: 1px solid rgba(245, 158, 11, 0.36);
}

.status-badge.paid {
  color: #c8ffd4;
  background: var(--green-soft);
  border: 1px solid rgba(34, 197, 94, 0.36);
}

.status-badge.active {
  color: #d8ded4;
  background: var(--neutral-soft);
  border: 1px solid rgba(154, 161, 150, 0.3);
}

.status-badge.inactive {
  color: var(--muted);
  background: var(--neutral-soft);
  border: 1px solid var(--border);
}

body.light-theme .status-badge.expired {
  color: #b91c1c;
}

body.light-theme .status-badge.due-soon {
  color: #9a5b00;
}

body.light-theme .status-badge.paid {
  color: var(--green);
}

body.light-theme .status-badge.active {
  color: var(--text);
  border-color: var(--border);
}

.member-actions {
  display: grid;
  min-width: 0;
  max-width: 100%;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.member-actions button,
.member-actions a {
  min-width: 0;
  min-height: 2.55rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  background: var(--surface-lift);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
}

.member-actions a {
  color: #ffffff;
  background: var(--green);
  border-color: var(--green);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--green) 18%, transparent);
}

.member-actions .quiet-action {
  grid-column: 1 / -1;
  color: var(--muted);
  background: var(--surface-soft);
}

.member-card.inactive .member-actions button:not(.info-button) {
  grid-column: 1 / -1;
}

.member-card.inactive .reactivate-from {
  grid-column: 1 / -1;
}

.member-card.inactive .reactivate-months {
  grid-column: 1 / -1;
}

.member-card.inactive .reactivate-amount {
  grid-column: 1 / -1;
}

.member-actions.advanced {
  grid-template-columns: 1fr 1fr;
}

.member-actions.advanced a {
  grid-column: 1 / -1;
}

.paid-months,
.paid-amount,
.paid-from {
  gap: 0.25rem;
  font-size: 0.76rem;
}

.paid-from {
  grid-column: 1 / -1;
  padding: 0.6rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-lift);
}

.paid-months select,
.paid-amount input,
.paid-from input {
  min-height: 2.55rem;
  padding-inline: 0.65rem;
}

.paid-from small {
  color: var(--quiet);
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.25;
}

.paid-from-help {
  display: flex;
  align-items: flex-start;
  gap: 0.42rem;
}

.info-button {
  width: 1.35rem !important;
  min-width: 1.35rem !important;
  max-width: 1.35rem !important;
  height: 1.35rem !important;
  min-height: 1.35rem !important;
  max-height: 1.35rem !important;
  aspect-ratio: 1 / 1;
  flex: 0 0 1.35rem;
  display: grid;
  place-items: center;
  align-self: flex-start;
  padding: 0 !important;
  border: 1px solid color-mix(in srgb, var(--green) 42%, var(--border));
  border-radius: 50%;
  color: var(--green);
  background: var(--surface-soft);
  box-shadow: none;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
}

.member-card.inactive .member-actions .info-button {
  grid-column: auto;
}

.paid-note {
  min-height: 2.55rem;
  display: grid;
  place-items: center;
  grid-column: 1 / -1;
  border: 1px solid rgba(34, 197, 94, 0.36);
  border-radius: 14px;
  color: #c8ffd4;
  background: var(--green-soft);
  font-size: 0.88rem;
  font-weight: 600;
}

.inactive-note {
  min-height: 2.55rem;
  display: grid;
  place-items: center;
  grid-column: 1 / -1;
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--muted);
  background: var(--surface-lift);
  font-size: 0.88rem;
  font-weight: 600;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.62);
}

.modal-card {
  width: min(100%, 420px);
  display: grid;
  gap: 0.85rem;
  padding: 1.1rem;
  border: 1px solid var(--border);
  border-radius: 22px;
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.34);
}

.info-modal {
  position: relative;
  padding-top: 1.35rem;
}

.modal-close {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  background: var(--surface-lift);
  box-shadow: none;
  font-size: 1.2rem;
  line-height: 1;
}

.info-example {
  padding: 0.82rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  color: var(--text);
  background: var(--surface-lift);
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.45;
}

.modal-card h2,
.modal-card p {
  margin: 0;
}

.modal-card > p:not(.eyebrow) {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.bulk-modal {
  max-height: min(86vh, 560px);
}

.bulk-list {
  display: grid;
  gap: 0.55rem;
  max-height: 16rem;
  overflow: auto;
  padding-right: 0.1rem;
}

.bulk-select-all {
  display: flex;
  align-items: center;
  gap: 0.62rem;
  padding: 0.65rem 0.72rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  color: var(--text);
  background: var(--surface-soft);
  font-size: 0.9rem;
  font-weight: 750;
}

.bulk-member {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.85rem;
  padding: 0.72rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  color: var(--text);
  background: var(--surface-lift);
  text-decoration: none;
}

.bulk-choice {
  cursor: pointer;
}

.bulk-select-all input[type="checkbox"],
.bulk-choice input[type="checkbox"] {
  width: 1.08rem;
  height: 1.08rem;
  min-height: 1.08rem;
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
  accent-color: var(--green);
  box-shadow: none;
}

.bulk-member span {
  min-width: 0;
}

.bulk-member b,
.bulk-member small {
  display: block;
}

.bulk-member small {
  margin-top: 0.16rem;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.bulk-member i {
  color: var(--green);
  font-size: 0.82rem;
  font-style: normal;
  font-weight: 700;
  white-space: nowrap;
}

body.light-theme .paid-note {
  color: var(--green);
  border-color: var(--strong-border);
}

.subscription-grid {
  display: grid;
  gap: 0.8rem;
  margin-top: 0.9rem;
}

.plan-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid transparent;
  border-radius: 16px;
  background: var(--surface-soft);
}

.subscription-grid .plan-card {
  align-items: stretch;
  flex-direction: column;
}

.featured-plan {
  border-color: color-mix(in srgb, var(--green) 38%, transparent);
  box-shadow: 0 14px 30px color-mix(in srgb, var(--green) 14%, transparent);
}

.plan-card p {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 500;
}

.plan-card strong {
  display: block;
  margin-top: 0.24rem;
  font-size: 1.1rem;
  font-weight: 700;
}

.plan-card small {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.plan-card ul {
  display: grid;
  gap: 0.35rem;
  margin: 0.75rem 0 0;
  padding-left: 1rem;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.plan-card span {
  color: var(--green);
  font-size: 0.86rem;
  font-weight: 650;
  text-align: right;
}

.plan-card-compact {
  margin-top: 0.8rem;
}

.plan-action {
  width: 100%;
  min-height: 2.65rem;
}

.subscription-note {
  margin-top: 0.7rem;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.analytics-panel {
  display: grid;
  gap: 1rem;
}

.analytics-header,
.analytics-section-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
}

.analytics-header select {
  width: auto;
  min-width: 8.5rem;
  min-height: 2.6rem;
  padding-inline: 0.75rem;
  font-size: 0.86rem;
}

.analytics-kpis {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem;
}

.analytics-kpi,
.analytics-section,
.impact-card {
  min-width: 0;
  border: 1px solid color-mix(in srgb, var(--border) 84%, transparent);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface-soft) 80%, var(--surface-lift));
}

.analytics-kpi {
  display: grid;
  gap: 0.12rem;
  padding: 0.9rem 0.85rem;
}

.analytics-kpi:nth-child(1) {
  color: var(--feature-text);
  background: var(--metric-due-bg);
}

.analytics-kpi:nth-child(1) strong,
.analytics-kpi:nth-child(1) span,
.analytics-kpi:nth-child(1) small {
  color: var(--feature-text);
}

.analytics-kpi:nth-child(2) {
  background: var(--metric-paid-bg);
}

.analytics-kpi:nth-child(3) {
  background: var(--metric-expired-bg);
}

.analytics-kpi:nth-child(4) {
  background: var(--metric-soon-bg);
}

.analytics-kpi strong {
  color: var(--text);
  font-size: 1.18rem;
  line-height: 1.05;
}

.analytics-kpi span,
.analytics-kpi small {
  color: var(--muted);
  font-weight: 600;
}

.analytics-kpi small {
  color: var(--green);
  font-size: 0.75rem;
}

.analytics-section {
  display: grid;
  gap: 0.9rem;
  padding: 1rem;
}

.analytics-section h3 {
  margin: 0.18rem 0 0;
  font-size: 1.3rem;
  line-height: 1.1;
}

.analytics-section-title > span {
  color: var(--green);
  font-size: 0.9rem;
  font-weight: 700;
}

.mini-chart {
  min-height: 9rem;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  align-items: end;
  gap: 0.45rem;
  padding: 0.9rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background:
    linear-gradient(to top, rgba(154, 161, 150, 0.1) 1px, transparent 1px) 0 0 / 100% 33%,
    var(--surface-lift);
}

.chart-bar {
  min-height: 0.55rem;
  display: flex;
  align-items: end;
  justify-content: center;
  border-radius: 999px 999px 0 0;
  background: linear-gradient(180deg, var(--green), var(--green-hover));
}

.chart-bar i {
  display: none;
}

.impact-card {
  padding: 1.1rem;
  text-align: center;
  background:
    radial-gradient(circle at top, var(--green-soft), transparent 60%),
    var(--surface-soft);
}

.impact-card strong {
  display: block;
  margin-top: 0.35rem;
  color: var(--text);
  font-size: 2rem;
  line-height: 1;
}

.impact-card > span {
  display: block;
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.impact-grid,
.timing-grid,
.duration-grid,
.growth-chips {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.55rem;
}

.duration-grid {
  grid-template-columns: repeat(4, 1fr);
}

.impact-grid {
  grid-template-columns: repeat(2, 1fr);
  margin-top: 1rem;
}

.impact-grid p,
.timing-grid p,
.duration-grid p,
.growth-chips span {
  margin: 0;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-lift);
}

.impact-grid b,
.impact-grid small,
.timing-grid b,
.timing-grid small,
.duration-grid b,
.duration-grid small {
  display: block;
}

.impact-grid small,
.timing-grid small,
.duration-grid small {
  margin-top: 0.15rem;
  color: var(--muted);
  font-weight: 600;
}

.timing-grid b,
.duration-grid b {
  color: var(--text);
  font-size: 1.15rem;
}

.payment-history-list {
  display: grid;
  gap: 0.55rem;
  max-height: 18rem;
  overflow: auto;
  padding-right: 0.1rem;
}

.payment-history-tools {
  display: grid;
  grid-template-columns: 1fr minmax(8.5rem, auto);
  gap: 0.55rem;
}

.payment-history-tools input,
.payment-history-tools select {
  width: 100%;
  min-height: 2.65rem;
  padding-inline: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  background: var(--surface-lift);
  box-shadow: var(--shadow);
  font-size: 0.88rem;
  font-weight: 650;
}

.payment-history-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.4rem 0.8rem;
  padding: 0.78rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-lift);
}

.payment-history-row b,
.payment-history-row strong {
  color: var(--text);
}

.payment-history-row b,
.payment-history-row span,
.payment-history-row small {
  min-width: 0;
}

.payment-history-row span,
.payment-history-row small {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.payment-history-row strong {
  text-align: right;
  white-space: nowrap;
}

.analytics-note {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 500;
}

.health-list {
  display: grid;
  gap: 0.75rem;
}

.health-row {
  display: grid;
  grid-template-columns: 5.4rem 1fr 2.4rem;
  align-items: center;
  gap: 0.65rem;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 650;
}

.health-track {
  height: 0.65rem;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-lift);
}

.health-track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
  transition: width 180ms ease;
}

.health-row:nth-child(2) .health-track i {
  background: var(--orange);
}

.health-row:nth-child(3) .health-track i {
  background: var(--red);
}

.health-row b {
  color: var(--text);
  text-align: right;
}

.growth-chips span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-align: center;
}

.member-growth-chart .chart-bar {
  background: linear-gradient(180deg, var(--muted), var(--green));
}

.attention-insights {
  display: grid;
  gap: 0.55rem;
}

.attention-insights button {
  width: 100%;
  min-width: 0;
  min-height: 3.2rem;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 0.6rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0.75rem;
  color: var(--text);
  background: var(--surface-lift);
  text-align: left;
}

.attention-insights b,
.attention-insights strong {
  overflow-wrap: anywhere;
}

.attention-insights strong {
  color: var(--green);
  white-space: nowrap;
}

.attention-insights i {
  color: var(--quiet);
  font-style: normal;
  font-size: 1.2rem;
}

.attention-dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 999px;
}

.attention-dot.red {
  background: var(--red);
}

.attention-dot.orange {
  background: var(--orange);
}

.install-prompt {
  position: fixed;
  left: 50%;
  bottom: 5.9rem;
  z-index: 45;
  width: min(calc(100% - 1.5rem), 488px);
  display: grid;
  gap: 0.9rem;
  transform: translateX(-50%);
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
}

body.light-theme .install-prompt {
  box-shadow: 0 14px 40px rgba(15, 23, 18, 0.12);
}

.install-prompt h2 {
  margin-top: 0.18rem;
  font-size: 1.05rem;
}

.install-prompt p {
  margin: 0;
}

.install-prompt #installCopy,
.install-tip {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 500;
}

.install-tip {
  margin-top: 0.45rem !important;
}

.install-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.install-later,
.install-add {
  min-height: 2.75rem;
  border-radius: 14px;
  font-weight: 650;
}

.install-later {
  border: 1px solid var(--border);
  color: var(--muted);
  background: var(--surface-lift);
}

.install-add {
  border: 1px solid var(--green);
  color: #ffffff;
  background: var(--green);
}

.install-add:hover {
  background: var(--green-hover);
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0.62rem;
  z-index: 35;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  width: min(calc(100% - 1.1rem), 500px);
  min-height: 4.1rem;
  transform: translateX(-50%);
  padding: 0.38rem 0.45rem calc(0.38rem + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 1px solid color-mix(in srgb, var(--border) 86%, transparent);
  border-radius: 26px;
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(18px);
}

body.light-theme .bottom-nav {
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 36px rgba(20, 40, 28, 0.11);
}

.nav-item {
  min-width: 0;
  min-height: 3.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.18rem;
  border: 1px solid transparent;
  border-radius: 20px;
  color: var(--muted);
  background: transparent;
  font-size: 0.78rem;
  font-weight: 600;
}

.nav-icon {
  width: 1.72rem;
  height: 1.58rem;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 1rem;
  line-height: 1;
  font-weight: 700;
}

.nav-item.active {
  color: var(--green);
  background: transparent;
  border-color: transparent;
}

.nav-item.active .nav-icon {
  background: var(--green-soft);
  border-color: color-mix(in srgb, var(--green) 38%, var(--border));
}

.add-nav {
  color: var(--muted);
  border-color: transparent;
  background: transparent;
}

.add-nav.active {
  color: var(--green);
  background: transparent;
  border-color: transparent;
}

.add-nav.active .nav-icon {
  color: #061009;
  background: var(--green);
  border-color: var(--green);
}

@media (max-width: 430px) {
  main {
    padding-inline: 0.75rem;
  }

  .topbar {
    padding-inline: 0.75rem;
  }

  .panel {
    padding: 0.85rem;
  }

  .hero-strip {
    min-height: 8.8rem;
    align-items: stretch;
  }

  .hero-balance {
    justify-content: end;
    padding: 0.72rem;
  }

  .section-title {
    gap: 0.6rem;
    flex-wrap: wrap;
  }

  .section-actions {
    width: 100%;
    justify-content: stretch;
  }

  .section-actions .filter-button {
    flex: 1;
  }

  .filter-button {
    padding-inline: 0.7rem;
    white-space: nowrap;
  }

  .filter-chip {
    min-height: 2.2rem;
    padding-inline: 0.72rem;
    font-size: 0.8rem;
  }

  .member-card {
    padding: 0.82rem;
  }

  .member-actions.advanced {
    grid-template-columns: 1fr;
  }

  .member-actions.advanced a {
    grid-column: auto;
  }

  .paid-months select {
    min-height: 2.65rem;
  }
}

@media (min-width: 760px) {
  .app-shell {
    width: min(100%, 920px);
  }

  .bottom-nav {
    width: min(calc(100% - 1.5rem), 560px);
  }

  main {
    padding-inline: 1.2rem;
  }

  .screen.active {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }

  #home-screen.active,
  #members-screen.active,
  #analytics-screen.active {
    grid-template-columns: 1fr;
  }

  .metrics {
    grid-template-columns: repeat(4, 1fr);
  }

  .metric-card[data-filter="due"] {
    grid-column: auto;
    min-height: 4.15rem;
  }

  .metric-card[data-filter="due"] strong {
    font-size: 1.05rem;
  }

  .analytics-kpis {
    grid-template-columns: repeat(4, 1fr);
  }

  .member-list {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 370px) {
  .metrics,
  .analytics-kpis,
  .growth-chips,
  .timing-grid,
  .duration-grid,
  .payment-history-tools,
  form,
  .settings-list,
  .member-actions {
    grid-template-columns: 1fr;
  }

  .bottom-nav {
    min-height: 4.55rem;
    padding-inline: 0.35rem;
  }

  .nav-item {
    font-size: 0.72rem;
  }
}

/* Premium dashboard layer */
:root {
  --outside-bg: #050706;
  --hero-premium-bg:
    radial-gradient(circle at 84% 28%, rgba(34, 197, 94, 0.28), transparent 8rem),
    radial-gradient(circle at 8% 100%, rgba(244, 247, 245, 0.07), transparent 11rem),
    linear-gradient(135deg, rgba(34, 197, 94, 0.16), rgba(13, 17, 15, 0.94) 58%);
  --status-card-bg: rgba(244, 247, 245, 0.08);
  --metric-due-bg: linear-gradient(135deg, rgba(118, 96, 255, 0.28), rgba(18, 23, 20, 0.92));
  --metric-expired-bg: linear-gradient(135deg, rgba(255, 117, 138, 0.24), rgba(18, 23, 20, 0.92));
  --metric-soon-bg: linear-gradient(135deg, rgba(250, 188, 84, 0.24), rgba(18, 23, 20, 0.92));
  --metric-paid-bg: linear-gradient(135deg, rgba(45, 212, 123, 0.24), rgba(18, 23, 20, 0.92));
  --card-glow: 0 16px 42px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  --search-bg: color-mix(in srgb, var(--surface) 84%, var(--surface-lift));
  --nav-bg: color-mix(in srgb, var(--surface) 88%, transparent);
  --nav-shadow: 0 18px 54px rgba(0, 0, 0, 0.34);
}

body.light-theme {
  --outside-bg: #e9edf5;
  --hero-premium-bg:
    radial-gradient(circle at 80% 22%, rgba(126, 119, 244, 0.2), transparent 8.5rem),
    radial-gradient(circle at 4% 100%, rgba(34, 197, 94, 0.1), transparent 12rem),
    linear-gradient(135deg, #f1efff 0%, #ffffff 72%);
  --status-card-bg: rgba(255, 255, 255, 0.72);
  --metric-due-bg: linear-gradient(135deg, #ebe8ff 0%, #f8f6ff 100%);
  --metric-expired-bg: linear-gradient(135deg, #ffe3e9 0%, #fff2f5 100%);
  --metric-soon-bg: linear-gradient(135deg, #fff0cc 0%, #fff8e8 100%);
  --metric-paid-bg: linear-gradient(135deg, #dcf8ef 0%, #f1fffb 100%);
  --card-glow: 0 16px 40px rgba(95, 109, 101, 0.13), inset 0 1px 0 rgba(255, 255, 255, 0.86);
  --search-bg: rgba(255, 255, 255, 0.92);
  --nav-bg: rgba(255, 255, 255, 0.86);
  --nav-shadow: 0 18px 54px rgba(85, 94, 110, 0.18);
}

body[data-theme="violet-peach"] {
  --hero-premium-bg:
    radial-gradient(circle at 82% 26%, rgba(255, 213, 154, 0.35), transparent 8.5rem),
    radial-gradient(circle at 2% 100%, rgba(255, 247, 239, 0.08), transparent 12rem),
    linear-gradient(135deg, rgba(255, 213, 154, 0.26), rgba(67, 59, 104, 0.96) 58%);
  --status-card-bg: rgba(255, 247, 239, 0.12);
  --metric-due-bg: linear-gradient(135deg, #ffd59a 0%, #f0b978 100%);
  --metric-expired-bg: linear-gradient(135deg, rgba(255, 141, 146, 0.4), rgba(67, 59, 104, 0.84));
  --metric-soon-bg: linear-gradient(135deg, rgba(250, 201, 135, 0.46), rgba(67, 59, 104, 0.84));
  --metric-paid-bg: linear-gradient(135deg, rgba(202, 188, 255, 0.4), rgba(67, 59, 104, 0.84));
  --search-bg: rgba(255, 247, 239, 0.11);
  --nav-bg: rgba(255, 247, 239, 0.12);
}

body[data-theme="pastel-health"] {
  --hero-premium-bg:
    radial-gradient(circle at 82% 26%, rgba(123, 117, 230, 0.2), transparent 8.5rem),
    radial-gradient(circle at 5% 100%, rgba(141, 236, 218, 0.18), transparent 12rem),
    linear-gradient(135deg, #ebe9ff 0%, #ffffff 74%);
  --status-card-bg: rgba(255, 255, 255, 0.76);
  --metric-due-bg: linear-gradient(135deg, #dcd8ff 0%, #f2f0ff 100%);
  --metric-expired-bg: linear-gradient(135deg, #ffd6dd 0%, #fff0f2 100%);
  --metric-soon-bg: linear-gradient(135deg, #ffe4bd 0%, #fff6e6 100%);
  --metric-paid-bg: linear-gradient(135deg, #cbf3e8 0%, #f0fffb 100%);
}

body[data-theme="charcoal-champagne"] {
  --hero-premium-bg:
    radial-gradient(circle at 82% 25%, rgba(198, 161, 91, 0.32), transparent 8.5rem),
    radial-gradient(circle at 6% 100%, rgba(245, 242, 235, 0.06), transparent 12rem),
    linear-gradient(135deg, rgba(198, 161, 91, 0.2), rgba(30, 30, 30, 0.96) 58%);
  --status-card-bg: rgba(245, 242, 235, 0.09);
  --metric-due-bg: linear-gradient(135deg, rgba(198, 161, 91, 0.32), rgba(30, 30, 30, 0.94));
  --metric-expired-bg: linear-gradient(135deg, rgba(170, 92, 78, 0.28), rgba(30, 30, 30, 0.94));
  --metric-soon-bg: linear-gradient(135deg, rgba(214, 178, 104, 0.26), rgba(30, 30, 30, 0.94));
  --metric-paid-bg: linear-gradient(135deg, rgba(147, 124, 82, 0.32), rgba(30, 30, 30, 0.94));
}

body[data-theme="ivory-espresso"] {
  --hero-premium-bg:
    radial-gradient(circle at 82% 25%, rgba(121, 85, 72, 0.18), transparent 8.5rem),
    radial-gradient(circle at 4% 100%, rgba(198, 161, 91, 0.16), transparent 12rem),
    linear-gradient(135deg, #efe4dc 0%, #ffffff 76%);
  --status-card-bg: rgba(255, 255, 255, 0.76);
  --metric-due-bg: linear-gradient(135deg, #efe4dc 0%, #ffffff 100%);
  --metric-expired-bg: linear-gradient(135deg, #f7deda 0%, #fff4f1 100%);
  --metric-soon-bg: linear-gradient(135deg, #f7ead0 0%, #fff9ec 100%);
  --metric-paid-bg: linear-gradient(135deg, #eaded4 0%, #ffffff 100%);
}

body {
  background:
    radial-gradient(circle at 50% -8rem, color-mix(in srgb, var(--green) 18%, transparent), transparent 25rem),
    var(--outside-bg);
}

.app-shell {
  background:
    radial-gradient(circle at 14% 8%, color-mix(in srgb, var(--green) 9%, transparent), transparent 12rem),
    var(--app-texture),
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 42%, var(--bg)), var(--bg) 22rem);
}

body.light-theme .app-shell {
  background:
    radial-gradient(circle at 14% 8%, color-mix(in srgb, var(--green) 12%, transparent), transparent 12rem),
    var(--app-texture),
    linear-gradient(180deg, #fbfcff 0%, var(--bg) 22rem);
}

.topbar {
  gap: 0.62rem;
  padding: 0.72rem 0.82rem;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  box-shadow: 0 10px 28px color-mix(in srgb, var(--text) 7%, transparent);
  overflow: hidden;
}

body.light-theme .topbar {
  background: rgba(255, 255, 255, 0.84);
}

.menu-button,
.ghost-button {
  min-width: 2.75rem;
  min-height: 2.75rem;
  border-radius: 17px;
  background: color-mix(in srgb, var(--surface-lift) 82%, transparent);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--text) 5%, transparent);
}

.menu-button span {
  width: 1.45rem;
  height: 0.16rem;
}

.brand-mark {
  width: 2.55rem;
  height: 2.55rem;
  border-radius: 16px;
  box-shadow: 0 12px 22px color-mix(in srgb, var(--text) 12%, transparent);
}

.brand {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}

.brand p {
  font-size: 1.14rem;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand small {
  display: block;
  margin-top: 0.08rem;
  color: var(--muted);
  max-width: 100%;
  overflow: hidden;
  font-size: 0.72rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bell-action {
  display: none;
  position: relative;
  font-size: 1.2rem;
}

.bell-action::after {
  content: "";
  position: absolute;
  top: 0.82rem;
  right: 0.86rem;
  width: 0.52rem;
  height: 0.52rem;
  border: 2px solid var(--surface);
  border-radius: 999px;
  background: #ff4f68;
}

.icon-action {
  color: #ffffff;
  background: linear-gradient(135deg, var(--green), color-mix(in srgb, var(--green) 65%, #8777ff));
  border-color: transparent;
  font-size: 2rem;
  box-shadow: 0 16px 34px color-mix(in srgb, var(--green) 28%, transparent);
}

main {
  padding: 1.25rem 1.15rem 7.4rem;
}

.screen {
  gap: 1rem;
}

.hero-strip {
  min-height: 16.6rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  padding: 1.4rem;
  border-radius: 28px;
  background: var(--hero-premium-bg);
  box-shadow: var(--card-glow);
}

.hero-strip::before,
.hero-strip::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.hero-strip::before {
  right: -2.3rem;
  bottom: -2.7rem;
  width: 15rem;
  height: 8.6rem;
  border-radius: 60% 40% 0 0;
  background: color-mix(in srgb, var(--green) 14%, transparent);
  filter: blur(0.2px);
}

.hero-strip::after {
  right: 1.2rem;
  bottom: 1rem;
  width: 9rem;
  height: 5.6rem;
  border-radius: 999px 999px 0 0;
  background: linear-gradient(135deg, color-mix(in srgb, var(--green) 16%, transparent), transparent);
}

.hero-copy {
  position: relative;
  z-index: 2;
  padding-right: 0.8rem;
}

.hero-strip .eyebrow {
  color: color-mix(in srgb, var(--green) 78%, var(--text));
  font-size: 1.04rem;
  text-transform: none;
}

.hero-strip h1 {
  max-width: 13.5rem;
  margin-top: 0.32rem;
  color: var(--text);
  font-size: 2.55rem;
  line-height: 0.98;
  letter-spacing: -0.02em;
}

.hero-copy small {
  margin-top: 0.62rem;
  color: var(--muted);
  font-size: 1rem;
}

.hero-status-card {
  width: min(100%, 16.7rem);
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-top: 1.2rem;
  padding: 0.9rem;
  border: 1px solid color-mix(in srgb, var(--border) 58%, transparent);
  border-radius: 22px;
  background: var(--status-card-bg);
  backdrop-filter: blur(14px);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--text) 8%, transparent);
}

.hero-status-icon {
  width: 2.45rem;
  height: 2.45rem;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 999px;
  color: #ffffff;
  background: linear-gradient(135deg, #35d978, #18b86a);
  box-shadow: 0 12px 22px rgba(34, 197, 94, 0.25);
  font-size: 1.25rem;
  font-weight: 800;
}

.hero-status-card b,
.hero-status-card small {
  display: block;
}

.hero-status-card b {
  color: var(--text);
  font-size: 1rem;
  line-height: 1.15;
}

.hero-status-card small {
  margin-top: 0.1rem;
  font-size: 0.84rem;
  line-height: 1.25;
}

.hero-menu-dots {
  position: absolute;
  top: 1.25rem;
  right: 1.55rem;
  z-index: 3;
  color: var(--quiet);
  letter-spacing: 0.18rem;
}

.hero-post-button {
  position: absolute;
  top: 1.05rem;
  right: 1.1rem;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.55rem;
  padding: 0 0.8rem;
  border: 1px solid color-mix(in srgb, var(--text) 24%, transparent);
  border-radius: 999px;
  color: var(--text);
  background: color-mix(in srgb, var(--surface-lift) 34%, transparent);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--text) 12%, transparent);
  backdrop-filter: blur(14px);
}

.hero-post-button span {
  display: grid;
  place-items: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 8px;
  color: var(--surface);
  background: var(--text);
  font-size: 0.76rem;
  line-height: 1;
}

.hero-post-button b {
  font-size: 0.9rem;
  line-height: 1;
}

.hero-post-button i {
  color: var(--muted);
  font-size: 1.15rem;
  font-style: normal;
  line-height: 1;
}

.hero-balance {
  position: relative;
  z-index: 2;
  width: 8.6rem;
  height: 8.6rem;
  place-items: center;
  align-self: center;
  border-radius: 999px;
  text-align: center;
  background:
    radial-gradient(circle, color-mix(in srgb, var(--surface) 92%, transparent) 0 54%, transparent 55%),
    conic-gradient(var(--green) 0 74%, color-mix(in srgb, var(--green) 18%, transparent) 74% 100%);
  border: 0;
  box-shadow:
    inset 0 0 0 0.8rem color-mix(in srgb, var(--surface) 76%, transparent),
    0 16px 34px color-mix(in srgb, var(--green) 14%, transparent);
}

.hero-balance::after {
  display: none;
}

.hero-balance strong {
  color: var(--text);
  font-size: 1.75rem;
}

.hero-balance span {
  max-width: 5.4rem;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.1;
  text-transform: none;
}

.hero-gym-note {
  position: absolute;
  right: 1.55rem;
  bottom: 1.35rem;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
}

.hero-gym-note span {
  color: var(--quiet);
  font-size: 1.35rem;
  transform: rotate(90deg);
}

.hero-gym-note small {
  font-size: 0.8rem;
  line-height: 1.05;
  font-weight: 700;
}

.posts-panel {
  display: grid;
  gap: 0.85rem;
}

.post-list {
  display: grid;
  gap: 0.72rem;
}

.post-empty {
  margin: 0;
  padding: 0.8rem 0.9rem;
  border: 1px dashed color-mix(in srgb, var(--border) 85%, transparent);
  border-radius: 16px;
  color: var(--muted);
  background: color-mix(in srgb, var(--surface-soft) 76%, transparent);
  font-weight: 700;
}

.post-card {
  border: 1px solid color-mix(in srgb, var(--border) 82%, transparent);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface-soft) 84%, transparent);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--text) 6%, transparent);
  overflow: hidden;
}

.post-card summary {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.3rem 0.65rem;
  align-items: center;
  min-height: 4.6rem;
  padding: 0.85rem;
  cursor: pointer;
  list-style: none;
}

.post-card summary::-webkit-details-marker {
  display: none;
}

.post-card summary::after {
  content: "›";
  grid-column: 2;
  grid-row: 1 / span 3;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 1.25rem;
  font-weight: 800;
  transition: transform 160ms ease;
}

.post-card[open] summary::after {
  transform: rotate(90deg);
}

.post-card summary span {
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.post-card summary b {
  color: var(--text);
  font-size: 0.98rem;
  line-height: 1.15;
}

.post-card summary small {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.32;
}

.post-card p {
  margin: 0;
  padding: 0 0.9rem 0.82rem;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.post-card p + p {
  padding-top: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.premium-search {
  margin-bottom: 0;
}

.search-box::after {
  font-size: 1.7rem;
}

.premium-search::after {
  top: 50%;
  bottom: auto;
  left: 1.4rem;
  transform: translateY(-50%);
  color: var(--quiet);
}

.premium-search input {
  min-height: 4.15rem;
  padding-left: 3.9rem;
  padding-right: 1rem;
  border-radius: 24px;
  background: var(--search-bg);
  box-shadow: var(--soft-shadow);
  font-size: 1rem;
}

.metrics {
  gap: 0.9rem;
}

.metric-card,
.metric-card[data-filter="due"] {
  position: relative;
  grid-column: auto;
  min-height: 8.4rem;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 0.55rem;
  padding: 1rem;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--border) 48%, transparent);
  border-radius: 24px;
  box-shadow: var(--card-glow);
}

.metric-card::before {
  content: "";
  position: absolute;
  right: -0.35rem;
  bottom: -0.15rem;
  width: 5.4rem;
  height: 4.35rem;
  opacity: 0.18;
  background:
    linear-gradient(90deg, transparent 0 14%, currentColor 14% 26%, transparent 26% 36%, currentColor 36% 50%, transparent 50% 60%, currentColor 60% 74%, transparent 74%),
    linear-gradient(180deg, transparent 0 22%, currentColor 22% 100%);
  clip-path: polygon(0 86%, 18% 86%, 18% 68%, 34% 68%, 34% 48%, 50% 48%, 50% 30%, 66% 30%, 66% 0, 82% 0, 82% 100%, 0 100%);
}

.metric-card::after {
  content: "›";
  width: 2.2rem;
  height: 2.2rem;
  display: grid;
  place-items: center;
  justify-self: end;
  border-radius: 999px;
  color: var(--muted);
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  font-size: 2rem;
  line-height: 0;
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--text) 8%, transparent);
}

.metric-card[data-filter="due"] {
  color: var(--text);
  background: var(--metric-due-bg);
}

.metric-card[data-filter="expired"] {
  background: var(--metric-expired-bg);
}

.metric-card[data-filter="due-soon"] {
  background: var(--metric-soon-bg);
}

.metric-card[data-filter="paid"] {
  background: var(--metric-paid-bg);
}

.metric-card .dot {
  width: 2.85rem;
  height: 2.85rem;
  display: grid;
  place-items: center;
  margin: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  box-shadow: 0 12px 24px color-mix(in srgb, currentColor 18%, transparent);
}

.metric-card .dot::before {
  color: currentColor;
  font-size: 1.25rem;
  font-weight: 800;
}

.metric-card[data-filter="due"] .dot {
  color: #7660ff;
}

.metric-card[data-filter="expired"] .dot {
  color: #ff4f68;
}

.metric-card[data-filter="due-soon"] .dot {
  color: #f5a623;
}

.metric-card[data-filter="paid"] .dot {
  color: #20c875;
}

.metric-card[data-filter="due"] .dot::before {
  content: "◉";
}

.metric-card[data-filter="expired"] .dot::before {
  content: "◷";
}

.metric-card[data-filter="due-soon"] .dot::before {
  content: "▣";
}

.metric-card[data-filter="paid"] .dot::before {
  content: "▰";
}

.metric-copy {
  grid-column: 1 / -1;
}

.metrics p,
.metric-card[data-filter="due"] p {
  color: var(--muted);
  font-size: 1.02rem;
  font-weight: 700;
}

.metric-copy small,
.metric-card[data-filter="due"] small {
  color: var(--muted);
  font-size: 0.9rem;
}

.metrics strong,
.metric-card[data-filter="due"] strong {
  grid-column: 1 / -1;
  justify-self: start;
  color: var(--text);
  font-size: 1.75rem;
  text-align: left;
}

.metric-card.active {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--green) 36%, var(--border));
}

.panel {
  border-radius: 24px;
  box-shadow: var(--soft-shadow);
}

.bottom-nav {
  min-height: 5.35rem;
  padding: 0.55rem 0.7rem calc(0.55rem + env(safe-area-inset-bottom));
  background: var(--nav-bg);
  border-color: color-mix(in srgb, var(--border) 54%, transparent);
  border-radius: 30px;
  box-shadow: var(--nav-shadow);
}

.nav-item {
  position: relative;
  min-height: 4.05rem;
  gap: 0.28rem;
  border-radius: 22px;
  font-size: 0.88rem;
}

.nav-icon {
  width: 2.45rem;
  height: 2.45rem;
  border-radius: 999px;
  font-size: 1.28rem;
}

.nav-item.active .nav-icon {
  color: var(--green);
  background: color-mix(in srgb, var(--green-soft) 76%, var(--surface));
  border-color: transparent;
  box-shadow: 0 10px 22px color-mix(in srgb, var(--green) 14%, transparent);
}

.add-nav.active .nav-icon {
  color: #ffffff;
}

.nav-item.active::after {
  content: none;
}

.members-icon {
  position: relative;
  color: currentColor;
}

.members-icon::before,
.members-icon::after {
  content: none;
  position: absolute;
  left: 50%;
  border: 0.14rem solid currentColor;
  transform: translateX(-50%);
}

.members-icon::before {
  top: 0.44rem;
  width: 0.44rem;
  height: 0.44rem;
  border-radius: 999px;
  box-shadow:
    -0.58rem 0.18rem 0 -0.05rem currentColor,
    0.58rem 0.18rem 0 -0.05rem currentColor;
}

.members-icon::after {
  bottom: 0.42rem;
  width: 1.18rem;
  height: 0.52rem;
  border-top-left-radius: 999px;
  border-top-right-radius: 999px;
  border-bottom: 0;
}

body[data-theme="violet-peach"] {
  --metric-due-bg: linear-gradient(135deg, #f6dcc2 0%, #edc7a5 100%);
}

body[data-theme="violet-peach"] .metric-card[data-filter="due"] p,
body[data-theme="violet-peach"] .metric-card[data-filter="due"] strong {
  color: #302640;
}

body[data-theme="violet-peach"] .metric-card[data-filter="due"] small {
  color: #514158;
}

.members-icon svg {
  display: block;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

body[data-theme="mint-gloss"],
body[data-theme="cream-red"],
body[data-theme="icy-blue"] {
  --panel-pad: 1rem;
  color-scheme: light;
  background: var(--outside-bg);
}

body[data-theme="mint-gloss"] {
  --outside-bg: #dffcf8;
  --bg: #e9fffb;
  --surface: rgba(246, 255, 253, 0.86);
  --surface-soft: rgba(239, 255, 251, 0.82);
  --surface-lift: rgba(248, 255, 253, 0.9);
  --border: rgba(79, 202, 191, 0.2);
  --strong-border: rgba(16, 196, 182, 0.42);
  --text: #10213a;
  --muted: #557184;
  --quiet: #79a6af;
  --red: #ff6f72;
  --orange: #f1b956;
  --green: #16d8c6;
  --green-hover: #0fc1b2;
  --red-soft: rgba(255, 111, 114, 0.16);
  --orange-soft: rgba(241, 185, 86, 0.15);
  --green-soft: rgba(22, 216, 198, 0.18);
  --neutral-soft: rgba(255, 255, 255, 0.52);
  --feature-start: rgba(25, 224, 207, 0.24);
  --feature-mid: rgba(176, 255, 245, 0.76);
  --feature-end: rgba(248, 255, 253, 0.94);
  --feature-text: #10213a;
  --app-texture:
    radial-gradient(ellipse at 100% 18%, rgba(40, 220, 207, 0.5) 0 8rem, transparent 8.2rem),
    radial-gradient(ellipse at -8% 32%, rgba(69, 223, 213, 0.42) 0 8.8rem, transparent 9rem),
    radial-gradient(ellipse at 96% 105%, rgba(78, 231, 217, 0.36) 0 8.4rem, transparent 8.6rem);
  --hero-premium-bg:
    radial-gradient(ellipse at 100% 58%, rgba(43, 225, 211, 0.42) 0 8.4rem, transparent 8.6rem),
    radial-gradient(ellipse at 78% 84%, rgba(110, 239, 227, 0.38) 0 7.2rem, transparent 7.4rem),
    linear-gradient(135deg, rgba(255, 255, 255, 0.93), rgba(192, 255, 247, 0.8));
  --status-card-bg: rgba(250, 255, 253, 0.76);
  --metric-due-bg:
    radial-gradient(ellipse at 92% 20%, rgba(61, 235, 220, 0.5), transparent 5.8rem),
    linear-gradient(135deg, #9bfff4 0%, #d7fff9 100%);
  --metric-expired-bg: linear-gradient(135deg, #ffffff 0%, #eafffb 100%);
  --metric-soon-bg: linear-gradient(135deg, #cbfff7 0%, #f6fffd 100%);
  --metric-paid-bg: linear-gradient(135deg, #dffffb 0%, #ffffff 100%);
  --card-glow: 0 14px 34px rgba(18, 162, 153, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.88);
  --search-bg: rgba(251, 255, 253, 0.86);
  --nav-bg: rgba(246, 255, 253, 0.78);
  --nav-shadow: 0 18px 44px rgba(31, 164, 157, 0.22);
}

body[data-theme="cream-red"] {
  --outside-bg: #f5ead7;
  --bg: #f8edda;
  --surface: rgba(250, 241, 222, 0.92);
  --surface-soft: rgba(241, 229, 208, 0.78);
  --surface-lift: rgba(232, 219, 197, 0.72);
  --border: rgba(113, 26, 22, 0.15);
  --strong-border: rgba(151, 20, 27, 0.42);
  --text: #4d070d;
  --muted: #73534c;
  --quiet: #9e8172;
  --red: #b60e1d;
  --orange: #cc7a35;
  --green: #b60e1d;
  --green-hover: #9f0b18;
  --red-soft: rgba(182, 14, 29, 0.14);
  --orange-soft: rgba(204, 122, 53, 0.16);
  --green-soft: rgba(182, 14, 29, 0.12);
  --neutral-soft: rgba(255, 250, 238, 0.5);
  --feature-start: rgba(182, 14, 29, 0.2);
  --feature-mid: rgba(255, 246, 229, 0.72);
  --feature-end: rgba(250, 241, 222, 0.98);
  --feature-text: #4d070d;
  --app-texture:
    linear-gradient(132deg, #b60e1d 0 12%, transparent 12.2% 78%, #b60e1d 78.2% 100%),
    repeating-radial-gradient(circle at 94% 14%, transparent 0 1.2rem, rgba(113, 26, 22, 0.18) 1.24rem 1.3rem, transparent 1.34rem 2.45rem),
    repeating-radial-gradient(circle at 10% 92%, transparent 0 1.4rem, rgba(113, 26, 22, 0.14) 1.44rem 1.5rem, transparent 1.54rem 2.7rem);
  --hero-premium-bg:
    linear-gradient(130deg, #b60e1d 0 15%, transparent 15.2% 68%, #b60e1d 68.2% 100%),
    repeating-radial-gradient(circle at 97% 12%, transparent 0 1.1rem, rgba(113, 26, 22, 0.18) 1.14rem 1.2rem, transparent 1.24rem 2.2rem),
    linear-gradient(135deg, rgba(255, 248, 232, 0.95), rgba(238, 224, 201, 0.88));
  --status-card-bg: rgba(255, 248, 232, 0.82);
  --metric-due-bg:
    linear-gradient(135deg, #b60e1d 0 24%, #fff1df 24.2% 100%),
    linear-gradient(135deg, #fff1df, #f5e1c7);
  --metric-expired-bg:
    linear-gradient(135deg, rgba(182, 14, 29, 0.14), rgba(255, 248, 232, 0.95));
  --metric-soon-bg: linear-gradient(135deg, rgba(182, 14, 29, 0.34), rgba(246, 229, 205, 0.92));
  --metric-paid-bg: linear-gradient(135deg, rgba(255, 248, 232, 0.96), rgba(238, 224, 201, 0.94));
  --card-glow: 0 14px 32px rgba(84, 22, 16, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.72);
  --search-bg: rgba(236, 223, 202, 0.86);
  --nav-bg: rgba(255, 246, 229, 0.88);
  --nav-shadow: 0 18px 44px rgba(86, 37, 21, 0.2);
}

body[data-theme="icy-blue"] {
  --outside-bg: #d7edff;
  --bg: #e9f6ff;
  --surface: rgba(239, 249, 255, 0.86);
  --surface-soft: rgba(224, 243, 255, 0.78);
  --surface-lift: rgba(238, 249, 255, 0.88);
  --border: rgba(48, 139, 219, 0.18);
  --strong-border: rgba(21, 121, 225, 0.42);
  --text: #0b2448;
  --muted: #466c9c;
  --quiet: #76a4cc;
  --red: #ff5e78;
  --orange: #77aff5;
  --green: #168cf0;
  --green-hover: #0875d4;
  --red-soft: rgba(255, 94, 120, 0.16);
  --orange-soft: rgba(119, 175, 245, 0.16);
  --green-soft: rgba(22, 140, 240, 0.16);
  --neutral-soft: rgba(255, 255, 255, 0.52);
  --feature-start: rgba(57, 164, 255, 0.22);
  --feature-mid: rgba(193, 230, 255, 0.82);
  --feature-end: rgba(247, 252, 255, 0.96);
  --feature-text: #0b2448;
  --app-texture:
    radial-gradient(ellipse at 100% 18%, rgba(80, 174, 255, 0.42) 0 8rem, transparent 8.2rem),
    radial-gradient(ellipse at -6% 30%, rgba(113, 193, 255, 0.4) 0 8.2rem, transparent 8.4rem),
    radial-gradient(ellipse at 98% 104%, rgba(94, 181, 255, 0.32) 0 8.7rem, transparent 8.9rem);
  --hero-premium-bg:
    radial-gradient(ellipse at 100% 56%, rgba(72, 165, 255, 0.32) 0 8rem, transparent 8.2rem),
    radial-gradient(ellipse at 78% 84%, rgba(145, 211, 255, 0.46) 0 7rem, transparent 7.2rem),
    linear-gradient(135deg, rgba(249, 253, 255, 0.94), rgba(201, 233, 255, 0.82));
  --status-card-bg: rgba(248, 253, 255, 0.78);
  --metric-due-bg:
    radial-gradient(ellipse at 92% 20%, rgba(70, 169, 255, 0.34), transparent 5.8rem),
    linear-gradient(135deg, #b8e3ff 0%, #eaf7ff 100%);
  --metric-expired-bg: linear-gradient(135deg, #ffffff 0%, #e5f4ff 100%);
  --metric-soon-bg: linear-gradient(135deg, #d0ebff 0%, #f7fcff 100%);
  --metric-paid-bg: linear-gradient(135deg, #dff2ff 0%, #ffffff 100%);
  --card-glow: 0 14px 34px rgba(42, 128, 218, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.88);
  --search-bg: rgba(246, 252, 255, 0.86);
  --nav-bg: rgba(241, 249, 255, 0.78);
  --nav-shadow: 0 18px 44px rgba(47, 127, 205, 0.22);
}

body[data-theme="mint-gloss"] .app-shell,
body[data-theme="cream-red"] .app-shell,
body[data-theme="icy-blue"] .app-shell {
  position: relative;
  isolation: isolate;
  background:
    var(--app-texture),
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 62%, var(--bg)), var(--bg) 24rem);
}

body[data-theme="mint-gloss"] .app-shell::before,
body[data-theme="cream-red"] .app-shell::before,
body[data-theme="icy-blue"] .app-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: var(--app-texture);
  opacity: 0.8;
}

body[data-theme="mint-gloss"] .topbar,
body[data-theme="cream-red"] .topbar,
body[data-theme="icy-blue"] .topbar {
  margin: 0.55rem 0.85rem 0;
  padding: 0.75rem 0.85rem;
  border: 1px solid color-mix(in srgb, var(--border) 64%, transparent);
  border-radius: 26px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: blur(18px);
  box-shadow: var(--card-glow);
}

body[data-theme="mint-gloss"] .menu-button,
body[data-theme="cream-red"] .menu-button,
body[data-theme="icy-blue"] .menu-button,
body[data-theme="mint-gloss"] .ghost-button,
body[data-theme="cream-red"] .ghost-button,
body[data-theme="icy-blue"] .ghost-button {
  border-color: color-mix(in srgb, var(--border) 62%, transparent);
  background: color-mix(in srgb, var(--surface-lift) 86%, transparent);
  box-shadow: 0 10px 22px color-mix(in srgb, var(--green) 14%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

body[data-theme="mint-gloss"] .brand-mark,
body[data-theme="cream-red"] .brand-mark,
body[data-theme="icy-blue"] .brand-mark {
  border-radius: 999px;
  color: #ffffff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--green), color-mix(in srgb, var(--green) 70%, #08315d));
  box-shadow: 0 12px 24px color-mix(in srgb, var(--green) 32%, transparent);
}

body[data-theme="cream-red"] .brand-mark {
  background: linear-gradient(135deg, #7f0711, #c11223);
}

body[data-theme="mint-gloss"] .icon-action,
body[data-theme="cream-red"] .icon-action,
body[data-theme="icy-blue"] .icon-action {
  min-width: 3.6rem;
  min-height: 3.6rem;
  border-radius: 24px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--green), color-mix(in srgb, var(--green) 74%, #0b2448));
  box-shadow: 0 16px 30px color-mix(in srgb, var(--green) 32%, transparent);
}

body[data-theme="mint-gloss"] .install-action,
body[data-theme="cream-red"] .install-action,
body[data-theme="icy-blue"] .install-action {
  min-width: 7rem;
  min-height: 3.1rem;
  border-radius: 999px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--green), color-mix(in srgb, var(--green) 74%, #0b2448));
  box-shadow: 0 16px 30px color-mix(in srgb, var(--green) 28%, transparent);
}

body[data-theme="cream-red"] .install-action {
  background: linear-gradient(135deg, #b60e1d, #8f0713);
}

body[data-theme="mint-gloss"] main,
body[data-theme="cream-red"] main,
body[data-theme="icy-blue"] main {
  padding-top: 1rem;
}

body[data-theme="mint-gloss"] .hero-strip,
body[data-theme="cream-red"] .hero-strip,
body[data-theme="icy-blue"] .hero-strip,
body[data-theme="mint-gloss"] .panel,
body[data-theme="cream-red"] .panel,
body[data-theme="icy-blue"] .panel {
  border: 1px solid color-mix(in srgb, var(--border) 62%, rgba(255, 255, 255, 0.7));
  border-radius: 24px;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  box-shadow: var(--card-glow);
  backdrop-filter: blur(18px);
}

body[data-theme="mint-gloss"] .hero-strip,
body[data-theme="cream-red"] .hero-strip,
body[data-theme="icy-blue"] .hero-strip {
  min-height: 16.2rem;
  border-radius: 28px;
  background: var(--hero-premium-bg);
}

body[data-theme="mint-gloss"] .hero-strip::before,
body[data-theme="icy-blue"] .hero-strip::before {
  right: -2.2rem;
  bottom: -2.8rem;
  width: 15rem;
  height: 8.2rem;
  border-radius: 60% 40% 0 0;
  background: color-mix(in srgb, var(--green) 18%, transparent);
}

body[data-theme="cream-red"] .hero-strip::before {
  right: -0.8rem;
  bottom: -0.5rem;
  width: 7rem;
  height: 7rem;
  border-radius: 999px;
  background:
    radial-gradient(circle, transparent 0 38%, rgba(77, 7, 13, 0.08) 39% 42%, transparent 43%),
    linear-gradient(45deg, transparent 47%, rgba(77, 7, 13, 0.12) 48% 52%, transparent 53%);
  opacity: 0.9;
}

body[data-theme="cream-red"] .hero-strip::after {
  right: 1.2rem;
  bottom: 1.2rem;
  width: 4.4rem;
  height: 4.4rem;
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 42%, #4d070d 0 0.42rem, transparent 0.46rem),
    radial-gradient(ellipse at 50% 65%, #4d070d 0 0.82rem, transparent 0.86rem);
  opacity: 0.7;
}

body[data-theme="mint-gloss"] .hero-balance,
body[data-theme="cream-red"] .hero-balance,
body[data-theme="icy-blue"] .hero-balance {
  width: 8.4rem;
  height: 8.4rem;
  border-radius: 999px;
  text-align: center;
  background:
    radial-gradient(circle, color-mix(in srgb, var(--surface) 94%, transparent) 0 54%, transparent 55%),
    conic-gradient(var(--green) 0 74%, color-mix(in srgb, var(--green) 18%, rgba(255, 255, 255, 0.66)) 74% 100%);
  box-shadow: 0 16px 34px color-mix(in srgb, var(--green) 24%, transparent), inset 0 0 0 0.78rem rgba(255, 255, 255, 0.34);
}

body[data-theme="cream-red"] .hero-balance {
  background:
    radial-gradient(circle, #fff4e4 0 54%, transparent 55%),
    conic-gradient(#b60e1d 0 74%, rgba(112, 84, 72, 0.18) 74% 100%);
}

body[data-theme="mint-gloss"] .hero-status-icon,
body[data-theme="cream-red"] .hero-status-icon,
body[data-theme="icy-blue"] .hero-status-icon {
  background: linear-gradient(135deg, var(--green), color-mix(in srgb, var(--green) 72%, #0b2448));
  box-shadow: 0 13px 24px color-mix(in srgb, var(--green) 24%, transparent);
}

body[data-theme="cream-red"] input,
body[data-theme="cream-red"] select,
body[data-theme="cream-red"] textarea,
body[data-theme="cream-red"] .filter-chip {
  background: color-mix(in srgb, #e7d9bf 82%, transparent);
}

body[data-theme="mint-gloss"] input,
body[data-theme="mint-gloss"] select,
body[data-theme="mint-gloss"] textarea,
body[data-theme="icy-blue"] input,
body[data-theme="icy-blue"] select,
body[data-theme="icy-blue"] textarea,
body[data-theme="mint-gloss"] .filter-chip,
body[data-theme="icy-blue"] .filter-chip {
  background: color-mix(in srgb, var(--surface-lift) 84%, transparent);
}

body[data-theme="mint-gloss"] input,
body[data-theme="cream-red"] input,
body[data-theme="icy-blue"] input,
body[data-theme="mint-gloss"] select,
body[data-theme="cream-red"] select,
body[data-theme="icy-blue"] select,
body[data-theme="mint-gloss"] textarea,
body[data-theme="cream-red"] textarea,
body[data-theme="icy-blue"] textarea,
body[data-theme="mint-gloss"] .theme-field,
body[data-theme="cream-red"] .theme-field,
body[data-theme="icy-blue"] .theme-field,
body[data-theme="mint-gloss"] .paid-from,
body[data-theme="cream-red"] .paid-from,
body[data-theme="icy-blue"] .paid-from,
body[data-theme="mint-gloss"] .empty-state,
body[data-theme="cream-red"] .empty-state,
body[data-theme="icy-blue"] .empty-state {
  border-color: color-mix(in srgb, var(--border) 62%, rgba(255, 255, 255, 0.5));
  box-shadow: 0 10px 24px color-mix(in srgb, var(--green) 9%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

body[data-theme="mint-gloss"] .primary-button,
body[data-theme="cream-red"] .primary-button,
body[data-theme="icy-blue"] .primary-button,
body[data-theme="mint-gloss"] .member-actions a,
body[data-theme="cream-red"] .member-actions a,
body[data-theme="icy-blue"] .member-actions a,
body[data-theme="mint-gloss"] .filter-chip.active,
body[data-theme="cream-red"] .filter-chip.active,
body[data-theme="icy-blue"] .filter-chip.active {
  color: #ffffff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--green), color-mix(in srgb, var(--green) 72%, #0b2448));
  box-shadow: 0 12px 24px color-mix(in srgb, var(--green) 22%, transparent);
}

body[data-theme="cream-red"] .primary-button,
body[data-theme="cream-red"] .member-actions a,
body[data-theme="cream-red"] .filter-chip.active {
  background: linear-gradient(135deg, #b60e1d, #8f0713);
}

body[data-theme="mint-gloss"] .member-card,
body[data-theme="cream-red"] .member-card,
body[data-theme="icy-blue"] .member-card,
body[data-theme="mint-gloss"] .analytics-kpi,
body[data-theme="cream-red"] .analytics-kpi,
body[data-theme="icy-blue"] .analytics-kpi,
body[data-theme="mint-gloss"] .analytics-section,
body[data-theme="cream-red"] .analytics-section,
body[data-theme="icy-blue"] .analytics-section,
body[data-theme="mint-gloss"] .impact-card,
body[data-theme="cream-red"] .impact-card,
body[data-theme="icy-blue"] .impact-card {
  border-color: color-mix(in srgb, var(--border) 58%, rgba(255, 255, 255, 0.58));
  border-radius: 22px;
  box-shadow: var(--card-glow);
}

body[data-theme="mint-gloss"] .member-card.expired,
body[data-theme="cream-red"] .member-card.expired,
body[data-theme="icy-blue"] .member-card.expired {
  background: linear-gradient(100deg, color-mix(in srgb, var(--red-soft) 76%, transparent), color-mix(in srgb, var(--surface-soft) 92%, transparent) 42%);
}

body[data-theme="mint-gloss"] .status-badge.expired,
body[data-theme="cream-red"] .status-badge.expired,
body[data-theme="icy-blue"] .status-badge.expired {
  color: #d61f36;
  background: #ffd9df;
  border-color: rgba(214, 31, 54, 0.18);
  box-shadow: 0 8px 18px rgba(214, 31, 54, 0.16);
}

body[data-theme="cream-red"] .status-badge.expired {
  color: #b60e1d;
  background: #ffd9dd;
}

body[data-theme="mint-gloss"] .analytics-kpis,
body[data-theme="cream-red"] .analytics-kpis,
body[data-theme="icy-blue"] .analytics-kpis {
  grid-template-columns: 1fr;
}

body[data-theme="mint-gloss"] .analytics-kpi,
body[data-theme="cream-red"] .analytics-kpi,
body[data-theme="icy-blue"] .analytics-kpi {
  position: relative;
  min-height: 5.25rem;
  overflow: hidden;
  padding: 1.05rem 5.25rem 1.05rem 1.1rem;
}

body[data-theme="mint-gloss"] .analytics-kpi:nth-child(1),
body[data-theme="icy-blue"] .analytics-kpi:nth-child(1) {
  min-height: 5.9rem;
  background:
    radial-gradient(circle at 87% 26%, color-mix(in srgb, var(--green) 18%, transparent), transparent 4.5rem),
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), color-mix(in srgb, var(--green) 24%, white));
}

body[data-theme="mint-gloss"] .analytics-kpi:nth-child(2),
body[data-theme="icy-blue"] .analytics-kpi:nth-child(2) {
  background:
    radial-gradient(circle at 86% 50%, rgba(255, 255, 255, 0.52) 0 2rem, transparent 2.1rem),
    linear-gradient(135deg, color-mix(in srgb, var(--green) 26%, white), rgba(255, 255, 255, 0.9));
}

body[data-theme="mint-gloss"] .analytics-kpi:nth-child(3),
body[data-theme="icy-blue"] .analytics-kpi:nth-child(3) {
  background:
    radial-gradient(ellipse at 88% 68%, rgba(255, 107, 120, 0.22), transparent 4rem),
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), color-mix(in srgb, var(--red) 16%, white));
}

body[data-theme="mint-gloss"] .analytics-kpi:nth-child(4),
body[data-theme="icy-blue"] .analytics-kpi:nth-child(4) {
  background:
    radial-gradient(ellipse at 88% 72%, color-mix(in srgb, var(--green) 22%, transparent), transparent 4.2rem),
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), color-mix(in srgb, var(--green) 18%, white));
}

body[data-theme="cream-red"] .analytics-kpi:nth-child(1) {
  color: #fff8ef;
  background:
    radial-gradient(circle at 88% 50%, rgba(255, 248, 232, 0.13), transparent 3.8rem),
    linear-gradient(135deg, #b60e1d, #870712);
}

body[data-theme="cream-red"] .analytics-kpi:nth-child(1) strong,
body[data-theme="cream-red"] .analytics-kpi:nth-child(1) span,
body[data-theme="cream-red"] .analytics-kpi:nth-child(1) small {
  color: #fff8ef;
}

body[data-theme="cream-red"] .analytics-kpi:nth-child(2),
body[data-theme="cream-red"] .analytics-kpi:nth-child(4) {
  background:
    repeating-radial-gradient(circle at 96% 12%, transparent 0 1rem, rgba(77, 7, 13, 0.12) 1.04rem 1.1rem, transparent 1.14rem 2.2rem),
    linear-gradient(135deg, rgba(255, 248, 232, 0.95), rgba(229, 214, 190, 0.8));
}

body[data-theme="cream-red"] .analytics-kpi:nth-child(3) {
  background:
    linear-gradient(135deg, rgba(191, 27, 34, 0.2), rgba(255, 248, 232, 0.92)),
    linear-gradient(135deg, transparent 0 72%, #b60e1d 72.2% 100%);
}

body[data-theme="mint-gloss"] .analytics-kpi::after,
body[data-theme="cream-red"] .analytics-kpi::after,
body[data-theme="icy-blue"] .analytics-kpi::after {
  content: "";
  position: absolute;
  right: 1rem;
  top: 50%;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 999px;
  transform: translateY(-50%);
  background: linear-gradient(135deg, var(--green), color-mix(in srgb, var(--green) 66%, #112a67));
  box-shadow: 0 12px 24px color-mix(in srgb, var(--green) 28%, transparent);
}

body[data-theme="cream-red"] .analytics-kpi::after {
  background: linear-gradient(135deg, #b60e1d, #7f0711);
}

body[data-theme="mint-gloss"] .metric-card,
body[data-theme="icy-blue"] .metric-card {
  min-height: 7.9rem;
  padding: 1rem;
}

body[data-theme="cream-red"] .metric-card {
  min-height: 7.9rem;
  padding: 1rem;
  background-blend-mode: normal;
}

body[data-theme="cream-red"] .metric-card::before {
  right: auto;
  left: 0;
  top: 0;
  width: 3.8rem;
  height: 3.8rem;
  opacity: 1;
  background:
    repeating-radial-gradient(circle at 0 0, transparent 0 0.75rem, rgba(255, 248, 232, 0.14) 0.78rem 0.84rem, transparent 0.88rem 1.5rem),
    #b60e1d;
  clip-path: polygon(0 0, 100% 0, 0 100%);
}

body[data-theme="mint-gloss"] .metric-card[data-filter="due"] p,
body[data-theme="mint-gloss"] .metric-card[data-filter="due"] small,
body[data-theme="mint-gloss"] .metric-card[data-filter="due"] strong,
body[data-theme="cream-red"] .metric-card[data-filter="due"] p,
body[data-theme="cream-red"] .metric-card[data-filter="due"] small,
body[data-theme="cream-red"] .metric-card[data-filter="due"] strong,
body[data-theme="icy-blue"] .metric-card[data-filter="due"] p,
body[data-theme="icy-blue"] .metric-card[data-filter="due"] small,
body[data-theme="icy-blue"] .metric-card[data-filter="due"] strong {
  color: var(--text);
}

body[data-theme="mint-gloss"] .metric-card[data-filter="due"] .dot,
body[data-theme="cream-red"] .metric-card[data-filter="due"] .dot,
body[data-theme="icy-blue"] .metric-card[data-filter="due"] .dot {
  color: #7c5cff;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
}

body[data-theme="cream-red"] .metric-card[data-filter="due"] .dot {
  color: #b60e1d;
}

body[data-theme="mint-gloss"] .member-actions.advanced a,
body[data-theme="cream-red"] .member-actions.advanced a,
body[data-theme="icy-blue"] .member-actions.advanced a {
  min-height: 3rem;
  border-radius: 999px;
}

body[data-theme="mint-gloss"] .analytics-header select,
body[data-theme="cream-red"] .analytics-header select,
body[data-theme="icy-blue"] .analytics-header select {
  min-height: 3rem;
  border-radius: 18px;
}

body[data-theme="mint-gloss"] .bottom-nav,
body[data-theme="cream-red"] .bottom-nav,
body[data-theme="icy-blue"] .bottom-nav {
  bottom: 0.85rem;
  width: min(calc(100% - 1.25rem), 500px);
  min-height: 4.9rem;
  padding: 0.5rem 0.6rem calc(0.5rem + env(safe-area-inset-bottom));
  border-radius: 30px;
  background: var(--nav-bg);
  border-color: color-mix(in srgb, var(--border) 58%, rgba(255, 255, 255, 0.62));
  box-shadow: var(--nav-shadow);
}

body[data-theme="mint-gloss"] .nav-item,
body[data-theme="cream-red"] .nav-item,
body[data-theme="icy-blue"] .nav-item {
  min-height: 3.65rem;
  border-radius: 22px;
  color: var(--muted);
}

body[data-theme="mint-gloss"] .nav-icon,
body[data-theme="cream-red"] .nav-icon,
body[data-theme="icy-blue"] .nav-icon {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 999px;
}

body[data-theme="mint-gloss"] .nav-item.active,
body[data-theme="cream-red"] .nav-item.active,
body[data-theme="icy-blue"] .nav-item.active {
  color: var(--green);
}

body[data-theme="mint-gloss"] .nav-item.active .nav-icon,
body[data-theme="cream-red"] .nav-item.active .nav-icon,
body[data-theme="icy-blue"] .nav-item.active .nav-icon {
  color: #ffffff;
  background: linear-gradient(135deg, var(--green), color-mix(in srgb, var(--green) 72%, #0b2448));
  border-color: transparent;
  box-shadow: 0 10px 22px color-mix(in srgb, var(--green) 28%, transparent);
}

body[data-theme="cream-red"] .nav-item.active .nav-icon {
  background: linear-gradient(135deg, #b60e1d, #8f0713);
}

body[data-theme="mint-gloss"] .install-action.installed,
body[data-theme="cream-red"] .install-action.installed,
body[data-theme="icy-blue"] .install-action.installed {
  color: #ffffff;
  background: linear-gradient(135deg, var(--green), color-mix(in srgb, var(--green) 70%, #0b2448));
}

body[data-theme="cream-red"] .install-action.installed {
  background: linear-gradient(135deg, #b60e1d, #8f0713);
}

body[data-theme="mint-gloss"] .add-nav.active .nav-icon,
body[data-theme="cream-red"] .add-nav.active .nav-icon,
body[data-theme="icy-blue"] .add-nav.active .nav-icon {
  color: #ffffff;
}

@media (min-width: 760px) {
  body[data-theme="mint-gloss"] .analytics-kpis,
  body[data-theme="cream-red"] .analytics-kpis,
  body[data-theme="icy-blue"] .analytics-kpis {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 760px) {
  .hero-strip {
    min-height: 15.2rem;
  }

  .hero-strip h1 {
    max-width: 28rem;
  }

  .metric-card,
  .metric-card[data-filter="due"] {
    min-height: 8rem;
  }
}

@media (max-width: 430px) {
  .topbar {
    gap: 0.58rem;
    padding: 0.72rem;
  }

  .menu-button,
  .ghost-button {
    min-width: 2.85rem;
    min-height: 2.85rem;
    border-radius: 17px;
  }

  .bell-action {
    display: none;
  }

  .brand {
    gap: 0.58rem;
  }

  .brand-mark {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 17px;
  }

  .brand p {
    font-size: 1.06rem;
  }

  .brand small {
    max-width: 8.8rem;
    overflow: hidden;
    font-size: 0.76rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

.install-action {
  flex: 0 0 auto;
  min-width: 5.35rem;
  min-height: 2.35rem;
  padding-inline: 0.52rem;
  gap: 0.34rem;
}

.install-status-icon {
  width: 1.22rem;
  height: 1.22rem;
  font-size: 0.78rem;
}

.install-status-text {
  font-size: 0.74rem;
}

body[data-theme="mint-gloss"] .install-action,
body[data-theme="cream-red"] .install-action,
body[data-theme="icy-blue"] .install-action {
  min-width: 5.45rem;
  min-height: 2.45rem;
  padding-inline: 0.58rem;
}

body[data-theme="mint-gloss"] .brand-mark,
body[data-theme="cream-red"] .brand-mark,
body[data-theme="icy-blue"] .brand-mark {
  width: 2.4rem;
  height: 2.9rem;
  border-radius: 999px;
}

@media (max-width: 430px) {
  .topbar {
    gap: 0.48rem;
    padding: 0.62rem;
  }

  .menu-button,
  .ghost-button {
    min-width: 2.45rem;
    min-height: 2.45rem;
    border-radius: 15px;
  }

  .menu-button span {
    width: 1.12rem;
  }

  .brand {
    gap: 0.42rem;
  }

  .brand-mark {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 14px;
    font-size: 0.84rem;
  }

  body[data-theme="mint-gloss"] .brand-mark,
  body[data-theme="cream-red"] .brand-mark,
  body[data-theme="icy-blue"] .brand-mark {
    width: 2rem;
    height: 2.45rem;
  }

  .brand p {
    font-size: 0.98rem;
  }

  .brand small {
    font-size: 0.66rem;
  }

  .install-action,
  body[data-theme="mint-gloss"] .install-action,
  body[data-theme="cream-red"] .install-action,
  body[data-theme="icy-blue"] .install-action {
    min-width: 4.85rem;
    min-height: 2.18rem;
    padding-inline: 0.42rem;
    gap: 0.28rem;
  }

  .install-status-icon {
    width: 1.05rem;
    height: 1.05rem;
    font-size: 0.68rem;
  }

  .install-status-text {
    font-size: 0.68rem;
  }
}

  main {
    padding: 1rem 0.95rem 7rem;
  }

  .hero-strip {
    min-height: 15.8rem;
    padding: 1.15rem;
    border-radius: 26px;
  }

  .hero-strip h1 {
    max-width: 12.4rem;
    font-size: 2.25rem;
  }

  .hero-strip .eyebrow {
    font-size: 0.98rem;
  }

  .hero-copy small {
    max-width: 12rem;
    font-size: 0.9rem;
  }

  .hero-status-card {
    width: 14.5rem;
    margin-top: 1rem;
    padding: 0.76rem;
  }

  .hero-status-icon {
    width: 2.15rem;
    height: 2.15rem;
  }

  .hero-status-card small {
    font-size: 0.78rem;
  }

  .hero-balance {
    width: 7.2rem;
    height: 7.2rem;
    margin-top: 3rem;
  }

  .hero-balance strong {
    font-size: 1.42rem;
  }

  .hero-balance span {
    font-size: 0.68rem;
  }

  .hero-gym-note {
    right: 1rem;
    bottom: 1rem;
  }

  .hero-gym-note small {
    font-size: 0.68rem;
  }

  .premium-search input {
    min-height: 3.8rem;
    border-radius: 21px;
  }

  .metrics {
    gap: 0.8rem;
  }

  .metric-card,
  .metric-card[data-filter="due"] {
    min-height: 7.45rem;
    padding: 0.82rem;
    border-radius: 22px;
  }

  .metric-card .dot {
    width: 2.45rem;
    height: 2.45rem;
  }

  .metric-card::after {
    width: 1.9rem;
    height: 1.9rem;
    font-size: 1.65rem;
  }

  .metrics p,
  .metric-card[data-filter="due"] p {
    font-size: 0.94rem;
  }

  .metric-copy small,
  .metric-card[data-filter="due"] small {
    font-size: 0.8rem;
  }

  .metrics strong,
  .metric-card[data-filter="due"] strong {
    font-size: 1.48rem;
  }

  .bottom-nav {
    min-height: 5.1rem;
    border-radius: 28px;
  }

  .nav-item {
    min-height: 3.8rem;
    font-size: 0.78rem;
  }

  .nav-icon {
    width: 2.12rem;
    height: 2.12rem;
    font-size: 1.06rem;
  }
}

@media (max-width: 370px) {
  .hero-strip {
    min-height: 15rem;
    padding: 1rem;
  }

  .hero-strip h1 {
    max-width: 10.8rem;
    font-size: 2rem;
  }

  .hero-status-card {
    width: 13rem;
  }

  .hero-balance {
    width: 6.35rem;
    height: 6.35rem;
  }

  .hero-gym-note {
    display: none;
  }

  .metrics {
    grid-template-columns: repeat(2, 1fr);
  }

  .bottom-nav {
    width: min(calc(100% - 0.75rem), 500px);
    padding-inline: 0.35rem;
  }
}

/* Final compact header pass: keeps the install pill from covering the brand text. */
.topbar {
  gap: 0.5rem;
  overflow: hidden;
}

.topbar .brand {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}

.topbar .brand > div {
  min-width: 0;
  overflow: hidden;
}

.topbar .brand p,
.topbar .brand small {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar .install-action,
body[data-theme="mint-gloss"] .topbar .install-action,
body[data-theme="cream-red"] .topbar .install-action,
body[data-theme="icy-blue"] .topbar .install-action {
  flex: 0 0 auto;
  min-width: 5.25rem;
  min-height: 2.28rem;
  padding-inline: 0.48rem;
  gap: 0.32rem;
  border-radius: 999px;
}

.topbar .install-status-icon {
  width: 1.16rem;
  height: 1.16rem;
  font-size: 0.75rem;
}

.topbar .install-status-text {
  font-size: 0.72rem;
}

.topbar .install-action,
body[data-theme="mint-gloss"] .topbar .install-action,
body[data-theme="cream-red"] .topbar .install-action,
body[data-theme="icy-blue"] .topbar .install-action {
  color: #ffffff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--green), color-mix(in srgb, var(--green) 70%, #061827));
  box-shadow: 0 10px 20px color-mix(in srgb, var(--green) 28%, transparent);
}

body[data-theme="cream-red"] .topbar .install-action {
  background: linear-gradient(135deg, #bd0e20, #890713);
  box-shadow: 0 10px 20px rgba(150, 8, 21, 0.22);
}

.topbar .install-action .install-status-icon,
body[data-theme="mint-gloss"] .topbar .install-action .install-status-icon,
body[data-theme="cream-red"] .topbar .install-action .install-status-icon,
body[data-theme="icy-blue"] .topbar .install-action .install-status-icon {
  color: var(--green);
  background: #ffffff;
}

body[data-theme="cream-red"] .topbar .install-action .install-status-icon {
  color: #9a0916;
}

.desktop-nav {
  display: none;
}

.desktop-sidebar,
.desktop-breadcrumb,
.desktop-global-search,
.desktop-alert,
.desktop-add-member,
.desktop-admin,
.desktop-empty-panel {
  display: none;
}

.desktop-nav-item {
  min-height: 2.65rem;
  padding: 0 0.78rem;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-size: 0.84rem;
  font-weight: 800;
  white-space: nowrap;
}

.desktop-nav-item span {
  display: inline-grid;
  place-items: center;
  width: 1.28rem;
  height: 1.28rem;
  margin-right: 0.3rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-lift) 78%, transparent);
  color: var(--green);
  font-size: 0.82rem;
}

.desktop-nav-item.active {
  color: var(--text);
  background: color-mix(in srgb, var(--green-soft) 74%, var(--surface-lift));
  border-color: color-mix(in srgb, var(--green) 22%, var(--border));
  box-shadow: inset 0 1px 0 color-mix(in srgb, #ffffff 42%, transparent);
}

.desktop-nav-item.active span {
  color: #ffffff;
  background: var(--green);
}

@media (min-width: 900px) {
  body {
    min-height: 100vh;
    color: #101828;
    background: #f5f8fc;
  }

  .app-shell {
    display: grid;
    grid-template-columns: 18rem minmax(0, 1fr);
    width: 100%;
    min-height: 100vh;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: #f5f8fc;
    box-shadow: none;
    overflow: visible;
  }

  .desktop-sidebar {
    position: sticky;
    top: 0;
    z-index: 38;
    grid-column: 1;
    grid-row: 1 / span 3;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 1.35rem 1.25rem;
    border-right: 1px solid #d9e0ea;
    background: rgba(255, 255, 255, 0.96);
  }

  .desktop-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 2.2rem;
  }

  .desktop-logo {
    display: grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    border-radius: 999px;
    color: #ffffff;
    background: #c40025;
    font-size: 1.15rem;
    font-weight: 900;
  }

  .desktop-sidebar-brand strong {
    display: block;
    color: #0f172a;
    font-size: 1.4rem;
    line-height: 1.05;
  }

  .desktop-sidebar-brand small {
    display: block;
    margin-top: 0.12rem;
    color: #64748b;
    font-size: 0.88rem;
    font-weight: 600;
  }

  .desktop-side-nav {
    display: grid;
    gap: 0.42rem;
  }

  .desktop-side-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-height: 3.45rem;
    padding: 0 1rem;
    border: 0;
    border-radius: 10px;
    color: #475569;
    background: transparent;
    font-size: 0.96rem;
    font-weight: 800;
    text-align: left;
  }

  .desktop-side-item span {
    width: 1.55rem;
    color: #334155;
    font-size: 1.2rem;
  }

  .desktop-side-item.active {
    color: #b40022;
    background: #fff0f3;
  }

  .desktop-side-item.active span {
    color: #c40025;
  }

  .desktop-gym-card {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    width: 100%;
    margin-top: auto;
    padding: 1rem 0;
    border: 0;
    border-top: 1px solid #d9e0ea;
    color: #334155;
    background: transparent;
    text-align: left;
  }

  .desktop-gym-card > span {
    display: grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    border-radius: 999px;
    background: #eef2f7;
    color: #334155;
    font-size: 1.25rem;
  }

  .desktop-gym-card small {
    display: grid;
    gap: 0.18rem;
    flex: 1;
    color: #64748b;
    font-size: 0.82rem;
  }

  .desktop-gym-card b {
    color: #1e293b;
    font-size: 0.9rem;
  }

  .desktop-gym-card i {
    font-style: normal;
    font-size: 1.4rem;
  }

  .topbar,
  body[data-theme="mint-gloss"] .topbar,
  body[data-theme="cream-red"] .topbar,
  body[data-theme="icy-blue"] .topbar {
    position: sticky;
    top: 0;
    z-index: 35;
    grid-column: 2;
    margin: 0;
    min-height: 4.25rem;
    padding: 0 1.8rem;
    border: 0;
    border-bottom: 1px solid #d9e0ea;
    border-radius: 0;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: none;
    backdrop-filter: blur(14px);
  }

  .menu-button,
  .topbar > .brand,
  .desktop-nav,
  .bell-action,
  .install-action {
    display: none;
  }

  .desktop-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.82rem;
    color: #475569;
    font-size: 0.95rem;
    font-weight: 800;
    min-width: 15rem;
  }

  .desktop-breadcrumb span {
    font-size: 1.28rem;
  }

  .desktop-breadcrumb i {
    color: #94a3b8;
    font-style: normal;
  }

  .desktop-breadcrumb b {
    color: #0f172a;
  }

  .desktop-global-search {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    width: min(100%, 24rem);
    margin-left: auto;
    padding: 0 0.85rem;
    border: 1px solid #d5dde8;
    border-radius: 9px;
    color: #64748b;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  }

  .desktop-global-search input {
    min-height: 2.55rem;
    padding: 0;
    border: 0;
    color: #0f172a;
    background: transparent;
    font-size: 0.9rem;
    font-weight: 600;
  }

  .desktop-alert,
  .desktop-add-member,
  .desktop-admin {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
  }

  .desktop-alert {
    position: relative;
    width: 2.65rem;
    height: 2.65rem;
    color: #334155;
    font-size: 1.4rem;
  }

  .desktop-alert i {
    position: absolute;
    top: 0.55rem;
    right: 0.5rem;
    width: 0.58rem;
    height: 0.58rem;
    border: 2px solid #ffffff;
    border-radius: 999px;
    background: #d90429;
  }

  .desktop-add-member {
    gap: 0.6rem;
    min-height: 3.2rem;
    padding: 0 1.45rem;
    border-radius: 8px;
    color: #ffffff;
    background: linear-gradient(180deg, #d4052a, #b40022);
    box-shadow: 0 8px 18px rgba(196, 0, 37, 0.18);
    font-size: 0.98rem;
    font-weight: 950;
  }

  .desktop-add-member span {
    font-size: 1.35rem;
    line-height: 1;
  }

  .desktop-admin {
    gap: 0.6rem;
    color: #0f172a;
    font-size: 0.96rem;
    font-weight: 900;
  }

  .desktop-admin span {
    display: grid;
    place-items: center;
    width: 2.55rem;
    height: 2.55rem;
    border-radius: 999px;
    color: #ffffff;
    background: #4b5563;
  }

  .desktop-admin i {
    color: #64748b;
    font-style: normal;
  }

  .mobile-menu,
  .bottom-nav {
    display: none;
  }

  main {
    grid-column: 2;
    padding: 1.7rem 1.9rem 1.45rem;
    background: #f5f8fc;
  }

  .screen.active {
    gap: 1.2rem;
  }

  #home-screen.active {
    display: grid;
    grid-template-columns: minmax(0, 1.72fr) minmax(22rem, 1fr);
    align-items: start;
    gap: 1rem 1.2rem;
  }

  #home-screen .hero-strip,
  #home-screen #appMessage {
    grid-column: 1 / -1;
  }

  #home-screen .home-search,
  #home-screen .article-search-results,
  #home-screen .panel[aria-labelledby="attention-title"] {
    display: none;
  }

  #home-screen .metrics,
  #home-screen .desktop-collections,
  #home-screen .desktop-members-summary {
    grid-column: 1;
  }

  #home-screen .posts-panel {
    grid-column: 2;
    grid-row: 3 / span 3;
  }

  .hero-strip {
    min-height: 7.2rem;
    display: block;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .hero-strip::before,
  .hero-strip::after,
  .hero-balance,
  .hero-gym-note,
  .hero-post-button {
    display: none;
  }

  .hero-copy .eyebrow {
    color: #64748b;
    font-size: 1rem;
    text-transform: none;
  }

  .hero-copy h1 {
    max-width: none;
    margin-top: 0.18rem;
    color: #020617;
    font-size: clamp(2.8rem, 4.2vw, 4rem);
    font-weight: 950;
    line-height: 0.95;
  }

  .hero-copy > small {
    margin-top: 0.6rem;
    color: #475569;
    font-size: 1rem;
    font-weight: 800;
  }

  .hero-status-card {
    margin-top: 1.4rem;
    min-height: 5rem;
    border: 1px solid #bde8ce;
    border-radius: 8px;
    background: linear-gradient(180deg, #f7fff9, #f0fff5);
    color: #0f172a;
    box-shadow: none;
  }

  .hero-status-icon {
    width: 3.1rem;
    height: 3.1rem;
    background: #2fb36d;
    font-size: 1.7rem;
  }

  .hero-status-card b {
    font-size: 1.05rem;
  }

  .hero-status-card small {
    color: #334155;
    font-size: 0.96rem;
  }

  .metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
  }

  .metric-card,
  .metric-card[data-filter="due"] {
    min-height: 8rem;
    grid-column: auto;
    grid-template-columns: auto 1fr;
    align-items: center;
    padding: 1.35rem;
    border: 1px solid #d9e0ea;
    border-radius: 8px;
    color: #0f172a;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  }

  .metric-card .dot {
    width: 3.35rem;
    height: 3.35rem;
    grid-row: 1 / span 3;
    background: #fde8ed;
  }

  .metric-card .dot::after {
    content: "₹";
    color: #c40025;
    font-size: 1.45rem;
    font-weight: 950;
  }

  .metric-card[data-filter="expired"] .dot::after {
    content: "!";
  }

  .metric-card[data-filter="due-soon"] .dot::after {
    content: "◷";
  }

  .metric-card[data-filter="paid"] .dot {
    background: #eef2f7;
  }

  .metric-card[data-filter="paid"] .dot::after {
    content: "♙";
    color: #0f172a;
  }

  .metric-card p,
  .metric-card[data-filter="due"] p {
    color: #475569;
    font-size: 0.93rem;
    font-weight: 900;
  }

  .metric-card strong,
  .metric-card[data-filter="due"] strong {
    color: #020617;
    font-size: 1.78rem;
    line-height: 1;
  }

  .metric-card small,
  .metric-card[data-filter="due"] small {
    color: #64748b;
    font-size: 0.95rem;
  }

  .desktop-empty-panel {
    display: block;
    min-height: 12.6rem;
    padding: 1.45rem;
    border: 1px solid #d9e0ea;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  }

  .desktop-panel-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.2rem;
  }

  .desktop-empty-panel h2 {
    margin: 0;
    color: #0f172a;
    font-size: 1.12rem;
    font-weight: 950;
  }

  .desktop-panel-head button {
    min-height: 2.65rem;
    padding: 0 0.9rem;
    border: 1px solid #d9e0ea;
    border-radius: 8px;
    color: #334155;
    background: #ffffff;
    font-weight: 900;
  }

  .desktop-empty-state {
    display: grid;
    place-items: center;
    min-height: 8rem;
    text-align: center;
    color: #64748b;
  }

  .desktop-empty-state > span {
    color: #b1bac7;
    font-size: 3rem;
    line-height: 1;
  }

  .desktop-empty-state b {
    margin-top: 0.4rem;
    color: #0f172a;
    font-size: 1.02rem;
  }

  .desktop-empty-state small {
    margin-top: 0.25rem;
    color: #64748b;
    font-size: 0.95rem;
  }

  .desktop-empty-state button {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 2.7rem;
    margin-top: 1rem;
    padding: 0 1.15rem;
    border: 1px solid #c40025;
    border-radius: 8px;
    color: #ffffff;
    background: linear-gradient(180deg, #d4052a, #b40022);
    font-weight: 950;
  }

  .desktop-empty-state.compact button {
    color: #c40025;
    background: #ffffff;
  }

  #members-screen.active,
  #analytics-screen.active,
  #subscription-screen.active,
  #settings-screen.active,
  #add-screen.active,
  #privacy-screen.active,
  #terms-screen.active {
    max-width: 980px;
    margin-inline: auto;
  }

  .member-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .member-list.compact {
    grid-template-columns: 1fr;
  }

  .post-list {
    gap: 0.95rem;
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .posts-panel {
    min-height: 29rem;
    padding: 1.45rem;
    border: 1px solid #d9e0ea;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  }

  .posts-panel .section-title {
    align-items: center;
  }

  .posts-panel .eyebrow {
    display: none;
  }

  .posts-panel h2 {
    color: #0f172a;
    font-size: 1.12rem;
    font-weight: 950;
  }

  .posts-panel .section-title::after {
    content: "View all articles  →";
    color: #c40025;
    font-size: 0.9rem;
    font-weight: 950;
  }

  .post-card {
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .post-card summary {
    min-height: 5.4rem;
    grid-template-columns: 6.2rem 1fr auto;
    gap: 0.2rem 1rem;
    padding: 0;
  }

  .post-card summary::before {
    content: "";
    grid-column: 1;
    grid-row: 1 / span 3;
    width: 6.2rem;
    height: 4.2rem;
    border-radius: 6px;
    background:
      linear-gradient(135deg, rgba(0, 0, 0, 0.32), transparent),
      radial-gradient(circle at 70% 30%, #a9b4c2, transparent 28%),
      linear-gradient(135deg, #1f2937, #9ca3af);
  }

  .post-card:nth-child(2n) summary::before {
    background:
      linear-gradient(135deg, rgba(196, 0, 37, 0.24), transparent),
      repeating-linear-gradient(0deg, #f8fafc 0 0.55rem, #e2e8f0 0.55rem 0.62rem);
  }

  .post-card:nth-child(3n) summary::before {
    background:
      radial-gradient(circle at 32% 45%, #f59e0b, transparent 18%),
      radial-gradient(circle at 65% 45%, #22c55e, transparent 18%),
      linear-gradient(135deg, #334155, #111827);
  }

  .post-card summary span {
    display: none;
  }

  .post-card summary b {
    grid-column: 2;
    color: #0f172a;
    font-size: 0.98rem;
    line-height: 1.2;
  }

  .post-card summary small {
    grid-column: 2;
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.35;
  }

  .post-card summary::after {
    grid-column: 3;
    grid-row: 1 / span 3;
    width: auto;
    height: auto;
    color: #94a3b8;
    background: transparent;
  }

  .post-card p {
    margin-left: 7.2rem;
    color: #475569;
  }
}

@media (min-width: 1120px) {
  .desktop-nav-item {
    padding-inline: 0.95rem;
  }

  main {
    padding-inline: 1.8rem;
  }
}

@media (max-width: 430px) {
  .topbar {
    margin-inline: 0.62rem;
    padding: 0.56rem;
    gap: 0.38rem;
  }

  .topbar .menu-button {
    min-width: 2.32rem;
    min-height: 2.32rem;
  }

  .topbar .brand {
    gap: 0.36rem;
  }

  .topbar .brand-mark,
  body[data-theme="mint-gloss"] .topbar .brand-mark,
  body[data-theme="cream-red"] .topbar .brand-mark,
  body[data-theme="icy-blue"] .topbar .brand-mark {
    width: 2rem;
    height: 2.18rem;
    border-radius: 14px;
    font-size: 0.78rem;
  }

  .topbar .brand p {
    font-size: 0.94rem;
  }

  .topbar .brand small {
    font-size: 0.64rem;
  }

  .topbar .install-action,
  body[data-theme="mint-gloss"] .topbar .install-action,
  body[data-theme="cream-red"] .topbar .install-action,
  body[data-theme="icy-blue"] .topbar .install-action {
    min-width: 4.72rem;
    min-height: 2.05rem;
    padding-inline: 0.38rem;
    gap: 0.24rem;
  }

  .topbar .install-status-icon {
    width: 0.98rem;
    height: 0.98rem;
    font-size: 0.64rem;
  }

  .topbar .install-status-text {
    font-size: 0.64rem;
  }
}

/* Desktop dashboard owns its surfaces; mobile theme artwork stays on mobile. */
@media (min-width: 900px) {
  html { font-size: 16px; }
  body .app-shell { grid-template-columns: 250px minmax(0, 1fr); grid-template-rows: 60px 1fr; max-width: none; padding: 0; background: #f3f5f8 !important; }
  body .app-shell::before { display: none; }
  body .app-shell, body .app-shell button, body .app-shell input { font-family: Arial, Helvetica, sans-serif; letter-spacing: 0; }
  body .desktop-sidebar { height: 100vh; min-height: 0; padding: 18px 21px; background: #fff; }
  body .desktop-sidebar-brand { gap: 12px; margin-bottom: 36px; }
  body .desktop-logo { width: 50px; height: 50px; flex: 0 0 50px; font-size: 22px; font-weight: 700; }
  body .desktop-sidebar-brand b { font-size: 23px; font-weight: 700; }
  body .desktop-sidebar-brand small { font-size: 13px; font-weight: 400; }
  body .desktop-side-nav { gap: 10px; }
  body .desktop-side-item { min-height: 48px; padding: 0 15px; gap: 16px; font-size: 14px; font-weight: 600; border-radius: 8px; }
  body .desktop-gym-card { padding: 18px 0; }
  body .topbar { height: 60px; min-height: 60px; padding: 0 28px; gap: 20px; background: #fafbfd !important; }
  body .desktop-breadcrumb { min-width: 140px; font-size: 14px; }
  body .desktop-global-search { width: 325px; height: 36px; flex: 0 1 325px; border-radius: 8px; }
  body .topbar .desktop-global-search input { width: 100%; min-width: 0; min-height: 0; height: 32px; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; color: #101828; font-size: 13px; font-weight: 400; }
  body .topbar .desktop-global-search input::placeholder { color: #667085; }
  body .desktop-admin { font-size: 14px; font-weight: 600; }
  body .desktop-admin span { width: 36px; height: 36px; }
  body .topbar .desktop-add-member { display: none; }
  body #appMain { min-width: 0; padding: 24px 28px; background: #f3f5f8; }
  body #home-screen.active { grid-template-columns: minmax(0, 1.71fr) minmax(300px, 1fr); gap: 16px 18px; }
  #home-screen .hero-strip { position: relative; min-height: 0; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; overflow: visible; }
  #home-screen .hero-strip::before, #home-screen .hero-strip::after { display: none; }
  #home-screen .hero-copy { width: 100%; max-width: none; }
  #home-screen .hero-copy .eyebrow { margin: 0 0 3px; color: #667085; font-size: 16px; font-weight: 600; }
  #home-screen .hero-copy h1 { max-width: calc(100% - 200px); margin: 0; font-size: 48px; line-height: 1.1; font-weight: 700; letter-spacing: 0; color: #080d18; overflow-wrap: anywhere; }
  #home-screen .hero-copy > small { display: block; margin-top: 4px; color: #596273; font-size: 16px; font-weight: 600; }
  #home-screen .hero-status-card { width: 100%; min-height: 74px; margin-top: 20px; padding: 14px 18px; gap: 18px; border: 1px solid #c9e6d3; border-radius: 8px; background: #f3faf6; box-shadow: none; }
  #home-screen .hero-status-icon { width: 44px; height: 44px; background: #22b573; color: #fff; box-shadow: none; font-size: 26px; }
  #home-screen .hero-status-card b { color: #101828; font-size: 16px; font-weight: 700; }
  #home-screen .hero-status-card small { margin-top: 3px; color: #344054; font-size: 15px; font-weight: 400; }
  #home-screen .desktop-hero-add { display: flex; position: absolute; top: 23px; right: 0; min-height: 44px; padding: 0 24px; background: #c90028; color: white; border: 0; border-radius: 8px; box-shadow: none; font-size: 15px; font-weight: 600; }
  #home-screen .metrics { grid-column: 1 / -1; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
  #home-screen .metric-card { display: grid; grid-template-columns: 56px minmax(0, 1fr); grid-template-rows: auto auto; gap: 4px 20px; height: 112px; min-height: 112px; padding: 18px 20px; background: #fff; border: 1px solid #dce2ea; border-radius: 8px; color: #101828; box-shadow: none; transform: none; text-align: left; }
  #home-screen .metric-card::before, #home-screen .metric-card::after, #home-screen .metric-card .dot::before { display: none; }
  #home-screen .metric-card .dot { grid-column: 1; grid-row: 1 / 3; align-self: start; width: 56px; height: 56px; background: #fbe9ed; box-shadow: none; }
  #home-screen .metric-copy { grid-column: 2; grid-row: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  #home-screen .metric-copy p { margin: 0; font-size: 14px; color: #475467; font-weight: 600; }
  #home-screen .metric-copy small { font-size: 13px; font-weight: 400; color: #667085; }
  #home-screen .metric-card strong { grid-column: 2; grid-row: 2; font-size: 28px; font-weight: 700; color: #090d16; line-height: 1; }
  #home-screen .desktop-collections { grid-column: 1; grid-row: 3; height: 275px; }
  #home-screen .desktop-members-summary { grid-column: 1; grid-row: 4; min-height: 180px; }
  #home-screen .desktop-empty-panel, #home-screen .posts-panel { padding: 18px 20px; background: #fff; border: 1px solid #dce2ea; border-radius: 8px; box-shadow: none; }
  #home-screen .posts-panel { grid-column: 2; grid-row: 3 / 5; min-height: 471px; }
  #home-screen .posts-panel::before, #home-screen .posts-panel::after { display: none; }
  #home-screen h2 { font-size: 18px; font-weight: 700; color: #101828; }
  #home-screen .desktop-panel-head { align-items: center; margin-bottom: 24px; }
  #home-screen .desktop-panel-head button { min-height: 36px; font-size: 13px; font-weight: 400; }
  #home-screen .desktop-empty-state { min-height: 165px; }
  #home-screen .desktop-empty-state.compact { min-height: 125px; }
  #home-screen .desktop-empty-state b { font-size: 15px; font-weight: 600; }
  #home-screen .desktop-empty-state small { font-size: 14px; font-weight: 400; }
  #home-screen .desktop-empty-state button { min-height: 36px; margin-top: 10px; font-size: 14px; font-weight: 600; background: #c90028; color: #fff; }
  #home-screen .desktop-empty-state.compact button { background: #fff; color: #c90028; }
  #home-screen .posts-panel .section-title { margin-bottom: 24px; }
  #home-screen .posts-panel .section-title::after { display: none; }
  #home-screen .posts-panel { display: flex; flex-direction: column; gap: 0; min-width: 0; }
  #home-screen .posts-panel .section-title { flex: 0 0 auto; }
  #home-screen .post-list { display: flex; flex-direction: column; gap: 0; min-height: 0; max-height: 370px; overflow-y: auto; overflow-x: hidden; scrollbar-gutter: stable; }
  #home-screen .post-card { flex: 0 0 auto; min-width: 0; background: #fff; border: 0; border-bottom: 1px solid #e4e9f0; box-shadow: none; overflow: visible; }
  #home-screen .post-card summary { grid-template-columns: minmax(0, 1fr) 24px; grid-template-rows: auto auto; min-height: 96px; padding: 16px 8px 16px 0; gap: 6px 12px; }
  #home-screen .post-card summary::before { display: none; }
  #home-screen .post-card summary b { grid-column: 1; grid-row: 1; line-height: 1.4; overflow-wrap: anywhere; }
  #home-screen .post-card summary small { grid-column: 1; grid-row: 2; line-height: 1.5; overflow-wrap: anywhere; }
  #home-screen .post-card summary::after { grid-column: 2; grid-row: 1 / 3; color: #183153; }
  #home-screen .post-card p { margin: 0; padding: 0 16px 14px 0; color: #475467; line-height: 1.6; }
  #home-screen .post-card summary:hover { background: #f5f7fb; }
  #home-screen .post-card summary:focus-visible { outline: 2px solid #183153; outline-offset: -2px; }
  #home-screen .post-card summary b { font-size: 15px; font-weight: 600; }
  #home-screen .post-card summary small { font-size: 14px; font-weight: 400; }
}
@media (min-width: 900px) and (max-width: 1199px) {
  body .app-shell { grid-template-columns: 210px minmax(0, 1fr); }
  body #appMain { padding: 20px; }
  #home-screen .hero-copy h1 { font-size: 36px; }
  #home-screen .metric-card { padding: 14px; gap: 4px 10px; grid-template-columns: 38px minmax(0, 1fr); }
  #home-screen .metric-card .dot { width: 38px; height: 38px; }
  body #home-screen.active { grid-template-columns: minmax(0, 1fr); }
  #home-screen .posts-panel { grid-column: 1; grid-row: 5; }
}
.desktop-hero-add { display: none; }

@media (min-width: 900px) {
  body .theme-field { display: none; }
  /* Desktop screens share one palette regardless of the saved mobile theme. */
  body, body.light-theme, body[data-theme] {
    color-scheme: light;
    --bg: #f3f5f8;
    --outside-bg: #f3f5f8;
    --surface: #ffffff;
    --surface-soft: #f7f9fc;
    --surface-lift: #ffffff;
    --text: #101828;
    --muted: #475467;
    --quiet: #667085;
    --border: #dce2ea;
    --strong-border: #aab8ca;
    --green: #183153;
    --green-hover: #24476f;
    --green-soft: #eaf0f7;
    --red: #b42318;
    --red-soft: #fef3f2;
    --orange: #854a0e;
    --orange-soft: #fff8e8;
    --neutral-soft: #eef2f6;
    --feature-start: #eaf0f7;
    --feature-mid: #f7f9fc;
    --feature-end: #ffffff;
    --feature-text: #101828;
    --app-texture: none;
    --card-glow: none;
    --shadow: none;
    --soft-shadow: none;
    --search-bg: #ffffff;
    background: #f3f5f8;
    color: #101828;
  }
  #appMain .screen:not(#home-screen) > .panel {
    padding: 24px;
    border: 1px solid #dce2ea;
    border-radius: 8px;
    background: #fff;
    color: #101828;
    box-shadow: none;
    backdrop-filter: none;
  }
  #appMain .screen:not(#home-screen) :is(.member-card, .plan-card, .analytics-kpi, .analytics-section, .impact-card) {
    background: #fff;
    color: #101828;
    border-color: #dce2ea;
    border-radius: 8px;
    box-shadow: none;
  }
  #appMain .analytics-kpi::after { display: none; }
  #appMain .analytics-kpi :is(strong, span, small) { color: #101828; }
  #appMain :is(input, select, textarea) {
    background: #fff;
    color: #101828;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    box-shadow: none;
    font-size: 15px;
    font-weight: 400;
  }
  #appMain textarea[readonly] { background: #f7f9fc; color: #475467; opacity: 1; }
  #appMain :is(input, textarea)::placeholder { color: #667085; }
  #appMain :is(input, select, textarea):focus-visible { outline: 2px solid #183153; outline-offset: 2px; }
  #appMain :is(.primary-button, .member-actions a, .filter-chip.active) {
    background: #183153;
    color: #fff;
    border-color: #183153;
    border-radius: 8px;
    box-shadow: none;
  }
  #appMain :is(.primary-button, .member-actions a):hover { background: #24476f; }
  #appMain .filter-chip:not(.active), #appMain .filter-button {
    background: #fff;
    color: #183153;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    box-shadow: none;
  }
  #appMain .settings-list label { color: #344054; font-weight: 600; }
  #appMain .featured-plan { border-color: #183153; }
  body .modal-card { background: #fff; color: #101828; border-radius: 8px; }
  body .modal-card .primary-button { background: #183153; color: #fff; }
  body .desktop-logo,
  #home-screen .desktop-hero-add,
  #home-screen .desktop-empty-state button { background: #183153; color: #fff; border-color: #183153; }
  body .desktop-side-item.active { background: #eaf0f7; color: #183153; }
  body .desktop-side-item.active span { color: #183153; }
  body .desktop-alert i { background: #183153; }
  #home-screen .metric-card .dot { background: #eaf0f7; color: #183153; }
  #home-screen .metric-card .dot::after { color: #183153; }
  #home-screen .desktop-empty-state.compact button { background: #fff; color: #183153; border-color: #183153; }
  #home-screen .desktop-hero-add:hover,
  #home-screen .desktop-empty-state:not(.compact) button:hover { background: #24476f; }
}

.legal-screen.active {
  grid-template-columns: minmax(0, 1fr);
}

.article-access-note { font-size: 12px; line-height: 1.5; color: var(--muted); margin: 0 0 12px; flex-shrink: 0; }
.article-access-note a, .post-card p a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
#postSection .post-list:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
@media (max-width: 899px) {
  #postSection .post-list { display: flex; flex-direction: column; max-height: 420px; max-height: min(420px, 60dvh); overflow-y: auto; scrollbar-gutter: stable; }
  #postSection .post-card { flex-shrink: 0; }
}

#referrals-screen.active { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.billing-referral { grid-column: 1 / -1; padding: 18px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); }
.billing-referral h2 { font-size: 20px; margin: 0 0 10px; }
.billing-referral p { font-size: 14px; line-height: 1.6; }
.billing-referral input { box-sizing: border-box; width: 100%; min-width: 0; padding: 12px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--text); font: inherit; }
.billing-referral button { padding: 12px 16px; background: #292a31; color: #fff; border-radius: 6px; border: 1px solid #595d68; cursor: pointer; }
.billing-referral button:disabled { opacity: .6; cursor: default; }
.billing-referral label { display: block; margin-bottom: 8px; }
#billingReferralForm { display: block; }
#billingReferralForm .referral-share-row { width: 100%; }
#referrals-screen { color: var(--text); min-width: 0; }
#referrals-screen h1 { font-size: 26px; margin: 0; }
#referrals-screen h2 { font-size: 20px; margin: 0 0 12px; }
#referrals-screen p { line-height: 1.6; font-size: 14px; overflow-wrap: anywhere; }
#referrals-screen [hidden] { display: none !important; }
.referral-heading, .referral-share-row, .referral-review-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.referral-heading { justify-content: space-between; }
#referrals-screen button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 10px 14px; background: #292a31; color: #fff; border: 1px solid #595d68; border-radius: 6px; cursor: pointer; font-size: 14px; white-space: normal; }
#referrals-screen button:disabled { opacity: .55; cursor: not-allowed; }
#referrals-screen button svg { width: 18px; height: 18px; }
#referrals-screen input, #signupReferralCode { box-sizing: border-box; min-width: 0; width: 100%; padding: 12px; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 6px; font: inherit; font-size: 14px; }
.referral-code-label { display: block; font-size: 13px; margin-top: 18px; margin-bottom: 6px; }
.referral-share-row input { flex: 1 1 270px; }
.referral-share label, .referral-withdraw label, .referral-request label { display: grid; gap: 8px; font-size: 14px; }
.referral-share, .referral-withdraw, .referral-history, .referral-rules, #referralAdmin { border-top: 1px solid var(--border); padding-top: 20px; min-width: 0; }
.referral-balances { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.referral-balances article { display: grid; gap: 10px; padding: 18px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); min-width: 0; }
.referral-balances span { font-size: 13px; }
.referral-balances strong { font-size: 22px; overflow-wrap: anywhere; }
#referralWithdrawalForm { display: grid; grid-template-columns: 1fr 1fr auto; gap: 14px; align-items: end; }
#referralWithdrawalForm > * { grid-column: auto; }
.referral-table-wrap { overflow-x: auto; width: 100%; }
.referral-table-wrap table { width: 100%; border-collapse: collapse; font-size: 14px; }
.referral-table-wrap th, .referral-table-wrap td { padding: 12px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.referral-request { padding: 18px; margin-top: 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.referral-request h3 { font-size: 18px; margin: 0; }
.referral-request label { margin: 12px 0; }
#referralFeedback { margin: 0; }
@media (min-width: 1100px) {
  body #referrals-screen { --surface: #fffcfa; --text: #242938; --border: #ddd4cf; }
  body .billing-referral { --surface: #fffcfa; --text: #242938; --border: #ddd4cf; --bg: #fff; }
  .desktop-side-nav { overflow-y: auto; }
}
@media (max-width: 700px) {
  .referral-balances { grid-template-columns: repeat(2,minmax(0,1fr)); }
  #referralWithdrawalForm { grid-template-columns: minmax(0,1fr); }
  .referral-balances article { padding: 12px; }
  .referral-balances strong { font-size: 18px; }
}

/* Keep the shared icon intact across theme-specific monogram styles. */
body img.app-logo {
  object-fit: contain;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

#trialBanner:not([hidden]) { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; margin-bottom: 16px; background: #eef6f3; color: #193d30; border: 1px solid #c5ded3; border-radius: 8px; grid-column: 1 / -1; }
#trialBanner button { background: #27282e; color: #fff; padding: 10px 16px; border: 0; border-radius: 6px; cursor: pointer; }

#importInstructions {
  box-sizing: border-box;
  width: min(680px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 24px;
  overflow-y: auto;
  border: 1px solid #d8dce3;
  border-radius: 8px;
  background: #fff;
  color: #20242c;
  font-size: 14px;
  line-height: 1.6;
}
#importInstructions::backdrop { background: rgb(15 20 30 / 50%); }
.import-guide-header { display: flex; align-items: center; gap: 16px; justify-content: space-between; }
.import-guide-header h2 { margin: 0; font-size: 20px; line-height: 1.3; }
#closeImportInstructions { flex: 0 0 40px; width: 40px; height: 40px; display: grid; place-items: center; padding: 8px; background: #f2f3f5; color: #20242c; border: 1px solid #d8dce3; border-radius: 6px; cursor: pointer; }
#closeImportInstructions svg { width: 20px; height: 20px; }
.import-guide-table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 14px; }
.import-guide-table th, .import-guide-table td { padding: 10px; text-align: left; vertical-align: top; border-bottom: 1px solid #e3e5e9; overflow-wrap: anywhere; }
.import-guide-table th { background: #f2f3f5; }
#importInstructions ol { padding-left: 20px; }
#importInstructions li { margin-bottom: 8px; }
#chooseImportFile { background: #27282e; color: #fff; width: 100%; }
.member-import-progress { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 10px; margin: 14px 0 8px; }
.member-import-spinner { width: 18px; height: 18px; border: 2px solid #d8dce3; border-top-color: #157347; border-radius: 50%; animation: member-import-spin .8s linear infinite; }
.member-import-progress-track { height: 9px; overflow: hidden; background: #e8ecef; border-radius: 999px; }
.member-import-progress-track span { display: block; width: 0; height: 100%; background: #157347; border-radius: inherit; transition: width .2s ease; }
.member-import-progress strong { min-width: 48px; text-align: right; font-size: 13px; color: #30363d; }
@keyframes member-import-spin { to { transform: rotate(360deg); } }
@media (max-width: 480px) { #importInstructions { padding: 16px; } }
