:root {
  color: #17322f;
  background: #f3f7f5;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  --ink: #17322f;
  --muted: #66807b;
  --line: #dbe7e3;
  --surface: #ffffff;
  --surface-soft: #eef5f2;
  --brand: #147d68;
  --brand-dark: #0c5d4d;
  --brand-accent: #22c55e;
  --danger: #a83c42;
  --shadow: 0 18px 50px rgba(17, 56, 49, 0.08);
}

* { box-sizing: border-box; }
html, body, #root { min-height: 100%; margin: 0; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.55; }

:focus-visible {
  outline: 3px solid rgba(20, 125, 104, 0.35);
  outline-offset: 2px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 22px 18px;
  background: #102c29;
  color: #edf9f5;
  z-index: 30;
}

.brand, .sidebar-user {
  display: flex;
  align-items: center;
  gap: 11px;
}

.brand > div:nth-child(2), .sidebar-user > div { min-width: 0; flex: 1; }
.brand strong, .brand span, .sidebar-user strong, .sidebar-user span { display: block; }
.brand span, .sidebar-user span { color: #9ebdb6; font-size: 0.78rem; }
.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: white;
  background: linear-gradient(145deg, var(--brand-accent), var(--brand));
}
.brand-logo { display: block; width: min(180px, 70%); max-height: 64px; margin-bottom: 20px; object-fit: contain; object-position: left center; }
.brand-logo.sidebar-logo { width: 42px; height: 42px; margin: 0; border-radius: 10px; object-fit: contain; }

.sidebar .field > span { color: #9ebdb6; }
.sidebar select { border-color: #35534e; color: white; background: #173a36; }
.sidebar nav { display: grid; gap: 5px; }
.sidebar nav button {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  border: 0;
  border-radius: 10px;
  padding: 10px 12px;
  color: #b9d0ca;
  background: transparent;
  text-align: left;
}
.sidebar nav button:hover, .sidebar nav button.active { color: white; background: rgba(255, 255, 255, 0.1); }
.unread-dot { width: 8px; height: 8px; margin-left: auto; border-radius: 50%; background: #58d9b7; }
.sidebar-user { margin-top: auto; padding-top: 16px; border-top: 1px solid #31504a; }
.sidebar .icon-button { color: #bad0cb; }

.content { min-width: 0; padding: 32px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(1.65rem, 3vw, 2.35rem); letter-spacing: -0.035em; }
h2 { margin-bottom: 12px; font-size: 1.18rem; }
h3 { margin: 20px 0 9px; font-size: 0.92rem; }
.eyebrow { margin-bottom: 4px; color: var(--brand); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.13em; text-transform: uppercase; }
.muted { color: var(--muted); }
.stack { display: grid; gap: 18px; }

.primary, .secondary, .text-button, .icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 9px;
  padding: 9px 14px;
  border: 1px solid transparent;
  font-weight: 700;
}
.primary { color: white; background: var(--brand); }
.primary:hover { background: var(--brand-dark); }
.secondary { color: var(--ink); border-color: var(--line); background: var(--surface); }
.secondary:hover { border-color: #adcac2; background: var(--surface-soft); }
.text-button { width: 100%; color: var(--brand); background: transparent; }
.icon-button { width: 38px; height: 38px; padding: 0; color: var(--ink); background: transparent; }

.field { display: grid; gap: 6px; }
.field > span { color: var(--muted); font-size: 0.76rem; font-weight: 800; letter-spacing: 0.04em; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 11px;
  color: var(--ink);
  background: var(--surface);
}
textarea { min-height: 92px; resize: vertical; }

.alert { margin-bottom: 18px; border: 1px solid; border-radius: 10px; padding: 11px 13px; }
.alert.error { color: #7d272d; border-color: #efc5c8; background: #fff1f2; }
.alert.success { color: #0f624f; border-color: #b7dfd5; background: #edfbf6; }

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 15% 10%, rgba(80, 201, 169, 0.22), transparent 32%),
    radial-gradient(circle at 90% 90%, rgba(17, 103, 86, 0.17), transparent 34%),
    #eef5f2;
}
.auth-card {
  width: min(100%, 440px);
  padding: clamp(24px, 5vw, 42px);
  border: 1px solid rgba(190, 214, 207, 0.8);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}
.auth-card .brand-mark { margin-bottom: 20px; }
.auth-card h1 { margin-bottom: 10px; }
.auth-card .stack { margin: 24px 0 10px; }
.identity-box { display: flex; justify-content: space-between; gap: 18px; margin: 20px 0 12px; border-radius: 10px; padding: 12px; background: var(--surface-soft); }
.order-summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 18px 0 4px; border: 1px solid var(--line); border-radius: 11px; padding: 12px 14px; background: var(--surface-soft); }
.order-summary span { color: var(--muted); }

.storefront-shell {
  min-height: 100vh;
  color: #202826;
  background: #f2f5f3;
}
.storefront-header, .storefront-footer { max-width: 1140px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 24px 28px; }
.storefront-brand { display: flex; align-items: center; gap: 11px; }
.storefront-brand img { max-width: 190px; max-height: 52px; object-fit: contain; }
.storefront-brand .brand-mark { width: 40px; height: 40px; }
.storefront-signin, .checkout-link, .checkout-switch { border: 0; padding: 6px 0; color: #64716d; background: transparent; font-size: .86rem; }
.storefront-signin strong, .checkout-link, .checkout-switch { color: var(--brand); }
.storefront-secure { display: inline-flex; align-items: center; gap: 7px; color: #65736f; font-size: .82rem; }
.storefront-frame { width: min(1120px, calc(100% - 40px)); margin: 34px auto 72px; display: grid; grid-template-columns: minmax(0, 1.13fr) minmax(390px, .87fr); overflow: hidden; border: 1px solid #dde5e1; border-radius: 28px; background: white; box-shadow: 0 28px 80px rgba(28, 51, 45, .12); }
.storefront-story { min-width: 0; padding: 38px; border-right: 1px solid #e3e9e6; }
.storefront-art { --product-color: var(--brand); position: relative; min-height: 360px; display: flex; align-items: flex-end; overflow: hidden; border-radius: 19px; padding: clamp(28px, 5vw, 52px); color: white; background: linear-gradient(145deg, color-mix(in srgb, var(--product-color) 88%, #182b27), var(--product-color)); isolation: isolate; }
.storefront-art::before, .storefront-art::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255,255,255,.1); z-index: -1; }
.storefront-art::before { width: 320px; height: 320px; top: -130px; right: -80px; }
.storefront-art::after { width: 210px; height: 210px; bottom: -100px; left: -50px; }
.storefront-art > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.storefront-art > img:not([hidden]) + .storefront-art-copy { padding: 18px 22px; border-radius: 14px; background: rgba(11, 25, 22, .7); backdrop-filter: blur(8px); }
.storefront-art-copy { display: grid; gap: 7px; max-width: 500px; }
.storefront-art-copy span { font-size: .73rem; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; opacity: .82; }
.storefront-art-copy strong { font-size: clamp(2.1rem, 5vw, 4.1rem); line-height: .98; letter-spacing: -.05em; }
.storefront-art-copy svg { position: absolute; top: 28px; right: 28px; width: 38px; height: 38px; opacity: .78; }
.storefront-copy { padding: 36px 4px 12px; }
.storefront-eyebrow { margin-bottom: 10px; color: var(--brand); font-size: .74rem; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.storefront-copy h1 { max-width: 700px; margin-bottom: 18px; font-size: clamp(2rem, 4.2vw, 3.65rem); line-height: 1.02; letter-spacing: -.05em; }
.storefront-description { max-width: 700px; margin-bottom: 0; color: #5d6b67; font-size: 1.05rem; line-height: 1.72; }
.storefront-included { margin-top: 32px; padding-top: 30px; border-top: 1px solid #e4eae7; }
.storefront-included h2 { margin-bottom: 20px; font-size: 1.15rem; }
.storefront-benefits { display: grid; gap: 18px; }
.storefront-benefits article { display: flex; align-items: flex-start; gap: 13px; }
.storefront-benefits article > svg { flex: 0 0 auto; margin-top: 2px; color: var(--brand); }
.storefront-benefits strong { display: block; margin-bottom: 3px; font-size: .94rem; }
.storefront-benefits p { margin: 0; color: #6c7975; font-size: .87rem; line-height: 1.55; }
.storefront-testimonial { margin: 34px 0 0; border-radius: 17px; padding: 24px; background: #f4f7f5; }
.storefront-testimonial blockquote { margin: 0 0 18px; color: #34413e; font-size: 1.02rem; font-weight: 550; line-height: 1.65; }
.storefront-testimonial figcaption { display: flex; align-items: center; gap: 11px; }
.storefront-testimonial img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; }
.storefront-testimonial figcaption span, .storefront-testimonial figcaption small { display: block; }
.storefront-testimonial figcaption small { margin-top: 2px; color: #75817d; }
.storefront-checkout { min-width: 0; align-self: start; display: grid; gap: 18px; padding: 42px 36px; background: #fbfcfb; }
.checkout-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; padding-bottom: 2px; }
.checkout-heading p { margin: 0; color: #64716d; font-size: .82rem; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.checkout-heading > strong { color: #1f2a27; font-size: 1.25rem; white-space: nowrap; }
.offer-options { display: grid; overflow: hidden; border: 1px solid #dce4e0; border-radius: 15px; background: white; }
.offer-option { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 13px; border: 0; border-bottom: 1px solid #e1e7e4; padding: 17px; color: #25302d; background: transparent; text-align: left; }
.offer-option:last-child { border-bottom: 0; }
.offer-option:hover { background: #f6f9f7; }
.offer-option.selected { background: color-mix(in srgb, var(--brand) 7%, white); box-shadow: inset 3px 0 var(--brand); }
.offer-options.single .offer-option { cursor: default; box-shadow: none; }
.offer-radio { width: 20px; height: 20px; border: 2px solid #c5cfcb; border-radius: 50%; box-shadow: inset 0 0 0 4px white; background: white; }
.offer-option.selected .offer-radio { border-color: var(--brand); background: var(--brand); }
.offer-copy, .offer-copy small, .offer-price, .offer-price small { display: block; }
.offer-copy strong { font-size: .95rem; }
.offer-copy small { margin-top: 4px; color: #75817d; font-size: .74rem; line-height: 1.4; }
.offer-price { text-align: right; }
.offer-price strong { font-size: .96rem; white-space: nowrap; }
.offer-price small { margin-top: 4px; color: var(--brand); font-size: .71rem; font-weight: 800; }
.checkout-continue, .checkout-account-action, .checkout-pay { width: 100%; min-height: 50px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; border: 0; border-radius: 11px; padding: 13px 18px; color: white; background: var(--brand); font-weight: 800; box-shadow: 0 9px 20px color-mix(in srgb, var(--brand) 20%, transparent); }
.checkout-continue:hover, .checkout-account-action:hover, .checkout-pay:hover { background: var(--brand-dark); }
.checkout-account-action:disabled, .checkout-pay:disabled { cursor: wait; opacity: .58; box-shadow: none; }
.checkout-account, .stripe-payment { display: grid; gap: 16px; border-top: 1px solid #e1e7e4; padding-top: 20px; }
.checkout-account-ready { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.checkout-account-ready .checkout-section-title > svg { color: #16826a; }
.checkout-account-ready .checkout-link { white-space: nowrap; }
.checkout-section-title { display: flex; align-items: flex-start; gap: 11px; }
.checkout-section-title > svg { flex: 0 0 auto; margin-top: 2px; color: var(--brand); }
.checkout-section-title strong, .checkout-section-title small { display: block; }
.checkout-section-title small { margin-top: 3px; color: #75817d; font-size: .76rem; line-height: 1.4; }
.checkout-form { display: grid; gap: 13px; }
.checkout-form .field > span { color: #4d5b57; font-size: .74rem; }
.checkout-form input { min-height: 45px; border-radius: 10px; background: white; }
.checkout-account-email { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid #dce4e0; border-radius: 10px; padding: 11px 13px; color: #31413c; background: #f8faf9; font-size: .9rem; }
.checkout-account-email span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.checkout-account-email button { border: 0; padding: 2px 0; color: var(--brand); background: transparent; font-size: .78rem; font-weight: 750; }
.checkout-credential-title strong, .checkout-credential-title small { display: block; }
.checkout-credential-title small { margin-top: 4px; color: #75817d; font-size: .78rem; line-height: 1.45; }
.checkout-link { justify-self: start; }
.checkout-switch { width: 100%; border-top: 1px solid #e1e7e4; padding-top: 15px; text-align: center; }
.checkout-preparing { display: flex; align-items: center; gap: 13px; min-height: 110px; border: 1px solid #dfe6e3; border-radius: 13px; padding: 20px; background: white; }
.checkout-preparing > svg { color: var(--brand); }
.checkout-preparing strong, .checkout-preparing small { display: block; }
.checkout-preparing small { margin-top: 4px; color: #75817d; }
.checkout-payment-pending { opacity: .72; }
.checkout-payment-note { margin: 0; color: #66736d; font-size: 13px; line-height: 1.45; }
@keyframes checkout-shimmer { to { background-position: -220% 0; } }
.stripe-element { min-height: 120px; }
.stripe-loading { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 70px; color: #6d7975; font-size: .82rem; }
.checkout-trust { display: flex; align-items: flex-start; justify-content: center; gap: 9px; border-top: 1px solid #e1e7e4; padding-top: 18px; color: #687570; }
.checkout-trust > svg { flex: 0 0 auto; margin-top: 2px; }
.checkout-trust strong, .checkout-trust small { display: block; }
.checkout-trust strong { color: #43504c; font-size: .78rem; }
.checkout-trust small { margin-top: 2px; font-size: .7rem; }
.checkout-terms { margin: -7px 0 0; color: #7a8582; font-size: .7rem; line-height: 1.5; text-align: center; }
.checkout-unavailable { padding: 24px; color: #6d7975; text-align: center; }
.storefront-footer { border-top: 1px solid #dfe6e3; color: #74817d; font-size: .78rem; }
.storefront-footer a { color: var(--brand); }

.hero {
  min-height: 210px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  overflow: hidden;
  border-radius: 20px;
  padding: clamp(24px, 5vw, 48px);
  color: #f3fffb;
  background: linear-gradient(130deg, #0d5548, #168772);
  box-shadow: var(--shadow);
}
.hero h2 { margin-bottom: 8px; font-size: clamp(1.8rem, 4vw, 3rem); }
.hero p:last-child { max-width: 620px; color: #cae5de; }
.hero .eyebrow { color: #7ee2c6; }
.hero-icon { opacity: 0.18; }
.hero-icon svg { width: 150px; height: 150px; }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.metric, .member-card, .profile-card, .card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(20, 68, 59, 0.04);
}
.metric { display: grid; gap: 3px; padding: 20px; }
.metric strong { font-size: 1.8rem; }
.metric span { color: var(--muted); font-size: 0.82rem; }

.three-pane {
  min-height: calc(100vh - 145px);
  display: grid;
  grid-template-columns: minmax(190px, 0.75fr) minmax(240px, 1fr) minmax(340px, 1.5fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}
.pane { min-width: 0; padding: 18px; border-right: 1px solid var(--line); }
.pane:last-child { border-right: 0; }
.pane > h2 { min-height: 28px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.item-list { display: grid; gap: 6px; }
.item-list > button, .lesson-list button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 11px;
  color: var(--ink);
  background: transparent;
  text-align: left;
}
.item-list button span, .lesson-list button span { color: var(--muted); font-size: 0.76rem; }
.item-list button:hover, .item-list button.selected, .lesson-list button:hover, .lesson-list button.selected {
  border-color: #c8ddd7;
  background: var(--surface-soft);
}
.composer { display: grid; gap: 10px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.conversation-pane { display: flex; flex-direction: column; }
.messages { flex: 1; min-height: 260px; display: flex; flex-direction: column; gap: 11px; overflow: auto; padding: 4px 2px 18px; }
.message { max-width: 86%; align-self: flex-start; border-radius: 4px 13px 13px 13px; padding: 11px 13px; background: var(--surface-soft); }
.message.mine { align-self: flex-end; border-radius: 13px 4px 13px 13px; background: #dcf5ed; }
.message header { display: flex; gap: 10px; justify-content: space-between; color: var(--muted); font-size: 0.72rem; }
.message header strong { color: var(--ink); }
.message p { margin: 7px 0 0; white-space: pre-wrap; }
.message-actions { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.message-actions button { border: 0; border-radius: 999px; padding: 3px 7px; color: var(--muted); background: rgba(255,255,255,.7); font-size: .72rem; }
.reply { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.reply textarea { min-height: 70px; }
.empty { display: grid; min-height: 110px; place-items: center; padding: 20px; color: var(--muted); text-align: center; }

.course-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); overflow: hidden; min-height: calc(100vh - 145px); border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.course-content { min-width: 0; padding: 22px; }
.course-heading, .lesson-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.course-price { display: inline-flex; margin-top: 4px; border-radius: 999px; padding: 5px 9px; color: var(--brand-dark); background: #dcf5ed; font-size: .78rem; font-weight: 800; }
.purchase-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.purchase-card { display: grid; gap: 6px; margin-top: 22px; border: 1px solid var(--line); border-radius: 14px; padding: 22px; background: var(--surface-soft); }
.purchase-card p { margin: 0; }
.purchase-card .empty { min-height: 80px; }
.lesson-layout { display: grid; grid-template-columns: minmax(190px, 260px) minmax(0, 1fr); gap: 22px; margin-top: 20px; }
.lesson-list { border-right: 1px solid var(--line); padding-right: 18px; }
.lesson-list h3 { color: var(--muted); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }
.lesson-reader { min-width: 0; }
.lesson-body { min-height: 180px; margin: 18px 0 28px; white-space: pre-wrap; line-height: 1.7; }
.lesson-reader section { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }
.lesson-reader ul { padding-left: 20px; }
.card { display: grid; gap: 5px; margin-bottom: 8px; padding: 13px; }
.card p { margin: 0; }
.comment-list { display: grid; gap: 8px; }
.comment-list article { border-radius: 10px; padding: 11px; background: var(--surface-soft); }
.comment-list p { margin: 5px 0 0; }
.membership-plans, .membership-summary { display: grid; gap: 10px; margin-bottom: 18px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.membership-plans article { display: grid; gap: 7px; padding-top: 12px; border-top: 1px solid var(--line); }
.membership-plans article:first-of-type { padding-top: 0; border-top: 0; }
.membership-plans p, .membership-summary span { margin: 0; color: var(--muted); font-size: .86rem; }
.status-pill { justify-self: start; padding: 3px 8px; border-radius: 999px; background: #e8f4ef; color: #176351 !important; font-size: .72rem !important; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.status-pill.past_due, .status-pill.paused { background: #fff1d8; color: #8a5700 !important; }
.status-pill.cancelled, .status-pill.ended, .status-pill.failed { background: #fee7e5; color: #9e2d25 !important; }

.member-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.member-card { display: flex; align-items: flex-start; gap: 14px; padding: 18px; }
.member-card > div { min-width: 0; flex: 1; }
.member-card h2 { margin-bottom: 2px; }
.member-card p { margin-bottom: 6px; color: var(--muted); }
.message-layout { min-height: calc(100vh - 145px); display: grid; grid-template-columns: minmax(240px, .8fr) minmax(360px, 1.7fr); overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.profile-card { display: flex; align-items: flex-start; gap: 22px; max-width: 720px; padding: 28px; }
.profile-card > div { flex: 1; }
.avatar { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; color: white; background: #287b6a; font-weight: 800; }
.avatar.large { width: 52px; height: 52px; font-size: 1.2rem; }
.avatar.xlarge { width: 72px; height: 72px; font-size: 1.6rem; }
.mobile-header, .mobile-close, .nav-scrim { display: none; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1080px) {
  .content { padding: 24px; }
  .three-pane { grid-template-columns: 210px minmax(240px, .9fr) minmax(300px, 1.2fr); overflow-x: auto; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .storefront-frame { grid-template-columns: minmax(0, 1fr) minmax(360px, .9fr); }
  .storefront-story { padding: 28px; }
  .storefront-checkout { padding: 34px 28px; }
}

@media (max-width: 820px) {
  .app-shell { display: block; padding-top: 62px; }
  .mobile-header {
    position: fixed;
    inset: 0 0 auto;
    height: 62px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(12px);
    z-index: 25;
  }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(310px, 88vw);
    height: 100dvh;
    transform: translateX(-105%);
    transition: transform .2s ease;
    box-shadow: 18px 0 50px rgba(0,0,0,.18);
  }
  .sidebar.open { transform: translateX(0); }
  .mobile-close { display: inline-flex; }
  .nav-scrim { position: fixed; inset: 0; display: block; border: 0; background: rgba(5, 24, 21, .5); z-index: 29; }
  .content { padding: 20px 16px; }
  .topbar { align-items: flex-start; }
  .three-pane, .course-layout, .message-layout { min-height: 0; display: grid; grid-template-columns: 1fr; overflow: visible; }
  .pane { border-right: 0; border-bottom: 1px solid var(--line); }
  .pane:last-child { border-bottom: 0; }
  .lesson-layout { grid-template-columns: 1fr; }
  .lesson-list { border-right: 0; border-bottom: 1px solid var(--line); padding: 0 0 16px; }
  .storefront-frame { width: min(720px, calc(100% - 28px)); grid-template-columns: 1fr; }
  .storefront-story { border-right: 0; border-bottom: 1px solid #e3e9e6; }
  .storefront-art { min-height: 300px; }
}

@media (max-width: 560px) {
  .content { padding: 16px 12px; }
  .topbar { align-items: stretch; flex-direction: column; }
  .topbar .secondary { width: 100%; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .hero { min-height: 190px; }
  .hero-icon { display: none; }
  .reply { grid-template-columns: 1fr; }
  .course-heading, .lesson-title, .profile-card, .member-card { align-items: stretch; flex-direction: column; }
  .purchase-actions { justify-content: stretch; }
  .purchase-actions button { width: 100%; }
  .message { max-width: 94%; }
  .storefront-header, .storefront-footer { padding-left: 18px; padding-right: 18px; }
  .storefront-brand strong { display: none; }
  .storefront-frame { width: calc(100% - 16px); margin-top: 12px; border-radius: 19px; }
  .storefront-story, .storefront-checkout { padding: 18px; }
  .storefront-art { min-height: 250px; padding: 24px; border-radius: 14px; }
  .storefront-art-copy strong { font-size: 2.15rem; }
  .storefront-copy { padding-top: 26px; }
  .storefront-copy h1 { font-size: 2.15rem; }
  .checkout-heading { align-items: flex-start; flex-direction: column; gap: 7px; }
  .offer-option { grid-template-columns: auto minmax(0, 1fr); }
  .offer-price { grid-column: 2; text-align: left; }
}
